:root {
  color-scheme: dark;
  --bg: #071019;
  --panel: rgba(17, 29, 41, .86);
  --panel-strong: #111d29;
  --line: rgba(159, 188, 214, .18);
  --line-strong: rgba(159, 188, 214, .34);
  --text: #f4f8fb;
  --muted: #9db0c0;
  --accent: #66e3c4;
  --accent-strong: #2fc8a3;
  --accent-ink: #03231c;
  --danger: #ff7d85;
  --danger-bg: rgba(255, 83, 95, .12);
  --shadow: 0 22px 70px rgba(0, 0, 0, .3);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(39, 187, 157, .16), transparent 38rem),
    radial-gradient(circle at 100% 20%, rgba(59, 130, 246, .12), transparent 34rem),
    linear-gradient(180deg, #08131e 0%, #061019 100%);
}
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.site-header {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 760;
  text-decoration: none;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent-ink);
  background: linear-gradient(135deg, #8ff2db, #45d1ae);
  font-size: .7rem;
  letter-spacing: .04em;
  box-shadow: 0 8px 24px rgba(47, 200, 163, .16);
}
.text-link { color: var(--muted); text-decoration: none; font-weight: 650; }
.text-link:hover { color: var(--text); }
.header-note { color: var(--muted); font-size: .78rem; font-weight: 650; line-height: 1.2; }
.header-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.eink-control { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .76rem; font-weight: 650; white-space: nowrap; cursor: pointer; }
.eink-control input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent-strong); }
.language-control { display: inline-flex; min-width: 0; }
.language-select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 28px 0 9px;
  color: var(--text);
  background: rgba(4, 11, 18, .58);
  font-size: .76rem;
  font-weight: 650;
}
.language-select:focus { outline: 2px solid rgba(102, 227, 196, .3); outline-offset: 1px; }

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 34px;
}
.hero-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
  padding: clamp(42px, 7vh, 72px) 0;
}
.hero-copy { max-width: 720px; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 16px;
  max-width: 18ch;
  font-size: clamp(2rem, 3vw, 3.15rem);
  line-height: 1;
  letter-spacing: -.045em;
}
.hero-copy > p {
  max-width: 590px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: clamp(.92rem, 1.2vw, 1.02rem);
  line-height: 1.5;
}
h2 { margin-bottom: 8px; font-size: 1.25rem; letter-spacing: -.025em; }
.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(21, 36, 50, .94), rgba(12, 23, 34, .9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.join-card {
  width: 100%;
  max-width: 420px;
  justify-self: end;
  padding: 20px 22px;
}
.join-card .eyebrow { margin-bottom: 7px; }
.join-card h2 { margin-bottom: 5px; }
.join-card > div > p { margin-bottom: 0; }
.join-card .stack { margin-top: 12px; gap: 7px; }
.join-card .message:empty { display: none; }
.join-card p, .page-heading p { color: var(--muted); line-height: 1.5; }
.integration-guidance {
  grid-column: 1 / -1;
  width: 100%;
  padding: 20px 22px;
}
.integration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.integration-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  color: var(--text);
  background: rgba(4, 11, 18, .34);
  text-decoration: none;
}
.integration-card strong { overflow-wrap: anywhere; }
.integration-card span { color: var(--muted); font-size: .84rem; line-height: 1.5; }
a.integration-card:hover, a.integration-card:focus-visible { border-color: var(--line-strong); }

.stack { display: grid; gap: 9px; margin-top: 18px; }
label { color: #c9d6df; font-size: .86rem; font-weight: 700; }
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: none;
  padding: 0 14px;
  color: var(--text);
  background: rgba(4, 11, 18, .6);
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 227, 196, .12);
}
#join-code { text-transform: uppercase; letter-spacing: .17em; font-weight: 760; }

