/* ==========================================================================
   MapMyPDF design system
   One accent, one typeface family, generous space, fast by default.
   ========================================================================== */

/* ---------------------------------------------------------------- fonts */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* --------------------------------------------------------------- tokens */
:root {
  --ink: #0d1117;
  --ink-2: #333c47;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e7e9ee;
  --line-strong: #d4d8e0;
  --paper: #ffffff;
  --canvas: #f8f8f9;
  --canvas-2: #f1f2f4;

  --brand: #c8102e;
  --brand-hover: #a70c26;
  --brand-ink: #7d0a1d;
  --brand-soft: #fff1f3;
  --brand-line: #ffd7dd;

  --ok: #0f7b4f;
  --ok-soft: #eaf7f0;
  --warn: #b45309;
  --warn-soft: #fff7e6;
  --danger: #b42318;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  --shadow-xs: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-sm: 0 1px 3px rgb(16 24 40 / 0.06), 0 1px 2px rgb(16 24 40 / 0.04);
  --shadow-md: 0 4px 14px -4px rgb(16 24 40 / 0.1), 0 2px 6px -2px rgb(16 24 40 / 0.06);
  --shadow-lg: 0 18px 40px -18px rgb(16 24 40 / 0.22), 0 6px 14px -8px rgb(16 24 40 / 0.12);

  --shell: 1160px;
  --gutter: 24px;
  --header-h: 66px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------- reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll {
  overflow: hidden;
}
h1,
h2,
h3,
h4,
h5 {
  margin: 0 0 0.4em;
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.033em;
  color: var(--ink);
  text-wrap: balance;
}
p {
  margin: 0 0 1em;
  text-wrap: pretty;
}
a {
  color: inherit;
  text-decoration: none;
}
img,
svg,
canvas,
video {
  display: block;
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.2em;
}
li {
  margin-bottom: 0.35em;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}
::selection {
  background: var(--brand);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------- layout */
.shell {
  width: 100%;
  max-width: calc(var(--shell) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell-narrow {
  max-width: 780px;
  margin-inline: auto;
}
.section {
  padding: 76px 0;
}
.section-tight {
  padding: 52px 0;
}
.section-alt {
  background: var(--canvas);
  border-block: 1px solid var(--line);
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: top 0.15s;
}
.skip-link:focus {
  top: 12px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------ typography */
.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.display {
  font-size: clamp(2.6rem, 6.1vw, 4.6rem);
  font-weight: 680;
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 0 0 22px;
}
.display em,
.serif {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--brand);
  padding-right: 0.04em;
}
.h2 {
  font-size: clamp(1.7rem, 3.1vw, 2.5rem);
  letter-spacing: -0.038em;
  line-height: 1.06;
  margin: 0 0 14px;
}
.h3 {
  font-size: 1.25rem;
  letter-spacing: -0.024em;
  margin: 0 0 10px;
}
.lede {
  font-size: 1.125rem;
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 60ch;
}
/* the promise, marked with a highlighter stroke */
.lede .usp {
  color: var(--ink);
  font-weight: 600;
  background: linear-gradient(transparent 58%, var(--brand-line) 58%);
  padding: 0 0.08em;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.tiny {
  font-size: 0.78rem;
}
.balance {
  text-wrap: balance;
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
    color 0.16s var(--ease), transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.btn:active {
  transform: translateY(1px);
}
.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: var(--shadow-md);
}
.btn-dark {
  background: var(--ink);
  color: #fff;
}
.btn-dark:hover {
  background: #1c2530;
}
.btn-ghost {
  background: var(--paper);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--ink);
}
.btn-quiet {
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink-2);
}
.btn-quiet:hover {
  background: var(--canvas-2);
  color: var(--ink);
}
.btn-block {
  width: 100%;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}
.btn-lg {
  min-height: 54px;
  padding: 0 28px;
  font-size: 1rem;
  border-radius: 12px;
}
.link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.link:hover {
  color: var(--brand-hover);
}

/* ----------------------------------------------------------------- chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip svg {
  width: 14px;
  height: 14px;
  color: var(--brand);
}
.chip-ok {
  background: var(--ok-soft);
  border-color: #c8e9d8;
  color: #0a5c3b;
}
.chip-ok svg {
  color: var(--ok);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: rgb(255 255 255 / 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .shell {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.03em;
  flex: none;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}
.brand-mark svg {
  width: 20px;
  height: 24px;
}
.brand .word {
  display: inline;
}
.brand .word span {
  color: var(--brand);
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav > a,
.nav-toggle {
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.main-nav > a:hover,
.nav-toggle:hover {
  background: var(--canvas-2);
  color: var(--ink);
}
.main-nav > a[aria-current="page"] {
  color: var(--ink);
  background: var(--canvas-2);
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.85rem;
  transition: border-color 0.15s, background 0.15s;
}
.search-btn:hover {
  border-color: var(--line-strong);
  background: var(--canvas);
  color: var(--ink-2);
}
.search-btn svg {
  width: 15px;
  height: 15px;
}
.search-btn kbd {
  font-family: inherit;
  font-size: 0.7rem;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--faint);
}
.nav-cta {
  min-height: 36px;
  padding: 0 15px;
  font-size: 0.87rem;
  border-radius: 9px;
}
.menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.menu-btn svg {
  width: 18px;
  height: 18px;
}

/* mega menu */
.mega {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--header-h) - 6px);
  width: min(860px, calc(100vw - 32px));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: none;
  grid-template-columns: 1.15fr 1.15fr 0.9fr;
  gap: 20px;
  z-index: 70;
}
.mega.open {
  display: grid;
  animation: pop 0.16s var(--ease);
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }
}
.mega-group h4 {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 8px;
  font-weight: 600;
}
.mega-list {
  display: grid;
  gap: 1px;
}
.mega-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
}
.mega-list a svg {
  width: 16px;
  height: 16px;
  color: var(--brand);
  flex: none;
}
.mega-list a:hover {
  background: var(--canvas);
  color: var(--ink);
}
.mega-promo {
  background: var(--canvas);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}
