:root {
  color-scheme: dark;
  --bg: #101317;
  --surface: #171c22;
  --raised: #1d232b;
  --line: #2b343e;
  --text: #edf2f5;
  --muted: #a0aebc;
  --dim: #8b99a8;
  --accent: #b9f4d6;
  --mint: #72dbad;
  --warn: #f1bc6d;
  --danger: #ff9698;
  --blue: #a8caff;
  --radius: 18px;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; min-height: 100vh; background: var(--bg); color: var(--text); }
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { flex: 0 0 auto; }
.icon { width: 18px; height: 18px; vertical-align: middle; }
.wrap { width: min(1320px, 100% - 80px); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); background: #12161b; }
.top-inner { min-height: 62px; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; }
.brand, .nav, .top-tools, .btn, .toolbar, .tabs, .card-id, .card-actions, .card-foot,
  .metric-name, .status-chip, .provider-logo, .empty-icon, .detail-label {
  display: flex; align-items: center;
}
.brand { gap: 10px; color: var(--text); font-size: 17px; font-weight: 760; letter-spacing: -.025em; white-space: nowrap; }
.brand img { width: 32px; height: 32px; }
.nav { gap: 5px; }
.top-tools { gap: 10px; }
.btn { gap: 8px; justify-content: center; min-height: 42px; padding: 8px 14px; border: 1px solid transparent; border-radius: 10px; background: var(--raised); color: var(--text); font-size: .88rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); }
.btn.primary { color: #152c22; background: var(--accent); }
.btn.outline { border-color: var(--line); background: #1a2027; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover, .btn.ghost[aria-current="page"] { background: #202831; color: var(--text); }
.btn.icon-only { width: 42px; padding: 0; }
.btn.danger { background: #4d262a; border-color: #704047; color: #ffc3c4; }
main.wrap { padding-block: 22px 36px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.summaries { display: flex; gap: 6px; }
.summary { display: flex; align-items: center; min-width: 0; gap: 6px; padding: 5px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .72rem; line-height: 1.2; font-weight: 550; }
.summary-icon { color: var(--blue); }
.summary-icon .icon { width: 14px; height: 14px; }
.summary:nth-child(2) .summary-icon { color: var(--mint); }
.summary:nth-child(3) .summary-icon { color: var(--warn); }
.summary strong { color: var(--text); font-size: .9rem; font-variant-numeric: tabular-nums; }
.provider-logo, .empty-icon { justify-content: center; width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin: 0 0 17px; }
.section-head h1 { font-size: 1.54rem; line-height: 1.15; letter-spacing: -.04em; }
.section-head p { font-size: .85rem; color: var(--muted); margin-top: 5px; }
.toolbar { gap: 8px; flex-wrap: wrap; }
.tabs { padding: 4px; gap: 3px; border: 1px solid var(--line); border-radius: 11px; background: #13181e; }
.tabs button { min-height: 34px; padding: 6px 10px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; font-size: .81rem; font-weight: 630; }
.tabs button[aria-pressed="true"] { color: var(--text); background: #242d37; border-color: #323d49; }
.tabs button:hover { color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 15px; min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card[data-provider="cursor"] { background: #1a222c; border-color: #2f3b4a; }
.card[data-provider="codex"] { background: #251f1d; border-color: #42332c; }
.card.dragging { opacity: .52; }
.card.drop-target { outline: 2px solid var(--mint); outline-offset: -2px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-id { gap: 10px; min-width: 0; }
.provider-logo { width: 38px; height: 38px; background: #243244; color: #c5dbff; border: 1px solid #354861; }
.provider-logo.codex { background: #2c2844; color: #dbceff; border-color: #3c3658; }
.provider-logo .icon { width: 21px; height: 21px; }
.card-name { min-width: 0; }
.card h2 { font-size: 1rem; line-height: 1.26; font-weight: 720; letter-spacing: -.017em; overflow-wrap: anywhere; }
.card-name p { margin-top: 3px; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.card-actions { gap: 2px; flex-shrink: 0; }
.card-actions .btn { min-height: 35px; width: 35px; padding: 0; }
.card-actions .icon { width: 16px; height: 16px; }
.card-grip { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.card-grip:active { cursor: grabbing; }
.card-email { display: block; color: var(--dim); font-size: .72rem; overflow-wrap: anywhere; }
.meters { display: grid; gap: 13px; }
.metric { min-width: 0; --meter: var(--mint); }
.metric.warn { --meter: var(--warn); }
.metric.hot { --meter: var(--danger); }
.metric-name { justify-content: space-between; gap: 8px; color: #d9e1ea; font-size: .84rem; }
.metric-name b { color: var(--meter); font-variant-numeric: tabular-nums; }
.metric-name .unavailable { color: var(--dim); }
progress { display: block; appearance: none; width: 100%; height: 7px; margin-top: 7px; border: 0; border-radius: 8px; background: #28323b; overflow: hidden; accent-color: var(--meter); }
progress::-webkit-progress-bar { background: #28323b; border-radius: 8px; }
progress::-webkit-progress-value { background: var(--meter); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--meter); border-radius: 8px; }
.metric small { color: var(--muted); font-size: .72rem; display: block; margin-top: 5px; }
.countdown { display: inline-block; color: var(--accent); font-size: .7rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.countdown::before { content: "· "; }
.detail-box { display: grid; gap: 9px; background: #12181e; border: 1px solid #28323c; border-radius: 11px; padding: 10px 11px; }
.detail { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; font-size: .76rem; }
.detail-label { gap: 6px; color: var(--muted); }
.detail-label .icon { width: 14px; height: 14px; }
.detail strong { font-weight: 640; }
.detail .missing { color: var(--dim); }
.detail em { color: var(--muted); font-size: .69rem; font-style: normal; }
.credits { border-top: 1px solid #28323c; padding-top: 8px; font-size: .76rem; }
.credits summary { cursor: pointer; color: var(--accent); padding: 3px 0; }
.credits ul { margin: 7px 0 0; padding: 0 0 0 16px; color: var(--muted); }
.credits li + li { margin-top: 6px; }
.credits li b { color: var(--text); display: block; font-weight: 600; overflow-wrap: anywhere; }
.credits p { color: var(--muted); margin-top: 6px; }
.note { display: flex; gap: 7px; color: #c2cbd6; font-size: .8rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.note .icon { width: 15px; height: 15px; color: #99abc0; margin-top: 3px; }
.card-foot { justify-content: space-between; gap: 7px; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line); flex-wrap: wrap; color: var(--muted); font-size: .71rem; }
.status-chip { gap: 6px; color: var(--dim); }
.status-chip.live { color: var(--mint); }
.status-chip.error, .status-chip.connect { color: var(--warn); }
.card-error, .form-error { color: var(--warn); font-size: .8rem; overflow-wrap: anywhere; }
.card-error:empty, .form-error:empty { display: none; }
.empty { grid-column: 1 / -1; display: grid; justify-items: center; text-align: center; gap: 10px; padding: 43px 20px; border: 1px dashed #394551; border-radius: var(--radius); background: #151a20; }
.empty-icon { width: 48px; height: 48px; background: #23332f; color: var(--accent); }
.empty h2 { margin-top: 4px; font-size: 1.06rem; }
.empty p { color: var(--muted); font-size: .86rem; max-width: 47ch; }
.empty .toolbar { justify-content: center; margin-top: 4px; }
.demo-notice { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 9px 5px 14px; margin-bottom: 14px; border: 1px solid #4c4030; border-radius: 11px; background: #28231e; color: #f3c98f; font-size: .84rem; }
.footer { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--dim); font-size: .76rem; }
.manage-list { display: grid; gap: 9px; }
.manage-row { display: flex; justify-content: space-between; align-items: center; gap: 11px; min-width: 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.manage-row strong, .manage-row small { display: block; overflow-wrap: anywhere; }
.manage-row small { color: var(--muted); }
.manage-row .toolbar { justify-content: flex-end; flex-shrink: 0; }
.manage-row .toolbar .btn { min-height: 38px; }
dialog { width: min(510px, 100% - 28px); max-height: calc(100% - 32px); padding: 0; color: var(--text); background: var(--surface); border: 1px solid #384653; border-radius: 17px; box-shadow: 0 24px 90px #000a; }
dialog::backdrop { background: #070a0dd1; backdrop-filter: blur(4px); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 19px 20px 12px; }
.modal-head h2 { font-size: 1.32rem; letter-spacing: -.035em; }
.modal-head p, .dialog-body > p { color: var(--muted); font-size: .85rem; margin-top: 3px; }
.dialog-body { display: grid; gap: 13px; padding: 4px 20px 20px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; padding-top: 5px; }
.field { display: grid; gap: 5px; color: #e0e7ee; font-size: .82rem; font-weight: 620; }
.field input, .field textarea { min-height: 43px; width: 100%; padding: 9px 11px; background: #11171d; border: 1px solid #3a4653; border-radius: 9px; color: var(--text); font-size: 16px; }
.field input::placeholder, .field textarea::placeholder { color: #8592a2; }
.field textarea { resize: vertical; min-height: 76px; }
.hint { color: var(--muted); font-size: .76rem; font-weight: 450; }
.check { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .8rem; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.platform { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.platform legend { margin-bottom: 5px; font-size: .82rem; font-weight: 620; }
.platform label { display: flex; gap: 7px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.platform label:has(:checked) { background: #20322c; border-color: #4c7463; }
.platform input { accent-color: var(--accent); margin: 0; }
.code { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px 7px 14px; border: 1px solid #4c7463; border-radius: 10px; background: #1c3229; }
.code strong { font-family: ui-monospace, monospace; letter-spacing: .09em; color: var(--accent); }
.login-screen { display: grid; min-height: 100dvh; place-items: center; padding: 20px; background: radial-gradient(ellipse at 50% 2%, #203530 0%, #101317 57%); }
.login-card { width: min(410px, 100%); padding: 28px; border: 1px solid #34424a; border-radius: 22px; background: var(--surface); box-shadow: 0 22px 80px #0006; }
.login-card h1 { margin: 23px 0 7px; font-size: 2.13rem; line-height: 1.06; letter-spacing: -.06em; font-weight: 740; }
.login-card p { color: var(--muted); font-size: .87rem; }
.login-card form { display: grid; gap: 14px; margin-top: 19px; }
.login-card .btn { margin-top: 3px; }
.loading { display: grid; place-items: center; min-height: 100dvh; }
#toast { position: fixed; right: 18px; bottom: 18px; z-index: 2; max-width: min(390px, 100% - 36px); padding: 12px 16px; background: #25343d; border: 1px solid #52636f; border-radius: 11px; box-shadow: 0 10px 30px #0006; color: var(--text); font-size: .87rem; }
#toast:empty { display: none; }
.spin { animation: spin .95s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1120px) {
  .wrap { width: calc(100% - 48px); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .top-inner { grid-template-columns: auto 1fr auto; gap: 6px 12px; padding-block: 8px; }
  .top-tools { grid-column: 3; grid-row: 1; justify-self: end; }
  .summaries { grid-column: 1 / -1; grid-row: 2; justify-self: end; }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .top-inner { gap: 6px; }
  .top-inner > .brand { grid-column: 1 / 3; grid-row: 1; }
  .top-tools { gap: 6px; }
  .top-tools .btn { min-height: 40px; }
  .nav { grid-column: 1; grid-row: 2; gap: 2px; }
  .nav .btn { min-height: 36px; width: 36px; padding: 0; }
  .nav .btn span { display: none; }
  .topbar .brand { font-size: .96rem; gap: 7px; }
  .topbar .brand img { width: 29px; height: 29px; }
  main.wrap { padding-top: 16px; }
  .summaries { grid-column: 2 / -1; justify-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .summary { justify-content: space-between; gap: 3px; padding: 4px 5px; font-size: .67rem; }
  .summary-icon { display: none; }
  .section-head .toolbar { width: 100%; justify-content: space-between; }
  .grid { gap: 11px; grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .card-actions .btn { width: 42px; min-height: 42px; }
  .manage-row .toolbar { gap: 1px; }
}
@media (max-width: 360px) {
  .wrap { width: calc(100% - 22px); }
  .top-tools .btn { padding-inline: 8px; gap: 4px; }
  .top-tools .btn .icon { width: 14px; }
  .tabs button { padding-inline: 7px; }
  .section-head .toolbar > .btn { padding-inline: 8px; }
  .manage-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
