/* LMPure PDF — stylesheet
   Palette: cool paper, navy ink, cobalt for actions, highlighter yellow for selected pages. */

@property --fold {
  syntax: '<length>';
  inherits: true;
  initial-value: 18px;
}

:root {
  --paper: #f2f4f8;
  --sheet: #ffffff;
  --ink: #14213d;
  --ink-2: #4a5672;
  --ink-3: #737d93;
  --rule: #d9dfe9;
  --rule-2: #e9edf3;
  --cobalt: #2442d6;
  --cobalt-2: #1a31a8;
  --cobalt-tint: #e8ecfc;
  --marker: #ffe14d;
  --marker-soft: #fff6c2;
  --danger: #c2352b;
  --danger-tint: #fbeae8;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --wrap: 1120px;
  --paper-shadow: 0 1px 0 rgba(20, 33, 61, 0.04), 0 10px 28px -16px rgba(20, 33, 61, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--cobalt); }
a:hover { color: var(--cobalt-2); }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip-link:focus { top: 12px; color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 28px; height: 28px; flex: none; }
.logo-tag { font-weight: 500; color: var(--ink-2); margin-left: -4px; }
.site-nav { display: flex; gap: 4px; align-items: center; }
.site-nav > a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 10px; border-radius: 6px; }
.site-nav > a:hover, .site-nav > a[aria-current="page"] { color: var(--ink); background: var(--rule-2); }
@media (max-width: 600px) { .site-nav > a { display: none; } }

/* ---------- Home hero ---------- */
.hero { padding: 52px 0 36px; }
.hero h1 {
  font-size: clamp(1.85rem, 4.2vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.hero p { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-2); max-width: 52ch; margin: 20px 0 0; }

/* ---------- Tool tiles: sheets with a folded corner ---------- */
.tool-group { margin: 0 0 40px; }
.tool-group h2 { font-size: 1.05rem; font-weight: 600; color: var(--ink-2); margin: 0 0 14px; letter-spacing: 0; }
.tile-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile {
  --fold: 18px;
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 22px 22px;
  background: var(--sheet);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  clip-path: polygon(0 0, calc(100% - var(--fold)) 0, 100% var(--fold), 100% 100%, 0 100%);
  transition: --fold 0.18s ease;
}
.tile::after {
  content: "";
  position: absolute; top: 0; right: 0;
  width: var(--fold); height: var(--fold);
  background: linear-gradient(to bottom left, transparent 50%, var(--rule) 50%);
  border-bottom-left-radius: 3px;
}
.tile:hover, .tile:focus-visible { --fold: 32px; color: var(--ink); }
.tile:hover::after, .tile:focus-visible::after { background: linear-gradient(to bottom left, transparent 50%, #c9d3fb 50%); }
.tile:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--cobalt); }
.tile-icon { width: 30px; height: 30px; color: var(--cobalt); margin-bottom: 10px; }
.tile-icon svg { width: 100%; height: 100%; }
.tile-name { font-weight: 700; font-size: 1.08rem; letter-spacing: -0.01em; }
.tile-desc { font-size: 0.94rem; color: var(--ink-2); line-height: 1.45; }
.tile-grid--compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile-grid--compact .tile { padding: 16px 18px 18px; }
.tile-grid--compact .tile-icon { width: 24px; height: 24px; margin-bottom: 6px; }

/* ---------- Home: why + faq ---------- */
.why { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); padding: 28px 0 8px; border-top: 1px solid var(--rule); margin-top: 16px; }
.why h3 { font-size: 1.1rem; margin-bottom: 6px; }
.why p { color: var(--ink-2); margin: 0; }
.home-more { padding: 48px 0 24px; }
.home-more h2 { font-size: 1.6rem; margin-bottom: 16px; }

/* ---------- Tool page head ---------- */
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--ink-3); padding: 22px 0 0; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.tool-head { display: flex; gap: 18px; align-items: flex-start; padding: 22px 0 26px; }
.tool-head-icon { width: 52px; height: 52px; flex: none; color: var(--cobalt); background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 11px; }
.tool-head h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); font-weight: 700; letter-spacing: -0.03em; }
.tool-head .lead { color: var(--ink-2); font-size: 1.1rem; margin: 8px 0 0; max-width: 60ch; }