.mega-promo strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

/* mobile drawer */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 auto;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 14px var(--gutter) 24px;
  display: none;
  z-index: 55;
  max-height: calc(100vh - var(--header-h));
  overflow: auto;
}
.mobile-nav.open {
  display: block;
}
.mobile-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 550;
  color: var(--ink);
}
.mobile-nav a span {
  color: var(--faint);
  font-size: 0.8rem;
  font-weight: 500;
}

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 74px 0 64px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 420px at 12% -10%, #fff2f4 0%, transparent 60%),
    radial-gradient(700px 380px at 92% 0%, #f2f5ff 0%, transparent 62%),
    var(--paper);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--line-strong) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / 0.5), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}
.hero > .shell {
  position: relative;
  z-index: 1;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 56px;
  align-items: center;
}
.hero-copy .display {
  max-width: 13ch;
}
.hero-copy .lede {
  margin-bottom: 26px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

/* drop widget */
.dropwidget {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  position: relative;
}
.dropwidget-inner {
  border: 1.5px dashed var(--line-strong);
  border-radius: 20px;
  padding: 34px 26px;
  text-align: center;
  transition: border-color 0.18s, background 0.18s;
  background: linear-gradient(180deg, #fff, #fcfcfd);
}
.dropwidget.dragover .dropwidget-inner {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropwidget-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
}
.dropwidget-icon svg {
  width: 24px;
  height: 24px;
}
.dropwidget h2 {
  font-size: 1.08rem;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.dropwidget p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.86rem;
}
.dropwidget-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dropwidget-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.76rem;
  color: var(--faint);
}
.dropwidget-note svg {
  width: 13px;
  height: 13px;
}
.handoff-menu {
  display: none;
  text-align: left;
}
.handoff-menu.open {
  display: block;
}
.handoff-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
  margin-bottom: 12px;
  font-size: 0.83rem;
  font-weight: 500;
  overflow: hidden;
}
.handoff-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.handoff-options {
  display: grid;
  gap: 6px;
}
.handoff-options a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 550;
  transition: border-color 0.15s, background 0.15s;
}
.handoff-options a:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.handoff-options a svg {
  width: 17px;
  height: 17px;
  color: var(--brand);
  flex: none;
}
.handoff-options a small {
  margin-left: auto;
  font-weight: 500;
  color: var(--faint);
  font-size: 0.75rem;
}

/* trust strip */
.trustbar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.trustbar .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 16px;
}
.trustbar p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.trust-items {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.trust-items span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--ink-2);
}
.trust-items svg {
  width: 15px;
  height: 15px;
  color: var(--ok);
}

