/* app.css — PDF Highlighter. Desktop layout: top bar, PDF in the middle, highlights on the right. */
:root {
  --bg: #eef0f3; --panel: #ffffff; --panel-2: #f7f8fa; --ink: #141a24; --ink-2: #4b5563; --muted: #8a93a3;
  --line: #e3e6eb; --acc: #0f766e; --acc-ink: #ffffff; --acc-soft: #e6f4f2; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.08);
  --r: 10px; --bar: 56px; --side: 340px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218; --panel: #171b23; --panel-2: #1d222c; --ink: #e8ebf0; --ink-2: #b4bccb; --muted: #7d8696;
    --line: #2a303b; --acc: #2dd4bf; --acc-ink: #06201d; --acc-soft: #12302d; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 Inter, "Segoe UI", system-ui, sans-serif; display: flex; flex-direction: column; overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
kbd { font: 12px/1 ui-monospace, Consolas, monospace; padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--panel); }

/* ---------- top bar */
.bar { height: var(--bar); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.logo { width: 28px; height: 28px; display: block; border-radius: 7px; }
.file { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 280px; padding: 5px 10px; border-radius: 8px; background: var(--panel-2); color: var(--ink-2); }
.file span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan { flex: none; font-size: 12px; color: var(--acc); }
.tools { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.tool { display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 6px 12px; border-radius: 7px; color: var(--ink-2); transition: background .15s, color .15s; }
.tool:hover { color: var(--ink); }
.tool.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.ic { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.ic-hl { background: #ffd400; }
.ic-ul { border-bottom: 3px solid currentColor; border-radius: 0; height: 12px; }
.swatches { display: flex; gap: 6px; }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); padding: 0; transition: transform .12s, box-shadow .12s; }
.sw:hover { transform: scale(1.12); }
.sw.on { box-shadow: 0 0 0 2px var(--ink); }
.nav { display: flex; align-items: center; gap: 4px; }
.icon, .zv { border: 1px solid transparent; background: none; height: 32px; min-width: 32px; border-radius: 8px; font-size: 18px; color: var(--ink-2); }
.zv { font-size: 13px; min-width: 56px; }
.icon:hover, .zv:hover { background: var(--panel-2); border-color: var(--line); color: var(--ink); }
#pageIn { width: 52px; height: 32px; text-align: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
#pageIn:focus { outline: 2px solid var(--acc); outline-offset: -1px; }
.of { color: var(--muted); margin: 0 4px 0 2px; white-space: nowrap; }
.vsep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; transition: border-color .15s, background .15s, transform .08s; white-space: nowrap; }
.btn:hover { border-color: var(--acc); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
body:not(.has-doc) #openBtn { margin-left: 0; }

/* ---------- main */
main { flex: 1; display: flex; min-height: 0; }
.viewer { position: relative; flex: 1; min-width: 0; overflow: auto; padding: 28px 32px 60px; display: flex; flex-direction: column; align-items: center; gap: 20px; outline: none; }
.page { flex: none; position: relative; background: #fff; border-radius: 3px; box-shadow: var(--shadow); }
.page canvas { display: block; border-radius: 3px; }
.page:not(.ready)::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #f3f4f6 0%, #fafafa 50%, #f3f4f6 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: 3px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pnum { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.hl-layer { position: absolute; inset: 0; pointer-events: none; } /* no z-index: a z-index would seal the layer off, and the marks multiply-blend would no longer reach the page (Zotero, page.js) */
.mark { position: absolute; border-radius: 2px; transition: outline-color .2s; outline: 2px solid transparent; outline-offset: 1px; }
.mark.hl { mix-blend-mode: multiply; opacity: .4; } /* same as Zotero: 40%, multiply */
.mark.ul, .mark.so { opacity: .9; }
.mark.box { border: 2px solid; }
.mark.flash { outline-color: var(--acc); animation: pulse .5s 3; }
@keyframes pulse { 50% { outline-offset: 4px; } }
.textLayer { position: absolute; inset: 0; overflow: hidden; line-height: 1; z-index: 2; }
.textLayer span, .textLayer br { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0 0; }
.textLayer ::selection { background: rgba(15, 118, 110, .28); }

/* ---------- sidebar */
.side { width: var(--side); flex: none; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); }
.side-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.side-head h2 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.count { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--acc-soft); color: var(--acc); }
#search { height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
#search:focus { outline: 2px solid var(--acc); outline-offset: -1px; background: var(--panel); }
.filters { display: flex; gap: 6px; }
.chip { border: 1px solid var(--line); background: none; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.cfilter { display: flex; gap: 6px; }
.cfilter:empty { display: none; }
.cf { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); padding: 0; }
.cf.on { box-shadow: 0 0 0 2px var(--ink); }
.list { flex: 1; overflow: auto; padding: 6px 12px 14px; }
.pgroup { position: sticky; top: -6px; z-index: 1; background: var(--panel); padding: 10px 2px 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card { position: relative; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 8px 14px; margin-bottom: 8px; cursor: pointer; background: var(--panel); transition: border-color .15s, box-shadow .15s, transform .15s; }
.card::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--c); }
.card:hover { border-color: color-mix(in srgb, var(--c) 60%, var(--line)); box-shadow: var(--shadow); transform: translateY(-1px); }
.card.new { animation: slidein .35s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } }
.meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tag { padding: 0 6px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line); font-size: 11px; }
.sp { flex: 1; }
.mini { border: 0; background: none; color: var(--muted); padding: 2px 6px; border-radius: 6px; font-size: 12px; opacity: 0; transition: opacity .15s; }
.card:hover .mini { opacity: 1; }
.mini:hover { background: var(--panel-2); color: var(--ink); }
.card blockquote { margin: 6px 0 4px; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.card blockquote.muted { color: var(--muted); font-style: italic; }
.card textarea { width: 100%; resize: none; overflow: hidden; border: 1px solid transparent; border-radius: 7px; background: transparent; padding: 4px 6px; margin-left: -6px; font-size: 13px; color: var(--ink-2); }
.card textarea:hover { background: var(--panel-2); }
.card textarea:focus { outline: none; border-color: var(--line); background: var(--panel-2); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; }
.empty p { margin: 0; }
.empty-ic { width: 40px; height: 40px; margin: 0 auto 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); position: relative; }
.empty-ic::after { content: ""; position: absolute; left: 9px; right: 9px; top: 17px; height: 6px; border-radius: 2px; background: #ffd400; opacity: .7; }
.side-foot { padding: 12px 14px 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* ---------- toast */
.toast { position: fixed; bottom: 24px; left: calc(50% - var(--side) / 2); transform: translate(-50%, 12px); background: var(--ink); color: var(--panel); padding: 9px 16px; border-radius: 10px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* smaller laptop screens: hide button words, keep icons */
@media (max-width: 1180px) {
  .tool { padding: 6px 9px; font-size: 0; gap: 0; }
  .tool .ic { width: 16px; height: 16px; }
  :root { --side: 330px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- find bar (sits above the PDF) */
.center { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.findbar { position: absolute; top: 12px; right: 24px; z-index: 20; display: flex; align-items: center; gap: 4px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
#findIn { width: 240px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
#findIn:focus { outline: 2px solid var(--acc); outline-offset: -1px; }
.fcount { min-width: 74px; text-align: center; font-size: 12.5px; color: var(--muted); }
.fcount.none { color: #e0464b; }
.textLayer mark.found { color: transparent; background: rgba(255, 170, 0, .4); border-radius: 2px; padding: 0; }
.textLayer mark.found.cur { background: rgba(255, 110, 0, .7); box-shadow: 0 0 0 2px rgba(255, 110, 0, .7); }

/* ---------- sidebar tabs + contents */
.tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); }
.tab { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 10px 10px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--acc); }
.hlpane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-head h2 { display: none; }
.toc { flex: 1; overflow: auto; padding: 8px 6px 16px; }
.tree { list-style: none; margin: 0; padding: 0; }
.titem { width: 100%; display: flex; gap: 10px; align-items: baseline; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); }
.titem:hover:not(:disabled) { background: var(--panel-2); color: var(--ink); }
.titem:disabled { cursor: default; opacity: .6; }
.tree .tree .titem { font-size: 13px; }
.tt { flex: 1; }
.tp { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- card extras */
.recolor { display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.card:hover .recolor { opacity: 1; }
.rc { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); padding: 0; }
.rc:hover { transform: scale(1.2); }
.card.blink { animation: blink 1.2s ease-out; }
@keyframes blink { 0%, 40% { box-shadow: 0 0 0 3px var(--c); } 100% { box-shadow: none; } }
.page .mark.hl, .page .mark.ul, .page .mark.so, .page .mark.box { cursor: pointer; }

/* ---------- backup links */
.backup { display: flex; justify-content: center; gap: 14px; font-size: 12.5px; }
.link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--acc); }

.mark.note { border-radius: 4px 4px 4px 0; opacity: .85; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.savehint { margin: 0; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; }

#pdf.dirty::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ffb020; margin-left: 4px; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }

/* ---------- view buttons (top bar) */
.views { display: flex; gap: 2px; }
.vbtn.on { background: var(--acc-soft); color: var(--acc); border-color: transparent; }
.vi { display: inline-block; width: 18px; height: 14px; border: 2px solid currentColor; border-radius: 3px; position: relative; vertical-align: middle; }
.vi-panel::after { content: ""; position: absolute; right: 3px; top: 1px; bottom: 1px; width: 2px; background: currentColor; }
.vi-read { border-style: dashed; }
.icon.small { height: 28px; min-width: 28px; font-size: 15px; align-self: center; }
.tabs .sp { flex: 1; }

/* ---------- resizable / hideable panel */
.side { position: relative; }
.resizer { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 5; }
.resizer::after { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.resizer:hover::after, body.resizing .resizer::after { background: var(--acc); }
body.resizing { cursor: col-resize; user-select: none; }
body.no-panel .side { display: none; }
body.no-panel .toast { left: 50%; }

/* ---------- reading mode */
body.reading .bar, body.reading .side { display: none; }
body.reading .viewer { padding-top: 36px; background: var(--bg); }
body.reading .toast { left: 50%; top: 20px; bottom: auto; }
.dock { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25); transition: opacity .3s, transform .3s; }
.dock.away { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }
.dock .tool { padding: 7px 9px; }
.dock .tool.on { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.dsep { width: 1px; height: 22px; background: var(--line); }
.dpage { font-size: 13px; color: var(--ink-2); min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- highlights as a full page */
.notes { position: fixed; inset: var(--bar) 0 0 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; }
.notes-bar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.notes-bar h2 { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-bar .sp { flex: 1; }
.notes-body { flex: 1; overflow: auto; padding: 28px 24px 60px; }
.n-page { max-width: 760px; margin: 0 auto 8px; }
.n-page h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.n-item { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.n-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.n-item blockquote { margin: 0; font-size: 16px; line-height: 1.6; }
.n-note { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; }
.n-kind { margin: 0; color: var(--muted); font-style: italic; }
.n-empty { text-align: center; color: var(--muted); margin-top: 60px; }

/* fit button: icon shows the mode (arrows left-right = width, box = whole page) */
.fit.on { background: var(--acc-soft); color: var(--acc); }
.fi { display: inline-block; width: 16px; height: 12px; position: relative; vertical-align: middle; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.fi::after { content: ""; position: absolute; left: 2px; right: 2px; top: 5px; height: 2px; background: currentColor; }
.fit[data-mode="page"] .fi { width: 12px; height: 15px; border: 2px solid currentColor; border-radius: 2px; }
.fit[data-mode="page"] .fi::after { display: none; }

/* start screen: shortcuts — name left, keys right, one soft row each */
.krows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.krows li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 10px; background: var(--panel-2); font-size: 13.5px; color: var(--ink-2); }
.kk { display: flex; align-items: center; gap: 4px; }
.kk kbd { min-width: 26px; height: 26px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; font: 600 12px/1 Inter, "Segoe UI", sans-serif; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 7px; }
.kk .to { color: var(--muted); font-size: 12px; }

/* notice above the PDF (e.g. scanned file) */
.banner { display: flex; align-items: center; gap: 12px; margin: 12px 24px 0; padding: 10px 10px 10px 16px; border-radius: 10px; background: #fff4d6; color: #6b4a00; border: 1px solid #f3d27a; font-size: 13.5px; }
.banner span { flex: 1; }
.banner .icon { color: inherit; height: 28px; min-width: 28px; font-size: 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .banner { background: #3a2f12; color: #f6dc9b; border-color: #6b5520; } }
body.reading .banner { display: none; }


/* diagonal watermark text: never selectable */
.textLayer span.slant { user-select: none; -moz-user-select: none; -webkit-user-select: none; pointer-events: none; }

/* menu when a mark on the page is clicked */
.mmenu { position: fixed; z-index: 60; min-width: 176px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(0,0,0,.22); display: grid; gap: 2px; animation: mm .12s ease-out; }
@keyframes mm { from { opacity: 0; transform: translateY(-4px); } }
.mm-colors { display: flex; gap: 8px; justify-content: center; padding: 6px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.mm-colors .rc { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); padding: 0; cursor: pointer; }
.mm-colors .rc.on { box-shadow: 0 0 0 2px var(--ink); }
.mm-note { margin: 4px 8px 6px; font-size: 12px; color: var(--muted); }
.mm-item { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.mm-item:hover { background: var(--panel-2); }
.mm-item.danger { color: #d33; }
.mark.sel { outline: 2px solid var(--acc); outline-offset: 1px; }

.card.picked { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }

/* top bar view icons */
.svi { width: 18px; height: 18px; display: block; margin: auto; }

/* tab on the right edge when the highlights panel is hidden */
.sidetab { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 25; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 7px; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; background: var(--panel); color: var(--ink-2);
  box-shadow: -4px 0 18px rgba(0,0,0,.12); cursor: pointer; font-weight: 600; font-size: 13px; transition: padding .15s, color .15s; }
.sidetab:hover { color: var(--acc); padding-right: 11px; }
.st-label { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .02em; }
.st-arrow { font-size: 18px; line-height: 1; }
.st-count { font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--acc-soft); color: var(--acc); }
body.reading .sidetab, body.notes-open .sidetab { display: none; }

/* PDF view buttons (Fit, Full screen) in the middle of the top bar, with names */
.pdfview { display: flex; gap: 4px; margin-left: auto; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.pdfview + .tools { margin-left: 12px; }
.pv { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pv:hover { background: var(--panel); color: var(--ink); }
.pv.fit.on { background: var(--panel); color: var(--acc); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.pv .svi { width: 16px; height: 16px; margin: 0; }
@media (max-width: 1180px) { .pvl { display: none; } }

/* "Hide ›" on the highlights panel header */
.hidebtn { align-self: center; display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; margin-left: 4px; }
.hidebtn:hover { border-color: var(--acc); color: var(--acc); }
.hidebtn span { font-size: 16px; line-height: 1; }

/* ---------- start screen */
.start { margin: auto; width: 100%; max-width: 760px; padding: 24px 20px 40px; text-align: center; }
.eyebrow { display: inline-flex; gap: 6px; margin: 0 0 18px; }
.eyebrow span { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--acc-soft); color: var(--acc); }
.hero h1 { font-size: 40px; line-height: 1.12; letter-spacing: -.03em; margin: 0 0 12px; }
.lede { font-size: 16.5px; color: var(--ink-2); margin: 0 auto 28px; max-width: 520px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 24px; border: 2px dashed var(--line); border-radius: 18px; background: var(--panel);
  cursor: pointer; transition: border-color .2s, background .2s, transform .15s, box-shadow .2s; }
.drop:hover { border-color: var(--acc); box-shadow: var(--shadow); transform: translateY(-1px); }
body.dragging .drop { border-color: var(--acc); background: var(--acc-soft); }
body.dragging.has-doc .viewer { outline: 3px dashed var(--acc); outline-offset: -10px; }
.drop-ic { width: 56px; height: 56px; color: var(--acc); margin-bottom: 6px; }
.drop-ic svg { width: 100%; height: 100%; }
.drop-t { font-size: 16px; color: var(--ink-2); }
.drop-t b { display: inline-block; padding: 8px 18px; margin-right: 6px; border-radius: 10px; background: var(--acc); color: var(--acc-ink); font-weight: 600; }
.drop-s { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.tiles { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: left; }
.tiles li { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.tiles b { display: block; font-size: 14px; margin: 10px 0 4px; }
.tiles p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.ti { width: 34px; height: 34px; border-radius: 9px; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; }
.ti svg { width: 19px; height: 19px; }
.start-foot { margin: 22px 0 0; font-size: 13px; color: var(--muted); }
.start-foot .link { font-size: 13px; color: var(--acc); }

/* ---------- help window */
.helpbtn { margin-left: auto; }
body.has-doc .helpbtn { margin-left: 0; }
.help { position: fixed; inset: 0; z-index: 70; background: rgba(10,14,22,.45); display: grid; place-items: center; padding: 24px; animation: fadein .15s; }
@keyframes fadein { from { opacity: 0; } }
.help-box { width: min(880px, 100%); height: min(600px, 100%); display: grid; grid-template-columns: 220px 1fr; background: var(--panel); border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.help-nav { background: var(--panel-2); border-right: 1px solid var(--line); padding: 20px 10px; display: flex; flex-direction: column; gap: 2px; }
.help-nav h2 { font-size: 18px; margin: 0 10px 12px; }
.help-nav button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.help-nav button:hover { background: var(--panel); color: var(--ink); }
.help-nav button.on { background: var(--panel); color: var(--acc); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.help-body { position: relative; overflow: auto; padding: 28px 34px; }
.help-body h3 { font-size: 20px; margin: 0 0 14px; }
.help-body ol, .help-body ul:not(.krows) { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.help-body b { color: var(--ink); }
.help-body p { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }
.help-body .tip { margin-top: 18px; padding: 10px 14px; border-radius: 10px; background: var(--acc-soft); color: var(--acc); font-size: 13.5px; }
.help-x { position: absolute; top: 14px; right: 14px; }
