/* WebToolHome. Layout: calm single column, tools in a card grid, each tool page = one work surface then plain help text. */
@font-face {
  font-family: "Bricolage";
  src: url("/assets/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("/assets/fonts/caveat.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg: #f4f0e6;
  --surface: #fffcf4;
  --surface-2: #ece6d8;
  --fg: #27261f;
  --muted: #69654f;
  --line: #ddd5c3;
  --accent: #56693b;
  --accent-strong: #44552e;
  --accent-soft: #e2e7d0;
  --on-accent: #fbfaf2;
  --danger: #9e3f2b;
  --danger-soft: #f3e1d9;
  --paper: #ffffff;
  --shadow: 0 1px 2px rgba(45, 42, 25, 0.06), 0 10px 28px -14px rgba(45, 42, 25, 0.22);
  --font-display: "Bricolage", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1b1a16;
  --surface: #24231e;
  --surface-2: #2e2c26;
  --fg: #ece6d8;
  --muted: #a7a18c;
  --line: #3b3930;
  --accent: #a4b97f;
  --accent-strong: #bccd9c;
  --accent-soft: #323a28;
  --on-accent: #1b1a16;
  --danger: #e38c76;
  --danger-soft: #3d2a23;
  --paper: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -14px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img, canvas { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Header */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-head .wrap { display: flex; align-items: center; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand b { color: var(--accent); font-weight: 700; }
.head-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.head-nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 6px 10px; border-radius: 8px; }
.head-nav a:hover { color: var(--fg); background: var(--surface-2); }
.theme-toggle {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); border-radius: 50%; cursor: pointer; color: var(--fg);
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.88rem; }
.btn-big { min-height: 52px; padding: 0 26px; font-size: 1.05rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--fg); padding: 0;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }

/* Home */
.hero { padding-block: 56px 28px; display: grid; gap: 18px; }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); font-weight: 750; max-width: 16ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 54ch; }
.promises { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 4px 0 0; list-style: none; color: var(--fg); font-size: 0.95rem; }
.promises li { display: flex; align-items: center; gap: 7px; }
.promises svg { width: 17px; height: 17px; color: var(--accent); flex: none; }

