/* NW PDF Web — NW Design System (tokens copied from designsystem/NwColors.kt and NwTheme.kt of the Android app). */
:root, [data-theme="NW_LIGHT"] {
  --bg: #FFFFFF; --surface: #FFFFFF; --raised: #F4F5F6; --border: #E3E5E8; --title: #18334C; --text: #1F2933;
  --muted: #4A5058; --gold: #A9741C; --logo-tile: #18334C; --logo-text: #FFFFFF; --logo-accent: #D5AD62;
  --primary: #18334C; --on-primary: #FFFFFF; --danger: #B3261E; --backdrop: #F0F1F2; --success: #1E7A46;
  --warning: #8A5A00; --selection: rgba(24, 51, 76, .12); --scrim: rgba(0, 0, 0, .6);
  color-scheme: light;
}
/* Shape and spacing tokens (NwCorners, NwDensity): SOFT and NORMAL are the original NW style. */
:root {
  --r-card: 12px; --r-small: 8px; --r-sheet: 16px; --dens: 1; --gap: calc(8px * var(--dens)); --section: calc(18px * var(--dens));
  --pad: calc(20px * var(--dens)); --on-gold: #FFFFFF; --r-dialog: 20px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-theme="MINIMAL_LIGHT"] { --bg:#F2F2F2; --surface:#FFFFFF; --raised:#EBEBEB; --border:#DCDCDC; --title:#292929; --text:#292929; --muted:#5C5C5C; --gold:#333333; --logo-tile:#292929; --logo-text:#FFFFFF; --logo-accent:#BDBDBD; --primary:#333333; --on-primary:#FFFFFF; --backdrop:#E6E6E6; --selection:rgba(51,51,51,.12); }
[data-theme="CHARCOAL"] { --bg:#242424; --surface:#343434; --raised:#3E3E3E; --border:#4A4A4A; --title:#F5F5F5; --text:#F5F5F5; --muted:#BDBDBD; --gold:#E8E8E8; --logo-tile:#343434; --logo-text:#F5F5F5; --logo-accent:#BDBDBD; --primary:#E8E8E8; --on-primary:#242424; --danger:#FFB4AB; --backdrop:#1B1B1B; --success:#8FD8A8; --warning:#F2C46B; --selection:rgba(232,232,232,.2); color-scheme: dark; }
[data-theme="GRAPHITE"] { --bg:#121417; --surface:#1B1F24; --raised:#252A31; --border:#2F353D; --title:#F3F4F6; --text:#F3F4F6; --muted:#AEB4BD; --gold:#D5AD62; --logo-tile:#1B1F24; --logo-text:#F3F4F6; --logo-accent:#D5AD62; --primary:#D5AD62; --on-primary:#121417; --danger:#FFB4AB; --backdrop:#0C0E10; --success:#7FD6A2; --warning:#F2C46B; --selection:rgba(213,173,98,.2); color-scheme: dark; }
[data-theme="AMOLED"] { --bg:#000000; --surface:#111111; --raised:#1A1A1A; --border:#262626; --title:#FFFFFF; --text:#FFFFFF; --muted:#B3B3B3; --gold:#FFFFFF; --logo-tile:#111111; --logo-text:#FFFFFF; --logo-accent:#B3B3B3; --primary:#FFFFFF; --on-primary:#000000; --danger:#FFB4AB; --backdrop:#000000; --success:#7FD6A2; --warning:#F2C46B; --selection:rgba(255,255,255,.2); color-scheme: dark; }
[data-theme="NW_MIDNIGHT"] { --bg:#0B142E; --surface:#131D3D; --raised:#1F2B4D; --border:rgba(255,255,255,.1); --title:#F7F6F3; --text:#F7F6F3; --muted:#C6C3BC; --gold:#E2B458; --logo-tile:#131D3D; --logo-text:#F7F6F3; --logo-accent:#E2B458; --primary:#E2B458; --on-primary:#15151B; --danger:#FFB4AB; --backdrop:#070E22; --success:#7FD6A2; --warning:#F2C46B; --selection:rgba(226,180,88,.2); color-scheme: dark; }
[data-theme="NW_PETROLEUM"] { --bg:#18334C; --surface:#203E58; --raised:#284A66; --border:#3B5369; --title:#FFFFFF; --text:#E9EEF2; --muted:#B4C1CC; --gold:#D5AD62; --logo-tile:#203E58; --logo-text:#FFFFFF; --logo-accent:#D5AD62; --primary:#D5AD62; --on-primary:#18334C; --danger:#FFB4AB; --backdrop:#122838; --success:#7FD6A2; --warning:#F2C46B; --selection:rgba(213,173,98,.2); color-scheme: dark; }
[data-theme="NORD"] { --bg:#2E3440; --surface:#3B4252; --raised:#434C5E; --border:#4C566A; --title:#ECEFF4; --text:#ECEFF4; --muted:#C9D0DC; --gold:#88C0D0; --logo-tile:#3B4252; --logo-text:#ECEFF4; --logo-accent:#88C0D0; --primary:#88C0D0; --on-primary:#2E3440; --danger:#FFB4AB; --backdrop:#242933; --success:#A3BE8C; --warning:#EBCB8B; --selection:rgba(136,192,208,.2); color-scheme: dark; }
[data-theme="FOREST"] { --bg:#10251E; --surface:#1D372E; --raised:#26443A; --border:#32524A; --title:#ECF4EF; --text:#ECF4EF; --muted:#B5C9BE; --gold:#A5D6B1; --logo-tile:#1D372E; --logo-text:#ECF4EF; --logo-accent:#A5D6B1; --primary:#A5D6B1; --on-primary:#10251E; --danger:#FFB4AB; --backdrop:#0A1A14; --success:#8FE3A8; --warning:#F2C46B; --selection:rgba(165,214,177,.2); color-scheme: dark; }
[data-theme="SEPIA"] { --bg:#F2E9D8; --surface:#E7DAC4; --raised:#DED0B6; --border:#CDBD9F; --title:#493B2C; --text:#493B2C; --muted:#6B5946; --gold:#90612F; --logo-tile:#493B2C; --logo-text:#F2E9D8; --logo-accent:#C79A5B; --primary:#90612F; --on-primary:#FFFFFF; --danger:#A4261C; --backdrop:#E8DDC8; --success:#2E6B3A; --warning:#7A4E00; --selection:rgba(144,97,47,.15); }
html[data-corners="SQUARE"] { --r-card: 0px; --r-small: 0px; --r-sheet: 0px; --r-dialog: 0px; }
html[data-corners="SLIGHT"] { --r-card: 4px; --r-small: 3px; --r-sheet: 6px; --r-dialog: 8px; }
html[data-corners="ROUND"] { --r-card: 20px; --r-small: 14px; --r-sheet: 24px; --r-dialog: 28px; }
html[data-density="COMPACT"] { --dens: .8; }
html[data-density="SPACIOUS"] { --dens: 1.2; }
/* NwMotion: SYSTEM follows the system setting (prefers-reduced-motion), REDUCED keeps only short fades, OFF none. */
html[data-motion="REDUCED"] *:not(.spinner), html[data-motion="REDUCED"] *::before, html[data-motion="REDUCED"] *::after { transition-duration: .05s !important; scroll-behavior: auto !important; }
html[data-motion="OFF"] *:not(.spinner), html[data-motion="OFF"] *::before, html[data-motion="OFF"] *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
html[data-motion="REDUCED"] .spinner, html[data-motion="OFF"] .spinner { animation-duration: 3s; }
/* NwIconStyle FILLED: icon tiles and tool icons drawn on a solid accent background. */
html[data-icons="FILLED"] .set-tile { background: var(--gold); color: var(--on-gold); }
html[data-icons="FILLED"] .set-tile.danger { background: var(--danger); color: var(--bg); }
html[data-icons="FILLED"] .tool-card svg.i { background: var(--gold); color: var(--on-gold); border-radius: var(--r-small); padding: 5px; width: 36px; height: 36px; }
/* A logo tile on a dark theme gets the thin outline the app draws (NwLogoMark). */
[data-dark="1"] .logo { box-shadow: inset 0 0 0 1px var(--border); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/20px var(--font); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 24px; height: 24px; fill: currentColor; flex: none; }

#app { min-height: 100%; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.content { width: 100%; max-width: 960px; margin: 0 auto; padding: var(--pad); display: flex; flex-direction: column; gap: var(--section); }
.content.narrow { max-width: 680px; }

/* Header (NwAppHeader) */
.app-header { display: flex; align-items: center; gap: 12px; }
.logo { width: 56px; height: 56px; border-radius: var(--r-card); background: var(--logo-tile); color: var(--logo-text); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; line-height: 1; }
.logo b { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.logo span { font-size: 10px; color: var(--logo-accent); margin-top: 3px; letter-spacing: .5px; }
.app-header .titles { flex: 1; min-width: 0; }
.app-header h1 { margin: 0; font-size: 26px; line-height: 30px; font-weight: 600; color: var(--title); }
.app-header p { margin: 2px 0 0; font-size: 12px; line-height: 16px; letter-spacing: .2px; color: var(--muted); }

.icon-btn { width: 48px; height: 48px; border: 0; background: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--selection); }
.icon-btn:disabled { opacity: .38; cursor: default; background: none; }
.icon-btn.gold { color: var(--gold); }
.icon-btn.title { color: var(--title); }

/* Tool grid (NwToolGrid / NwToolCard): 3 columns on phones, 4 from 600 px, 6 from 840 px */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (min-width: 600px) { .tool-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 840px) { .tool-grid { grid-template-columns: repeat(6, 1fr); } }
.tool-card { min-height: calc(100px * var(--dens)); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--title); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 10px 6px; cursor: pointer; text-align: center; font-size: 12px; line-height: 15px; }
.tool-card svg.i { width: 28px; height: 28px; color: var(--gold); }
.tool-card:hover { background: var(--raised); }
/* Convert: the app's format badges (ConvertScreen FormatBadge), in the tool grid */
.fmt-badge { width: 46px; height: 46px; border-radius: 8px; color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .2px; display: flex; align-items: center; justify-content: center; flex: none; }
.fmt-badge.long { font-size: 10px; }
/* Badges on one line: the content starts at the top, whatever the length of the texts below. */
.conv-card { min-height: calc(118px * var(--dens)); justify-content: flex-start; padding-top: 16px; }
.conv-note { font-size: 11px; line-height: 13px; color: var(--muted); }
/* Create PDF: the blocks that can be added, as a grid of chips */
.card.insert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; padding: 8px; }
.insert-grid .chip { min-width: 0; padding: 10px 6px; white-space: normal; text-align: center; line-height: 15px; }
.insert-grid .chip:hover { background: var(--selection); }
/* Create PDF: live preview (the real PDF) beside the blocks on wide screens; «Editar» / «Pré-visualizar» below */
.content.create-wrap { max-width: 680px; }
.create-seg { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); align-self: center; }
.create-seg button { border: 0; background: none; padding: 8px 20px; border-radius: 999px; color: var(--title); font: inherit; font-size: 14px; cursor: pointer; min-height: 40px; }
.create-seg button.on { background: var(--selection); color: var(--gold); font-weight: 600; }
.create-live { display: none; position: relative; }
.create-wrap.show-live .create-edit { display: none; }
.create-wrap.show-live .create-live { display: block; }
.live-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; line-height: 16px; color: var(--title); padding: 0 2px 8px; }
.live-pages { display: flex; flex-direction: column; gap: 14px; }
.live-page { width: 100%; background: #fff; border-radius: 2px; box-shadow: 0 1px 5px rgba(0, 0, 0, .2); overflow: hidden; cursor: pointer; }
.live-page canvas { display: block; width: 100% !important; height: auto !important; }
@media (min-width: 420px) {
  .create-block > .btn-row:first-child { flex-wrap: nowrap; gap: 0; }
  .create-block > .btn-row:first-child .caption { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .create-block .icon-btn { width: 40px; height: 40px; }
}
.create-block.flash { animation: nw-flash 1.4s ease; }
@keyframes nw-flash { from { box-shadow: 0 0 0 3px var(--gold); } to { box-shadow: 0 0 0 3px transparent; } }
@media (min-width: 1024px) and (max-width: 1099px) { .dk-body .content.create-wrap { max-width: 760px; margin-inline: auto; } }
@media (min-width: 1100px) {
  .content.create-wrap { max-width: 1320px; }
  .create-seg { display: none; }
  .create-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .create-live, .create-wrap.show-live .create-live { display: block; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; padding: 2px 8px 16px; }
  .create-wrap.show-live .create-edit { display: flex; }
}

.section-label { font-size: 11px; font-weight: 500; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin: 0; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 18px; }
.caption { font-size: 11px; line-height: 14px; }
.info { font-size: 13px; line-height: 18px; color: var(--muted); margin: 0; }
.info.warn { color: var(--warning); }
.info.ok { color: var(--success); }
.info.err { color: var(--danger); }

/* Top bar (NwTopBar) */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); min-height: 56px; display: flex; align-items: center; padding: 4px; gap: 0; border-bottom: 1px solid transparent; }
.topbar.lined { border-bottom-color: var(--border); }
.topbar .tb-title { flex: 1; min-width: 0; padding: 0 4px; }
.topbar h2 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 500; color: var(--title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .tb-sub { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { color: var(--title); }

/* List rows (NwListRow) */
.list { display: flex; flex-direction: column; }
.row { min-height: max(48px, calc(56px * var(--dens))); display: flex; align-items: center; gap: 12px; padding: 6px 0; cursor: pointer; border-radius: var(--r-small); }
.row:hover { background: var(--selection); }
.row > svg.i { color: var(--gold); margin-left: 4px; }
.row .row-text { flex: 1; min-width: 0; }
.row .row-title { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; line-height: 20px; }
.row .row-detail { color: var(--muted); font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.static { cursor: default; }
.row.static:hover { background: none; }
.row.selected { background: var(--selection); }

/* Buttons */
.btn { min-height: 48px; padding: 0 20px; border-radius: 24px; border: 1px solid transparent; background: var(--primary); color: var(--on-primary); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.secondary { background: transparent; color: var(--title); border-color: var(--border); }
.btn.secondary svg.i { color: var(--gold); }
.btn.text { background: transparent; color: var(--gold); padding: 0 12px; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row.end { justify-content: flex-end; }
.btn-col { display: flex; flex-direction: column; gap: 8px; }

/* Cards and fields */
.card { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-small); background: var(--surface); color: var(--text); }
textarea.input { min-height: 160px; resize: vertical; line-height: 20px; }
.input:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
.radio, .check { display: flex; align-items: center; gap: 14px; min-height: 48px; cursor: pointer; padding: 4px 0; }
.radio input, .check input { width: 22px; height: 22px; accent-color: var(--gold); flex: none; margin: 0 2px; }
.radio .r-text, .check .r-text { flex: 1; }
.r-detail { display: block; font-size: 13px; line-height: 18px; color: var(--muted); }
.swatch-dot { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: inset 0 0 0 1px rgba(127,127,127,.35); }
.swatch-dot i { width: 12px; height: 12px; border-radius: 50%; }
.switch { appearance: none; width: 52px; height: 32px; border-radius: 16px; background: var(--raised); border: 2px solid var(--border); position: relative; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.switch:checked { background: var(--primary); border-color: var(--primary); }
.switch:checked::after { left: 24px; background: var(--on-primary); }

/* Drop zone */
.drop { border: 1.5px dashed var(--border); border-radius: var(--r-card); padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--muted); }
.drop svg.i { width: 36px; height: 36px; color: var(--gold); }
body.dragging .drop, .drop.over { border-color: var(--gold); background: var(--selection); }

/* Dialogs and sheets */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: var(--surface); color: var(--text); border-radius: var(--r-dialog); width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.dialog h3 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 500; color: var(--title); }
.dialog p { margin: 0; white-space: pre-line; }
.sheet-scrim { align-items: flex-end; padding: 0; }
.sheet { background: var(--surface); width: 100%; max-width: 640px; max-height: 80vh; overflow: auto; border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 8px 16px 20px; }
@media (min-width: 700px) { .sheet-scrim { align-items: center; padding: 16px; } .sheet { border-radius: var(--r-dialog); } }
.menu { position: fixed; z-index: 60; background: var(--surface); border-radius: var(--r-small); box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 6px 0; min-width: 220px; max-height: 80vh; overflow: auto; border: 1px solid var(--border); }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--text); cursor: pointer; text-align: left; }
.menu button svg.i { color: var(--gold); width: 22px; height: 22px; }
.menu button:hover { background: var(--selection); }
.menu button.danger, .menu button.danger svg.i { color: var(--danger); }
.menu hr { border: 0; height: 1px; background: var(--border); margin: 6px 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--title); color: var(--bg); padding: 12px 18px; border-radius: var(--r-small); z-index: 70; max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.busy { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: flex; align-items: center; justify-content: center; }
.busy .box { background: var(--surface); border-radius: 16px; padding: 24px; min-width: 260px; max-width: 90vw; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
progress { width: 100%; accent-color: var(--gold); }

/* Page previews (reader, organize, editor) */
.backdrop { background: var(--backdrop); }
.page-thumb { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); display: block; max-width: 100%; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.thumb { position: relative; border: 2px solid transparent; border-radius: var(--r-small); padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; background: var(--surface); user-select: none; }
.thumb.selected { border-color: var(--gold); background: var(--selection); }
.thumb.dragging { opacity: .4; }
.thumb.drop-before { box-shadow: -4px 0 0 var(--gold); }
.thumb canvas, .thumb img { max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.thumb .num { font-size: 12px; color: var(--muted); }
.thumb .check-mark { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: var(--on-primary); display: none; align-items: center; justify-content: center; }
.thumb.selected .check-mark { display: flex; }
.thumb .check-mark svg.i { width: 18px; height: 18px; }

/* Bottom action bar */
.bottom-bar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--border); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; z-index: 4; }
.chip-bar { display: flex; gap: 4px; overflow-x: auto; padding: 6px 8px; scrollbar-width: thin; }
.chip { min-width: 72px; border: 0; background: none; color: var(--title); border-radius: 12px; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.chip svg.i { color: var(--title); }
.chip.on { background: var(--selection); color: var(--gold); }
.chip.on svg.i { color: var(--gold); }
/* «Editar original»: the lines that can be changed, and the box where one is edited (editor.js) */
.src-line { fill: rgba(226, 180, 88, 0.06); stroke: rgba(169, 116, 28, 0.55); stroke-width: 0.6; stroke-dasharray: 3 2; cursor: text; }
.src-line:hover { fill: rgba(226, 180, 88, 0.2); stroke: #A9741C; }
.src-line.off { fill: transparent; stroke: rgba(120, 120, 120, 0.35); cursor: not-allowed; }
.src-input { position: absolute; z-index: 3; box-sizing: border-box; padding: 0 2px; margin: 0; border: 0; outline: 2px solid #A9741C; border-radius: 2px; line-height: 1; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }

/* File list in merge / images */
.file-item { display: flex; align-items: center; gap: 10px; min-height: 56px; border-bottom: 1px solid var(--border); padding: 4px 0; }
.file-item:last-child { border-bottom: 0; }
.file-item svg.i { color: var(--gold); }
.file-item .fi-text { flex: 1; min-width: 0; }
.file-item .fi-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }

.footer-note { text-align: center; padding: 8px 20px 28px; }
.app-promo { display: flex; align-items: center; gap: 12px; }
.app-promo .t { flex: 1; }
.kv { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.pre { white-space: pre-wrap; word-break: break-word; font-size: 13px; background: var(--raised); border-radius: var(--r-small); padding: 12px; max-height: 50vh; overflow: auto; user-select: text; }
.range { width: 100%; accent-color: var(--gold); }

/* Reader */
.reader { height: 100vh; height: 100dvh; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.reader-scroll { flex: 1; overflow: auto; position: relative; padding: 16px 8px 80px; outline: none; }
.reader-scroll.horizontal { display: flex; align-items: flex-start; justify-content: center; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 0 auto; }
.page { position: relative; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); flex: none; --scale-round-x: 1px; --scale-round-y: 1px; --user-unit: 1; --total-scale-factor: calc(var(--scale-factor) * var(--user-unit)); }
.page canvas.pc { position: absolute; inset: 0; width: 100%; height: 100%; }
.page.cropped { overflow: clip; } /* clip, not hidden: no scroll container for scrollIntoView to move */
.page .pin { position: absolute; }
.page[data-mode="dark"] canvas.pc { filter: invert(.9) hue-rotate(180deg) contrast(.92); }
.page[data-mode="sepia"] canvas.pc { filter: sepia(.6) saturate(.9) brightness(.96); }
.page .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9aa3ad; font-size: 12px; }
.page-chip { white-space: nowrap; position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 6px 14px; font-size: 13px; box-shadow: 0 2px 10px rgba(0,0,0,.15); z-index: 6; display: flex; align-items: center; gap: 4px; }
.page-chip .icon-btn { width: 32px; height: 32px; }
.page-chip .btn { min-height: 32px; padding: 0 8px; white-space: nowrap; }
.searchbar { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-bottom: 1px solid var(--border); background: var(--bg); }
.searchbar input { flex: 1; min-height: 40px; }
.searchbar .count { font-size: 12px; color: var(--muted); min-width: 60px; text-align: center; }
.reader.fullscreen .topbar, .reader.fullscreen .searchbar { display: none; }
.textLayer { color-scheme: only light; position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1; letter-spacing: normal; word-spacing: normal; -webkit-text-size-adjust: none; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; z-index: 0;
  --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.textLayer span, .textLayer br { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; user-select: text; -webkit-user-select: text; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0; font-size: calc(var(--text-scale-factor) * var(--font-height)); --scale-x: 1; --rotate: 0deg; transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.textLayer .markedContent { display: contents; }
.textLayer span[role="img"] { user-select: none; cursor: default; }
.textLayer ::selection { background: rgba(0, 0, 255, .25); color: transparent; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; user-select: none; }
.textLayer .hit { background: rgba(226, 180, 88, .45); border-radius: 2px; }
.textLayer .hit.current { background: rgba(169, 116, 28, .7); }
.annotLinks { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.annotLinks a { position: absolute; pointer-events: auto; cursor: pointer; }
.annotLinks a:hover { background: rgba(169, 116, 28, .12); }
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  #print-area img { display: block; width: 100%; page-break-after: always; break-after: page; }
  @page { margin: 0; }
}

/* Settings (NwSettingsKit: NwSettingsGroup, Item, Toggle, Info; NwAppearanceSettings) */
.set-page { display: flex; flex-direction: column; }
.set-page > .section-label { padding: calc(22px * var(--dens)) 4px 8px; }
.set-page > .section-label:first-child { padding-top: 8px; }
.set-space { height: calc(16px * var(--dens)); flex: none; }
.set-group { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.set-row { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: max(48px, calc(60px * var(--dens))); padding: calc(10px * var(--dens)) 16px; border: 0; background: none; color: var(--text); text-align: start; cursor: pointer; text-decoration: none; font-size: 15px; line-height: 20px; }
.set-row + .set-row::before { content: ""; position: absolute; top: 0; inset-inline: 16px 0; height: 1px; background: var(--border); }
.set-row:hover { background: var(--selection); }
.set-row:focus-visible, .theme-tile:focus-visible, .swatch:focus-visible, .opt:focus-visible { outline-offset: -2px; }
.set-row:disabled { opacity: .45; cursor: default; background: none; }
.set-row.static { cursor: default; }
.set-row.static:hover { background: none; }
.set-row .st { flex: 1; min-width: 0; }
.set-row .st b { display: block; font-weight: 400; color: var(--text); }
.set-row .st small { display: block; font-size: 13px; line-height: 18px; color: var(--muted); }
.set-row.danger .st b { color: var(--danger); }
.set-row .sv { max-width: 160px; font-size: 13px; line-height: 18px; color: var(--muted); text-align: end; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.set-row .chev { width: 24px; height: 24px; color: var(--muted); margin-inline-start: -6px; }
[dir="rtl"] .set-row .chev { transform: scaleX(-1); }
.set-row .switch { margin-inline-start: 4px; }
.set-tile { width: 36px; height: 36px; border-radius: var(--r-small); background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.set-tile.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.set-tile svg.i { width: 20px; height: 20px; }
.set-info { display: flex; gap: 12px; padding: 12px 16px; min-height: 48px; align-items: center; font-size: 15px; }
.set-info + .set-info { border-top: 1px solid var(--border); }
.set-info > span:first-child { flex: 4; color: var(--text); }
.set-info > span:last-child { flex: 5; text-align: end; color: var(--muted); word-break: break-word; }
.set-note { font-size: 13px; line-height: 18px; color: var(--muted); margin: 8px 4px 0; }
.set-text { padding: 14px 16px; font-size: 13px; line-height: 18px; color: var(--muted); }
.set-text strong { display: block; color: var(--text); font-size: 15px; font-weight: 400; margin-bottom: 6px; }
/* Theme tiles: one scrolling row of real previews */
.theme-row { display: flex; gap: 10px; overflow-x: auto; padding: 14px; scrollbar-width: none; }
.theme-row::-webkit-scrollbar, .swatch-row::-webkit-scrollbar { display: none; }
.theme-tile { width: 84px; flex: none; border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: var(--muted); }
.theme-tile .tp { position: relative; width: 100%; aspect-ratio: .72; border: 1px solid var(--border); border-radius: 10px; padding: 3px; display: flex; }
.theme-tile[aria-checked="true"] .tp { border: 2px solid var(--gold); padding: 2px; }
.theme-tile .tp-in { flex: 1; display: flex; border-radius: 8px; overflow: hidden; }
.tp-half { position: relative; flex: 1; background: var(--bg); }
.tp-half i, .tp-half b { position: absolute; display: block; }
.tp-card { left: 8%; right: 8%; top: 18%; height: 46%; background: var(--surface); border-radius: 4px; }
.tp-half + .tp-half .tp-card, .tp-pair .tp-half:first-child .tp-card { right: 0; }
.tp-pair .tp-half + .tp-half .tp-card { left: 0; right: 8%; }
.tp-dot { left: 12%; top: 26%; width: 12%; aspect-ratio: 1; border-radius: 50%; background: var(--gold); }
.tp-title { left: 30%; top: 28%; width: 38%; height: 5%; background: var(--title); }
.tp-line { left: 14%; top: 46%; width: 55%; height: 4%; background: var(--muted); }
.tp-btn { left: 8%; top: 74%; width: 50%; height: 12%; background: var(--primary); border-radius: 3px; }
.theme-tile .tp-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: var(--on-gold); display: flex; align-items: center; justify-content: center; z-index: 1; }
.theme-tile .tp-check svg.i { width: 14px; height: 14px; }
.theme-tile .tp-auto { position: absolute; bottom: 6px; right: 6px; width: 16px; height: 16px; color: var(--gold); z-index: 1; }
.theme-tile .tl { margin-top: 6px; font-size: 11px; line-height: 14px; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.theme-tile[aria-checked="true"] .tl { color: var(--title); }
/* Accent swatches */
.accent-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 0; font-size: 15px; }
.accent-head span:first-child { flex: 1; }
.accent-head .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); }
.swatch-row { display: flex; gap: 2px; overflow-x: auto; padding: 8px 10px; scrollbar-width: none; }
.swatch { width: 48px; height: 48px; flex: none; border: 0; background: none; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.swatch span { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; }
.swatch[aria-checked="true"] span { border: 3px solid var(--title); }
.swatch svg.i { width: 18px; height: 18px; }
.palette { display: flex; flex-wrap: wrap; gap: 2px; }
.palette button { width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.palette button span { width: 32px; height: 32px; border-radius: 50%; }
.palette button[aria-pressed="true"] span { box-shadow: 0 0 0 3px var(--title); }
.hex-preview { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.hex-preview i { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); flex: none; }
/* Option sheet (NwOptionSheet) */
.opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; border: 0; background: none; padding: 4px 8px; cursor: pointer; text-align: start; color: var(--text); border-radius: var(--r-small); font-size: 15px; }
.opt:hover { background: var(--selection); }
.opt .rb { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none; display: flex; align-items: center; justify-content: center; }
.opt[aria-checked="true"] .rb { border-color: var(--gold); }
.opt[aria-checked="true"] .rb::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }

/* ---------- Home on a computer (≥ 1024 px): the website's style (banner, tabs, glass panels) ----------
   Phones and tablets keep the app layout (.home-m). Fonts: SIL OFL 1.1, see vendor/licenses. Only used here,
   so a phone never downloads them. assets/banner.webp is the banner image: replace the file to change it. */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 500 700; font-display: swap; src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 500 700; font-display: swap; src: url("fonts/bricolage-grotesque-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400 600; font-display: swap; src: url("fonts/hanken-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400 600; font-display: swap; src: url("fonts/hanken-grotesk-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
.home-m { display: contents; }
.home-d { display: none; }
/* Documents, Settings, About and the tool pages in the frame (js/shell.js): on phones and tablets only the screen itself shows. */
.dk-framed > .dk-lights, .dk-framed > .dk-hero, .dk-framed > .dk-tabs, .dk-framed > .dk-foot { display: none; }
.dk-shell-main, .dk-shell-main > .dk-wrap, .dk-shell-panel, .dk-body { display: contents; }
/* Same query as DESKTOP in js/shell.js (and the block at the end of this file): keep them in step. */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .home-m { display: none; }
  .home-d, .dk-framed {
    --dk-navy: #0B142E; --dk-gold: #E2B458; --dk-gold-light: #F3D58D; --dk-head: "Bricolage Grotesque", var(--font);
    --dk-glass: color-mix(in srgb, var(--surface) 72%, transparent); --dk-glass-border: rgba(255, 255, 255, .8);
    --dk-radius: min(calc(var(--r-card) * 2), 28px);
    position: relative; isolation: isolate; background: var(--backdrop); font: 16px/1.5 "Hanken Grotesk", var(--font);
  }
  .home-d { display: flex; flex-direction: column; flex: 1; }
  [data-dark="1"] .dk-framed,
  [data-dark="1"] .home-d { --dk-glass: color-mix(in srgb, var(--surface) 82%, transparent); --dk-glass-border: var(--border); }
  .dk-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 clamp(24px, 4vw, 56px); }

  /* Soft coloured lights behind the glass, as on the website */
  .dk-lights { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
  .dk-lights span { position: absolute; border-radius: 50%; }
  .dk-lights span:nth-child(1) { width: 52vw; height: 52vw; right: -12vw; top: -10vw; background: radial-gradient(circle, #FFC7A1 0%, transparent 66%); }
  .dk-lights span:nth-child(2) { width: 60vw; height: 60vw; left: -18vw; bottom: -24vw; background: radial-gradient(circle, #A8C9FF 0%, transparent 66%); }
  .dk-lights span:nth-child(3) { width: 46vw; height: 46vw; right: 6vw; bottom: -20vw; background: radial-gradient(circle, #D2B6FF 0%, transparent 66%); }
  [data-dark="1"] .dk-lights { opacity: .16; }

  /* Banner with the menu on top */
  .dk-hero { position: relative; isolation: isolate; overflow: hidden; color: #FFFFFF; background: var(--dk-navy); padding-bottom: 40px; }
  .dk-hero :focus-visible, .dk-foot :focus-visible { outline-color: var(--dk-gold); }
  .dk-hero-img { position: absolute; inset: 0; z-index: -1; background: url("banner.webp") 100% 42% / cover no-repeat; }
  .dk-hero-img::after {
    content: ""; position: absolute; inset: 0;
    background:
      linear-gradient(180deg, rgba(11, 20, 46, .38) 0%, rgba(11, 20, 46, 0) 30%, rgba(11, 20, 46, 0) 70%, rgba(11, 20, 46, .45) 100%),
      linear-gradient(90deg, rgba(11, 20, 46, .86) 0%, rgba(11, 20, 46, .76) 34%, rgba(11, 20, 46, .58) 60%, rgba(11, 20, 46, .36) 100%);
  }
  .dk-bar { display: flex; align-items: center; gap: 4px; min-height: 88px; }
  .dk-brand { display: flex; align-items: center; gap: 14px; margin-right: auto; color: inherit; text-decoration: none; font: 700 24px/1 var(--dk-head); letter-spacing: -.01em; }
  .dk-brand .logo { width: 46px; height: 46px; background: #18334C; color: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
  .dk-brand .logo b { font-size: 18px; }
  .dk-brand .logo span { font-size: 8.5px; color: #D5AD62; margin-top: 2px; }
  .dk-links { display: flex; margin-right: 10px; }
  .dk-links a { color: rgba(255, 255, 255, .86); text-decoration: none; font-weight: 600; padding: 10px 14px; border-radius: 999px; }
  .dk-links a:hover { color: #FFFFFF; background: rgba(255, 255, 255, .1); }
  .dk-bar .icon-btn { color: #FFFFFF; }
  .dk-bar .icon-btn:hover { background: rgba(255, 255, 255, .12); }
  .dk-hero-body { padding-top: 26px; }
  .dk-hero h1 { margin: 0; max-width: 24ch; font: 700 clamp(40px, 4vw, 58px)/1.06 var(--dk-head); letter-spacing: -.02em; text-shadow: 0 1px 18px rgba(11, 20, 46, .35); }
  .dk-hero h1 span { display: block; } /* one sentence per line, in every language */
  .dk-line { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; font-size: 16px; color: rgba(255, 255, 255, .82); }
  .dk-line::before { content: ""; flex: none; width: 28px; height: 2px; background: var(--dk-gold); }
  .dk-drop {
    display: flex; align-items: center; gap: 18px; width: fit-content; margin-top: 26px; padding: 8px 24px 8px 8px;
    border: 1.5px dashed rgba(255, 255, 255, .34); border-radius: 999px; background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    transition: border-color .15s ease, background-color .15s ease;
  }
  body.dragging .dk-drop { border-color: var(--dk-gold); background: rgba(226, 180, 88, .18); }
  .dk-btn { display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 14px 26px 14px 20px; background: var(--dk-gold); color: #15151B; font-weight: 600; font-size: 16px; line-height: 1; cursor: pointer; transition: background-color .15s ease; }
  .dk-btn:hover { background: var(--dk-gold-light); }
  .dk-privacy { display: flex; align-items: center; gap: 10px; max-width: 62ch; margin: 18px 0 0; font-size: 14px; color: rgba(255, 255, 255, .74); }
  .dk-privacy svg.i { width: 18px; height: 18px; color: var(--dk-gold); }

  /* Small menu of tabs under the banner (website's legal pages); stays under the top when scrolling */
  .dk-tabs {
    position: sticky; top: 0; z-index: 4; background: var(--surface); background: color-mix(in srgb, var(--surface) 80%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid var(--border); box-shadow: 0 10px 24px -18px rgba(11, 20, 46, .35);
  }
  .dk-tabs .dk-wrap { display: flex; gap: 14px; }
  .dk-tabs a { display: flex; align-items: center; min-height: 52px; padding: 0 12px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; box-shadow: inset 0 -3px 0 transparent; transition: color .15s ease, box-shadow .15s ease; }
  .dk-tabs a:first-child { padding-left: 0; }
  .dk-tabs a:hover, .dk-tabs a[aria-current] { color: var(--title); }
  .dk-tabs a[aria-current] { box-shadow: inset 0 -3px 0 var(--gold); }
  .dk-tabs a:focus-visible { outline-offset: -4px; }

  /* Tools (3 groups), then recent documents below, on glass */
  .dk-main { flex: 1; display: flex; flex-direction: column; gap: 28px; padding-top: 40px; padding-bottom: 56px; }
  .dk-panel {
    background: var(--dk-glass); border: 1px solid var(--dk-glass-border); border-radius: var(--dk-radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 2px rgba(11, 20, 46, .04), 0 14px 34px -16px rgba(11, 20, 46, .16);
    -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  }
  [data-dark="1"] .dk-panel { box-shadow: 0 14px 34px -16px rgba(0, 0, 0, .5); }
  .dk-tools { padding: 30px 34px 34px; }
  .dk-tools h3, .dk-recent h2 { margin: 0; font: 700 19px/1.2 var(--dk-head); letter-spacing: -.01em; color: var(--title); }
  .dk-tools h3 { margin: 28px 0 14px; }
  .dk-tools h3:first-of-type { margin-top: 0; }
  .dk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  @media (min-width: 1200px) { .dk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } } /* 4 tools per group: 2 x 2 or one row */
  .dk-tool {
    display: flex; align-items: center; gap: 14px; min-height: calc(76px * var(--dens)); padding: 12px 16px 12px 12px; text-align: start;
    border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--text); cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  }
  @media (prefers-reduced-motion: reduce) { html[data-motion="SYSTEM"] .dk-tool { transition: none; } html[data-motion="SYSTEM"] .dk-tool:hover { transform: none; } }
  .dk-tool:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); box-shadow: 0 14px 28px -18px rgba(11, 20, 46, .45); }
  .dk-ic { flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-card); background: color-mix(in srgb, var(--gold) 13%, transparent); color: var(--gold); transition: background-color .15s ease, color .15s ease; }
  .dk-ic svg.i { width: 26px; height: 26px; }
  .dk-tool:hover .dk-ic, html[data-icons="FILLED"] .dk-ic { background: var(--gold); color: var(--on-gold); }
  .dk-tt { min-width: 0; }
  .dk-tt b { display: block; font-weight: 600; font-size: 16px; line-height: 1.3; color: var(--title); }
  .dk-tt small { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
  .dk-recent { padding: 26px 30px 24px; }
  .dk-recent .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2px 24px; }
  .dk-recent-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 10px; }
  .dk-recent-head a { font-size: 14px; font-weight: 600; color: var(--gold); text-decoration: none; }
  .dk-recent-head a:hover { text-decoration: underline; }
  .dk-recent .info { grid-column: 1 / -1; padding: 20px 4px; text-align: center; font-size: 14px; line-height: 1.5; }

  /* Footer as on the website: black with a gold line */
  .dk-foot { background: #09090C; color: #C6C3BC; border-top: 3px solid var(--dk-gold); font-size: 14px; }
  .dk-foot .dk-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; min-height: 64px; padding-top: 14px; padding-bottom: 14px; }
  .dk-foot a { color: #C6C3BC; text-decoration: none; }
  .dk-foot a:hover { color: #FFFFFF; text-decoration: underline; }
}

/* Documents, Settings, About and the tool pages on a computer: compact banner, tabs, the screen on one glass panel (js/shell.js) */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .dk-framed > .dk-lights, .dk-framed > .dk-hero, .dk-framed > .dk-tabs, .dk-framed > .dk-foot { display: block; }
  .dk-hero-page { padding-bottom: 36px; }
  .dk-hero-page .dk-hero-body { padding-top: 44px; }
  .dk-hero-page h1 { font-size: clamp(32px, 3vw, 46px); }
  .dk-shell-main { display: block; flex: 1; padding: 40px 0 56px; }
  .dk-shell-main > .dk-wrap, .dk-body { display: block; }
  .dk-shell-panel { display: block; padding: 24px 32px 32px; } /* as wide as the home page's panels */
  .dk-body .content { max-width: none; padding: 0; }
  /* A tool's form stays readable in the wide panel (the tab pages use the whole panel) */
  .dk-framed:not(.dk-tabpage) .dk-body .content.narrow { max-width: 760px; margin-inline: auto; }
  /* The screen's own bar keeps only its back button and actions (the title is in the banner) */
  .dk-body .topbar { position: static; min-height: 48px; margin: -8px -12px 8px; padding: 0; background: none; }
  .dk-body .topbar h2 { display: none; }
  .dk-framed.dk-tabpage .dk-body .topbar { display: none; }
  .dk-body .theme-row { flex-wrap: wrap; overflow: visible; } /* all the themes in view, no side scrolling */
}
