/* DREADR by Diyama Solutions. Diyama teal and gold, system fonts only (nothing fetched). */
:root {
  --teal: #1f5c4d;
  --teal-2: #2a7865;
  --gold: #e8a838;
  --gold-soft: #fbecd0;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #eef2f1;
  --ink: #1e2b30;
  --ink-2: #4b5a58;
  --line: #d9e0de;
  --stage: #e3e8e7;
  --mark: #ffe08a;
  --mark-now: #f2a900;
  --shadow: 0 1px 2px rgba(10, 30, 28, .08), 0 4px 16px rgba(10, 30, 28, .06);
  --radius: 12px;
  --top-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --teal: #5cb39b; --teal-2: #7fc7b2; --gold: #e8a838; --gold-soft: #3b3315;
    --bg: #0f1615; --surface: #172120; --surface-2: #1e2a29; --ink: #e6eeec; --ink-2: #9db0ad;
    --line: #2a3836; --stage: #0b1110; --mark: #8a6d10; --mark-now: #d39a00;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --teal: #5cb39b; --teal-2: #7fc7b2; --gold: #e8a838; --gold-soft: #3b3315;
  --bg: #0f1615; --surface: #172120; --surface-2: #1e2a29; --ink: #e6eeec; --ink-2: #9db0ad;
  --line: #2a3836; --stage: #0b1110; --mark: #8a6d10; --mark-now: #d39a00;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
a { color: var(--teal); }

.shell { height: 100%; display: flex; flex-direction: column; }

/* Top bar */
.top {
  height: var(--top-h); flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--teal); color: #fff; font-weight: 800; font-size: 19px; letter-spacing: -.5px;
  box-shadow: inset 0 -3px 0 var(--gold);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo.has-img { background: none; box-shadow: none; }
.brand-text { font-size: 17px; line-height: 1.1; white-space: nowrap; }
.brand-text b { font-weight: 850; color: var(--teal); letter-spacing: .6px; }
.brand-text small { display: block; font-size: 11.5px; color: var(--ink-2); letter-spacing: .2px; margin-top: 2px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600;
}
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #06201e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #06201e; } }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { height: 48px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.sm svg { width: 18px; height: 18px; }
.icon-btn:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

#btnTheme .moon { display: none; }
:root[data-theme="dark"] #btnTheme .sun { display: none; }
:root[data-theme="dark"] #btnTheme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #btnTheme .sun { display: none; }
  :root:not([data-theme="light"]) #btnTheme .moon { display: block; }
}

/* Layout */
.body { flex: 1; display: flex; min-height: 0; position: relative; }
.side {
  width: 264px; flex: none; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.side-tabs { display: flex; gap: 4px; padding: 12px 12px 8px; }
.side-tab {
  flex: 1; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px;
}
.side-tab.active { background: var(--surface-2); color: var(--ink); }
.side-panel { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 12px; min-height: 0; }
.side-empty { color: var(--ink-2); font-size: 13.5px; margin: 8px 4px; }
.side-note {
  display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 12px 16px;
  border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2);
}
.side-note svg { width: 16px; height: 16px; margin-top: 1px; color: var(--teal); }

.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.recent button {
  width: 100%; min-width: 0; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; text-align: left;
}
.recent button:hover { background: var(--surface-2); }
.recent button.current { background: var(--surface-2); border-color: var(--line); }
.recent .r-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.recent .r-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .r-meta { font-size: 12px; color: var(--ink-2); }