/* ---------- Workspace sheet ---------- */
.workspace {
  --fold: 40px;
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: var(--paper-shadow);
  padding: 28px;
  min-height: 320px;
  clip-path: polygon(0 0, calc(100% - var(--fold)) 0, 100% var(--fold), 100% 100%, 0 100%);
}
.workspace::after {
  content: ""; position: absolute; top: 0; right: 0; width: var(--fold); height: var(--fold);
  background: linear-gradient(to bottom left, transparent 50%, var(--rule) 50%);
  border-bottom-left-radius: 4px;
}
@media (max-width: 600px) { .workspace { padding: 18px 14px; --fold: 28px; } }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  text-align: center;
  min-height: 260px;
  padding: 40px 20px;
  border: 2px dashed var(--rule);
  border-radius: 10px;
  transition: background-color 0.15s, border-color 0.15s;
}
.dropzone.is-over { border-color: var(--cobalt); background: var(--cobalt-tint); }
.dropzone-icon { width: 46px; height: 46px; color: var(--ink-3); }
.dropzone p { margin: 0; color: var(--ink-3); }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 16px 0 0; font-size: 14px; color: var(--ink-2); text-align: center; }
.privacy-note svg { width: 16px; height: 16px; flex: none; color: var(--cobalt); }

.ws-error {
  margin: 0 0 18px; padding: 12px 16px;
  background: var(--danger-tint); color: #8a221b;
  border-left: 4px solid var(--danger); border-radius: 4px;
  font-weight: 500;
}
.ws-loading {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}
.ws-loading p { margin: 0; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--cobalt-tint); border-top-color: var(--cobalt); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  font-weight: 600; font-size: 15px; line-height: 1.2;
  background: var(--sheet); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 8px;
  cursor: pointer; text-decoration: none;
  transition: background-color 0.12s, border-color 0.12s;
}
.btn:hover { border-color: #b8c2d4; background: #f7f9fc; color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-2); border-color: var(--cobalt-2); color: #fff; }
.btn-lg { padding: 15px 28px; font-size: 17px; border-radius: 10px; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); padding-left: 8px; padding-right: 8px; }
.btn-quiet:hover { background: var(--rule-2); border-color: transparent; }
.btn svg { width: 18px; height: 18px; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border: 1px solid var(--rule); background: var(--sheet); border-radius: 7px; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: #b8c2d4; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Edit stage layout ---------- */
.doc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--rule-2); }
.doc-info { display: flex; flex-direction: column; min-width: 0; }
.doc-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.doc-info span { font-size: 14px; color: var(--ink-3); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar .hint { margin: 0 0 0 auto; }
.hint { font-size: 14px; color: var(--ink-3); margin: 6px 0 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--rule-2); }
.actions .hint { margin: 0; margin-right: auto; }
@media (max-width: 600px) { .actions .btn-lg { width: 100%; } }

/* Options and fields */
.options { display: grid; gap: 20px; align-content: start; }
.options-row { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 8px; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: 8px; background: #fff;
  font-size: 16px;
}
.input:focus { outline: 2px solid var(--cobalt); outline-offset: 0; border-color: var(--cobalt); }
.input-color { width: 56px; height: 40px; padding: 3px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; cursor: pointer; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--cobalt); }
.range-row output { min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 15px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--cobalt); flex: none; }