.finder { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-block: 18px 16px; }
.search {
  flex: 1 1 280px; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 1rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; cursor: pointer; font-size: 0.92rem; font-weight: 600; color: var(--muted);
}
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
a.chip { display: inline-flex; align-items: center; text-decoration: none; }
a.chip:hover { color: var(--fg); border-color: var(--accent); }
.chapter { display: grid; gap: 16px; padding-block: 18px 22px; scroll-margin-top: 16px; }
.chapter + .chapter { border-top: 1px solid var(--line); padding-top: 30px; }
.chapter-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.chapter-head h2 { font-size: clamp(1.35rem, 2.6vw, 1.65rem); font-weight: 700; }
.chapter-head p { color: var(--muted); font-size: 0.98rem; }
.chapter .tool-grid { padding-bottom: 0; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; padding-bottom: 24px; }
.tool-card {
  display: grid; grid-template-columns: 46px 1fr; gap: 4px 14px; align-items: start;
  padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--fg); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.tool-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-icon { grid-row: span 2; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.tool-icon svg { width: 24px; height: 24px; }
.tool-card h2, .tool-card h3 { font-size: 1.08rem; font-weight: 650; padding-top: 2px; }
.tool-card { grid-template-rows: auto 1fr; }
.tool-card p { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.empty-search { padding: 30px 0 40px; color: var(--muted); }
.coming { padding-block: 8px 56px; color: var(--muted); font-size: 0.95rem; }

/* Tool page */
.tool-head { padding-block: 36px 22px; display: grid; gap: 10px; }
.crumb { font-size: 0.9rem; color: var(--muted); }
.crumb a { color: var(--muted); }
.tool-head h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 750; }
.tool-head p { color: var(--muted); font-size: 1.08rem; max-width: 60ch; }

.workspace { padding-bottom: 48px; }
.drop {
  position: relative; display: grid; place-items: center; text-align: center; gap: 14px;
  min-height: 300px; padding: 40px 20px; border-radius: 22px;
  background: var(--surface); border: 2px dashed var(--line);
  transition: border-color 0.15s, background 0.15s;
}
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-inner { display: grid; gap: 14px; justify-items: center; }
.drop-art { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.drop-art svg { width: 32px; height: 32px; }
.drop .hint { color: var(--muted); font-size: 0.95rem; }
.private-note {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 7px 14px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); font-size: 0.88rem; color: var(--fg);
}
.private-note svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.private-note .try { color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: clip; }
.panel-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.panel-bar .spacer { flex: 1 1 auto; }
.panel-bar .meta { color: var(--muted); font-size: 0.9rem; }
.panel-body { padding: 18px; }
.sticky-bar { position: sticky; top: 0; z-index: 20; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); }
.seg button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
  font-weight: 600; font-size: 0.9rem; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px;
}
.seg button svg { width: 16px; height: 16px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.field { display: grid; gap: 6px; }
.field label, .label { font-size: 0.85rem; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.select, .input {
  min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg);
}
.options { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: end; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.radio-card { position: relative; display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; background: var(--surface); }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card strong { font-size: 0.98rem; }
.radio-card span { color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card:has(input:focus-visible) { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* Thumbnails (organize) */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.thumb {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--line); cursor: grab; touch-action: manipulation; user-select: none;
}
.thumb:active { cursor: grabbing; }
.thumb .sheet { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1.3; max-width: 100%; min-width: 0; overflow: hidden; }
.thumb .sheet > canvas, .thumb .sheet > img { width: auto; height: auto; }
.thumb canvas, .thumb img { display: block; max-width: 100%; max-height: 100%; background: var(--paper); box-shadow: 0 1px 4px rgba(0,0,0,.18); border-radius: 2px; }
.thumb .cap { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; }
.thumb .cap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.thumb .acts { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.thumb:hover .acts, .thumb:focus-within .acts { opacity: 1; }
@media (hover: none) { .thumb .acts { opacity: 1; } }
.thumb .badge { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.72rem; font-weight: 700; }
.thumb.sortable-ghost { opacity: 0.35; }
.thumb.sortable-chosen { box-shadow: var(--shadow); border-color: var(--accent); }
.add-tile {
  display: grid; place-items: center; align-content: center; gap: 8px; min-height: 200px; border-radius: 14px;
  border: 2px dashed var(--line); background: transparent; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 0.92rem;
}
.add-tile:hover { border-color: var(--accent); color: var(--accent-strong); }
.add-tile svg { width: 26px; height: 26px; }

/* Editor (edit pages) */
.edit-area { background: var(--surface-2); padding: 22px 14px 40px; display: grid; gap: 22px; justify-items: center; }
.page-wrap { position: relative; width: 100%; max-width: 820px; }
.page-wrap .pg { position: relative; width: 100%; background: var(--paper); box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.page-wrap canvas { display: block; width: 100%; height: 100%; }
.page-wrap .layer { position: absolute; inset: 0; }
.page-wrap .pnum { text-align: center; font-size: 0.8rem; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.mode-text .layer { cursor: text; }
.mode-sign .layer { cursor: crosshair; }

.ann { position: absolute; touch-action: none; }
.ann.sel { outline: 1.5px dashed var(--accent); outline-offset: 3px; }
.ann-text {
  min-width: 1ch; white-space: pre; outline: none; line-height: 1.2; padding: 0; margin: 0;
  font-family: Helvetica, Arial, sans-serif; cursor: text;
  font-size: calc(var(--fs) * var(--s, 1) * 1px);
}
.ann-text:empty::before { content: "Type here"; color: #9a9a9a; }
.ann .grip, .ann .x, .ann .rs {
  position: absolute; width: 24px; height: 24px; border-radius: 50%; display: none; place-items: center;
  background: var(--accent); color: var(--on-accent); border: 2px solid var(--paper); padding: 0; cursor: pointer;
}
.ann.sel .grip, .ann.sel .x, .ann.sel .rs { display: grid; }
.ann .grip { left: -6px; top: -32px; cursor: move; }
.ann .x { right: -10px; top: -32px; background: var(--danger); }
.ann-img .x { top: -14px; right: -14px; }
.ann .rs { right: -14px; bottom: -14px; cursor: nwse-resize; }
.ann svg { width: 13px; height: 13px; }
.ann-img { cursor: move; }
.ann-img img { display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; -webkit-user-drag: none; }

.ctx { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--accent); }
.place-hint {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--accent-soft); color: var(--fg);
  font-size: 0.92rem; border-bottom: 1px solid var(--line);
}
.place-hint svg { width: 18px; height: 18px; color: var(--accent-strong); flex: none; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(20, 19, 14, 0.5); }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); display: grid; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.2rem; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px; display: grid; gap: 14px; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); }
.sig-pad { position: relative; width: 100%; aspect-ratio: 2.6 / 1; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); touch-action: none; overflow: hidden; }
.sig-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.sig-pad .line { position: absolute; left: 8%; right: 8%; bottom: 26%; border-bottom: 1.5px solid #c9c3b4; pointer-events: none; }
.sig-pad .ph { position: absolute; left: 8%; bottom: 29%; color: #aaa391; font-size: 0.85rem; pointer-events: none; }
.sig-type { width: 100%; min-height: 54px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 1.05rem; }
.sig-preview { display: grid; place-items: center; min-height: 110px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: #1d2a55; font-family: "Caveat", cursive; font-size: 3rem; overflow: hidden; padding: 0 14px; white-space: nowrap; }

/* Lists of files (images, compress) */
.file-list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.file-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line);
}
.file-row .pv { width: 52px; height: 52px; border-radius: 9px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.file-row .pv img { width: 100%; height: 100%; object-fit: cover; }
.file-row .pv svg { width: 22px; height: 22px; }
.file-row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .st { font-size: 0.86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.file-row .st.ok { color: var(--accent-strong); }
.file-row .st.err { color: var(--danger); }
.file-row .ra { display: flex; gap: 6px; align-items: center; }

.result {
  display: grid; gap: 16px; padding: 22px; border-radius: 18px; background: var(--accent-soft); border: 1px solid var(--line);
}
.result h3 { font-size: 1.25rem; }
.sizes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-variant-numeric: tabular-nums; }
.sizes .big { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent-strong); }
.sizes .old { color: var(--muted); text-decoration: line-through; }
.result .row { display: flex; flex-wrap: wrap; gap: 10px; }

.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.busy { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 200;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  padding: 12px 16px; border-radius: 14px; background: var(--fg); color: var(--bg); box-shadow: var(--shadow); font-size: 0.95rem;
}
.toast button { border: 0; background: transparent; color: var(--bg); font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px; }
.toast.err { background: var(--danger); color: #fff; }

/* Help text */
.help { border-top: 1px solid var(--line); padding-block: 44px 20px; display: grid; gap: 40px; }
.help-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.help h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 14px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.steps li::before {
  content: counter(s); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-family: var(--font-display);
}
.steps li span { padding-top: 3px; }
.prose { display: grid; gap: 12px; color: var(--fg); max-width: 65ch; }
.prose p { color: var(--muted); }
.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 16px 16px; color: var(--muted); }
.related h2 { font-size: 1.25rem; margin-bottom: 14px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 40px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; padding-block: 26px 34px; color: var(--muted); font-size: 0.9rem; }
.site-foot a { color: var(--muted); }
.site-foot .grow { flex: 1 1 auto; }

.doc { padding-block: 40px 20px; max-width: 70ch; display: grid; gap: 16px; }
.doc h1 { font-size: clamp(2rem, 4.5vw, 2.6rem); }
.doc h2 { font-size: 1.3rem; margin-top: 12px; }
.doc p, .doc li { color: var(--muted); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 720px) {
  .help-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-block: 34px 18px; }
  .tool-head { padding-block: 24px 16px; }
  .head-nav a.hide-sm { display: none; }
  .drop { min-height: 260px; }
  .panel-body { padding: 12px; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .edit-area { padding: 14px 8px 30px; gap: 16px; }
  .label-long { display: none; }
  .panel-bar .meta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}

/* Editor additions: remembered signature, redaction boxes, compact tool labels */
.remember { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 0.95rem; line-height: 1.4; }
.remember input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.saved-sig { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.saved-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.saved-img { display: grid; place-items: center; width: 160px; height: 60px; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); }
.saved-img img { max-height: 100%; max-width: 100%; }
.ann-redact { background: rgba(0, 0, 0, 0.82); cursor: move; min-width: 4px; min-height: 4px; }
.ann-redact .x { top: -14px; right: -14px; }
.mode-redact .layer { cursor: crosshair; }
@media (max-width: 720px) {
  .seg[aria-label="Tool"] .tool-label { display: none; }
  .seg[aria-label="Tool"] button { padding: 0 11px; }
}
.ctx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sticky-bar { background: var(--surface); }

/* Editor block on top of a homepage chapter, with its single tasks */
.editor-hero { display: grid; gap: 0; border-radius: 20px; background: var(--surface); border: 1.5px solid var(--accent); box-shadow: var(--shadow); overflow: clip; }
.hero-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px 22px; padding: 24px 26px; text-decoration: none; color: var(--fg); background: linear-gradient(135deg, var(--accent-soft), transparent 70%); }
.hero-main:hover .hero-cta { background: var(--accent-strong); border-color: var(--accent-strong); }
.hero-icon { width: 68px; height: 68px; border-radius: 18px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.hero-icon svg { width: 36px; height: 36px; }
.hero-text { display: grid; gap: 3px; min-width: 0; }
.hero-kicker { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong); }
.hero-text strong { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 750; line-height: 1.15; }
.hero-text > span:last-child { color: var(--muted); font-size: 1rem; }
.hero-subs { display: grid; gap: 10px; padding: 16px 26px 20px; border-top: 1px solid var(--line); }
.hero-subs .label, .task-row .label { font-size: 0.82rem; }
.subs { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.sub-chip svg { width: 17px; height: 17px; color: var(--accent-strong); flex: none; }
.sub-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.task-row { display: grid; gap: 8px; margin-top: 6px; }
@media (max-width: 720px) {
  .hero-main { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .hero-icon { width: 54px; height: 54px; border-radius: 14px; }
  .hero-icon svg { width: 28px; height: 28px; }
  .hero-cta { grid-column: 1 / -1; width: 100%; }
  .hero-subs { padding: 14px 18px 18px; }
}

/* Ads: a quiet column at the side on wide screens, one calm spot between sections otherwise */
.wrap.wide { max-width: 1440px; }
.with-rail { display: grid; grid-template-columns: minmax(0, 1fr); }
.ad-rail { display: none; }
@media (min-width: 1400px) {
  .with-rail { grid-template-columns: minmax(0, 1040px) 300px; gap: 40px; justify-content: center; }
  .ad-rail { display: block; padding-top: 36px; }
  .ad-rail .ad { position: sticky; top: 24px; }
}
.ad { display: grid; gap: 6px; }
.ad-label { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ad-inline { padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.link-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.feedback-strip { color: var(--muted); font-size: 0.95rem; }
.feedback-strip .link-btn { color: var(--accent-strong); font-weight: 600; }
.doc .lead-in { font-size: 1.12rem; color: var(--fg); }
.big-mail { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.guide p { max-width: 70ch; }
@media (max-width: 720px) {
  .task-row .subs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; margin-inline: -4px; padding-inline: 4px; }
  .task-row .sub-chip { flex: none; }
}

/* Install and "your tools" */
.install-btn svg { width: 16px; height: 16px; }
@media (max-width: 720px) { .install-btn { padding: 0 10px; font-size: 0.85rem; } }
.install-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 6px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 0.95rem; color: var(--muted); max-width: 720px; }
.your-tools { display: grid; gap: 12px; padding-block: 4px 18px; }
.yt-head { display: flex; align-items: baseline; gap: 14px; }
.yt-head h2 { font-size: 1.2rem; font-weight: 700; }
.yt-head .link-btn { color: var(--muted); font-size: 0.88rem; }
.sub-chip.pinned { border-color: var(--accent); }
.crumb-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.pin-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.pin-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.pin-btn[aria-pressed="true"] { color: var(--accent-strong); border-color: var(--accent); }
.pin-btn[aria-pressed="true"] svg { fill: currentColor; }
.pin-btn:hover { border-color: var(--accent); color: var(--fg); }