/* ------------------------------------------------------------- sections */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 46ch;
  font-size: 0.95rem;
}
.section-head .h2 {
  margin-bottom: 6px;
}

/* ----------------------------------------------------------- tool cards */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px;
}
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s var(--ease);
  min-height: 168px;
}
.tool-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card:focus-visible {
  outline-offset: 4px;
}
.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-line);
  flex: none;
}
.tool-icon svg {
  width: 21px;
  height: 21px;
}
.tool-card .arrow {
  color: var(--faint);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity 0.18s, transform 0.18s, color 0.18s;
}
.tool-card:hover .arrow {
  opacity: 1;
  transform: none;
  color: var(--brand);
}
.tool-card h3 {
  font-size: 1.03rem;
  margin: 0;
  letter-spacing: -0.022em;
}
.tool-card p {
  margin: 0;
  font-size: 0.855rem;
  line-height: 1.5;
  color: var(--muted);
}
.tool-card .tool-meta {
  margin-top: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--canvas-2);
  border-radius: 5px;
  padding: 3px 7px;
}
.tag-hot {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.tag-new {
  background: var(--ok-soft);
  color: #0a5c3b;
}

/* feature/value cards */
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.value-card {
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--paper);
  border: 1px solid var(--line);
}
.value-card .tool-icon {
  margin-bottom: 16px;
}
.value-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.value-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 26px;
  counter-reset: step;
}
.step {
  position: relative;
  padding-top: 46px;
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 2rem;
  line-height: 1;
  color: var(--brand);
}
.step h3 {
  font-size: 1.02rem;
  margin-bottom: 5px;
}
.step p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* big CTA band */
.cta-band {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.cta-band::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -100px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(200 16 46 / 0.55), transparent 65%);
  pointer-events: none;
}
.cta-band h2 {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 8px;
}
.cta-band p {
  margin: 0;
  color: #c3cad5;
  max-width: 46ch;
}
.cta-band .btn-primary {
  background: #fff;
  color: var(--ink);
}
.cta-band .btn-primary:hover {
  background: #f1f2f4;
}

/* ------------------------------------------------------------- tool page */
.tool-head {
  padding: 34px 0 30px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.breadcrumb a:hover {
  color: var(--ink);
}
.breadcrumb svg {
  width: 12px;
  height: 12px;
  color: var(--faint);
}
.tool-head h1 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  letter-spacing: -0.04em;
  margin: 0 0 10px;
}
.tool-head p {
  margin: 0;
  color: var(--ink-2);
  max-width: 62ch;
}
.tool-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* workspace */
.workspace {
  padding: 34px 0 56px;
}
.workspace-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 26px;
}
.workspace-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--muted);
}
.workspace-foot svg {
  width: 14px;
  height: 14px;
  color: var(--ok);
}

/* dropzone */
.dropzone {
  display: block;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  background: var(--canvas);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropzone .dropwidget-icon {
  margin-bottom: 12px;
}
.dropzone strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 3px;
}
.dropzone span {
  font-size: 0.82rem;
  color: var(--muted);
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 0.875rem;
}
.file-row .thumb {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--canvas-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: none;
  overflow: hidden;
}
.file-row .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.file-row .fname {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.file-row .fsize {
  color: var(--faint);
  font-size: 0.76rem;
  flex: none;
}
.file-row .grow {
  flex: 1;
  min-width: 0;
}
.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: none;
}
.icon-btn:hover {
  background: var(--canvas-2);
  color: var(--ink);
}
.icon-btn svg {
  width: 15px;
  height: 15px;
}

