/* The account pages wear the reader's clothes: knotera.html's Star White / Night Sky tokens, its fonts, hairlines and pills. */
[hidden] { display: none !important; }
:root {
  --ground: #e7e6e2; --surface: #f9f8f5; --raised: #ffffff;
  --ink: #1a1b1f; --ink-2: #3b3d44; --muted: #6c6f78; --faint: #a4a6ad;
  --hair: rgb(26 27 31 / .08); --frame: rgb(26 27 31 / .14);
  --accent: #b8741f; --red: #c4472f; --red-soft: #fbe9e4;
  --ok: #7fd3a3; --ok-ink: #1d6b43; --key-ink: #7a5d00; --warm: #d98a2f;
  --glass: rgb(255 255 255 / .64);
  --lift: 0 1px 1px rgb(30 28 24 / .04), 0 30px 60px -30px rgb(30 28 24 / .42), 0 10px 22px -14px rgb(30 28 24 / .18);
  --page-bg: radial-gradient(ellipse 95% 90% at 55% 50%, transparent 58%, rgb(40 50 72 / .09)), radial-gradient(120% 100% at 50% 30%, #dde1e7, #c6ccd5);
  --sun-a: #f6c264; --sun-b: #eea040; --sun-c: #d8781f; --sun-glow: .55;
  --spring: cubic-bezier(.2, .8, .2, 1);
  --ui: "Geist", "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0d0c0b; --surface: #1c1a17; --raised: #23211e;
    --ink: #ebe4d8; --ink-2: #cac2b4; --muted: #968d80; --faint: #625b52;
    --hair: rgb(255 238 214 / .08); --frame: rgb(255 238 214 / .13);
    --accent: #dcb577; --red: #ee957f; --red-soft: #38231d;
    --ok-ink: #a3d3b0; --key-ink: #ead08c; --warm: #eaa24c;
    --glass: rgb(30 28 25 / .66);
    --lift: 0 1px 1px rgb(0 0 0 / .3), 0 40px 80px -30px rgb(0 0 0 / .8), 0 10px 22px -14px rgb(0 0 0 / .5);
    --page-bg: radial-gradient(ellipse 95% 90% at 55% 50%, transparent 58%, rgb(0 0 0 / .3)), radial-gradient(120% 90% at 50% 18%, #1d1b18, #0b0a09);
    --sun-a: #ffe4a8; --sun-b: #f5b355; --sun-c: #e3892c; --sun-glow: .8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0d0c0b; --surface: #1c1a17; --raised: #23211e;
  --ink: #ebe4d8; --ink-2: #cac2b4; --muted: #968d80; --faint: #625b52;
  --hair: rgb(255 238 214 / .08); --frame: rgb(255 238 214 / .13);
  --accent: #dcb577; --red: #ee957f; --red-soft: #38231d;
  --ok-ink: #a3d3b0; --key-ink: #ead08c; --warm: #eaa24c;
  --glass: rgb(30 28 25 / .66);
  --lift: 0 1px 1px rgb(0 0 0 / .3), 0 40px 80px -30px rgb(0 0 0 / .8), 0 10px 22px -14px rgb(0 0 0 / .5);
  --page-bg: radial-gradient(ellipse 95% 90% at 55% 50%, transparent 58%, rgb(0 0 0 / .3)), radial-gradient(120% 90% at 50% 18%, #1d1b18, #0b0a09);
  --sun-a: #ffe4a8; --sun-b: #f5b355; --sun-c: #e3892c; --sun-glow: .8;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--page-bg); color: var(--ink); font: 14px/1.6 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the wordmark, drawn exactly as in the reader's margin */
.top { width: min(100% - 32px, 1040px); margin: 0 auto; padding: 22px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wm { display: inline-flex; align-items: baseline; gap: 12px; margin-left: -6px; padding: 6px 6px 4px; border-radius: 10px; color: color-mix(in srgb, var(--ink) 88%, transparent); text-decoration: none; transition: background .2s; }
.wm:hover { background: var(--hair); }
.wm svg { display: block; flex: none; overflow: visible; align-self: center; }
.wm .tag { font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.wm .sa { stop-color: var(--sun-a); } .wm .sb { stop-color: var(--sun-b); } .wm .sc { stop-color: var(--sun-c); }
.wm .si { stop-color: currentColor; } .wm .si9 { stop-color: currentColor; stop-opacity: .9; } .wm .si0 { stop-color: currentColor; stop-opacity: 0; }
.wm .glow { flood-color: #ffad42; flood-opacity: var(--sun-glow); }

main { flex: 1; width: min(100% - 32px, 1040px); margin: 0 auto; }
body[data-view="auth"] main { width: min(100% - 32px, 412px); padding-top: clamp(0px, 7vh, 64px); }
.loading { color: var(--muted); text-align: center; padding: 40px 0; }
footer { width: min(100% - 32px, 1040px); margin: 36px auto 0; padding: 0 0 28px; color: var(--muted); font-size: 12px; text-align: center; }

/* messages float like the reader's glass controls */
#message { margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); box-shadow: 0 0 0 1px var(--hair), 0 8px 20px -12px rgb(0 0 0 / .4); }
#message.error { background: var(--red-soft); color: var(--red); }

/* cards are the reader's rcard */
.card { margin: 0 0 16px; padding: 22px 24px; border-radius: 22px; background: var(--raised); box-shadow: 0 0 0 1px var(--hair), 0 24px 60px -34px rgb(0 0 0 / .45); }
.auth { padding: 28px 28px 24px; box-shadow: 0 0 0 1px var(--hair), var(--lift); }
.auth h1 { font: 600 22px/1.4 var(--serif); letter-spacing: .06em; }
.lede { margin-top: 6px; color: var(--muted); font-size: 13px; }
.cardhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.cardhead h2 { font-size: 15px; font-weight: 600; }
.cardhead p { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.cardhead:last-child { margin-bottom: 0; }
.auth .wnote { margin-bottom: 14px; }

/* segmented tabs, a quiet track with one raised pill */
.tabs { display: flex; gap: 2px; margin: 20px 0 18px; padding: 3px; border-radius: 999px; background: var(--hair); }
.tabs button { flex: 1; height: 32px; border-radius: 999px; font-size: 13px; color: var(--muted); transition: background .2s, color .2s, box-shadow .2s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--raised); color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px var(--hair), 0 1px 3px rgb(0 0 0 / .1); }

/* forms */
.form { display: grid; gap: 14px; margin: 0; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label { display: flex; align-items: center; gap: 8px; }
label { font-size: 12px; color: var(--muted); }
input, select, textarea { width: 100%; min-width: 0; height: 40px; padding: 0 12px; border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--frame); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; transition: box-shadow .15s; }
select { padding-right: 8px; }
input::placeholder { color: var(--faint); }
input:hover, select:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 24%, transparent); }
input:focus, select:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
input:disabled { opacity: .5; }
.field small, .notice { font-size: 12px; line-height: 1.6; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }
.row input { flex: 1; }
#goodnotes-settings .row input { min-width: 0; }
#goodnotes-settings .form { margin-top: 20px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 15px; height: 15px; margin: 0; flex: none; accent-color: var(--ink); box-shadow: none; }
.check:has(input:disabled) { opacity: .5; cursor: default; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: 12px; align-content: start; }
legend { display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: 2px; font-size: 13px; font-weight: 600; color: var(--ink); }
fieldset > .notice { margin-top: -6px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; }
.rule { height: 1px; margin: 4px 0; border: 0; background: var(--hair); }

/* buttons: ink pills for the main act, hairline pills for the rest */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: 999px; font: inherit; font-size: 13px; white-space: nowrap; text-decoration: none; cursor: pointer; background: var(--hair); color: var(--ink); transition: background .2s, opacity .2s, transform .2s var(--spring); }
button:hover:not(:disabled), .button:hover { background: color-mix(in srgb, var(--ink) 13%, transparent); }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .45; cursor: default; }
.primary, .button.primary { background: var(--ink); color: var(--surface); font-weight: 500; }
.primary:hover:not(:disabled), .button.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--surface)); }
.danger { color: var(--red); background: var(--red-soft); }
.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 18%, var(--red-soft)); }
.tabs button, .tabs button:hover:not(:disabled) { background: transparent; }
.tabs button[aria-selected="true"], .tabs button[aria-selected="true"]:hover { background: var(--raised); }
.row button { height: 40px; flex: none; }
.full { width: 100%; height: 42px; margin-top: 4px; font-size: 14px; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* chips, as on the reader's page head */
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; background: var(--hair); color: var(--muted); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.chip.ok { background: color-mix(in srgb, var(--ok) 26%, transparent); color: var(--ok-ink); }
.chip.bad { background: var(--red-soft); color: var(--red); }

.wnote { padding: 10px 14px; border-radius: 12px; background: var(--hair); font-size: 13px; line-height: 1.6; color: var(--ink-2); }

/* settings: the groups sit in the margin like the reader's rail, the open group fills the pane */
.settings { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 32px; align-items: start; }
.side { position: sticky; top: 20px; display: grid; gap: 18px; }
.who { display: grid; gap: 2px; padding: 0 10px; font-size: 12.5px; color: var(--muted); }
.who b { font-size: 14px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.who #state { margin-top: 6px; }
.groups { display: grid; gap: 2px; }
.groups a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 10px; color: var(--ink-2); font-size: 14px; text-decoration: none; transition: background .2s, color .2s; }
.groups a:hover { background: var(--hair); color: var(--ink); }
.groups a[aria-current="page"] { background: color-mix(in srgb, var(--warm) 14%, transparent); color: var(--ink); font-weight: 500; }
.groups a[aria-current="page"]::before { content: ''; width: 3px; height: 14px; margin-left: -4px; border-radius: 2px; background: var(--warm); }
.groups .sep { margin: 14px 10px 4px; font-size: 11.5px; letter-spacing: .08em; color: var(--faint); }
.side .button { width: 100%; height: 40px; }
.pane { min-width: 0; }
.panehead { margin: 4px 4px 18px; }
.panehead h1 { font: 600 24px/1.35 var(--serif); letter-spacing: .06em; }
.panehead p { margin-top: 4px; font-size: 13px; color: var(--muted); }
.plain { font-size: 13.5px; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#quotaform .row { max-width: 360px; }
.tile { display: grid; align-content: start; gap: 2px; padding: 16px 18px; border-radius: 18px; background: var(--raised); color: var(--ink); text-decoration: none; box-shadow: 0 0 0 1px var(--hair), 0 18px 40px -30px rgb(0 0 0 / .45); transition: transform .25s var(--spring), box-shadow .25s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--frame), 0 22px 44px -28px rgb(0 0 0 / .5); }
.tile span, .tile small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.tile b { margin-top: 4px; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.tile .meter { height: 6px; margin-top: 10px; }
#state { display: flex; align-items: center; gap: 9px; }
#state::before { content: ''; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--faint); }
#state[data-tone="ok"]::before { background: #3ea86d; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 30%, transparent); }
#state[data-tone="busy"]::before { background: var(--warm); box-shadow: 0 0 8px 2px rgb(255 168 60 / .45); animation: pulse 1.1s ease-in-out infinite; }
#state[data-tone="bad"]::before { background: var(--red); }
@keyframes pulse { 50% { transform: scale(.6); opacity: .55; } }

details > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; font-size: 15px; font-weight: 600; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ''; width: 7px; height: 7px; margin-left: auto; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--spring); }
details[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
details[open] > summary + * { margin-top: 16px; }
.guide { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); }
.guide > summary { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.guide ol { margin: 0 0 10px; padding-left: 20px; font-size: 13px; color: var(--ink-2); }
.guide a { color: var(--accent); }
.stack { display: grid; gap: 18px; }

/* the user's side: first steps, model checks, usage and sign-ins */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--hair); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li:last-child { padding-bottom: 0; }
.steps b { display: block; font-weight: 500; }
.steps span { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.steps i { position: relative; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 11.5px/1 var(--ui); font-style: normal; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--frame); }
.steps i::after { content: counter(step); }
.steps .done i { background: var(--ink); box-shadow: none; }
.steps .done i::after { content: ''; width: 9px; height: 5px; margin-top: -3px; border-left: 2px solid var(--surface); border-bottom: 2px solid var(--surface); transform: rotate(-45deg); }
.steps .busy i::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 8px 2px rgb(255 168 60 / .45); animation: pulse 1.1s ease-in-out infinite; }
.steps .bad i { box-shadow: inset 0 0 0 1.5px var(--red); color: var(--red); }
.steps .bad i::after { content: '!'; }
.steps .done b { color: var(--muted); font-weight: 400; }
.keylink { justify-self: start; font-size: 12px; color: var(--accent); text-decoration: none; }
.keylink:hover { text-decoration: underline; }
.tierfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.tierfoot button { height: 32px; padding: 0 14px; font-size: 12.5px; }
.result { font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.result:empty { display: none; }
.result.ok { color: var(--ok-ink); }
.result.bad { color: var(--red); }
fieldset > .result { margin-top: -4px; }
input, select { scroll-margin-top: 140px; }
.meterline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.meterline b { font-weight: 500; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 4px; background: var(--hair); overflow: hidden; }
.meter i { display: block; width: 0; height: 100%; border-radius: 4px; background: var(--accent); transition: width .4s var(--spring); }
.meter.full i { background: var(--red); }
.meter + .result { margin-top: 8px; }
.limits + .result { margin-top: 14px; }
.limits { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 18px 0 0; font-size: 13px; }
.limits div { display: contents; }
.limits dt { color: var(--muted); }
.limits dd { margin: 0; color: var(--ink-2); }
.secrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; margin-bottom: 14px; border-bottom: 1px solid var(--hair); }
.secrow b { display: block; font-weight: 500; }
.secrow.last { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.secrow span { display: block; font-size: 12.5px; color: var(--muted); }
details.sub > summary { font-size: 14px; font-weight: 500; }

/* registrants */
.users { margin: 4px 0 0; padding: 0; list-style: none; }
.user { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--hair); }
.uhead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.uhead b { font-weight: 500; overflow-wrap: anywhere; }
.user dl { grid-column: 1; display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 0; font-size: 12px; color: var(--muted); }
.user dl div { display: flex; gap: 6px; }
.user dt { color: var(--faint); }
.user dd { margin: 0; font-variant-numeric: tabular-nums; }
.user dd.bad { color: var(--red); }
.user .uerr { grid-column: 1; font-size: 12px; color: var(--red); }
.uactions { grid-column: 2; grid-row: 1 / span 3; display: flex; gap: 8px; }
.uactions button { height: 32px; padding: 0 14px; font-size: 12.5px; }
.count { font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .settings { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .side { position: static; gap: 12px; }
  .who { padding: 0 4px; }
  .groups { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
  .groups::-webkit-scrollbar { display: none; }
  .groups a { flex: none; min-height: 34px; padding: 0 14px; border-radius: 999px; background: var(--glass); box-shadow: 0 0 0 1px var(--hair); }
  .groups a[aria-current="page"] { background: var(--ink); color: var(--surface); }
  .groups a[aria-current="page"]::before, .groups .sep { display: none; }
  .panehead { margin-top: 4px; }
}
@media (max-width: 680px) {
  .top { padding: 14px 0 10px; }
  .wm .tag { display: none; }
  body[data-view="auth"] main { padding-top: 8px; }
  .card { padding: 18px; border-radius: 18px; }
  .auth { padding: 22px 18px 18px; }
  .grid { grid-template-columns: 1fr; }
  .tiles { gap: 10px; }
  .tile { padding: 14px; border-radius: 16px; }
  .tile b { font-size: 16px; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions button { height: 42px; }
  .user { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 26px minmax(0, 1fr); }
  .steps li > a { grid-column: 2; justify-self: start; height: 34px; }
  .secrow { flex-direction: column; align-items: stretch; }
  .secrow button { height: 40px; }
  .limits { grid-template-columns: 1fr; gap: 2px; }
  .limits dd { margin-bottom: 8px; }
  .uactions { grid-column: 1; grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
