:root {
  --paper: #f7efe4;
  --paper-2: #f0e4d4;
  --card: #fffdf8;
  --ink: #241a14;
  --ink-2: #5d564c;
  --ink-3: #8c8476;
  --line: #e6d6c1;
  --lamp: #b4501f;
  --lamp-ink: #ffffff;
  --lamp-soft: #f6dcc7;
  --ok: #2f7a4f;
  --danger: #a33a2c;
  --shadow: 0 1px 2px rgba(40, 30, 10, .08), 0 6px 18px rgba(40, 30, 10, .08);
  --cover-shadow: 0 1px 1px rgba(0,0,0,.12), 0 6px 14px rgba(40, 30, 10, .18);
  --radius: 14px;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --top: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="sepia"]) {
    --paper: #16110e; --paper-2: #1f1813; --card: #241c16; --ink: #f1ebe0; --ink-2: #bfb6a7; --ink-3: #8b8274;
    --line: #2f2a24; --lamp: #ee8a4f; --lamp-ink: #1d0f06; --lamp-soft: #3d2416; --ok: #6cc08e; --danger: #e47a69;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --cover-shadow: 0 2px 10px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #16110e; --paper-2: #1f1813; --card: #241c16; --ink: #f1ebe0; --ink-2: #bfb6a7; --ink-3: #8b8274;
  --line: #2f2a24; --lamp: #ee8a4f; --lamp-ink: #1d0f06; --lamp-soft: #3d2416; --ok: #6cc08e; --danger: #e47a69;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --cover-shadow: 0 2px 10px rgba(0,0,0,.5);
  color-scheme: dark;
}
:root[data-theme="sepia"] {
  --paper: #efe2c8; --paper-2: #e7d7b8; --card: #f6ecd8; --ink: #3b2e1e; --ink-2: #6a5640; --ink-3: #8e7a60; --line: #d9c6a3;
  --lamp: #9a5a12; --lamp-soft: #ead2a6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar / tabs ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top);
  display: flex; align-items: center; gap: 20px; padding: 0 16px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: var(--paper); display: grid; place-items: center; }
.brand-mark svg { width: 19px; height: 19px; color: var(--lamp-soft); stroke: currentColor; }
.brand-name { font: 700 20px/1 var(--serif); letter-spacing: -.01em; }
.tabs { display: flex; gap: 2px; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.tabs a:hover { background: var(--paper-2); color: var(--ink); }
.tabs a.active { background: var(--ink); color: var(--paper); }
.tabs a svg { width: 19px; height: 19px; }
.top-search { margin-left: auto; position: relative; width: min(360px, 32vw); }
.top-search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--ink-3); }
.top-search input, .field {
  width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); outline: none;
}
.top-search input:focus, .field:focus { border-color: var(--lamp); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lamp) 22%, transparent); }
.device-pill {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-weight: 500; font-size: 14px; white-space: nowrap;
}
.device-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.device-pill.on .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }

@media (max-width: 860px) {
  .topbar { backdrop-filter: none; background: var(--paper); } /* a filter would trap the fixed tab bar inside the header */
  .top-search { display: none; }
  .brand { margin-right: auto; }
  .tabs {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; justify-content: space-around; gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line);
  }
  .tabs a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; border-radius: 12px; min-width: 64px; }
  .tabs a.active { background: none; color: var(--ink); }
  .tabs a.active svg { color: var(--lamp); stroke-width: 2.1; }
  .tabs a svg { width: 23px; height: 23px; }
}
@media (min-width: 861px) { body { padding-bottom: 40px; } }