/* options/forms */
.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > label,
.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
}
.field .hint {
  font-size: 0.75rem;
  color: var(--faint);
}
.input,
.select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  font-size: 0.9rem;
  min-width: 0;
}
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.input[type="range"] {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--brand);
}
.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.range-row .input {
  flex: 1;
}
.range-row output {
  min-width: 44px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--canvas-2);
  border-radius: 9px;
  gap: 2px;
  flex-wrap: wrap;
}
.segmented label {
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--ink-2);
  cursor: pointer;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented input:checked + span {
  color: var(--ink);
}
.segmented label:has(input:checked) {
  background: var(--paper);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

/* action bar */
.action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.action-bar .btn {
  min-width: 200px;
}
.action-note {
  font-size: 0.78rem;
  color: var(--faint);
  margin-left: auto;
}

/* progress */
.progress {
  height: 8px;
  background: var(--canvas-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 18px;
}
.progress > div {
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.25s var(--ease);
}

/* result panel */
.result {
  display: none;
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid #c8e9d8;
  background: var(--ok-soft);
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.result.show {
  display: flex;
  animation: fadeUp 0.3s var(--ease);
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.result-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.result-icon svg {
  width: 20px;
  height: 20px;
}
.result-body {
  flex: 1;
  min-width: 200px;
}
.result-body strong {
  display: block;
  color: #0a5c3b;
  font-size: 0.95rem;
}
.result-body span {
  font-size: 0.82rem;
  color: #207a56;
}
.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  background: var(--canvas);
  border: 1px solid var(--line);
  color: var(--ink-2);
  margin-top: 16px;
}
.notice svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  color: var(--muted);
}
.notice-warn {
  background: var(--warn-soft);
  border-color: #f5dfb0;
  color: #7a4a06;
}
.notice-warn svg {
  color: var(--warn);
}
.notice-danger {
  background: #fff2f0;
  border-color: #ffd5cf;
  color: #93261b;
}
.notice-danger svg {
  color: var(--danger);
}

/* page thumbnails (organizer) */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.page-thumb {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper);
  cursor: grab;
}
.page-thumb img {
  width: 100%;
  display: block;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: #fff;
}
.page-thumb .pnum {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgb(13 17 23 / 0.78);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.page-thumb .pdel {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgb(255 255 255 / 0.92);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-xs);
}
.page-thumb .pdel:hover {
  background: var(--brand);
  color: #fff;
}
.page-thumb.dragging {
  opacity: 0.4;
}
.page-thumb.drop-target {
  outline: 2px dashed var(--brand);
  outline-offset: -3px;
}

/* rotate / delete page tools */.page-thumb.is-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.page-thumb.is-clickable:hover {
  border-color: #c3c8d2;
}
.page-thumb.is-clickable:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.page-thumb .pthumb-img {
  transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
  transform-origin: center;
}
.page-thumb .pflag {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgb(255 255 255 / 0.94);
  box-shadow: var(--shadow-xs);
}
.page-thumb .pflag:empty {
  display: none;
}
.page-thumb.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgb(200 16 46 / 0.16);
}
.page-thumb.is-selected .pflag {
  background: var(--brand);
  color: #fff;
}
.page-thumb.is-removed {
  border-color: #ffd5cf;
}
.page-thumb.is-removed .pthumb-img {
  opacity: 0.32;
  filter: grayscale(1);
}
.page-thumb.is-removed .pflag {
  background: var(--danger);
  color: #fff;
}
.page-thumb.is-removed::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top right,
    transparent calc(50% - 1px),
    rgb(147 38 27 / 0.5) calc(50% - 1px),
    rgb(147 38 27 / 0.5) calc(50% + 1px),
    transparent calc(50% + 1px)
  );
}

/* page preview with an overlay (watermark, page numbers) */
.doc-preview {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 18px 0 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  line-height: 0;
  box-shadow: var(--shadow-xs);
}
.doc-preview img {
  display: block;
  max-width: 100%;
  height: auto;
}
.doc-preview .overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.doc-preview .wm-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-38deg);
  transform-origin: center;
  white-space: nowrap;
  font-weight: 700;
  font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0.01em;
}
.doc-preview .wm-text.is-straight {
  transform: translate(-50%, -50%);
}
.doc-preview .pnum-mark {
  position: absolute;
  font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #3b414c;
  white-space: nowrap;
}

/* extracted text preview */.result-inline {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas-2);
}
.result-inline .text-out {
  margin: 10px 0 0;
  padding: 12px 14px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-2);
}

/* invoice generator */
.inv-lines .row-head,
.inv-lines .row-line {
  grid-template-columns: minmax(0, 1fr) 64px 92px 92px 34px;
}
.inv-lines .row-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--ink-2);
  padding-right: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-lines .icon-btn[hidden] {
  display: none;
}
.inv-summary {
  width: min(340px, 100%);
  margin: 16px 0 0 auto;
  display: grid;
  gap: 8px;
}
.inv-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.inv-summary strong {
  font-variant-numeric: tabular-nums;
}
.inv-summary .total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line-strong);
  font-weight: 700;
  color: var(--ink);
  font-size: 1.02rem;
}

