:root { --ink: #1f2933; --muted: #6b7a8c; --line: #dde3ea; --brand: #4e2a84; --ok: #1b7f3b; --bad: #b42318; --warn: #b54708; --bg: #f5f7fa; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
code { font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: #eef1f5; padding: 2px 6px; border-radius: 4px; }
pre { background: #eef1f5; padding: 12px; border-radius: 6px; overflow: auto; font-size: 12px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; text-decoration: none; color: var(--brand); }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { text-decoration: none; color: var(--ink); }
.inline { display: inline; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
.container { max-width: 960px; margin: 24px auto; padding: 0 16px; }
.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px; margin-bottom: 20px; }
h1 { margin: 0 0 8px; font-size: 24px; }
h2 { margin: 0 0 12px; font-size: 18px; }
.muted { color: var(--muted); }
.env { display: inline-block; font-size: 11px; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: #e6e9ef; color: var(--muted); margin-bottom: 12px; }
.env-prod { background: #fde8e6; color: var(--bad); }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-error { background: #fde8e6; color: var(--bad); }
.alert-success { background: #e3f6e8; color: var(--ok); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 16px 0; }
label { display: block; margin-bottom: 12px; }
label > span, .field > span, .field > label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; font: inherit; text-transform: uppercase; }
input[type=email], input[type=password] { text-transform: none; }
.has-error input { border-color: var(--bad); }
.hint { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.error { display: block; color: var(--bad); font-size: 12px; margin-top: 4px; }
.checkbox { display: flex; gap: 8px; align-items: center; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-go { background: var(--ok); color: #fff; border-color: var(--ok); font-size: 16px; padding: 12px 22px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.advanced { margin: 12px 0 20px; }
.advanced summary { cursor: pointer; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.compact { max-width: 360px; margin-bottom: 20px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e6e9ef; }
.badge-P { background: #e3f6e8; color: var(--ok); }
.badge-E, .badge-X { background: #fde8e6; color: var(--bad); }
.badge-N, .badge-I { background: #fff4e5; color: var(--warn); }
.result-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.result-P { border-top: 4px solid var(--ok); }
.result-E, .result-X { border-top: 4px solid var(--bad); }
.result-N, .result-I { border-top: 4px solid var(--warn); }
.chartstring-box { display: flex; gap: 12px; align-items: center; margin: 16px 0; }
.chartstring-box code { font-size: 22px; padding: 10px 16px; }
.parts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 20px; }
.parts dt { color: var(--muted); }
.parts dd { margin: 0; }
.actions { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 20px; }
.offline { flex: 1; min-width: 260px; }
.offline p { margin: 4px 0 0; }
.description { font-size: 17px; }
.inline-form { display: flex; gap: 12px; }
.inline-form input { flex: 1; }
.field { position: relative; }
.field input[role=combobox] { padding-right: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7a8c' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.field input[role=combobox]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(78, 42, 132, .12); }
.field.is-loading input[role=combobox] { background-image: none; }
.field.is-loading::after { content: ""; position: absolute; right: 12px; top: 33px; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
.suggest { position: absolute; left: 0; right: 0; z-index: 20; max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(31, 41, 51, .14); text-transform: none; font-weight: 400; }
.suggest[hidden] { display: none; }
.suggest-item { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f0f3f6; }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item.is-active { background: #f3effa; }
.suggest-code { font: 600 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--brand); min-width: 64px; }
.suggest-label { color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.overlay { position: fixed; inset: 0; background: rgba(245, 247, 250, .75); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.overlay[hidden] { display: none; }
.overlay-box { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 24px; box-shadow: 0 10px 30px rgba(31, 41, 51, .14); font-weight: 600; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