/* Segmented radio control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--rule); border-radius: 9px; padding: 3px; background: #f7f9fc; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 13px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 33, 61, 0.14), 0 0 0 1px var(--rule); }
.seg input:focus-visible + span { outline: 2px solid var(--cobalt); outline-offset: 1px; }
.seg--stack { display: grid; }

/* ---------- Page thumbnails ---------- */
.page-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
@media (max-width: 420px) { .page-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.thumb {
  position: relative;
  padding: 8px 8px 6px;
  border: 2px solid transparent; border-radius: 9px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.thumb-page { position: relative; aspect-ratio: 1 / 1; }
.thumb-page canvas {
  position: absolute; inset: 0; margin: auto;
  max-width: 92%; max-height: 92%;
  background: #fff;
  box-shadow: 0 0 0 1px var(--rule), 0 2px 6px -2px rgba(20, 33, 61, 0.25);
  visibility: hidden;
  transition: transform 0.22s ease, opacity 0.15s;
}
.thumb.is-ready canvas { visibility: visible; }
.thumb:not(.is-ready) .thumb-page::before {
  content: ""; position: absolute; inset: 4% 15%; background: var(--rule-2); border-radius: 2px;
}
.thumb-num { display: block; width: max-content; margin: 6px auto 0; padding: 0 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; border-radius: 3px; }
.thumb.is-clickable { cursor: pointer; }
.thumb.is-clickable:hover { background: var(--rule-2); }
.thumb.is-clickable:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 0; }

/* Extract: highlighter */
.thumb.is-picked { background: var(--marker-soft); border-color: var(--marker); }
.thumb.is-picked:hover { background: #fff0a3; }
.thumb.is-picked .thumb-num { background: var(--marker); color: var(--ink); }

/* Delete: struck out */
.thumb.is-marked { border-color: var(--danger); background: var(--danger-tint); }
.thumb.is-marked:hover { background: #f8dcd8; }
.thumb.is-marked canvas { opacity: 0.35; }
.thumb.is-marked .thumb-page::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 40%; height: 40%;
  background:
    linear-gradient(45deg, transparent 45%, var(--danger) 45%, var(--danger) 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, var(--danger) 45%, var(--danger) 55%, transparent 55%);
}
.thumb.is-marked .thumb-num { color: var(--danger); text-decoration: line-through; }

/* Rotate badge */
.thumb-badge { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid var(--rule); display: grid; place-items: center; color: var(--cobalt); }
.thumb-badge svg { width: 14px; height: 14px; }

/* Sortable */
.is-sortable > * { cursor: grab; touch-action: pan-y; }
.is-dragging { position: relative; z-index: 20; cursor: grabbing !important; opacity: 0.9; transition: none !important; }
.is-dragging.thumb { background: var(--cobalt-tint); border-color: var(--cobalt); }
.is-sorting { cursor: grabbing; }

/* ---------- File list (merge, jpg) ---------- */
.file-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-2); }
.file-item { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--rule-2); background: #fff; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.file-item.is-dragging { box-shadow: 0 10px 24px -10px rgba(20, 33, 61, 0.35); border-radius: 8px; }
.file-grip { width: 10px; align-self: stretch; flex: none; background-image: radial-gradient(var(--ink-3) 1.2px, transparent 1.3px); background-size: 5px 5px; opacity: 0.6; }
.file-thumb { width: 52px; height: 52px; flex: none; display: grid; place-items: center; }
.file-thumb canvas, .file-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 0 0 1px var(--rule); background: #fff; }
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-info strong { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info span { font-size: 13px; color: var(--ink-3); }
.file-actions { display: flex; gap: 6px; flex: none; }
.file-num { width: 22px; text-align: right; font-size: 14px; font-weight: 600; color: var(--ink-3); flex: none; font-variant-numeric: tabular-nums; }

/* ---------- Two-column panel (watermark, page numbers) ---------- */
.split-panel { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .split-panel { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); } }
.preview-wrap { align-self: start; }
.preview { position: relative; max-width: 440px; margin: 0 auto; background: #fff; box-shadow: 0 0 0 1px var(--rule), var(--paper-shadow); overflow: hidden; }
.preview canvas { width: 100%; height: auto; }
.preview-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.wm-text { position: absolute; white-space: pre; font-weight: 700; line-height: 1; transform-origin: center; }
.pn-text { position: absolute; white-space: pre; font-family: Helvetica, Arial, sans-serif; line-height: 1; color: #1a1a1a; }
.preview-wrap .hint { text-align: center; }

/* Position picker */
.pos-picker { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: 44px 28px 44px; gap: 0; width: max-content; border: 1px solid var(--rule); border-radius: 6px; background: #fff; padding: 6px; }
.pos-picker label { position: relative; display: grid; place-items: center; cursor: pointer; }
.pos-picker label:nth-child(n+4) { grid-row: 3; }
.pos-picker input { position: absolute; opacity: 0; pointer-events: none; }
.pos-picker span { width: 22px; height: 10px; border-radius: 3px; background: var(--rule-2); border: 1px solid var(--rule); }
.pos-picker input:checked + span { background: var(--cobalt); border-color: var(--cobalt); }
.pos-picker input:focus-visible + span { outline: 2px solid var(--cobalt); outline-offset: 3px; }

/* ---------- Sign ---------- */
.sign-layout { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .sign-layout { grid-template-columns: 340px minmax(0, 1fr); } }
.sign-side { display: grid; gap: 14px; align-content: start; }
.panel-title { font-size: 1.05rem; }
.tabs { display: flex; border-bottom: 1px solid var(--rule); gap: 4px; }
.tab { padding: 8px 12px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 15px; color: var(--ink-3); cursor: pointer; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--cobalt); }
.sig-pad {
  width: 100%; height: 170px; touch-action: none; cursor: crosshair;
  border: 1px solid var(--rule); border-radius: 8px;
  background: #fff linear-gradient(to right, var(--rule), var(--rule)) no-repeat 50% 74% / 82% 1px;
}
.pad-tools { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--rule); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--cobalt); }
.pad-tools .btn { margin-left: auto; }
.font-choices { display: grid; gap: 6px; margin-top: 10px; }
.font-choice { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; min-height: 56px; }
.font-choice input { accent-color: var(--cobalt); }
.font-choice span { font-size: 30px; line-height: 1.1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.font-choice:has(input:checked) { border-color: var(--cobalt); background: var(--cobalt-tint); }
.sig-upload-preview { max-height: 110px; margin: 10px auto 0; background: repeating-conic-gradient(#eef1f6 0 25%, #fff 0 50%) 0 0 / 14px 14px; border: 1px solid var(--rule); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.pager span { font-weight: 500; font-variant-numeric: tabular-nums; min-width: 11ch; text-align: center; }
.sign-stage { position: relative; max-width: min(700px, 62vh); margin: 0 auto; background: #f7f9fc; box-shadow: 0 0 0 1px var(--rule), var(--paper-shadow); }
.sign-stage canvas { width: 100%; height: auto; }
.overlay-layer { position: absolute; inset: 0; }
.sig-box {
  position: absolute; touch-action: none; cursor: move;
  outline: 1.5px dashed var(--cobalt); outline-offset: 2px;
  user-select: none; -webkit-user-select: none;
}
.sig-box img { width: 100%; height: auto; pointer-events: none; }
.sig-box:focus-visible { outline: 2px solid var(--cobalt); }
.sig-remove, .sig-resize {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  background: var(--cobalt); color: #fff; border: 2px solid #fff;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  box-shadow: 0 1px 4px rgba(20, 33, 61, 0.3);
}
.sig-remove { top: -15px; right: -15px; }
.sig-resize { bottom: -15px; right: -15px; cursor: nwse-resize; touch-action: none; }
.sig-remove svg, .sig-resize svg { width: 12px; height: 12px; }

/* ---------- Done stage ---------- */
.stage-done { text-align: center; padding: 30px 0 10px; }
.done-mark { width: 58px; height: 58px; margin: 0 auto 14px; color: var(--cobalt); }
.stage-done h2 { font-size: 1.7rem; margin-bottom: 10px; }
.stage-done h2:focus { outline: none; }
.result-file { display: flex; flex-direction: column; gap: 2px; margin-bottom: 22px; }
.result-file strong { word-break: break-all; }
.result-file span { color: var(--ink-3); font-size: 15px; }
.done-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.done-next { margin: 26px 0 0; font-size: 15px; color: var(--ink-2); }
.done-next a { margin: 0 4px; }

/* ---------- SEO content ---------- */
.content-wrap { padding-top: 56px; padding-bottom: 24px; }
.content { max-width: 70ch; }
.content h2 { font-size: 1.55rem; margin: 0 0 16px; }
.content section + section { margin-top: 44px; }
.content p { color: #2c3854; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding-left: 46px; min-height: 32px; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1.5px solid var(--ink); border-radius: 50%;
  font-weight: 700; font-size: 15px;
}
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; gap: 16px;
  padding: 16px 0; font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--ink-3); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 18px; color: #2c3854; }
.related { padding-top: 40px; padding-bottom: 64px; }
.related h2 { font-size: 1.25rem; margin-bottom: 14px; }

/* ---------- Plain pages ---------- */
.plain { max-width: 70ch; padding: 48px 0 72px; }
.plain h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); letter-spacing: -0.03em; margin-bottom: 20px; }
.plain h2 { font-size: 1.3rem; margin: 32px 0 10px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); background: var(--sheet); font-size: 15px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1.4fr repeat(4, 1fr); padding-top: 40px; padding-bottom: 28px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
.footer-grid p { color: var(--ink-2); margin: 10px 0 0; max-width: 34ch; }
.footer-grid h2 { font-size: 14px; font-weight: 700; margin-bottom: 10px; letter-spacing: 0; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--cobalt); text-decoration: underline; }
.footer-base { display: flex; gap: 18px; padding-top: 16px; padding-bottom: 28px; border-top: 1px solid var(--rule-2); color: var(--ink-3); font-size: 14px; }
.footer-base a { color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Toolbars that hold a text field */
.toolbar--fields { align-items: flex-end; }
.toolbar .field.grow { flex: 1 1 260px; }

/* Small phones: give file names room in the merge and image lists */
@media (max-width: 480px) {
  .file-item { gap: 8px; }
  .file-grip, .file-num { display: none; }
  .file-thumb { width: 40px; height: 40px; }
  .file-actions { gap: 4px; }
  .icon-btn { width: 32px; height: 32px; }
  .tool-head { gap: 12px; }
  .tool-head-icon { width: 42px; height: 42px; padding: 8px; }
}

/* ---------- All tools menu ---------- */
.menu-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 10px; border: 0; border-radius: 6px; background: none;
  color: var(--cobalt); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
}
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--rule-2); color: var(--cobalt-2); }
.menu-btn svg { width: 14px; height: 14px; transition: transform 0.15s; }
.menu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.menu-panel {
  position: absolute; top: calc(100% - 4px); right: 12px; z-index: 50;
  width: min(860px, calc(100vw - 24px));
  display: grid; gap: 22px 26px; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 22px 24px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 22px 44px -20px rgba(20, 33, 61, 0.4);
}
.menu-group h2 { font-size: 13px; font-weight: 700; color: var(--ink-3); margin: 0 0 8px; letter-spacing: 0; }
.menu-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.menu-group a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; margin-left: -8px; border-radius: 6px;
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; line-height: 1.25;
}
.menu-group a:hover { background: var(--cobalt-tint); color: var(--ink); }
.menu-group a[aria-current="page"] { background: var(--rule-2); }
.menu-group a svg { width: 20px; height: 20px; flex: none; color: var(--cobalt); }
@media (max-width: 860px) { .menu-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .menu-panel { padding: 16px; gap: 16px 14px; } .menu-group a { font-size: 14px; gap: 7px; } .menu-group a svg { width: 18px; height: 18px; } }