/* signature pad */.sig-pad {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  touch-action: none;
  cursor: crosshair;
}
.sig-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.doc-preview .sig-ghost {
  position: absolute;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
  filter: drop-shadow(0 1px 1px rgb(13 17 23 / 0.12));
}
.doc-preview .sig-ghost:active {
  cursor: grabbing;
}

/* --------------------------------------------------------- grid mapper */
.gm-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0 14px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
}
.gm-pages {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  background: var(--paper);
}
.gm-pages button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.gm-pages button:hover {
  background: var(--canvas-2);
}
.gm-pages span {
  font-size: 0.8rem;
  font-weight: 550;
  padding: 0 6px;
  min-width: 104px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.gm-stage {
  position: relative;
  margin: 0 auto 4px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
  touch-action: none;
}
.gm-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
.gm-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
.gm-overlay line {
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}
.gm-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 8px 0 0;
}
.gm-hint kbd {
  font-family: inherit;
  font-size: 0.72rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 4px;
  color: var(--ink-2);
}
.gm-region-tag {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  pointer-events: none;
}
.gm-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 22px;
  align-items: start;
}
.gm-preview {
  margin-top: 16px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.gm-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  white-space: nowrap;
}
.gm-preview td {
  padding: 4px 7px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gm-preview tr:first-child td {
  background: var(--canvas);
  font-weight: 600;
  position: sticky;
  top: 0;
}
.gm-empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------------------------------------------------------- row editor */
.rows-editor {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.rows-editor .row-head,
.rows-editor .row-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 96px 40px;
  gap: 1px;
  align-items: center;
  background: var(--line);
}
.rows-editor .row-head > *,
.rows-editor .row-line > * {
  background: var(--paper);
  padding: 8px 10px;
  min-width: 0;
}
.rows-editor .row-head > * {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--canvas);
}
.rows-editor input {
  border: 0;
  background: transparent;
  width: 100%;
  font-size: 0.85rem;
  padding: 3px 0;
}
.rows-editor input:focus {
  outline: none;
  background: var(--brand-soft);
}
.rows-editor .row-line + .row-line {
  border-top: 1px solid var(--line);
}
.rows-editor .totals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 96px 40px;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line-strong);
}
.rows-editor .totals > * {
  background: var(--canvas);
  padding: 10px;
  font-weight: 600;
  font-size: 0.85rem;
}
.rows-editor .totals .label {
  text-align: right;
}

/* ----------------------------------------------------------- presenter */
.present-stage {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--canvas);
  overflow: hidden;
}
.present-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.present-bar .grow {
  flex: 1;
  min-width: 90px;
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.present-body {
  height: 60vh;
  min-height: 340px;
  overflow: auto;
  background: #fff;
  padding: 34px 40px;
  scroll-behavior: smooth;
}
.present-body.slide-mode {
  padding: 0;
  display: grid;
  place-items: center;
  background: #14181e;
}
.slide {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  background: #fff;
  border-radius: 10px;
  padding: 6% 7%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / 0.6);
  overflow: auto;
}
.slide h2 {
  font-size: clamp(1.2rem, 3.4vw, 2.3rem);
  margin: 0;
  letter-spacing: -0.03em;
}
.slide p,
.slide li {
  font-size: clamp(0.85rem, 1.6vw, 1.15rem);
  margin: 0;
  color: var(--ink-2);
}
.doc-view {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.7;
}
.doc-view h1 {
  font-size: 1.9rem;
}
.doc-view h2 {
  font-size: 1.35rem;
  margin-top: 1.6em;
}
.doc-view img {
  margin: 1em auto;
  border-radius: 8px;
}
.doc-view table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.doc-view td,
.doc-view th {
  border: 1px solid var(--line);
  padding: 7px 9px;
}
.presenter:fullscreen {
  background: #0b0e13;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.presenter:fullscreen .present-bar {
  background: #151a21;
  border-color: #232b35;
  color: #dfe4ea;
}
.presenter:fullscreen .present-bar .grow {
  color: #98a2b3;
}
.presenter:fullscreen .present-body {
  flex: 1;
  height: auto;
}

