/* iOS-inspired grouped surfaces. Original project icon, no external assets. */
@font-face {
  font-family: 'Proteus Rounded';
  src: url('./nunito-variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #000; --surface: #1c1c1e; --raised: #2c2c2e; --text: #f5f5f7;
  --muted: #aeaeb8; --border: #38383c; --accent: #64b5ff; --button: #0075e8;
  --button-text: #fff; --tint: #17334c; --danger: #ffb4b0; --danger-bg: #3d2427;
  --good: #9be9b1; --good-bg: #183b28; --warn: #f5d48a; --warn-bg: #3d321b;
  --sheet-shadow: #0009;
  font-family: 'Proteus Rounded', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme=light] {
  color-scheme: light;
  --bg: #f2f2f7; --surface: #fff; --raised: #e9e9ef; --text: #1c1c1e;
  --muted: #656570; --border: #d7d7df; --accent: #0062c7; --button: #0069d9;
  --tint: #e7f1ff; --danger: #b3212c; --danger-bg: #ffedf0;
  --good: #176337; --good-bg: #e3f4e9; --warn: #825400; --warn-bg: #fff2ce;
  --sheet-shadow: #17172920;
}
body { -webkit-tap-highlight-color: transparent; }
main { max-width: 780px; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
.brand { padding: 0 0 20px; border: 0; gap: 13px; }
.mark { display: block; width: 52px; height: 52px; border-radius: 14px; background: #02030b; object-fit: contain; box-shadow: 0 3px 12px var(--sheet-shadow); }
.brand strong { font-size: 15px; letter-spacing: .08em; }
.brand small { font-size: 11px; margin-top: 5px; }
.private { border: 0; border-radius: 30px; background: var(--raised); padding: 7px 10px; font-size: 9px; letter-spacing: .1em; color: var(--muted); }
.heading { margin: 15px 0 22px; align-items: center; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .12em; margin-bottom: 7px; }
h1 { font-size: 34px; letter-spacing: -.045em; line-height: 1.1; font-weight: 750; }
button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; border: 0; border-radius: 50px; background: var(--raised); color: var(--text); padding: 12px 17px; font-size: 14px; line-height: 1.4; font-weight: 600; touch-action: manipulation; }
button:disabled { opacity: .5; }
button:active:enabled { opacity: .72; }
button:hover:enabled { filter: none; }
.button-icon { flex-shrink: 0; font-size: 17px; line-height: 1; }
.premium-emoji { display: inline-grid; position: relative; width: 20px; height: 20px; vertical-align: -.2em; flex: 0 0 20px; overflow: hidden; color: inherit; }
.premium-emoji > span { grid-area: 1 / 1; }
.emoji-art { visibility: hidden; display: block; width: 100%; height: 100%; }
.premium-emoji[data-ready=true] > .emoji-art { visibility: visible; }
.premium-emoji[data-ready=true] > .emoji-fallback { visibility: hidden; }
.emoji-art svg { display: block; width: 100%; height: 100%; }
.emoji-art svg [fill]:not([fill="none"]) { fill: currentColor; }
.emoji-art svg [stroke]:not([stroke="none"]) { stroke: currentColor; }
.primary { background: var(--button); color: var(--button-text); }
.secondary { background: var(--raised); color: var(--accent); }
#new-license { min-height: 54px; font-size: 16px; gap: 10px; border-radius: 50px; }
#refresh { min-height: 44px; font-size: 12px; padding: 10px 12px; color: var(--accent); background: var(--tint); }
label { color: var(--muted); font-size: 12px; }
input, select, textarea { min-height: 48px; border: 0; border-radius: 13px; padding: 14px; color: var(--text); background: var(--surface); }
textarea { line-height: 1.6; }
input[type=search] { min-height: 50px; padding-left: 16px; }
.search { margin-top: 24px; }
.search label { margin: 0 4px 9px; }
.filter-row { background: var(--surface); border-radius: 14px; padding-left: 16px; margin-top: 10px; gap: 12px; }
.filter-row label { color: var(--text); }
.filter-row select { color: var(--accent); min-width: 0; }
.list-toolbar { display: flex; align-items: center; gap: 6px; margin: 14px 0 8px; padding-left: 12px; }
.select-all-control { display: grid; place-items: center; flex: 0 0 44px; width: 44px; min-height: 44px; margin: 0; cursor: pointer; }
#count { margin: 0; min-width: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#list { display: grid; gap: 16px; }
.license { min-width: 0; padding: 20px; border: 1px solid transparent; border-radius: 22px; background: var(--surface); box-shadow: 0 2px 6px #00000006; }
.license:has(input:checked) { border-color: var(--accent); }
.license-head { gap: 12px; align-items: flex-start; }
.license-head > div { min-width: 0; flex: 1; }
.license-head input, #select-all { appearance: none; -webkit-appearance: none; width: 25px; height: 25px; min-height: 25px; margin: 0; padding: 0; border: 1.5px solid var(--muted); border-radius: 50%; background: transparent; position: relative; }
.license-head input:checked, #select-all:checked, #select-all:indeterminate { background: var(--button); border-color: var(--button); }
.license-head input:checked::after, #select-all:checked::after { content: ''; position: absolute; width: 5px; height: 10px; left: 8px; top: 4px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
#select-all:indeterminate::after { content: ''; position: absolute; width: 11px; height: 2px; left: 5.5px; top: 10px; border: 0; background: #fff; transform: none; border-radius: 2px; }
#select-all:disabled { opacity: .4; cursor: default; }
.license-key { font-family: inherit; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .025em; line-height: 1.7; }
.badge { display: inline-block; border: 0; border-radius: 30px; font-size: 12px; font-weight: 700; padding: 4px 10px; margin-top: 8px; color: var(--good); background: var(--good-bg); }
.badge.expired { color: var(--warn); background: var(--warn-bg); }
.badge.blocked, .badge.revoked { color: var(--danger); background: var(--danger-bg); }
.metadata { margin: 18px 0; gap: 8px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.note-section { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 16px; }
.note-label { color: var(--muted); font-size: 11px; }
.note { font-size: 14px; line-height: 1.6; margin: 7px 0 0; }
.no-note .note { color: var(--muted); font-size: 12px; }
.hwid { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font: inherit; font-size: 13px; line-height: 1.55; margin: 16px 0; }
.hardware-icon { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hwid-value { min-width: 0; overflow-wrap: anywhere; font: 12px/1.7 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.hwid-empty { min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.actions button { min-height: 46px; border: 0; border-radius: 15px; background: var(--raised); color: var(--accent); padding: 10px 12px; font-size: 13px; font-weight: 700; }
.actions > button { flex: 1 1 120px; }
.actions .copy { margin-right: 0; background: var(--tint); }
.actions .note-button { flex: 1.4 1 140px; }
details { margin-top: 16px; border-top: 1px solid var(--border); }
summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 14px 0 0; font-size: 13px; font-weight: 700; color: var(--accent); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '⌄'; font-size: 20px; font-weight: 500; }
details[open] summary::after { content: '⌃'; }
.management-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.management-actions button { min-width: 0; }
.danger, .actions .danger { color: var(--danger); background: var(--danger-bg); }
#more { margin-top: 20px; }
#bulk { background: var(--surface); padding: 16px; border: 0; border-radius: 20px; }
#feedback, #editor-error, #confirm-error { background: var(--surface); border-radius: 13px; font-size: 13px; margin: 14px 0; }
footer { border: 0; text-align: center; font-size: 11px; margin-top: 24px; padding-top: 8px; line-height: 1.7; }
dialog { inset: auto 0 0; margin: auto auto 0; width: 100%; max-width: 520px; max-height: calc(100dvh - 24px); border: 1px solid var(--border); border-bottom: 0; padding: 28px 22px calc(24px + env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; background: var(--surface); color: var(--text); box-shadow: 0 -10px 70px var(--sheet-shadow); }
dialog::before { content: ''; display: block; width: 36px; height: 5px; border-radius: 4px; background: var(--muted); opacity: .5; margin: -15px auto 20px; }
dialog::backdrop { background: #0008; }
dialog h2 { font-size: 23px; letter-spacing: -.035em; line-height: 1.2; }
dialog input, dialog select, dialog textarea { background: var(--bg); border: 1px solid var(--border); }
.dialog-heading button { background: var(--raised); border-radius: 50%; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 10px; color: var(--muted); }
dialog textarea { min-height: 150px; }
.dialog-actions { margin-top: 24px; gap: 10px; }
.dialog-actions button { min-height: 50px; border-radius: 50px; }
.note-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-top: 10px; }
#note-help { font-size: 11px; line-height: 1.6; }
#note-counter { white-space: nowrap; font-size: 11px; padding-top: 2px; }
dialog pre { background: var(--bg); border-radius: 15px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; line-height: 1.6; }
.gate { padding: 38px 4px; }
.gate h1 { line-height: 1.2; }
.gate a { display: inline-flex; padding: 14px; margin: 8px; min-height: 48px; color: var(--accent); }
@media (max-width: 359px) {
  .management-actions { grid-template-columns: minmax(0, 1fr); }
  .license { padding: 15px; }
  .license-key { font-size: 13px; }
  h1 { font-size: 28px; }
  #refresh { padding: 10px; }
}
@media (min-width: 680px) {
  main { padding-top: 28px; }
  .heading { margin: 24px 0; }
  h1 { font-size: 38px; }
  .license { padding: 24px; }
  .license-key { font-size: 17px; }
  .actions > button { flex: 0 1 auto; padding-left: 18px; padding-right: 18px; }
  .management-actions { display: flex; }
  dialog { inset: 0; margin: auto; border: 1px solid var(--border); border-radius: 28px; }
  dialog::before { display: none; }
}