.button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  cursor: pointer;
  font-weight: 730;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.button:hover:not(:disabled) { border-color: rgba(159, 188, 214, .55); background: rgba(255,255,255,.075); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button.primary { border-color: transparent; color: var(--accent-ink); background: linear-gradient(135deg, #8bf1d9, #48d3af); }
.button.primary:hover:not(:disabled) { border-color: transparent; background: linear-gradient(135deg, #9af5df, #55dfba); }
.button.subtle { background: transparent; }
.button.danger { color: #ffd9dc; border-color: rgba(255, 125, 133, .35); background: var(--danger-bg); }
.button.compact { min-height: 38px; padding: 0 13px; font-size: .85rem; }

.message { min-height: 1.25rem; margin: 14px 0 0; color: var(--accent); font-size: .88rem; }
.message.error { color: var(--danger); }
.muted { color: var(--muted); }
.small { font-size: .82rem; line-height: 1.55; }

.session-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: start;
  gap: 16px;
}
.session-main { display: grid; gap: 14px; min-width: 0; }
.session-main > *, .session-heading > *, .section-heading > *, .file-row > *, .progress-label > * { min-width: 0; }
.session-main > .card, .owner-panel { padding: 18px; }
.crosspoint-advisory {
  grid-column: 1 / -1;
  padding: 18px;
  border-color: rgba(246, 196, 92, .38);
  background: linear-gradient(155deg, rgba(71, 55, 22, .76), rgba(26, 29, 30, .94));
}
.crosspoint-advisory .eyebrow { color: #f6c45c; }
.crosspoint-advisory h2 { margin: 5px 0 8px; font-size: 1.05rem; }
.crosspoint-advisory p { margin: 0; color: var(--text); line-height: 1.55; }
.session-heading, .section-heading, .upload-toolbar, .upload-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.session-heading h1 { max-width: none; margin-bottom: 6px; font-size: clamp(1.7rem, 3vw, 2.15rem); }
.session-time { display: flex; align-items: baseline; gap: 9px; }
.session-time strong { color: var(--accent); font-size: 1rem; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.session-opds { display: grid; gap: 5px; margin-top: 12px; min-width: 0; }
.session-opds-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
#session-opds-url { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; color: var(--accent); font-size: .84rem; font-weight: 700; }
#copy-opds { flex: 0 0 auto; }
.section-heading { margin-bottom: 12px; }
.section-heading h2 { margin: 0; }
.pill {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: .77rem;
  font-weight: 760;
}

.drop-zone {
  min-height: 112px;
  border: 1px dashed rgba(102, 227, 196, .38);
  border-radius: 15px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--muted);
  background: rgba(54, 195, 164, .045);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: rgba(54, 195, 164, .08); }
.drop-zone strong { color: var(--text); font-size: 1rem; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-icon { color: var(--accent); font-size: 1.45rem; line-height: 1; }

.conversion-options {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 10px 16px;
  align-items: end;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 12, 19, .3);
}
.conversion-setting {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 11px;
  border: 1px solid rgba(159, 188, 214, .12);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
}
.conversion-setting-label { font-size: .84rem; font-weight: 720; line-height: 1.25; }
.conversion-switch { flex: 0 0 auto; display: inline-flex; cursor: pointer; }
.conversion-switch input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.conversion-switch > span {
  width: 38px;
  height: 22px;
  position: relative;
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(159, 188, 214, .16);
  transition: background .15s ease, border-color .15s ease;
}
.conversion-switch > span::after {
  content: "";
  width: 16px;
  height: 16px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .15s ease, background .15s ease;
}
.conversion-switch input:checked + span { border-color: rgba(102, 227, 196, .7); background: rgba(102, 227, 196, .26); }
.conversion-switch input:checked + span::after { transform: translateX(16px); background: var(--accent); }
.conversion-switch input:focus-visible + span { outline: 2px solid rgba(102, 227, 196, .38); outline-offset: 2px; }

.conversion-target {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.conversion-target legend {
  margin: 0 0 5px;
  padding: 0;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 760;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.target-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 11, 18, .72);
}
.target-segments label { min-width: 0; cursor: pointer; }
.target-segments input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.target-segments span {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.target-segments label:hover span { color: var(--text); background: rgba(255,255,255,.04); }
.target-segments input:checked + span {
  border-color: rgba(102, 227, 196, .38);
  color: var(--accent);
  background: rgba(102, 227, 196, .12);
}
.target-segments input:focus-visible + span { outline: 2px solid rgba(102, 227, 196, .32); outline-offset: 1px; }
.conversion-help {
  grid-column: 1 / -1;
  margin: -1px 2px 0;
  line-height: 1.35;
}

.file-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid rgba(159, 188, 214, .12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: .72rem;
  white-space: nowrap;
}
.file-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.file-transform-note { color: var(--accent); }

.file-list { display: grid; gap: 7px; margin-top: 10px; }
.file-list.empty { color: var(--muted); font-size: .9rem; }
.file-list.empty p { margin: 0; }
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(4, 12, 19, .35);
}
.file-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
}
.file-cover {
  width: 38px;
  height: 52px;
  grid-column: 1;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
}
.file-cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.file-cover-placeholder { font-size: 1.25rem; line-height: 1; opacity: .6; }
.file-main .file-name, .file-main .file-meta { grid-column: 2; }
.file-main .file-meta { margin-top: 2px; }
.file-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.file-meta { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.status { color: var(--accent); font-size: .77rem; font-weight: 760; }
.status.pending { color: #f0c36a; }
.status.failed { color: var(--danger); }
.file-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }

.upload-controls { display: flex; gap: 8px; margin-top: 12px; }
.progress-wrap { margin-top: 12px; }
.progress-label { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: .82rem; }
.progress-label > :first-child { overflow-wrap: anywhere; }
.progress-label > :last-child { flex: 0 0 auto; white-space: nowrap; }
progress { width: 100%; height: 10px; overflow: hidden; border: 0; border-radius: 999px; background: rgba(255,255,255,.08); }
progress::-webkit-progress-bar { background: rgba(255,255,255,.08); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

.owner-panel { position: sticky; top: 14px; }
.owner-panel h2 { margin-bottom: 10px; font-size: 1.2rem; }
.qr-frame {
  width: 180px;
  max-width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  padding: 10px;
  margin-inline: auto;
  color: #4c5f6c;
  background: #f8fbfa;
}
.qr-frame img, .qr-frame svg { width: 100%; height: 100%; display: block; }
.code-block { display: grid; gap: 4px; margin: 12px 0 9px; }
.code-block span { color: var(--muted); font-size: .72rem; }
.code-block strong { font-size: 1.08rem; letter-spacing: .14em; }
.owner-panel .button { width: 100%; margin-top: 7px; }

footer {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 12px 0 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .75rem;
}
.footer-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; }

.brand-helmet { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(47, 200, 163, .14)); }

body.account-portal-active .site-header { width: min(1380px, calc(100% - 28px)); }
body.account-portal-active .site-header .brand { width: 196px; flex: 0 0 196px; padding: 0 10px; justify-content: flex-start; }
body.account-portal-active .header-actions { margin-left: auto; }
body.account-portal-active #session-policy { display: none; }
.account-portal { width: min(1380px, calc(100% - 28px)); margin: 0 auto; padding: 16px 0 34px; }
.account-portal-shell { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 16px; align-items: start; }
.account-portal-sidebar { position: sticky; top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-strong); box-shadow: 0 14px 36px rgba(0,0,0,.2); }
.account-portal-user { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.account-portal-user > div { min-width: 0; display: grid; gap: 2px; }
.account-portal-user strong, .account-portal-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-portal-user strong { font-size: .86rem; }
.account-portal-user .small { font-size: .66rem; }
.account-portal-nav { display: grid; padding: 7px; gap: 2px; }
.account-portal-nav-section { display: grid; gap: 2px; }
.account-portal-nav-section + .account-portal-nav-section { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.account-portal-side-label { padding: 9px 9px 3px; color: var(--muted); font-size: .61rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.account-portal-nav-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; box-sizing: border-box; border: 0; border-radius: 9px; padding: 8px 9px; color: var(--muted); background: transparent; font: inherit; font-size: .81rem; font-weight: 800; text-align: left; text-decoration: none; cursor: pointer; }
.account-portal-nav-button:hover { color: var(--text); background: rgba(255,255,255,.045); }
.account-portal-nav-button.active { color: var(--text); background: rgba(255,255,255,.06); box-shadow: inset 3px 0 0 var(--accent); }
.nav-count { min-width: 22px; border-radius: 999px; padding: 2px 6px; color: var(--muted); background: rgba(255,255,255,.05); font-size: .65rem; text-align: center; }
.account-portal-sidebar-foot { padding: 9px 11px 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: .66rem; line-height: 1.35; }
.account-portal-sidebar-foot strong { color: var(--accent); }
.account-portal-content { min-width: 0; }
.account-portal-view { display: grid; gap: 12px; }
.account-portal-heading { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-portal-heading > div { min-width: 0; }
.account-portal-heading .eyebrow { margin-bottom: 1px; font-size: .61rem; letter-spacing: .085em; }
.account-portal-heading h1 { max-width: none; margin: 1px 0 2px; font-size: clamp(1.48rem, 2vw, 1.78rem); line-height: 1.08; letter-spacing: -.025em; }
.account-portal-heading p { margin: 0; max-width: 900px; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.account-library-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 170px auto; gap: 8px; align-items: center; padding: 9px 11px; border-radius: 12px; box-shadow: none; }
.account-library-search { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; align-items: center; }
.account-library-search > span { color: var(--muted); font-size: 1rem; }
.account-library-toolbar input, .account-library-toolbar select { min-height: 36px; border-radius: 9px; }
.account-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.account-library-card { min-width: 0; display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(155deg, rgba(21,36,50,.94), rgba(12,23,34,.9)); cursor: pointer; box-shadow: 0 10px 28px rgba(0,0,0,.17); }
.account-library-card:hover, .account-library-card:focus-visible { border-color: var(--accent); outline: none; transform: translateY(-3px); }
.account-library-card-cover { position: relative; aspect-ratio: 2 / 3; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, rgba(102,227,196,.11), rgba(59,130,246,.08)); color: var(--muted); font-size: 2rem; }
.account-library-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-library-card-body { display: grid; gap: 5px; padding: 10px 11px 11px; }
.account-library-card-body h3 { margin: 0; font-size: .9rem; line-height: 1.2; overflow-wrap: anywhere; }
.account-library-card-body .book-author { min-height: 1.1em; color: var(--muted); font-size: .7rem; }
.account-library-card-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: .66rem; }
.account-library-card-expiry { color: var(--accent); font-size: .68rem; font-weight: 700; }
.account-library-empty { grid-column: 1 / -1; padding: 42px 20px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; }
.account-book-detail { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 22px; padding: 20px; border-radius: 14px; box-shadow: none; }
.account-book-cover { min-height: 330px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: linear-gradient(145deg, rgba(102,227,196,.11), rgba(59,130,246,.08)); color: var(--muted); font-size: 2.2rem; }
.account-book-cover img { width: 100%; height: 100%; object-fit: cover; }
.account-book-info { min-width: 0; display: grid; align-content: start; gap: 16px; }
.account-book-meta { display: grid; gap: 8px; margin: 0; }
.account-book-meta > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.account-book-meta dt { color: var(--muted); font-size: .72rem; }
.account-book-meta dd { margin: 0; overflow-wrap: anywhere; font-size: .78rem; }
.account-book-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.account-settings-portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "profile password" "send opds"; gap: 12px; align-items: stretch; }
.account-profile-card { grid-area: profile; }
.account-password-card { grid-area: password; }
.account-send-id-card { grid-area: send; }
.account-opds-card { grid-area: opds; }
.account-settings-portal-card { display: grid; align-content: start; gap: 8px; padding: 12px; border-radius: 12px; box-shadow: none; }
.account-settings-portal-card h2 { margin: 0; font-size: 1rem; }
.account-settings-portal-card .stack { gap: 6px; }
.account-settings-portal-card input { min-height: 38px; padding: 7px 10px; }
.account-settings-portal-card .button { min-height: 36px; }
.account-settings-compact-form { display: grid; gap: 5px; }
.account-settings-compact-form label { display: flex; align-items: center; gap: 7px; }
.account-settings-input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.account-settings-divider { height: 1px; margin: 2px 0; background: var(--line); }
.account-verified-badge { border-radius: 999px; padding: 2px 6px; color: var(--accent); background: rgba(102,227,196,.1); font-size: .6rem; font-weight: 800; }
.account-email-verify { display: grid; gap: 7px; border-top: 1px solid var(--line); padding-top: 8px; }
.account-email-verify p { margin: 0; }
.account-portal-code { display: block; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 9px; padding: 8px 9px; color: var(--accent); background: rgba(4,11,18,.45); font-size: .75rem; }
.account-transfer-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.account-transfer-option { min-height: 150px; display: grid; align-content: center; gap: 8px; padding: 18px; color: var(--text); text-align: left; cursor: pointer; }
.account-transfer-option:hover, .account-transfer-option:focus-visible { border-color: var(--accent); outline: none; transform: translateY(-2px); }
.account-transfer-option strong { font-size: 1rem; }
.account-transfer-option span { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.account-transfer-panel { max-width: 620px; display: grid; gap: 14px; padding: 16px; box-shadow: none; }
.account-transfer-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-transfer-panel-heading h2 { margin: 2px 0 0; font-size: 1.05rem; }
.account-transfer-panel .stack { margin: 0; }
.account-send-dialog .account-dialog-card { width: min(500px, calc(100vw - 28px)); }
.account-send-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.account-send-methods label { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; cursor: pointer; }
.account-send-methods input { width: auto; margin: 0; accent-color: var(--accent-strong); }
.account-portal-drawer-toggle { display: none; width: 38px; height: 38px; place-items: center; flex: 0 0 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0; color: var(--text); background: var(--panel); cursor: pointer; }
.account-portal-drawer-toggle svg { width: 20px; height: 20px; }
.account-portal-drawer-backdrop { display: none; position: fixed; inset: 0; z-index: 60; border: 0; padding: 0; background: rgba(2,8,16,.68); backdrop-filter: blur(2px); }

.admin-shell { width: min(1380px, calc(100% - 40px)); max-width: 1380px; padding-top: 20px; }
.page-heading { margin-bottom: 18px; }
.page-heading h1 { max-width: none; margin-bottom: 6px; font-size: clamp(1.9rem, 3vw, 2.7rem); }
.page-heading p { margin-bottom: 0; font-size: .9rem; }
.auth-card {
  width: min(460px, 100%);
  max-width: 460px;
  margin: clamp(34px, 7vh, 70px) auto 0;
  padding: 20px 22px;
}
.auth-card h1 {
  max-width: none;
  margin-bottom: 7px;
  font-size: clamp(1.65rem, 2.2vw, 2rem);
  line-height: 1.08;
}
.auth-card > div > p { margin-bottom: 0; line-height: 1.45; }
.auth-card .stack { margin-top: 14px; gap: 8px; }
.auth-card .message:empty { display: none; }
.admin-console {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.admin-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 18px;
  padding: 18px;
}
.admin-sidebar-heading { display: grid; gap: 5px; }
.admin-sidebar-heading strong { font-size: 1.08rem; }
.admin-nav { display: grid; gap: 7px; }
.admin-nav-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.admin-nav-button:hover { border-color: var(--line); color: var(--text); }
.admin-nav-button.active {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255,255,255,.06);
}
.admin-signout { width: 100%; }
.admin-content { min-width: 0; }
.admin-view { display: grid; gap: 18px; }
.admin-view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.admin-view-heading h1 { margin: 2px 0 5px; font-size: clamp(1.9rem, 3vw, 2.65rem); }
.admin-view-heading p { margin: 0; }
.admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.admin-metric { display: grid; gap: 4px; padding: 17px; }
.admin-metric strong { font-size: 1.55rem; overflow-wrap: anywhere; }
.admin-grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-panel { padding: 18px; }
.admin-panel h2 { margin-bottom: 14px; }
.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}
.admin-toolbar input[type="search"] { min-width: 0; }
.check-control { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.check-control input { width: auto; }
.admin-bulk-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.button.danger {
  border-color: rgba(224, 92, 92, .45);
  color: #ffb5b5;
  background: rgba(138, 34, 34, .16);
}
.button.danger:hover { background: rgba(138, 34, 34, .28); }
.danger-text { color: #ffb5b5; }
.admin-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
}
.admin-summary .message { margin: 0; }
.admin-list { display: grid; gap: 10px; }
.admin-record {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
}
.admin-record h3 { margin: 0 0 6px; overflow-wrap: anywhere; }
.session-record-select { flex: 0 0 auto; margin-top: 3px; }
.session-record-content { flex: 1; min-width: 0; }
.session-record-clickable { cursor: pointer; }
.session-record-clickable:hover,
.session-record-clickable:focus-visible {
  border-color: var(--accent);
  outline: none;
}
.session-detail {
  display: grid;
  gap: 18px;
}
.session-detail-grid { margin-top: 2px; }
.session-detail-grid > section { min-width: 0; }
.compact-list { gap: 8px; }
.compact-record {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px 14px;
}
.admin-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.upload-admin-record {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}
.record-select { width: 18px; height: 18px; }
.record-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.upload-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--muted); font-size: .78rem; }
.hash { margin-top: 7px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.status-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: .72rem;
}
.device-list { display: grid; gap: 7px; border-top: 1px solid var(--line); padding-top: 10px; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-key-values { display: grid; gap: 9px; }
.admin-key-values > div { display: flex; justify-content: space-between; gap: 14px; }
.admin-key-values strong { text-align: right; }
.storage-line { display: grid; gap: 7px; margin-bottom: 15px; }
.capacity-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.capacity-track span { display: block; height: 100%; border-radius: inherit; background: currentColor; opacity: .62; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-grid label { display: grid; gap: 7px; }
.settings-grid label span { color: var(--muted); font-size: .78rem; }
.settings-wide { grid-column: 1 / -1; }
.smtp-check { grid-template-columns: auto 1fr; align-items: center; justify-content: start; gap: 8px !important; }
.smtp-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent-strong); }
.smtp-test-row { flex-wrap: wrap; }
.smtp-test-row input { min-width: min(280px, 100%); flex: 1 1 280px; }
.admin-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 17px; }
.admin-definition-list {
  display: grid;
  grid-template-columns: minmax(160px, .7fr) minmax(0, 1.3fr);
  gap: 9px 18px;
  margin: 0;
}
.admin-definition-list dt { color: var(--muted); }
.admin-definition-list dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 4px; }
.admin-page .site-header {
  width: min(1380px, calc(100% - 28px));
}
.admin-page .brand {
  width: 196px;
  flex: 0 0 196px;
  margin-right: 0;
  padding: 0 10px;
  justify-content: flex-start;
}
.admin-page .header-actions { margin-left: auto; }