/* -------------------------------------------------------- image editor */
.ie-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
  align-items: start;
}
.ie-stage {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background:
    repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 50% / 18px 18px;
  overflow: hidden;
  min-height: 260px;
  display: grid;
  place-items: center;
  touch-action: none;
}
.ie-stage canvas {
  max-width: 100%;
  display: block;
}
.ie-tools {
  display: grid;
  gap: 6px;
}
.ie-tool {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.855rem;
  font-weight: 550;
  text-align: left;
  color: var(--ink-2);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ie-tool svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: none;
}
.ie-tool:hover {
  border-color: var(--line-strong);
  background: var(--canvas);
}
.ie-tool.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--ink);
}
.ie-tool.active svg {
  color: var(--brand);
}
.ie-group {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 10px 0 2px;
}
.ie-group:first-child {
  margin-top: 0;
}

@media (max-width: 940px) {
  .gm-split,
  .ie-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .present-body {
    padding: 22px 18px;
  }
}
.prose {
  font-size: 1rem;
  color: var(--ink-2);
  max-width: 72ch;
}
.prose h2 {
  font-size: 1.5rem;
  margin: 2.2em 0 0.6em;
  color: var(--ink);
}
.prose h3 {
  font-size: 1.15rem;
  margin: 1.8em 0 0.5em;
  color: var(--ink);
}
.prose p,
.prose li {
  line-height: 1.7;
}
.prose ul,
.prose ol {
  padding-left: 1.25em;
}
.prose strong {
  color: var(--ink);
  font-weight: 600;
}
.prose a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose blockquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--brand);
  background: var(--canvas);
  border-radius: 0 10px 10px 0;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--canvas-2);
  padding: 2px 5px;
  border-radius: 4px;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 0.9rem;
}
.prose th,
.prose td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prose th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--canvas);
  border-bottom-color: var(--line-strong);
}
.prose tr:last-child td {
  border-bottom: 0;
}
.table-scroll {
  overflow-x: auto;
  margin: 1.4em 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.table-scroll table {
  margin: 0;
  min-width: 520px;
}
.prose .notice {
  margin: 1.6em 0;
  font-size: 0.92rem;
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 64px;
  align-items: start;
}
.side-card {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--canvas);
}
.side-card h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-bottom: 12px;
}
.side-links {
  display: grid;
  gap: 2px;
}
.side-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
}
.side-links a:hover {
  background: var(--paper);
  color: var(--ink);
}
.side-links a span {
  color: var(--faint);
  font-size: 0.78rem;
}
.side-links a svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--faint);
}

/* FAQ */
.faq {
  border-top: 1px solid var(--line);
}
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 2px;
  font-weight: 550;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--muted);
  flex: none;
  transition: transform 0.2s var(--ease);
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq details p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 78ch;
}

/* guides */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.guide-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.guide-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.guide-card .kicker {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}
.guide-card h3 {
  font-size: 1.02rem;
  margin: 0 0 8px;
}
.guide-card p {
  margin: 0 0 14px;
  font-size: 0.855rem;
  color: var(--muted);
}
.guide-card .meta {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--faint);
}

/* ---------------------------------------------------------------- footer */
.site-footer {
  background: var(--ink);
  color: #a3adba;
  padding: 60px 0 30px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #ffffff14;
}
.site-footer .brand {
  color: #fff;
  margin-bottom: 14px;
}
.site-footer .brand .word span {
  color: #ff6b81;
}
.site-footer p {
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 34ch;
}
.footer-col h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6f7a88;
  margin-bottom: 14px;
  font-weight: 600;
}
.footer-col a {
  display: block;
  padding: 5px 0;
  font-size: 0.85rem;
  color: #a3adba;
}
.footer-col a:hover {
  color: #fff;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  font-size: 0.78rem;
}
.footer-bottom nav {
  display: flex;
  gap: 18px;
}
.footer-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.footer-badges .chip {
  background: #ffffff0d;
  border-color: #ffffff1a;
  color: #a3adba;
  font-size: 0.72rem;
}
.footer-badges .chip svg {
  color: #4ade80;
}