/* Size field with a unit after it */
.input-suffix { display: flex; align-items: center; gap: 10px; }
.input-suffix .input { width: 130px; }
.input-suffix span { font-weight: 600; color: var(--ink-2); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* About page contact card and footer note */
.contact-card { font-style: normal; line-height: 1.8; background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px; padding: 18px 22px; max-width: 520px; }
.footer-grid p a { color: var(--ink-2); text-decoration: underline; }
.contact-email { font-size: 1.15rem; font-weight: 600; word-break: break-all; margin-bottom: 12px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Promotions for Learning Media products ---------- */
.house-ad-slot { margin: 28px 0 0; }
.stage-done .house-ad-slot { max-width: 620px; margin: 30px auto 0; text-align: left; }
.content-wrap + .wrap .house-ad-slot, .home-promo { max-width: 760px; }
.house-ad {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  background: var(--sheet); color: var(--ink); text-decoration: none;
  border: 1px solid var(--rule); border-left: 4px solid var(--marker); border-radius: 8px;
}
.house-ad:hover { border-color: #b8c2d4; border-left-color: var(--marker); color: var(--ink); }
.house-ad:hover .house-ad-btn { border-color: #b8c2d4; background: #f7f9fc; }
.house-ad-img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.house-ad-badge {
  width: 56px; height: 56px; flex: none; display: grid; place-items: center;
  background: var(--ink); color: #fff; border-radius: 8px; font-weight: 700; font-size: 17px; letter-spacing: 0.02em;
}
.house-ad-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.house-ad-label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.house-ad-body strong { font-size: 1.05rem; }
.house-ad-text { font-size: 0.94rem; color: var(--ink-2); line-height: 1.45; }
.house-ad-btn { flex: none; }
@media (max-width: 560px) {
  .house-ad { flex-wrap: wrap; }
  .house-ad-btn { width: 100%; }
}