.admin-drawer-toggle {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0;
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
}
.admin-drawer-toggle:hover { border-color: var(--line-strong); background: rgba(255,255,255,.06); }
.admin-drawer-toggle svg { width: 20px; height: 20px; display: block; }
.admin-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  border: 0;
  padding: 0;
  background: rgba(2, 8, 16, .68);
  backdrop-filter: blur(2px);
}

.admin-shell { width: min(1380px, calc(100% - 28px)); padding-top: 16px; }
.admin-console { grid-template-columns: 196px minmax(0, 1fr); gap: 16px; }
.admin-sidebar {
  display: block;
  padding: 0;
  overflow: hidden;
  top: 14px;
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: 0 14px 36px rgba(0,0,0,.2);
}
.admin-sidebar-user { padding: 13px 14px; border-bottom: 1px solid var(--line); }
.admin-sidebar-user-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.admin-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-ink);
  background: linear-gradient(135deg, #8ff2db, #45d1ae);
  font-size: .82rem;
  font-weight: 900;
}
.admin-sidebar-user strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .86rem;
}
.admin-nav { display: grid; padding: 7px; gap: 2px; }
.admin-nav-section { display: grid; gap: 2px; }
.admin-nav-section + .admin-nav-section { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.admin-side-label {
  padding: 9px 9px 3px;
  color: var(--muted);
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.admin-nav-button {
  width: 100%;
  display: flex;
  text-decoration: none;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 0;
  border-radius: 9px;
  padding: 8px 9px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: .81rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.admin-nav-button:hover { border-color: transparent; color: var(--text); background: rgba(255,255,255,.045); }
.admin-nav-button.active {
  color: var(--text);
  border-color: transparent;
  background: rgba(255,255,255,.06);
  box-shadow: inset 3px 0 0 var(--accent);
}
.admin-sidebar-foot {
  padding: 9px 11px 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.35;
}
.admin-sidebar-foot strong { color: var(--accent); }
.admin-account-chip { text-decoration: none; }

.admin-view { gap: 12px; }
.admin-view-heading { min-height: 44px; align-items: center; gap: 12px; }
.admin-view-heading > div { min-width: 0; }
.admin-view-heading .eyebrow { margin-bottom: 1px; font-size: .61rem; letter-spacing: .085em; }
.admin-view-heading h1 { margin: 1px 0 2px; font-size: clamp(1.48rem, 2vw, 1.78rem); line-height: 1.08; letter-spacing: -.025em; }
.admin-view-heading p { margin: 0; max-width: 900px; font-size: .76rem; line-height: 1.35; }
.admin-console .button { min-height: 34px; border-radius: 9px; padding: 0 10px; font-size: .74rem; }
.admin-console input, .admin-console select { min-height: 36px; border-radius: 9px; }
.admin-console .message { min-height: 0; margin: 0; font-size: .76rem; }

.admin-metrics { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 8px; }
.admin-metric { min-height: 70px; align-content: center; gap: 3px; padding: 9px 11px; border-radius: 11px; box-shadow: none; }
.admin-metric strong { font-size: 1.2rem; line-height: 1.05; }
.admin-metric .small { font-size: .68rem; line-height: 1.25; }
.admin-grid-two { gap: 10px; }
.admin-panel { padding: 12px 14px; border-radius: 12px; box-shadow: none; }
.admin-panel h2 { margin: 0 0 8px; font-size: 1rem; }
.admin-toolbar { gap: 8px; }
.admin-bulk-toolbar { gap: 7px; }
.admin-summary { gap: 8px; min-height: 22px; font-size: .78rem; }
.admin-list { gap: 7px; }
.admin-record { gap: 8px; padding: 10px 12px; border-radius: 11px; box-shadow: none; }
.admin-record h3 { margin-bottom: 3px; font-size: .9rem; }
.admin-record-head { align-items: center; gap: 10px; }
.record-actions { gap: 6px; }
.upload-meta { gap: 4px 10px; font-size: .72rem; }
.hash { margin-top: 5px; font-size: .72rem; }
.device-list { gap: 5px; padding-top: 7px; }
.device-row { gap: 10px; font-size: .76rem; }
.admin-key-values { gap: 6px; font-size: .76rem; }
.storage-line { gap: 6px; margin-bottom: 10px; }
.capacity-track { height: 6px; }
.settings-grid { gap: 10px; }
.settings-grid label { gap: 5px; }
.settings-grid label span { font-size: .72rem; }
.admin-form-actions { gap: 10px; margin-top: 12px; }
.admin-definition-list { gap: 7px 16px; font-size: .75rem; }
.admin-definition-list dd { font-size: .74rem; }

.admin-user-table { display: grid; gap: 5px; overflow-x: auto; }
.admin-user-row {
  min-width: 940px;
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(140px, .8fr) minmax(70px, .45fr) minmax(70px, .45fr) minmax(110px, .7fr) minmax(260px, 1.45fr);
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 12, 19, .3);
  font-size: .74rem;
}
.admin-user-row.header {
  padding-block: 5px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.admin-user-name { min-width: 0; display: grid; gap: 2px; overflow: hidden; }
.admin-user-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-name span { color: var(--muted); font-size: .66rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-plan { display: grid; gap: 3px; color: var(--accent); font-weight: 750; text-transform: capitalize; }
.admin-user-plan select { min-width: 0; padding: 5px 7px; font-size: .7rem; }
.admin-user-plan span { color: var(--muted); font-size: .62rem; font-weight: 650; text-transform: none; }
.admin-user-cell { color: var(--muted); }
.admin-user-cell strong { color: var(--text); font-weight: 750; }
.admin-user-storage { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 7px; align-items: center; }
.admin-user-storage > span { grid-column: 1 / -1; color: var(--muted); font-size: .66rem; }
.admin-user-storage input { min-width: 0; padding: 5px 7px; font-size: .68rem; }
.admin-user-storage input[type="datetime-local"] { grid-column: 1 / -1; }
.admin-user-storage .button { min-height: 0; padding: 5px 8px; font-size: .66rem; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

@media (max-width: 900px) {
  .shell { padding-top: 32px; }
  .session-layout { grid-template-columns: 1fr; }
  .crosspoint-advisory { grid-column: 1; grid-row: 1; }
  .owner-panel { position: static; grid-row: 2; }
  .session-main { grid-row: 3; }
  .qr-frame { width: min(240px, 100%); max-width: 240px; margin-inline: auto; }
  body.account-portal-active .site-header, .account-portal { width: min(100% - 20px, 900px); }
  body.account-portal-active .site-header .brand { width: auto; flex: 0 0 auto; margin-right: auto; padding: 0; }
  .account-portal-drawer-toggle:not([hidden]) { display: grid; }
  .account-portal-shell { grid-template-columns: 1fr; }
  .account-portal-sidebar { position: fixed; top: 0; left: 0; z-index: 70; width: min(318px, 88vw); height: 100dvh; max-height: 100dvh; overflow-y: auto; border-radius: 0 14px 14px 0; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 24px 70px rgba(0,0,0,.38); }
  html[data-account-portal-drawer="open"], html[data-account-portal-drawer="open"] body { overflow: hidden; }
  html[data-account-portal-drawer="open"] .account-portal-sidebar { transform: translateX(0); }
  html[data-account-portal-drawer="open"] .account-portal-drawer-backdrop { display: block; }
  .account-library-toolbar { grid-template-columns: minmax(0, 1fr) 160px; }
  .account-library-toolbar .small { grid-column: 1 / -1; }
  .admin-page .site-header, .admin-page .admin-shell { width: min(100% - 20px, 900px); }
  .admin-page .brand { width: auto; flex: 0 0 auto; margin-right: auto; padding: 0; }
  .admin-drawer-toggle:not([hidden]) { display: grid; }
  .admin-console { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; top: 0; left: 0; z-index: 70; width: min(318px, 88vw); height: 100dvh; max-height: 100dvh; overflow-y: auto; border-radius: 0 14px 14px 0; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 24px 70px rgba(0,0,0,.38); }
  html[data-admin-drawer="open"], html[data-admin-drawer="open"] body { overflow: hidden; }
  html[data-admin-drawer="open"] .admin-sidebar { transform: translateX(0); }
  html[data-admin-drawer="open"] .admin-drawer-backdrop { display: block; }
  .admin-sidebar-user { display: block; position: sticky; top: 0; z-index: 2; background: var(--panel-strong); }
  .admin-nav { display: grid; grid-template-columns: 1fr; overflow: visible; padding: 9px; }
  .admin-nav-button { text-align: left; white-space: normal; }
  .admin-grid-two { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .account-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .account-transfer-options { grid-template-columns: 1fr; }
  .account-book-detail { grid-template-columns: 1fr; }
  .account-book-cover { min-height: 0; aspect-ratio: 2 / 3; width: min(260px, 100%); }
  .account-settings-portal-grid { grid-template-columns: 1fr; grid-template-areas: "profile" "password" "send" "opds"; }
  .conversion-options { grid-template-columns: 1fr; align-items: stretch; }
  .conversion-help { grid-column: 1; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 0 12px;
  }
  .hero-copy { max-width: 680px; padding: 0; }
  .join-card { max-width: none; justify-self: stretch; }
  .integration-grid { grid-template-columns: 1fr; }
  .auth-card { margin-top: 20px; }
}

@media (max-width: 600px) {
  .site-header, .shell, footer { width: min(100% - 24px, 1180px); }
  .admin-page .site-header, .admin-page .admin-shell { width: min(100% - 20px, 900px); }

  .site-header {
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    align-items: center;
    gap: 4px 10px;
    padding: 10px 0 12px;
  }
  .site-header .brand {
    min-width: 0;
    gap: 9px;
  }
  .site-header .brand-mark { flex: 0 0 38px; }
  .site-header .brand > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .site-header .header-actions { display: contents; }
  .site-header .header-note {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    padding-left: 47px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .7rem;
  }
  .site-header .eink-control {
    grid-column: 1 / -1;
    grid-row: 3;
    padding-left: 47px;
    font-size: .7rem;
  }
  .site-header .language-control {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }
  .site-header .language-select {
    width: auto;
    min-width: 108px;
    max-width: 132px;
  }

  .shell { padding: 26px 0 46px; }
  .hero-copy { min-width: 0; }
  .hero-copy h1 { font-size: clamp(2.35rem, 11vw, 3.05rem); }
  .join-card, .session-main > .card, .owner-panel, .auth-card { padding: 20px; border-radius: 19px; }

  .session-layout, .session-main, .session-main > .card { width: 100%; min-width: 0; max-width: 100%; }
  .session-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }
  .session-heading h1 {
    max-width: 100%;
    font-size: clamp(1.85rem, 9vw, 2.2rem);
    overflow-wrap: anywhere;
  }
  .session-time { flex-wrap: wrap; gap: 4px 8px; }
  #leave-session { align-self: start; white-space: nowrap; }

  .section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px 12px;
  }
  .section-heading > div { flex: 1 1 180px; }
  .section-heading .pill { flex: 0 0 auto; max-width: 100%; }

  .drop-zone {
    min-height: 150px;
    max-width: 100%;
    padding: 18px 12px;
    overflow: hidden;
  }
  .drop-zone > * { max-width: 100%; overflow-wrap: anywhere; }

  .button { min-height: 44px; }
  .upload-controls { display: grid; grid-template-columns: 1fr; }
  .upload-controls .button { width: 100%; }

  .file-list, .file-row { min-width: 0; max-width: 100%; }
  .file-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .file-row > div { min-width: 0; max-width: 100%; }
  .file-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .file-actions .status { flex: 1 0 100%; }
  .file-actions .button { flex: 1 1 120px; }

  .progress-wrap { min-width: 0; max-width: 100%; }
  .message { max-width: 100%; overflow-wrap: anywhere; }

  .admin-view-heading { align-items: flex-start; }
  .admin-toolbar { grid-template-columns: 1fr; }
  .admin-bulk-toolbar { display: grid; }
  .upload-admin-record { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .upload-admin-record .record-actions { grid-column: 1 / -1; display: grid; }
  .admin-record-head { display: grid; }
  .record-actions { justify-content: stretch; }
  .record-actions .button { width: 100%; }
  .device-row { align-items: flex-start; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-wide { grid-column: auto; }
  .admin-definition-list { grid-template-columns: 1fr; gap: 3px; }
  .admin-definition-list dd { margin-bottom: 10px; }
  .admin-summary { display: grid; justify-content: stretch; }
}

.account-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  color: var(--text);
  background: rgba(4, 11, 18, .48);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 720;
}
.account-chip:hover { border-color: var(--line-strong); }
.account-menu-wrap { position: relative; }
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: 170px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 5px;
  background: var(--panel-strong);
  box-shadow: 0 18px 46px rgba(0,0,0,.32);
}
.account-menu button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: .78rem;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}
.account-menu button:hover { background: rgba(255,255,255,.06); }
.account-menu-divider { height: 1px; margin: 4px 3px; background: var(--line); }
.account-role-badge {
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .04em;
}
.account-avatar {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}
.account-caret { color: var(--muted); font-size: .68rem; }
.send-id-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}
.send-id-divider::before,
.send-id-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.send-id-form { margin-top: 10px; }
.account-guidance { margin: 0 0 18px; }
.account-guidance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.account-guidance-grid > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px;
  background: rgba(4, 11, 18, .3);
}
.account-value {
  min-width: 0;
  color: var(--accent);
  overflow-wrap: anywhere;
  text-decoration: none;
}
.account-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: min(88vh, 760px);
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
}
.account-dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(5px); }
.account-dialog-card {
  max-height: inherit;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(155deg, rgba(21, 36, 50, .98), rgba(8, 17, 26, .98));
  box-shadow: var(--shadow);
}
.account-dialog-heading,
.account-settings-summary,
.account-inline-row,
.account-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.account-dialog-heading { align-items: flex-start; }
.account-dialog-heading h2 { margin: 0; }
.account-dialog-heading .eyebrow { margin-bottom: 5px; }
.account-link-row { margin-top: 12px; flex-wrap: wrap; }
.account-settings-summary {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.account-settings-summary > div { display: grid; gap: 3px; }
.account-setting-group {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.setting-label { display: block; color: #c9d6df; font-size: .86rem; font-weight: 700; }
.account-inline-row input { flex: 1 1 auto; min-width: 0; }
.account-code-row { flex-wrap: wrap; justify-content: flex-start; }
.account-code-row code {
  flex: 1 1 220px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  color: var(--accent);
  background: rgba(4, 11, 18, .44);
  overflow-wrap: anywhere;
}
.account-back { margin-top: 12px; }
.account-dialog .message:empty { min-height: 0; margin-top: 0; }

@media (max-width: 680px) {
  .account-guidance-grid { grid-template-columns: 1fr; }
  .account-inline-row { align-items: stretch; flex-direction: column; }
  .account-code-row code { flex-basis: auto; }
  .account-link-row .button { flex: 1 1 auto; }
  .account-chip #account-chip-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 420px) {
  .site-header .brand { font-size: .92rem; }
  .site-header .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .site-header .header-note { padding-left: 45px; font-size: .66rem; }
  .site-header .language-select { min-width: 96px; max-width: 112px; padding-left: 8px; }

  .session-heading { grid-template-columns: 1fr; }
  #leave-session { width: 100%; }
  .section-heading > div { flex-basis: 100%; }
  .section-heading .pill { align-self: flex-start; }
  .file-actions { display: grid; grid-template-columns: 1fr; }
  .file-actions .status { width: auto; }
  .file-actions .button { width: 100%; }
}

/* E-ink mode keeps the public UI functional while avoiding low-contrast paint,
   gradients, blur, shadows, and transitions that render poorly on e-paper. */
html.eink {
  color-scheme: light;
  --bg: #fff;
  --panel: #fff;
  --panel-strong: #fff;
  --line: #777;
  --line-strong: #000;
  --text: #000;
  --muted: #222;
  --accent: #000;
  --accent-strong: #000;
  --accent-ink: #fff;
  --danger: #000;
  --danger-bg: #fff;
  --shadow: none;
  background: #fff;
}

html.eink body { color: #000; background: #fff; }
html.eink *,
html.eink *::before,
html.eink *::after {
  animation: none !important;
  transition: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  backdrop-filter: none !important;
}

html.eink .site-header,
html.eink footer { border-color: #000; }

html.eink .brand-mark {
  border: 1px solid #000;
  border-radius: 4px;
  color: #fff;
  background: #000;
}

html.eink label,
html.eink .eink-control,
html.eink .eyebrow,
html.eink .message,
html.eink .session-time strong,
html.eink .status,
html.eink .status.pending,
html.eink .status.failed,
html.eink .drop-icon { color: #000; }

html.eink .eink-control input { accent-color: #000; }

html.eink .language-select,
html.eink input,
html.eink .button {
  border-color: #000;
  border-radius: 3px;
  color: #000;
  background: #fff;
}

html.eink input:focus {
  border-color: #000;
  outline: 2px solid #000;
  outline-offset: 1px;
}

html.eink .button:hover:not(:disabled) {
  border-color: #000;
  color: #000;
  background: #fff;
}

html.eink .button.primary,
html.eink .button.primary:hover:not(:disabled) {
  border-color: #000;
  color: #fff;
  background: #000;
}

html.eink .button.danger,
html.eink .button.danger:hover {
  border: 3px double #000;
  color: #000;
  background: #fff;
}

html.eink .card {
  border-color: #000;
  border-radius: 5px;
  background: #fff;
}

html.eink .crosspoint-advisory {
  border: 2px dashed #000;
  background: #fff;
}

html.eink .crosspoint-advisory .eyebrow { color: #000; }

html.eink .pill {
  border-color: #000;
  border-radius: 3px;
  color: #000;
}

html.eink .drop-zone,
html.eink .drop-zone:hover,
html.eink .drop-zone.dragging {
  border: 2px dashed #000;
  border-radius: 4px;
  color: #000;
  background: #fff;
}

html.eink .file-row {
  border-color: #000;
  border-radius: 3px;
  background: #fff;
}

html.eink progress {
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
}

html.eink progress::-webkit-progress-bar { border-radius: 0; background: #fff; }
html.eink progress::-webkit-progress-value { border-radius: 0; background: #000; }
html.eink progress::-moz-progress-bar { border-radius: 0; background: #000; }

html.eink .qr-frame {
  border: 1px solid #000;
  border-radius: 3px;
  color: #000;
  background: #fff;
}