.file-badge, .r-badge {
  flex: none; min-width: 42px; height: 24px; padding: 0 6px; border-radius: 6px; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: .4px; color: #fff; background: #6b7a78;
}
.t-pdf { background: #c0392b; } .t-docx { background: #2b5797; } .t-sheet { background: #1e7145; }
.t-pptx { background: #c55a11; } .t-text { background: #5b6b69; } .t-image { background: #7a4fa0; }

.thumbs { display: grid; gap: 12px; padding: 4px 8px; }
.thumb { border: 0; background: transparent; padding: 0; display: grid; justify-items: center; gap: 4px; color: var(--ink-2); font-size: 12px; }
.thumb canvas, .thumb .ph { width: 100%; max-width: 180px; border-radius: 4px; background: #fff; box-shadow: var(--shadow); border: 2px solid transparent; }
.thumb .ph { aspect-ratio: 1 / 1.414; }
.thumb.current canvas, .thumb.current .ph { border-color: var(--gold); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

/* Welcome */
.welcome { flex: 1; overflow-y: auto; padding: 32px 16px 24px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.drop {
  width: 100%; max-width: 680px; padding: 48px 24px; text-align: center; border-radius: 20px;
  border: 2px dashed var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--teal); }
.drop-icon { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--teal); }
.drop-icon svg { width: 44px; height: 44px; stroke-width: 2.2; }
.drop h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.3px; }
.lead { margin: 0 0 20px; color: var(--ink-2); font-size: 16px; }
.formats { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.formats li { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.promise { width: 100%; max-width: 680px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.promise-item { display: flex; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.promise-item svg { color: var(--gold); width: 22px; height: 22px; margin-top: 2px; }
.promise-item b { display: block; font-size: 14.5px; }
.promise-item span { display: block; font-size: 13.5px; color: var(--ink-2); }

/* Viewer */
.viewer { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.toolbar {
  flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px 8px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.tb-file { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 220px; }
.file-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-meta { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.tb-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 2px; height: 38px; padding: 0 4px 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-2);
}
.search svg { width: 18px; height: 18px; }
.search input { border: 0; background: transparent; color: var(--ink); width: 160px; height: 100%; padding: 0 6px; font: inherit; outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search-count { font-size: 12.5px; min-width: 40px; text-align: right; white-space: nowrap; }
.zoom { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; height: 38px; padding: 0 2px; }
.zoom-val { border: 0; background: transparent; min-width: 54px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.page-ind { font-size: 13px; color: var(--ink-2); padding: 0 6px; white-space: nowrap; }

.stage { flex: 1; overflow: auto; background: var(--stage); position: relative; outline: none; overscroll-behavior: contain; }
.content { padding: 20px 16px 40px; min-height: 100%; }

/* PDF */
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pdf-page { position: relative; background: #fff; box-shadow: var(--shadow); flex: none; }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-page .pnum { position: absolute; right: 8px; bottom: -22px; font-size: 12px; color: var(--ink-2); }
.textLayer { position: absolute; inset: 0; overflow: hidden; line-height: 1; opacity: 1; forced-color-adjust: none; transform-origin: 0 0; z-index: 2; }
.textLayer span, .textLayer br { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer span.hl { background: rgba(255, 196, 0, .45); border-radius: 2px; }
.textLayer span.hl.now { background: rgba(242, 120, 0, .6); }
.textLayer ::selection { background: rgba(19, 112, 107, .3); }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: -1; cursor: default; user-select: none; }

/* DOCX */
.docx-host { display: flex; justify-content: center; }
.docx-host .docx-wrapper { background: transparent !important; padding: 0 !important; }
.docx-host .docx-wrapper > section.docx { box-shadow: var(--shadow) !important; margin-bottom: 16px !important; }

/* Sheets */
.sheet-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: inline-block; min-width: 100%; }
.sheet { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 8px; white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.sheet td.num { text-align: right; }
.sheet thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 12px; text-align: center; }
.sheet tr.hdr td { position: sticky; top: 27px; z-index: 2; background: var(--gold-soft); font-weight: 700; }
.sheet th.rn, .sheet td.rn { position: sticky; left: 0; z-index: 1; background: var(--surface-2); color: var(--ink-2); font-size: 12px; text-align: right; min-width: 44px; }
.sheet thead th.rn { z-index: 4; }
.sheet tr.hdr td.rn { z-index: 3; }
.sheet tbody tr:hover td { background: color-mix(in srgb, var(--teal) 6%, var(--surface)); }
.sheet tbody tr.hdr:hover td { background: var(--gold-soft); }
.sheet-more { padding: 12px; text-align: center; color: var(--ink-2); font-size: 13px; }
.sheet-tabs {
  flex: none; display: flex; gap: 4px; overflow-x: auto; padding: 6px 8px; background: var(--surface); border-top: 1px solid var(--line);
}
.sheet-tabs button {
  flex: none; height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.sheet-tabs button.active { background: var(--surface-2); border-color: var(--line); color: var(--teal); box-shadow: inset 0 -3px 0 var(--gold); }

/* Slides */
.slides { display: grid; gap: 20px; max-width: 960px; margin: 0 auto; }
.slide { background: #fff; color: #1b1b1b; border-radius: 6px; box-shadow: var(--shadow); padding: 28px 32px; aspect-ratio: var(--ratio, 16 / 9); overflow: auto; position: relative; }
.slide .snum { position: absolute; top: 10px; right: 14px; font-size: 12px; color: #888; }
.slide h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.2; color: #1f5c4d; }
.slide p { margin: 0 0 6px; font-size: 16px; }
.slide p.lvl1 { padding-left: 22px; } .slide p.lvl2 { padding-left: 44px; } .slide p.lvl3 { padding-left: 66px; }
.slide p.bul::before { content: "\2022"; color: #c9a227; margin-right: 8px; }
.slide .imgs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.slide .imgs img { max-height: 220px; max-width: 100%; border-radius: 4px; object-fit: contain; }
.slide table { border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.slide td { border: 1px solid #ccc; padding: 4px 8px; }
.slide .notes { margin-top: 14px; padding-top: 10px; border-top: 1px dashed #ccc; font-size: 13.5px; color: #555; }
.slide-note { max-width: 960px; margin: 0 auto 16px; font-size: 13px; color: var(--ink-2); }

/* Text, markdown, JSON */
.doc-text { max-width: 900px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.doc-text pre { margin: 0; padding: 20px 24px; white-space: pre-wrap; word-break: break-word; font: 13.5px/1.6 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; }
.md { max-width: 820px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 28px 32px; box-shadow: var(--shadow); line-height: 1.65; }
.md img { max-width: 100%; }
.md pre { background: var(--surface-2); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.md code { font-family: ui-monospace, Consolas, Menlo, monospace; font-size: .92em; }
.md table { border-collapse: collapse; } .md th, .md td { border: 1px solid var(--line); padding: 6px 10px; }
.md blockquote { margin: 0; padding: 4px 16px; border-left: 4px solid var(--gold); color: var(--ink-2); }
.json-key { color: var(--teal); } .json-str { color: #b5651d; } .json-num { color: #2b5797; } .json-lit { color: #8e44ad; }
:root[data-theme="dark"] .json-str { color: #e6a15c; } :root[data-theme="dark"] .json-num { color: #7fb2ff; } :root[data-theme="dark"] .json-lit { color: #c792ea; }

/* Images */
.img-host { display: flex; justify-content: center; align-items: flex-start; min-height: 100%; }
.img-host img { max-width: 100%; height: auto; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 20px 20px; box-shadow: var(--shadow); }
.img-host.zoomed img { max-width: none; }

mark.find { background: var(--mark); color: inherit; border-radius: 2px; padding: 0; }
mark.find.now { background: var(--mark-now); color: #000; }

.notice { max-width: 560px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); }
.notice h2 { margin: 0 0 6px; font-size: 19px; }
.notice p { margin: 0 0 14px; color: var(--ink-2); }

.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: color-mix(in srgb, var(--bg) 80%, transparent); z-index: 20; color: var(--ink-2); font-weight: 600; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--teal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dropover { position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, var(--teal) 85%, transparent); display: grid; place-items: center; color: #fff; text-align: center; pointer-events: none; }
.dropover div { border: 3px dashed rgba(255,255,255,.8); border-radius: 24px; padding: 48px 64px; }
.dropover b { display: block; font-size: 26px; } .dropover span { opacity: .9; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); }

.foot { flex: none; padding: 6px 16px; font-size: 12px; color: var(--ink-2); background: var(--surface); border-top: 1px solid var(--line); text-align: center; }
.foot a { color: inherit; font-weight: 600; }

.only-phone { display: none; }
.scrim { display: none; }

/* Phone */
@media (max-width: 820px) {
  :root { --top-h: 56px; }
  .top { padding: 0 8px 0 4px; gap: 6px; }
  .only-phone { display: inline-grid; }
  .brand-text small { display: none; }
  .top .btn span { display: none; }
  .top .btn { width: 40px; padding: 0; justify-content: center; }
  .side {
    position: fixed; top: var(--top-h); bottom: 0; left: 0; z-index: 40; width: min(300px, 86vw);
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  .shell.side-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; background: rgba(0,0,0,.35); z-index: 35; }
  .promise { grid-template-columns: 1fr; }
  .drop { padding: 32px 16px; }
  .drop h1 { font-size: 22px; }
  .welcome { padding-top: 20px; }
  .toolbar { padding: 6px 8px; gap: 6px; }
  .tb-file { flex-basis: 100%; }
  .tb-tools { width: 100%; justify-content: space-between; gap: 2px; }
  .search { flex: 1 1 140px; min-width: 0; }
  .search input { width: 100%; min-width: 40px; }
  .zoom-val { min-width: 46px; }
  .page-ind { display: none; }
  .content { padding: 12px 8px 32px; }
  .slide { padding: 18px; aspect-ratio: auto; }
  .slide h2 { font-size: 19px; } .slide p { font-size: 14.5px; }
  .md { padding: 18px; }
  .doc-text pre { padding: 14px; }
  .foot { display: none; }
}
@media (max-width: 420px) {
  .zoom { display: none; }
  .file-meta { display: none; }
}

/* Print: only the document */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; color: #000; }
  .top, .side, .scrim, .toolbar, .sheet-tabs, .foot, .welcome, .loading, .toast, .dropover { display: none !important; }
  .shell, .body, .main, .viewer, .stage { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; }
  .content { padding: 0 !important; zoom: 1 !important; }
  .pdf-page, .slide, .docx-host section.docx { box-shadow: none !important; break-after: page; }
  .pdf-page .pnum { display: none; }
  .slide { aspect-ratio: auto; border: 1px solid #ccc; }
  .sheet thead th, .sheet tr.hdr td, .sheet .rn { position: static !important; }
  .sheet-wrap { border: 0; }
  .doc-text, .md { border: 0; box-shadow: none; max-width: none; }
  mark.find { background: none; }
}

/* Install prompt */
.install {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 95; width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 8px 32px rgba(0,0,0,.18); animation: rise .25s ease;
}
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }
.install-icon { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.install-text { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-2); }
.install-text b { color: var(--ink); }
.install-text > b { display: block; font-size: 15px; }
.install-btns { display: flex; gap: 6px; flex: none; }
.share-ico { width: 16px; height: 16px; vertical-align: -3px; color: var(--teal); }
.install-top { height: 36px; padding: 0 12px; color: var(--teal); border-color: var(--teal); }
@media (max-width: 520px) {
  .install { flex-wrap: wrap; }
  .install-text { flex-basis: calc(100% - 64px); }
  .install-btns { width: 100%; justify-content: flex-end; }
}

/* Contents list (EPUB) */
.toc-item { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--ink); }
.toc-item:hover { background: var(--surface-2); }
.epub .byline { color: var(--ink-2); margin-top: -6px; }
.epub .chapter { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 24px; }
.epub img, .odf img, .mail img { max-width: 100%; height: auto; }
.odf table, .epub table { border-collapse: collapse; margin: 8px 0; }
.odf td, .epub td { border: 1px solid var(--line); padding: 4px 8px; vertical-align: top; }
.odf td p { margin: 0; }

/* Email */
.mail-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; font-size: 14px; }
.mail-head h1 { font-size: 22px; margin: 0 0 10px; line-height: 1.3; }
.mail-head b { color: var(--ink-2); font-weight: 600; min-width: 48px; display: inline-block; }
.mail-body { overflow-x: auto; }
.mail-atts { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mail-atts h3 { width: 100%; margin: 0 0 4px; font-size: 14px; color: var(--ink-2); }
.mail-atts .btn { height: auto; min-height: 36px; padding: 6px 12px; font-size: 13.5px; font-weight: 500; max-width: 100%; overflow-wrap: anywhere; text-align: left; }

/* ZIP list */
.ziplist { max-width: 820px; margin: 0 auto; }
.ziplist ul { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ziplist li + li { border-top: 1px solid var(--line); }
.ziplist button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: transparent; text-align: left; }
.ziplist button:hover { background: var(--surface-2); }
.z-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.z-size { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }

/* Fallback views */
.fallback { max-width: 900px; margin: 0 auto; display: grid; gap: 12px; }
.fallback .notice { margin: 0; text-align: left; }
.fallback .notice p { margin: 0; }
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: grid; gap: 4px; font-size: 14px; }
.info-card div { display: flex; gap: 12px; }
.info-card b { min-width: 92px; color: var(--ink-2); font-weight: 600; }
.info-card span { overflow-wrap: anywhere; }
.seg { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; justify-self: start; }
.seg button { border: 0; background: transparent; border-radius: 7px; padding: 6px 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.seg button.active { background: var(--surface-2); color: var(--teal); }
.fallback .doc-text { max-width: none; width: 100%; }
.fallback pre { max-height: 70vh; overflow: auto; }
.linkish { border: 0; background: none; padding: 0; color: var(--teal); font-weight: 600; text-decoration: underline; }
@media print { .install, .install-top, .seg, .info-card { display: none !important; } }
