/* Xara PDF — tema claro (padrao) e escuro */
@font-face { font-family: 'X Sans'; src: url(/fonts/LiberationSans-Regular.ttf); }
@font-face { font-family: 'X Sans'; src: url(/fonts/LiberationSans-Bold.ttf); font-weight: 700; }
@font-face { font-family: 'X Sans'; src: url(/fonts/LiberationSans-Italic.ttf); font-style: italic; }
@font-face { font-family: 'X Sans'; src: url(/fonts/LiberationSans-BoldItalic.ttf); font-weight: 700; font-style: italic; }
@font-face { font-family: 'X Serif'; src: url(/fonts/LiberationSerif-Regular.ttf); }
@font-face { font-family: 'X Serif'; src: url(/fonts/LiberationSerif-Bold.ttf); font-weight: 700; }
@font-face { font-family: 'X Serif'; src: url(/fonts/LiberationSerif-Italic.ttf); font-style: italic; }
@font-face { font-family: 'X Serif'; src: url(/fonts/LiberationSerif-BoldItalic.ttf); font-weight: 700; font-style: italic; }
@font-face { font-family: 'X Mono'; src: url(/fonts/LiberationMono-Regular.ttf); }
@font-face { font-family: 'X Mono'; src: url(/fonts/LiberationMono-Bold.ttf); font-weight: 700; }
@font-face { font-family: 'X Mono'; src: url(/fonts/LiberationMono-Italic.ttf); font-style: italic; }
@font-face { font-family: 'X Narrow'; src: url(/fonts/LiberationSansNarrow-Regular.ttf); }
@font-face { font-family: 'X Narrow'; src: url(/fonts/LiberationSansNarrow-Bold.ttf); font-weight: 700; }
@font-face { font-family: 'X Calibri'; src: url(/fonts/Carlito-Regular.ttf); }
@font-face { font-family: 'X Calibri'; src: url(/fonts/Carlito-Bold.ttf); font-weight: 700; }
@font-face { font-family: 'X Calibri'; src: url(/fonts/Carlito-Italic.ttf); font-style: italic; }
@font-face { font-family: 'X Cambria'; src: url(/fonts/Caladea-Regular.ttf); }
@font-face { font-family: 'X Cambria'; src: url(/fonts/Caladea-Bold.ttf); font-weight: 700; }
@font-face { font-family: 'X Cambria'; src: url(/fonts/Caladea-Italic.ttf); font-style: italic; }