/* ---------- layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 40px; outline: none; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 4px 0 18px; flex-wrap: wrap; }
h1 { font: 700 30px/1.15 var(--serif); letter-spacing: -.015em; margin: 0; }
h2 { font: 600 20px/1.2 var(--serif); margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

/* ---------- shelves ---------- */
.shelf { margin: 8px 0 30px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.shelf-head a { font-size: 14px; color: var(--lamp); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; }
.shelf-head a svg { width: 16px; height: 16px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 128px; gap: 16px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.row > * { scroll-snap-align: start; }
@media (min-width: 861px) { .row { grid-auto-columns: 146px; gap: 20px; } }

/* ---------- book tile ---------- */
.tile { background: none; border: 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tile-title { font: 600 14px/1.25 var(--serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-author { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -4px; }
.cover {
  position: relative; aspect-ratio: 2 / 3; width: 100%; border-radius: 4px 7px 7px 4px; overflow: hidden; background: var(--paper-2);
  box-shadow: var(--cover-shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(255,255,255,.08) 60%, transparent); pointer-events: none; }
.tile:hover .cover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 14px 26px rgba(40,30,10,.22); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  position: absolute; right: 6px; top: 6px; z-index: 2; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ok); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.badge svg { width: 15px; height: 15px; stroke-width: 2.4; }
.progress { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--lamp); width: var(--p, 0%); }
.pct { font-size: 12px; color: var(--ink-3); }

/* generated cover for books without art */
.gen {
  position: absolute; inset: 0; padding: 14% 12%; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, hsl(var(--h, 30) 34% 34%), hsl(calc(var(--h, 30) + 24) 38% 20%)); color: #f7efe2;
}
.gen::before { content: ""; position: absolute; inset: 7%; border: 1px solid rgba(247, 239, 226, .35); border-radius: 2px; }
.gen b { font: 600 clamp(13px, 1.1vw + 6px, 17px)/1.15 var(--serif); position: relative; }
.gen span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; position: relative; }
.gen.pdf { background: linear-gradient(160deg, hsl(var(--h, 210) 14% 46%), hsl(var(--h, 210) 16% 28%)); }

/* ---------- grids ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 26px 16px; }
@media (min-width: 861px) { .grid { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 30px 22px; } }
.list { display: flex; flex-direction: column; }
.list .tile { flex-direction: row; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list .cover { width: 56px; flex: none; }
.list .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.list .tile-author { margin: 0; }
.list .progress { max-width: 220px; }
.list .gen b { font-size: 8px; }
.list .gen span { display: none; }

/* ---------- toolbar / chips ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); white-space: nowrap; font-size: 14px; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.spacer { flex: 1; }
.select { height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); padding: 0 12px; font-size: 14px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; width: 38px; height: 32px; display: grid; place-items: center; color: var(--ink-3); }
.seg button[aria-pressed="true"] { background: var(--paper-2); color: var(--ink); }
.seg svg { width: 18px; height: 18px; }

/* ---------- buttons ---------- */
.btn {
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 999px;
  border: 1px solid transparent; font-weight: 600; text-decoration: none; transition: transform .1s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 19px; height: 19px; }
.btn-primary { background: var(--lamp); color: var(--lamp-ink); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ok { background: color-mix(in srgb, var(--ok) 14%, var(--card)); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.btn-ghost { background: var(--card); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-danger { background: none; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn[disabled] { opacity: .7; cursor: default; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- hero / continue ---------- */
.hello { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.hello p { margin: 6px 0 0; }
.continue { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 34px; }
.cont {
  display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); text-align: left; box-shadow: var(--shadow);
}
.cont .cover { width: 62px; flex: none; }
.cont .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cont .tile-title { font-size: 15px; }
.banner {
  display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--lamp-soft), var(--card)); border: 1px solid var(--line); margin-bottom: 30px; flex-wrap: wrap;
}
.banner .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); color: var(--lamp); }
.banner .txt { flex: 1; min-width: 220px; }
.banner h2 { font-size: 18px; }
.banner p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }

/* ---------- sheet (book detail, pairing) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(20, 15, 8, .45); backdrop-filter: blur(2px); animation: fade .2s ease; }
.sheet {
  position: fixed; z-index: 50; left: 50%; top: 50%; translate: -50% -50%; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  overflow: auto; background: var(--card); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: pop .22s ease;
}
@media (max-width: 700px) {
  .sheet { left: 0; right: 0; top: auto; bottom: 0; translate: none; width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; animation: rise .25s ease; padding-bottom: env(safe-area-inset-bottom); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; scale: .97; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet-close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; }
.detail { display: grid; grid-template-columns: 210px 1fr; gap: 28px; padding: 28px; }
.detail .cover { width: 100%; }
.detail h1 { font-size: 28px; }
.detail .by { font-size: 16px; margin: 6px 0 14px; color: var(--ink-2); }
.detail .actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 8px; }
.detail .actions .btn-primary, .detail .actions .btn-ok { min-width: 200px; }
.detail .desc p { margin: 0 0 12px; font: 400 15.5px/1.65 var(--serif); }
.detail .facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 18px; }
.detail .facts span { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.detail .note { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
@media (max-width: 700px) {
  .detail { grid-template-columns: 1fr; padding: 22px 18px 28px; gap: 18px; }
  .detail .cover { width: 150px; margin: 6px auto 0; }
  .detail h1, .detail .by { text-align: center; }
  .detail .actions { flex-direction: column; }
  .detail .actions .btn { width: 100%; }
}

/* pairing */
.pair { padding: 30px 30px 34px; max-width: 560px; }
.pair h1 { font-size: 26px; }
.steps { list-style: none; padding: 0; margin: 22px 0; display: flex; flex-direction: column; gap: 16px; counter-reset: s; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps li::before {
  counter-increment: s; content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--lamp-soft); color: var(--lamp); font-weight: 700; font-size: 14px;
}
.steps a { color: var(--lamp); font-weight: 600; }
.code { display: flex; gap: 8px; margin: 8px 0 6px; }
.code input {
  width: 100%; height: 56px; text-align: center; letter-spacing: .5em; text-indent: .5em; font: 600 24px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: lowercase; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); outline: none;
}
.code input:focus { border-color: var(--lamp); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lamp) 22%, transparent); }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 6px 0 0; }

