:root {
  --bg: #f6f7f9; --card: #fff; --text: #17202a; --muted: #667085; --line: #e4e7ec;
  --brand: #0f766e; --brand-d: #0b5a54; --pos: #15803d; --neg: #b42318; --danger: #b42318;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1116; --card: #171b22; --text: #e8ecf1; --muted: #98a2b3; --line: #2a303a;
          --brand: #2dd4bf; --brand-d: #5eead4; --pos: #4ade80; --neg: #f87171; --danger: #f87171; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 1rem 4rem; }
header.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header.top .wrap { display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; }
header.top .brand { font-weight: 700; font-size: 1.1rem; color: var(--brand); }
header.top nav { margin-left: auto; display: flex; gap: .25rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.row { display: flex; align-items: center; gap: .75rem; }
.row.between { justify-content: space-between; }
.row.wrap-r { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.right { text-align: right; }
.list > * + * { border-top: 1px solid var(--line); }
.item { padding: .7rem 0; display: flex; gap: .75rem; align-items: center; }
.item .title { font-weight: 600; overflow-wrap: anywhere; }
.item.click { cursor: pointer; }
.item.click:hover .title { color: var(--brand); }
.pill { display: inline-block; font-size: .72rem; padding: .05rem .5rem; border-radius: 99px; background: var(--line); color: var(--muted); }
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: .45rem .8rem; border-radius: 8px; }
button:hover { border-color: var(--brand); }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { button.primary { color: #06201d; } }
button.primary:hover { background: var(--brand-d); }
button.danger { color: var(--danger); }
button.ghost { border-color: transparent; background: transparent; }
button.sm { padding: .2rem .55rem; font-size: .85rem; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
input[type=checkbox] { width: auto; }
label { display: block; font-size: .85rem; color: var(--muted); margin: .6rem 0 .2rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 1rem 0 0; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: .6rem .9rem; color: var(--muted); }
.tabs button.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.summary .card { margin: 0; }
.big { font-size: 1.4rem; font-weight: 700; }
.error { color: var(--danger); margin: .5rem 0 0; min-height: 1.2em; }
.auth { max-width: 380px; margin: 8vh auto; padding: 0 1rem; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto; z-index: 20; }
.modal { background: var(--card); border-radius: var(--radius); padding: 1.2rem; width: 100%; max-width: 480px; }
.actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.split-row { display: grid; grid-template-columns: auto 1fr 7rem; gap: .5rem; align-items: center; padding: .25rem 0; }
.token { font-family: ui-monospace, monospace; background: var(--bg); padding: .5rem; border-radius: 8px; word-break: break-all; user-select: all; }
code { background: var(--bg); padding: .1rem .35rem; border-radius: 4px; }
#toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .5rem 1rem; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
#toast.show { opacity: 1; }
.empty { text-align: center; color: var(--muted); padding: 1.5rem 0; }

.row.wrap-r .grow { min-width: 10rem; }
.cur { width: 5.5rem; flex: none; }
