:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2a44;
  --muted: #5d6680;
  --line: #dfe3ec;
  --accent: #ffc928;
  --ok: #1a7f4b;
  --bad: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161f;
    --card: #1b2130;
    --text: #e8ebf3;
    --muted: #a2aac0;
    --line: #2c3448;
    --ok: #57c48a;
    --bad: #ff8a80;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, "Segoe UI", Arial, sans-serif; }
.top { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font-size: 1.4rem; }
.top .link { margin-inline-start: auto; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 40px auto; }
h2 { margin: 0 0 12px; font-size: 1.15rem; }
label { display: block; margin-bottom: 12px; font-weight: 600; }
input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); width: 100%; margin-top: 4px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row input { width: auto; flex: 1; min-width: 120px; margin-top: 0; }
.row input[type="number"] { flex: 0 0 90px; min-width: 0; }
button { font: inherit; border-radius: 8px; padding: 8px 14px; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--text); }
button.primary { background: var(--accent); border-color: var(--accent); color: #1f2a44; font-weight: 700; }
button.link { border: 0; background: none; text-decoration: underline; color: var(--muted); }
.muted { color: var(--muted); }
.msg { min-height: 1.2em; margin: 8px 0 0; }
.msg.error { color: var(--bad); }
.msg.ok { color: var(--ok); }
.store-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.credits { font-size: 1.1rem; }
code { background: var(--bg); padding: 2px 6px; border-radius: 6px; }
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
.state-ok { color: var(--ok); font-weight: 600; }
.state-bad { color: var(--bad); font-weight: 600; }
.tech { display: flex; gap: 6px; align-items: center; }
.tech input { width: 90px; margin: 0; }
.tech .code { font-size: 1.2rem; font-weight: 700; letter-spacing: 2px; direction: ltr; }
.ledger { margin: 8px 0 0; padding-inline-start: 18px; color: var(--muted); }
.small { font-size: 0.9rem; }
a.button { display: inline-block; margin-top: 8px; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--line); background: var(--accent); color: #1f2a44; font-weight: 700; text-decoration: none; }
a.button[hidden] { display: none; }
.license-code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; text-align: left; }
.device-apps { display: flex; gap: 12px; }
label.inline { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
label.inline input, .row label.inline input { width: auto; min-width: 0; flex: 0 0 auto; margin: 0; }
.app-row { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.app-row h3 { margin: 0 0 8px; font-size: 1.05rem; }
.version { justify-content: space-between; padding: 6px 0; flex-wrap: wrap; }
.search { max-width: 380px; margin: 0; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 22%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); }
.banner[hidden] { display: none; }
.settings-box { margin-top: 12px; }
.settings-box summary { cursor: pointer; font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; margin-top: 12px; }
.actions { display: flex; gap: 6px; }
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); padding: 20px; width: min(640px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(15 20 30 / 45%); }
td.cancelled { color: var(--muted); }