/* ---------- settings ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card h2 { font-size: 18px; margin-bottom: 4px; }
.card p { margin: 4px 0 14px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row .field { padding-left: 14px; flex: 1; min-width: 220px; border-radius: 12px; height: 46px; }
.settings { max-width: 720px; }
.status-line { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.status-line .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 70px 20px; color: var(--ink-2); }
.empty svg { width: 46px; height: 46px; color: var(--ink-3); margin-bottom: 10px; }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.skel { background: linear-gradient(90deg, var(--paper-2), var(--line), var(--paper-2)); background-size: 200% 100%; animation: sh 1.4s infinite; border-radius: 6px; }
@keyframes sh { to { background-position: -200% 0; } }
.skel.cover { box-shadow: none; }
.skel.line { height: 12px; margin-top: 8px; width: 80%; }
.more { display: flex; justify-content: center; margin: 32px 0 8px; }
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); translate: -50% 0; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; animation: rise .2s ease;
  display: flex; gap: 10px; align-items: center;
}
.toast a { color: var(--lamp-soft); font-weight: 600; }
@media (min-width: 861px) { .toast { bottom: 28px; } }
.demo-flag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--lamp-soft); color: var(--lamp); font-weight: 600; margin-left: 4px; }
footer.foot { max-width: 1240px; margin: 0 auto; padding: 0 16px 30px; font-size: 12.5px; color: var(--ink-3); }
footer.foot a { color: inherit; }

.ds-search { position: relative; width: 100%; }
.ds-search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--ink-3); }
.ds-search .field { height: 46px; font-size: 16px; }
#subjects { margin: 0 0 22px; }
.center { text-align: center; width: 100%; }
.more { flex-direction: column; align-items: center; gap: 12px; }
.btn-block { width: 100%; }

/* Fireside Folio additions */
.brand-mark { background: linear-gradient(160deg, #3a2418, #1d130d); }
.brand-mark svg { color: #f4a65e; }
.head-actions { display: flex; align-items: center; gap: 12px; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; cursor: pointer; }
.btn-sm svg { width: 17px; height: 17px; }
.scope { margin: 6px 0 0; }
main.dropping { outline: 2px dashed var(--lamp); outline-offset: -8px; border-radius: 18px; background: color-mix(in srgb, var(--lamp) 6%, transparent); }
.folder-pick { display: flex; flex-direction: column; gap: 6px; margin: 16px 0 4px; font-weight: 500; font-size: 14px; }
.folder-pick .field { padding-left: 14px; border-radius: 12px; height: 46px; }
.folder-pick small { font-weight: 400; }
.toast .spin { width: 15px; height: 15px; }
@media (max-width: 860px) {
  .brand-name { font-size: 18px; white-space: nowrap; }
  .brand-mark { width: 30px; height: 30px; }
  .device-pill { height: 34px; padding: 0 12px; font-size: 13px; }
}
@media (max-width: 380px) { .device-pill .demo-flag { display: none; } }

/* ---------- accounts ---------- */
.auth { padding: 30px 30px 26px; max-width: 460px; margin: 0 auto; }
.auth-mark { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(160deg, #3a2418, #1d130d); margin-bottom: 14px; }
.auth-mark svg { width: 28px; height: 28px; color: #f4a65e; }
.auth h1 { font-size: 26px; }
.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; margin: 14px 0 0; }
.lbl .field { padding-left: 14px; border-radius: 12px; height: 46px; font-size: 16px; }
.lbl small { font-weight: 400; }
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; margin-top: 18px; }
.btn-google:hover { background: #f8f9fa; }
.btn-google .g { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 18px 0 2px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.linkish { border: 0; background: none; padding: 0; color: var(--lamp); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.linkish.danger { color: var(--danger); }
.pill-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); margin-left: 8px; vertical-align: middle; }
.ask { padding: 28px 28px 24px; max-width: 520px; }
.ask h1 { font-size: 22px; padding-right: 36px; }
.ask-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.status-line svg { width: 18px; height: 18px; color: var(--ink-3); }
.cover-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 8px; }
.cover-opt { text-align: left; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; gap: 4px; }
.cover-opt span { font-size: 13px; color: var(--ink-2); }
.cover-opt[aria-pressed="true"] { border-color: var(--lamp); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lamp) 30%, transparent); background: var(--card); }
@media (max-width: 560px) { .cover-pick { grid-template-columns: 1fr; } }

/* ---------- files ---------- */
.files-head { align-items: flex-start; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { color: var(--lamp); }
.crumbs svg { width: 14px; height: 14px; color: var(--ink-3); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.chip svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.chip[aria-pressed="true"] svg { color: inherit; }
.flist { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.frow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.frow:last-child { border-bottom: 0; }
.frow:hover { background: var(--paper); }
.frow.sel { background: color-mix(in srgb, var(--lamp) 10%, var(--card)); }
.fic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--paper-2); color: var(--ink-2); }
.fic.big { width: 54px; height: 54px; }
.fic.k-folder { background: color-mix(in srgb, var(--lamp) 16%, var(--card)); color: var(--lamp); }
.fic.k-notebook { color: #4f6b8a; }
.fic.k-epub { color: #6b5a8a; }
.fname { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.fname b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fname small { flex-basis: 100%; color: var(--ink-3); font-size: 12.5px; }
.fstar svg { width: 15px; height: 15px; color: var(--lamp); fill: currentColor; margin-left: 4px; }
.fmore { border: 0; background: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.fmore:hover { background: var(--paper-2); color: var(--ink); }
.fcheck { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--ink-3); display: grid; place-items: center; flex: none; }
.frow.sel .fcheck { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink); }
.fcheck svg { width: 15px; height: 15px; stroke-width: 2.6; }
.selbar { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); margin-top: 16px; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-radius: 14px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); font-weight: 600; flex-wrap: wrap; }
.selbar .btn-ghost { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 30%, transparent); }
.selbar .btn-danger { color: #ffb4a8; border-color: color-mix(in srgb, #ffb4a8 40%, transparent); }
@media (min-width: 861px) { .selbar { bottom: 20px; } }
.fsheet { padding: 26px 26px 24px; }
.fsheet-head { display: flex; gap: 14px; align-items: center; padding-right: 40px; }
.fsheet-head h1 { font-size: 21px; word-break: break-word; }
.fsheet-head p { margin: 4px 0 0; }
.factions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.factions .btn { justify-content: flex-start; }
.tree { display: flex; flex-direction: column; margin-top: 14px; max-height: 50vh; overflow: auto; }
.tree-row { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 11px 10px 11px calc(10px + var(--d, 0) * 22px); border-radius: 10px; text-align: left; font-weight: 500; }
.tree-row:hover { background: var(--paper-2); }
.tree-row svg { width: 19px; height: 19px; color: var(--lamp); }
@media (max-width: 860px) {
  .tabs a { min-width: 0; flex: 1; padding: 6px 4px; }
  .files-head .head-actions { width: 100%; }
}

.brand-name { white-space: nowrap; }
@media (max-width: 1180px) and (min-width: 861px) { .top-search { display: none; } .device-pill { margin-left: auto; } }