:root {
  --bg: #f3f4f7;
  --bg-2: #e9ebf0;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --line: #e3e6ec;
  --line-2: #d3d8e1;
  --text: #0e1525;
  --text-2: #4a5468;
  --text-3: #8a93a6;
  --navy: #0d1730;
  --gold: #d9a21b;
  --gold-2: #f2c14e;
  --gold-soft: #fbf1d6;
  --sel: #2f6bff;
  --sel-soft: rgba(47, 107, 255, .10);
  --ok: #14a46c;
  --bad: #e5484d;
  --warn: #e8a317;
  --shadow-1: 0 1px 2px rgba(14, 21, 37, .06), 0 1px 1px rgba(14, 21, 37, .04);
  --shadow-2: 0 8px 28px rgba(14, 21, 37, .10), 0 2px 6px rgba(14, 21, 37, .06);
  --shadow-3: 0 24px 60px rgba(14, 21, 37, .18);
  --r: 14px;
  --r-lg: 22px;
  --top: 60px;
  --bottom: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0f1c;
  --bg-2: #0e1424;
  --surface: #121a2c;
  --surface-2: #172036;
  --line: #222c44;
  --line-2: #2d3954;
  --text: #eef1f8;
  --text-2: #aab3c7;
  --text-3: #6f7a92;
  --gold-soft: rgba(217, 162, 27, .14);
  --sel-soft: rgba(47, 107, 255, .18);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

/* ---------- botoes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: transform .12s, background .15s, box-shadow .15s, opacity .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-1); }
[data-theme="dark"] .btn-primary { background: var(--gold); color: #1b1404; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1b1404; box-shadow: 0 6px 18px rgba(217, 162, 27, .35); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad); color: #fff; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; display: inline-grid; place-items: center;
  color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { background: var(--gold-soft); color: var(--gold); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 17px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--navy); display: grid; place-items: center; box-shadow: var(--shadow-1); }
[data-theme="dark"] .brand-mark { background: #1a2440; }
.brand small { font-weight: 600; color: var(--gold); font-size: 17px; }
.spacer { flex: 1; }

/* ---------- home ---------- */
.home { max-width: 1120px; margin: 0 auto; padding: 28px 18px calc(60px + var(--safe-b)); }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; align-items: center; padding: 26px 0 30px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.eyebrow::before { content: ""; width: 22px; height: 3px; border-radius: 3px; background: var(--gold); }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.04; letter-spacing: -.035em; margin: 14px 0 14px; font-weight: 800; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--gold), #b9790a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 17px; color: var(--text-2); margin: 0 0 24px; max-width: 520px; }
.hero-art { position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 4/3.4; box-shadow: var(--shadow-3); background: var(--navy); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-art .float {
  position: absolute; left: 18px; bottom: 18px; right: 18px; padding: 14px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .92); color: #0e1525; backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-2); font-size: 13.5px;
}
.hero-art .float b { display: block; font-size: 14px; }
.float .strike { text-decoration: line-through; color: #9aa3b5; }
.float .new { color: #0e1525; font-weight: 700; background: #fbf1d6; padding: 0 6px; border-radius: 6px; }
.float .dot { width: 38px; height: 38px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; flex: none; }

.drop {
  position: relative; display: flex; align-items: center; gap: 18px; padding: 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1.5px dashed var(--line-2); cursor: pointer; transition: .2s; box-shadow: var(--shadow-1);
}
.drop:hover, .drop.over { border-color: var(--gold); background: color-mix(in srgb, var(--gold-soft) 55%, var(--surface)); }
.drop.over { transform: scale(1.01); }
.drop .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--navy); color: var(--gold-2); display: grid; place-items: center; flex: none; }
.drop .ico svg.i { width: 26px; height: 26px; }
.drop b { display: block; font-size: 16.5px; }
.drop > div span { color: var(--text-3); font-size: 13.5px; }
.drop .btn { margin-left: auto; }
.drop input { display: none; }
.drop .progress { position: absolute; left: 22px; right: 22px; bottom: 10px; height: 4px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.drop .progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width .2s; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); font-weight: 500; }
.chip svg.i { width: 16px; height: 16px; color: var(--ok); }