/* --------------------------------------------------------------- search */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  padding: 12vh 16px 16px;
  background: rgb(9 13 18 / 0.55);
  backdrop-filter: blur(3px);
}
.search-modal.open {
  display: block;
}
.search-panel {
  width: min(620px, 100%);
  margin: 0 auto;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fadeUp 0.2s var(--ease);
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.search-field svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: none;
}
.search-field input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 1rem;
  background: none;
}
.search-field kbd {
  font-size: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--faint);
}
.search-results {
  max-height: 52vh;
  overflow: auto;
  padding: 8px;
}
.search-results a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 9px;
  font-size: 0.9rem;
}
.search-results a:hover,
.search-results a.active {
  background: var(--canvas);
}
.search-results svg {
  width: 17px;
  height: 17px;
  color: var(--brand);
  flex: none;
}
.search-results small {
  margin-left: auto;
  color: var(--faint);
  font-size: 0.75rem;
  flex: none;
}
.search-hit {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.search-hit strong {
  font-weight: 600;
  color: var(--ink);
}
.search-hit em {
  font-style: normal;
  font-size: 0.76rem;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (max-width: 560px) {
  .search-results small {
    display: none;
  }
}
.search-empty {
  padding: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.search-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
}

/* --------------------------------------------------------------- toasts */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.25s var(--ease);
}
.toast.err {
  background: #7a1a12;
}
.toast svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
}
.toast .close {
  margin-left: auto;
  color: #ffffff99;
  flex: none;
}

/* -------------------------------------------------------------- spinner */
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgb(255 255 255 / 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
.btn-ghost .spinner,
.btn-quiet .spinner {
  border-color: var(--line-strong);
  border-top-color: var(--ink);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------- utilities */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 16px; }
.center { text-align: center; }
.flex { display: flex; }
.wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.hide { display: none !important; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }
  .hero-copy .display {
    max-width: 16ch;
  }
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .side-card {
    position: static;
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
  }
  .mega {
    grid-template-columns: 1fr 1fr;
  }
  .mega-promo {
    display: none;
  }
}
@media (max-width: 860px) {
  :root {
    --gutter: 20px;
  }
  .main-nav {
    display: none;
  }
  .search-btn kbd {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
  }
  .header-actions .nav-cta {
    display: none;
  }
  .section {
    padding: 56px 0;
  }
  .hero {
    padding: 46px 0 48px;
  }
  .workspace-card {
    padding: 18px;
  }
  .cta-band {
    padding: 34px;
  }
  .display {
    letter-spacing: -0.035em;
  }
}
@media (max-width: 620px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .tool-card {
    padding: 16px;
    min-height: 150px;
    border-radius: 14px;
  }
  .tool-card p {
    display: none;
  }
  .tool-card h3 {
    font-size: 0.92rem;
  }
  .tool-icon {
    width: 36px;
    height: 36px;
  }
  .tool-icon svg {
    width: 18px;
    height: 18px;
  }
  .action-bar .btn {
    width: 100%;
    min-width: 0;
  }
  .action-note {
    margin-left: 0;
  }
  .dropwidget-inner {
    padding: 24px 16px;
  }
  .workspace-card {
    padding: 14px;
    border-radius: 16px;
  }
  .dropzone {
    padding: 28px 16px;
  }
  .thumb-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  }
  .search-btn span {
    display: none;
  }
  .search-btn {
    width: 36px;
    justify-content: center;
    padding: 0;
  }
}

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

/* print */
@media print {
  .site-header,
  .site-footer,
  .btn,
  .search-modal,
  .toasts {
    display: none !important;
  }
}

/* ------------------------------------------------------------- feedback */
.linklike {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.linklike:hover {
  color: var(--brand);
}
.feedback-panel {
  width: min(560px, 100%);
}
.feedback-body {
  padding: 18px;
  display: grid;
  gap: 10px;
}
.feedback-body .field-label {
  display: block;
  margin-bottom: 4px;
}
.feedback-body textarea {
  resize: vertical;
  min-height: 120px;
}
.feedback-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.feedback-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.feedback-ok {
  color: #15803d;
}
.feedback-error {
  color: var(--danger);
}
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* feedback inbox on the dashboard */
.feedback-list {
  display: grid;
  gap: 10px;
}
.feedback-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--paper);
}
.feedback-item.is-done {
  opacity: 0.6;
}
.feedback-item header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.feedback-item .fb-who {
  font-weight: 600;
}
.feedback-item .fb-meta {
  margin-left: auto;
  color: var(--faint);
  font-size: 0.77rem;
}
.feedback-item p {
  margin: 8px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.feedback-item .fb-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.fb-tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-line);
}
.feedback-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 6px 0;
}
@media (max-width: 520px) {
  .feedback-row {
    grid-template-columns: 1fr;
  }
}
