:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface2: #eef1f7;
  --text: #171a21;
  --muted: #69707d;
  --line: #e2e6ee;
  --accent: #1a6cf5;
  --accent-soft: #e3edff;
  --doc-bg: #e9ecf2;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 2px 8px rgb(0 0 0 / .06);
  --c-pdf: #e5393a;
  --c-word: #2b6ceb;
  --c-excel: #1e9e57;
  --c-ppt: #f0642a;
  --c-book: #8e5a2e;
  --c-text: #7e57c2;
  --c-img: #0f9aa8;
  --c-other: #6b7280;
  --top: 0px;
  --bottom: 0px;
  color-scheme: light;
}
:root.dark {
  --bg: #14161b;
  --surface: #1d2027;
  --surface2: #262a33;
  --text: #e8eaef;
  --muted: #9aa1ad;
  --line: #2d313b;
  --accent: #5b9bff;
  --accent-soft: #1f2d48;
  --doc-bg: #0f1115;
  --shadow: 0 1px 2px rgb(0 0 0 / .4);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Roboto", sans-serif;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
.hidden { display: none !important; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
}
.icon-btn:active { background: var(--surface2); }

/* ---------- início ---------- */
.topbar {
  padding: calc(var(--top) + 6px) 8px 0 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.greeting { font-size: 28px; margin: 6px 0 0; font-weight: 700; letter-spacing: -.4px; }
.logo { width: 32px; height: 32px; border-radius: 9px; background: url(logo.png) center/cover; }
.brand h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.2px; }

.searchrow {
  margin: 8px 12px 0; display: flex; align-items: center;
  background: var(--surface); border-radius: 24px; padding-left: 16px; box-shadow: var(--shadow);
}
.searchrow input { flex: 1; border: 0; background: none; outline: none; height: 44px; min-width: 0; }

.tabs { display: flex; gap: 4px; margin: 10px 12px 0; background: var(--surface2); border-radius: 12px; padding: 4px; }
.tab { flex: 1; height: 36px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 12px 4px; scrollbar-width: none; flex: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 17px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: 14px;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.list { flex: 1; overflow-y: auto; padding: 4px 0 calc(var(--bottom) + 96px); }
.group-title { padding: 14px 16px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 8px 10px 16px; min-height: 64px;
}
.item:active { background: var(--surface2); }
.ficon {
  width: 40px; height: 48px; border-radius: 6px; flex: none; position: relative;
  display: grid; place-items: end center; padding-bottom: 6px;
  color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .3px;
  background: var(--c-other);
}
.ficon::before {
  content: ""; position: absolute; top: 0; right: 0; width: 12px; height: 12px;
  background: linear-gradient(225deg, var(--bg) 50%, rgb(255 255 255 / .45) 50%);
  border-bottom-left-radius: 4px;
}
.ficon.pdf { background: var(--c-pdf); }
.ficon.word { background: var(--c-word); }
.ficon.excel { background: var(--c-excel); }
.ficon.ppt { background: var(--c-ppt); }
.ficon.book { background: var(--c-book); }
.ficon.text { background: var(--c-text); }
.ficon.img { background: var(--c-img); }
.ficon.media { background: #d6336c; }
.ficon.zip { background: #c08a12; }
.ficon.font { background: #455a64; }
.ficon .glyph { position: absolute; top: 12px; left: 0; right: 0; text-align: center; font-size: 15px; font-weight: 800; }
.meta { flex: 1; min-width: 0; }
.meta .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.item .x { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; }
.item .x svg { width: 20px; height: 20px; }

.empty { text-align: center; color: var(--muted); padding: 48px 32px; }
.empty .big { width: 88px; height: 88px; margin: 0 auto 16px; border-radius: 24px; background: url(logo.png) center/cover; opacity: .9; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0 0 18px; }
.btn {
  height: 44px; padding: 0 22px; border-radius: 22px; font-weight: 600;
  background: var(--accent); color: #fff;
}
.btn.ghost { background: var(--accent-soft); color: var(--accent); }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--bottom) + 18px);
  height: 56px; padding: 0 22px 0 18px; border-radius: 18px;
  background: var(--accent); color: #fff; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 6px 18px rgb(26 108 245 / .35);
}
.fab:active { transform: scale(.97); }

/* ---------- visualizador ---------- */
.vbar {
  padding: var(--top) 4px 0 4px; height: calc(var(--top) + 56px);
  display: flex; align-items: center; gap: 2px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  flex: none; z-index: 5; transition: transform .2s;
}
.vbar.away { transform: translateY(-100%); }
.vtype { font-size: 10px; font-weight: 800; color: #fff; padding: 3px 6px; border-radius: 4px; background: var(--c-other); flex: none; }
.vtype.pdf { background: var(--c-pdf); } .vtype.word { background: var(--c-word); }
.vtype.excel { background: var(--c-excel); } .vtype.ppt { background: var(--c-ppt); }
.vtype.book { background: var(--c-book); } .vtype.media { background: #d6336c; } .vtype.zip { background: #c08a12; } .vtype.font { background: #455a64; } .vtype.text { background: var(--c-text); } .vtype.img { background: var(--c-img); }
.vtitle { flex: 1; min-width: 0; margin-left: 8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.findbar {
  display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px 14px;
  background: var(--surface); border-bottom: 1px solid var(--line); flex: none; z-index: 4;
}
.findbar input { flex: 1; min-width: 0; height: 40px; border: 0; outline: none; background: none; }
#findCount { font-size: 13px; color: var(--muted); padding: 0 4px; white-space: nowrap; }

#vbody { flex: 1; position: relative; overflow: hidden; background: var(--doc-bg); }
.scroller { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.zoomable { transform-origin: 0 0; }

.page-ind {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bottom) + 16px); z-index: 6;
  background: rgb(20 22 27 / .78); color: #fff; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 16px; transition: opacity .3s;
}
.page-ind.faded { opacity: 0; pointer-events: none; }

.bottombar {
  flex: none; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 4px 6px calc(var(--bottom) + 4px);
}
.bottombar::-webkit-scrollbar { display: none; }
.bottombar button {
  flex: none; height: 38px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted);
  white-space: nowrap;
}
.bottombar button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.bottombar .grow { flex: 1; }

.loading {
  position: absolute; inset: 0; z-index: 8; background: var(--doc-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted);
}
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3.5px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box { padding: 48px 28px; text-align: center; color: var(--muted); }
.error-box h3 { color: var(--text); }

/* PDF */
.pdf-pages { padding: 10px 0 calc(var(--bottom) + 64px); display: flex; flex-direction: column; align-items: center; gap: 10px; width: max-content; min-width: 100%; }
.pdf-page { position: relative; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .18); flex: none; }
.pdf-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.night .pdf-page canvas, .night .page-like img, .night .docx-wrap section.docx { filter: invert(.92) hue-rotate(180deg); }
.night .pdf-page { background: #1a1a1a; }
.pdf-page .textLayer { position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1; text-size-adjust: none; transform-origin: 0 0; z-index: 2; }
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer span.markedContent { top: 0; height: 0; }
.textLayer ::selection { background: rgb(26 108 245 / .3); }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; user-select: none; }

/* destaque de busca (CSS Custom Highlight API) */
::highlight(find) { background-color: rgb(255 200 0 / .55); color: inherit; }
::highlight(find-cur) { background-color: rgb(255 120 0 / .75); color: inherit; }
.textLayer ::highlight(find), .textLayer ::highlight(find-cur) { color: transparent; }

/* Documentos fluidos (docx, odt, doc, rtf) */
.docx-wrap { padding: 10px 0 calc(var(--bottom) + 40px); }
.docx-wrap .docx-wrapper { background: transparent !important; padding: 0 !important; align-items: center; }
.docx-wrap .docx-wrapper > section.docx { box-shadow: 0 1px 4px rgb(0 0 0 / .18); margin: 0 auto 10px !important; }
.paper {
  background: #fff; color: #111; max-width: 820px; margin: 10px auto calc(var(--bottom) + 40px);
  padding: 28px 22px; box-shadow: 0 1px 4px rgb(0 0 0 / .18);
  font: 16px/1.55 "Calibri", "Carlito", system-ui, sans-serif; overflow-wrap: anywhere;
}
.paper table { border-collapse: collapse; margin: 10px 0; max-width: 100%; }
.paper td, .paper th { border: 1px solid #c8ccd4; padding: 4px 8px; vertical-align: top; }
.paper img { max-width: 100%; height: auto; }
.paper p { margin: 0 0 .55em; }
.paper hr.pb { border: 0; border-top: 1px dashed #c8ccd4; margin: 20px 0; }
.paper .err { color: #c22; }
:root.dark .paper.reflow { background: #1d2027; color: #e2e5ea; }
:root.dark .paper.reflow td { border-color: #3a3f4a; }

/* Planilhas */
.sheet-wrap { padding: 0 0 calc(var(--bottom) + 20px); width: max-content; min-width: 100%; }
.sheet-wrap table { border-collapse: collapse; background: #fff; color: #111; font: 13px/1.3 system-ui, sans-serif; }
.sheet-wrap td, .sheet-wrap th { border: 1px solid #d6dae1; padding: 3px 6px; white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; height: 24px; }
.sheet-wrap th { background: #eef1f5; color: #555; font-weight: 500; position: sticky; top: 0; z-index: 1; text-align: center; min-width: 40px; }
.sheet-wrap th.rh { position: sticky; left: 0; z-index: 2; min-width: 38px; }
.sheet-wrap thead th.rh { z-index: 3; }
.sheet-wrap td.num { text-align: right; }
.sheet-more { padding: 14px; color: var(--muted); font-size: 13px; }

/* Apresentações */
.slides { padding: 12px 0 calc(var(--bottom) + 60px); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.slide-box { position: relative; overflow: hidden; box-shadow: 0 1px 6px rgb(0 0 0 / .22); flex: none; background: #fff; }
.slide { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; background: #fff; color: #000; font-family: "Calibri", "Carlito", system-ui, sans-serif; }
.slide .shp { position: absolute; display: flex; flex-direction: column; overflow: visible; }
.slide .shp .txt { width: 100%; overflow-wrap: break-word; }
.slide .shp p { margin: 0; line-height: 1.15; white-space: pre-wrap; }
.slide .shp img { width: 100%; height: 100%; object-fit: fill; display: block; }
.slide .shp table { border-collapse: collapse; width: 100%; height: 100%; }
.slide .shp td { border: 1px solid #9aa; padding: 4px 6px; vertical-align: top; }
.slide-num { font-size: 12px; color: var(--muted); margin-bottom: -8px; }
.slides.present { gap: 0; padding: 0; background: #000; min-height: 100%; justify-content: center; }
.legacy-ppt .slide-text { border-bottom: 1px solid #dde; padding: 10px 0 14px; }
.legacy-ppt .num { font-size: 12px; color: #888; font-weight: 600; }

/* Livros (epub) e texto */
.book-text {
  max-width: 720px; margin: 0 auto; padding: 22px 20px calc(var(--bottom) + 80px);
  font: var(--book-size, 18px)/1.65 Georgia, "Noto Serif", serif; overflow-wrap: break-word;
}
.book-text img, .book-text svg { max-width: 100%; height: auto; }
.book-text a { color: var(--accent); }
.book-text.sepia { background: #f6efdf; color: #3b3125; }
.book-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; }
.text-view {
  margin: 0; padding: 14px 14px calc(var(--bottom) + 60px);
  font: 13.5px/1.55 ui-monospace, "Roboto Mono", "Droid Sans Mono", monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); background: var(--surface); min-height: 100%;
}
.md { max-width: 760px; margin: 0 auto; padding: 18px 18px calc(var(--bottom) + 60px); background: var(--surface); min-height: 100%; }
.md pre { background: var(--surface2); padding: 10px; border-radius: 8px; overflow-x: auto; }
.md code { background: var(--surface2); padding: 1px 4px; border-radius: 4px; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--line); margin: 0; padding-left: 12px; color: var(--muted); }
.md table { border-collapse: collapse; } .md td, .md th { border: 1px solid var(--line); padding: 4px 8px; }
.md a { color: var(--accent); }

/* Imagens */
.img-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; background: #000; }
.img-stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }

iframe.html-frame { border: 0; width: 100%; height: 100%; background: #fff; display: block; }

/* ---------- folha (menu) ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgb(0 0 0 / .4); animation: fade .15s; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 80%; overflow-y: auto;
  background: var(--surface); border-radius: 18px 18px 0 0;
  padding: 8px 0 calc(var(--bottom) + 10px); animation: up .18s ease-out;
}
.sheet-panel h4 { margin: 10px 20px 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.sheet-panel .handle { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 8px; }
.mi { display: flex; align-items: center; gap: 16px; width: 100%; padding: 13px 20px; text-align: left; font-size: 15.5px; }
.mi:active { background: var(--surface2); }
.mi svg { color: var(--muted); }
.mi .ti svg { color: #fff; }
.mi .r { margin-left: auto; color: var(--muted); font-size: 13px; }
.sheet-panel .field { display: flex; gap: 8px; padding: 6px 20px 14px; }
.sheet-panel .field input { flex: 1; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 0 12px; outline: none; min-width: 0; }
.toc .mi { padding: 11px 20px; font-size: 15px; }
.toc .mi.cur { color: var(--accent); font-weight: 600; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom) + 90px); transform: translate(-50%, 20px);
  background: #23262d; color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 30; max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- ferramentas ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 8px 12px 4px; }
.tool-card {
  background: var(--surface); border-radius: 16px; padding: 14px; text-align: left; min-height: 104px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow);
}
.tool-card:active { transform: scale(.98); }
.tool-card .ti { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.tool-card .ti svg { width: 22px; height: 22px; }
.tool-card b { font-size: 14.5px; }
.tool-card small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.tools-sec { padding: 14px 16px 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.credit { padding: 6px 16px 0; font-size: 12px; color: var(--muted); }
.credit a { color: var(--accent); }

.tool-body { flex: 1; overflow-y: auto; padding: 14px 14px calc(var(--bottom) + 30px); }
.card { background: var(--surface); border-radius: 16px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.desc { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.pick { width: 100%; border: 2px dashed var(--line); border-radius: 16px; padding: 26px 12px; color: var(--muted); font-weight: 600; background: var(--surface); }
.flist .fi { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.flist .fi:last-child { border-bottom: 0; }
.flist .fi .meta { flex: 1; min-width: 0; }
.flist .fi .mini { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.flist .fi .mini svg { width: 20px; height: 20px; }
.flist .fi img.th { width: 40px; height: 48px; object-fit: cover; border-radius: 4px; background: #fff; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row + .row { margin-top: 10px; }
.seg { display: flex; background: var(--surface2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.inp { width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 0 12px; outline: none; }
label.lb { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=color] { width: 48px; height: 36px; border: 0; background: none; padding: 0; }
.chk { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.chk input { width: 20px; height: 20px; accent-color: var(--accent); }
.run { width: 100%; height: 52px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; margin-top: 4px; }
.run:disabled { opacity: .5; }
.progress { height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.result { text-align: center; }
.result .ok { width: 60px; height: 60px; border-radius: 50%; background: #1e9e57; color: #fff; display: grid; place-items: center; margin: 6px auto 10px; }
.result .ok svg { width: 32px; height: 32px; }
.result .actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.result .actions button { height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.thumb { position: relative; background: var(--surface2); border-radius: 8px; padding: 6px; text-align: center; font-size: 12px; color: var(--muted); }
.thumb canvas { width: 100%; height: auto; background: #fff; display: block; border-radius: 3px; box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
.thumb.sel { outline: 3px solid var(--accent); }
.thumb .tb { display: flex; justify-content: space-between; margin-top: 4px; }
.thumb .tb button { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); }
.thumb .tb button svg { width: 16px; height: 16px; }
.thumb .rot { transition: transform .2s; }
.sig-pad { width: 100%; height: 200px; background: #fff; border-radius: 12px; border: 1px solid var(--line); touch-action: none; display: block; }
.sig-list { display: flex; gap: 8px; overflow-x: auto; }
.sig-list .sg { flex: none; background: #fff; border-radius: 8px; border: 2px solid var(--line); padding: 4px; position: relative; }
.sig-list .sg.on { border-color: var(--accent); }
.sig-list .sg img { height: 48px; display: block; }
.place { position: relative; touch-action: none; background: #fff; margin: 0 auto; box-shadow: 0 1px 4px rgb(0 0 0 / .2); }
.place canvas { width: 100%; display: block; }
.place .sigbox { position: absolute; border: 1.5px dashed var(--accent); }
.place .sigbox img { width: 100%; height: 100%; display: block; }
.text-out { white-space: pre-wrap; font: 13px/1.5 ui-monospace, monospace; max-height: 50vh; overflow: auto; background: var(--surface2); padding: 10px; border-radius: 10px; text-align: left; }

/* ---------- editores ---------- */
.ed-bar { position: sticky; top: -14px; z-index: 2; display: flex; gap: 4px; overflow-x: auto; background: var(--surface); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); margin-bottom: 10px; scrollbar-width: none; }
.ed-bar button { flex: none; min-width: 38px; height: 38px; border-radius: 8px; font-size: 15px; font-weight: 600; }
.ed-bar button:active { background: var(--surface2); }
.ed-page { background: #fff; color: #111; min-height: 60vh; padding: 28px 22px; border-radius: 6px; box-shadow: 0 1px 4px rgb(0 0 0 / .18); outline: none; font: 16px/1.55 Calibri, Carlito, system-ui, sans-serif; margin-bottom: 12px; overflow-wrap: anywhere; }
.ed-page h1 { font-size: 26px; margin: .4em 0; } .ed-page h2 { font-size: 20px; margin: .4em 0; } .ed-page p { margin: 0 0 .5em; }
.ed-text { width: 100%; min-height: 65vh; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); padding: 14px; font: 15px/1.55 ui-monospace, "Roboto Mono", monospace; outline: none; resize: vertical; }
.sheet-ed { overflow: auto; max-height: 62vh; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.sheet-ed table { border-collapse: collapse; color: #111; font: 14px system-ui, sans-serif; }
.sheet-ed th { position: sticky; top: 0; background: #eef1f5; color: #555; font-weight: 500; min-width: 36px; padding: 4px; border: 1px solid #d6dae1; z-index: 1; }
.sheet-ed tbody th { position: sticky; left: 0; }
.sheet-ed td { border: 1px solid #d6dae1; min-width: 84px; height: 30px; padding: 2px 6px; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.sheet-ed td.num { text-align: right; }
.sheet-ed td.cur { outline: 2px solid var(--accent); outline-offset: -2px; background: #eaf1ff; }