.section-h { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 14px; }
.section-h h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.recents { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.doc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-1); cursor: pointer; transition: transform .15s, box-shadow .15s; position: relative; }
.doc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.doc-card .thumb { aspect-ratio: 16/10; background: var(--bg-2) center top / cover no-repeat; border-bottom: 1px solid var(--line); }
.doc-card .meta { padding: 12px 14px; }
.doc-card .meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-card .meta span { font-size: 12.5px; color: var(--text-3); }
.doc-card .del { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, .9); color: #4a5468; width: 32px; height: 32px; border-radius: 10px; }
.doc-card .badge { position: absolute; top: 8px; left: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--gold-soft); color: #8a6105; }
[data-theme="dark"] .badge { color: var(--gold-2); }
.empty { text-align: center; padding: 34px 18px; color: var(--text-3); border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface); }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.how .step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-1); }
.how .n { width: 30px; height: 30px; border-radius: 9px; background: var(--navy); color: var(--gold-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; margin-bottom: 10px; }
[data-theme="dark"] .how .n { background: #1a2440; }
.how b { display: block; margin-bottom: 4px; }
.how p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.foot { text-align: center; color: var(--text-3); font-size: 12.5px; margin-top: 38px; }

/* ---------- editor ---------- */
.editor { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.editor .topbar { flex: none; }
.doc-title { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.doc-title b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.doc-title span { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.doc-title span .live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.doc-title span .live.busy { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.tb-group { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.zoom-val { min-width: 48px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg { display: flex; gap: 2px; }
.seg button { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg button svg.i { width: 17px; height: 17px; }

.workspace { flex: 1; display: flex; min-height: 0; }
.thumbs { width: 168px; flex: none; overflow: auto; border-right: 1px solid var(--line); background: var(--surface); padding: 14px 18px; }
.thumb-item { display: block; width: 100%; margin-bottom: 14px; text-align: center; font-size: 12px; color: var(--text-3); font-weight: 600; }
.thumb-item .tp { position: relative; width: 100%; background: #fff center / cover no-repeat; border-radius: 6px; border: 1px solid var(--line-2); margin-bottom: 6px; box-shadow: var(--shadow-1); transition: .15s; }
.thumb-item.on .tp { outline: 2.5px solid var(--gold); outline-offset: 2px; }
.thumb-item.on { color: var(--text); }
.thumb-item .tp .badge { position: absolute; top: 4px; right: 4px; padding: 1px 6px; font-size: 10.5px; }

.viewport { flex: 1; overflow: auto; position: relative; overscroll-behavior: contain; padding: 24px 16px calc(120px + var(--safe-b)); background: var(--bg); }
.notice { max-width: 760px; margin: 0 auto 16px; display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 14px; background: var(--gold-soft); color: var(--text); font-size: 13.5px; border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.notice svg.i { color: var(--gold); margin-top: 1px; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 22px; width: max-content; min-width: 100%; margin: 0 auto; }
.page {
  position: relative; background: #fff; box-shadow: 0 2px 4px rgba(14, 21, 37, .08), 0 12px 32px rgba(14, 21, 37, .10);
  border-radius: 3px; flex: none; user-select: none; -webkit-user-select: none;
}
.page > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; transition: opacity .25s; }
.page > img.fade { opacity: 0; }
.page .shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, #f3f4f7 30%, #fafbfc 50%, #f3f4f7 70%); background-size: 300% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -150% 0; } }
.page .pno { position: absolute; top: -20px; left: 0; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.layer { position: absolute; inset: 0; }
.mode-add .layer { cursor: crosshair; }

/* caixas de texto sobre a pagina */
.tb {
  position: absolute; white-space: pre; border-radius: 2px; color: transparent; cursor: text;
  outline: 1px solid transparent; outline-offset: 1px; transition: outline-color .12s, background .12s;
  line-height: 1; font-kerning: normal;
}
.mode-edit .tb:not(.editing):hover { outline-color: color-mix(in srgb, var(--sel) 70%, transparent); background: var(--sel-soft); }
.show-boxes .tb:not(.editing) { outline: 1px dashed color-mix(in srgb, var(--sel) 45%, transparent); }
.tb.locked { cursor: not-allowed; }
.tb.edited { outline: 1px solid transparent; }
.mode-edit .tb.edited:not(.editing):hover, .show-boxes .tb.edited:not(.editing) { outline: 1px dashed color-mix(in srgb, var(--gold) 90%, transparent); background: transparent; }
.tb.preview, .tb.editing { color: var(--c); background: var(--bgc, #fff); }
.tb.editing {
  outline: 2px solid var(--sel); outline-offset: 2px; cursor: text; z-index: 5; min-width: 6px;
  user-select: text; -webkit-user-select: text; caret-color: var(--sel);
  box-shadow: 0 0 0 6px var(--sel-soft);
}
.tb.deleted:not(.editing):not(.preview) { color: transparent; background: transparent; }
.tb.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 40% { background: rgba(242, 193, 78, .55); outline: 2px solid var(--gold); } }
.layer > .grip {
  position: absolute; z-index: 6; width: 24px; height: 24px; border-radius: 8px;
  background: var(--sel); color: #fff; display: grid; place-items: center; cursor: grab; touch-action: none; box-shadow: var(--shadow-2);
}
.layer > .grip svg.i { width: 14px; height: 14px; }

/* barra de formatacao flutuante */
.fmt {
  position: fixed; z-index: 40; display: flex; align-items: center; gap: 4px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-3);
  animation: pop .16s ease-out;
}
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }
.fmt .sep { width: 1px; height: 26px; background: var(--line); margin: 0 3px; }
.fmt select { height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 8px; font-size: 13px; font-weight: 600; max-width: 190px; }
.fmt .size { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); height: 36px; }
.fmt .size button { width: 30px; height: 100%; display: grid; place-items: center; color: var(--text-2); }
.fmt .size input { width: 44px; text-align: center; border: 0; background: transparent; font-weight: 700; font-size: 13px; outline: none; }
.fmt .icon-btn { width: 36px; height: 36px; }
.fmt .icon-btn svg.i { width: 18px; height: 18px; }
.fmt .swatch { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; position: relative; }
.fmt .swatch i { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.fmt .swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fmt .done { background: var(--sel); color: #fff; }
.fmt .done:hover { background: var(--sel); color: #fff; filter: brightness(1.1); }
.fmt .danger:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }

/* paineis */
.panel {
  position: fixed; z-index: 45; right: 16px; top: calc(var(--top) + 12px); width: 360px; max-height: calc(100dvh - var(--top) - 40px);
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-3);
  animation: pop .16s ease-out;
}
.panel header { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 18px; }
.panel header b { flex: 1; font-size: 15px; }
.panel .body { padding: 0 18px 16px; overflow: auto; }
.field { position: relative; margin-bottom: 10px; }
.field input[type=text], .field input[type=password], .input {
  width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); padding: 0 14px; font-size: 14.5px; outline: none; transition: .15s;
}
.field input:focus, .input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); background: var(--surface); }
.field .eye { position: absolute; right: 4px; top: 2px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); margin: 4px 0 12px; }
.check input { width: 17px; height: 17px; accent-color: var(--gold); }
.results { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.results .count { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-bottom: 2px; }
.result { text-align: left; padding: 10px 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.result:hover { border-color: var(--gold); }
.result small { display: block; color: var(--text-3); font-weight: 600; font-size: 11.5px; margin-bottom: 2px; }
.result mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -2px 0 var(--gold); }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }

/* menu inferior (mobile) */
.bottombar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 6px 8px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); justify-content: space-around;
}
.bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 12px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.bottombar button.on { color: var(--text); }
.bottombar button.on svg.i { color: var(--gold); }
.bottombar button svg.i { width: 24px; height: 24px; margin: 3px 0; }
.bottombar button.primary svg.i { margin: 0; background: var(--navy); color: var(--gold-2); width: 40px; height: 30px; padding: 5px 10px; border-radius: 11px; }
[data-theme="dark"] .bottombar button.primary svg.i { background: var(--gold); color: #1b1404; }

/* sheet / modal */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(8, 12, 22, .5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 420px; background: var(--surface); border-radius: 22px; padding: 24px; box-shadow: var(--shadow-3); animation: pop .18s ease-out; }
.modal h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; }
.modal p { margin: 0 0 18px; color: var(--text-2); font-size: 14px; }
.modal .mi { width: 48px; height: 48px; border-radius: 15px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; margin-bottom: 14px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-height: 60dvh; overflow: auto; padding: 4px; }

/* toast */
.toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--bottom) + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-3); animation: pop .2s ease-out; max-width: 92vw; }
[data-theme="dark"] .toast { background: #1d2842; }
.toast svg.i { width: 18px; height: 18px; }
.toast.ok svg.i { color: #4ade80; }
.toast.err svg.i { color: #ff7b7f; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .25); border-top-color: currentColor; animation: rot .7s linear infinite; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, rgba(217, 162, 27, .18), transparent 60%), var(--bg); }
.login .card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 30px; box-shadow: var(--shadow-3); }
.login h2 { margin: 18px 0 4px; letter-spacing: -.02em; }
.login p { margin: 0 0 20px; color: var(--text-2); font-size: 14px; }

@media (max-width: 1023px) {
  .thumbs { display: none; }
  .hide-md { display: none !important; }
}
@media (max-width: 760px) {
  :root { --top: 56px; --bottom: 64px; }
  .hero { grid-template-columns: 1fr; gap: 22px; padding-top: 6px; }
  .hero-art { order: -1; aspect-ratio: 16/10; border-radius: 22px; }
  .drop { flex-wrap: wrap; padding: 18px; }
  .drop .btn { width: 100%; margin: 0; }
  .how { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .bottombar { display: flex; }
  .viewport { padding: 20px 10px calc(150px + var(--safe-b)); }
  .doc-title b { max-width: 46vw; }
  .fmt select { max-width: 150px; }
  .fmt { left: 8px !important; right: 8px; bottom: calc(var(--bottom) + var(--safe-b) + 8px) !important; top: auto !important; overflow-x: auto; scrollbar-width: none; }
  .fmt::-webkit-scrollbar { display: none; }
  .panel { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(var(--bottom) + var(--safe-b) + 8px); max-height: 70dvh; }
}
