/* Salamailer — light, notarial, precise. Geist Sans/Mono self-hosted (CSP: font-src 'self'). */

@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-inset: #f5f5f5;
  --border: #ebebeb;
  --border-strong: #dcdcdc;
  --text: #0a0a0a;
  --text-2: #454545;
  --muted: #6b6b6b;
  --faint: #9b9b9b;
  --ink: #0a0a0a;
  --accent: #0d6b52;         /* pine — verification, the lock, "sent" */
  --accent-soft: #e7f2ee;
  --info: #0068d6;           /* opened */
  --info-soft: #e8f1fc;
  --warn: #a35200;
  --warn-soft: #fbf0e4;
  --danger: #cb2a2f;
  --danger-soft: #fbeaea;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Geist", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: text-decoration-color .15s; }
a:hover { text-decoration-color: var(--text); }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1rem; letter-spacing: -0.01em; }

::selection { background: var(--accent-soft); }

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

.container { max-width: 1064px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 480px; }
/* account & subscription: settings-density pages — wider than a single form so
   two-up input rows and long placeholders don't truncate, tighter than the
   marketing width so lines stay readable. */
.acct { max-width: 760px; }

/* ── header ─────────────────────────────────────────────── */
header.site {
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
header.site .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .95rem; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none;
}
.brand .lock { display: inline-flex; color: var(--accent); }
.brand .lock svg { display: block; }
.brand .lock img { display: block; width: 22px; height: 22px; }
.foot-logo { vertical-align: -3px; margin-right: 7px; opacity: .8; }
.receipt-mark { vertical-align: -2px; margin-right: 7px; opacity: .85; }
nav.top { display: flex; align-items: center; gap: 4px; }
nav.top a {
  color: var(--muted); font-size: .875rem; text-decoration: none;
  padding: 6px 10px; border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
nav.top a:hover { color: var(--text); background: var(--bg-inset); }
nav.top a.cta {
  color: #fff; background: var(--ink); font-weight: 500;
  padding: 6px 14px; margin-left: 6px;
}
nav.top a.cta:hover { background: #383838; color: #fff; }

/* Hamburger toggle — hidden on desktop, shown at ≤640px (see media query) */
.nav-btn {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin: -8px -9px -8px 0;
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text);
}
.nav-btn:hover { background: var(--bg-inset); }
.nav-btn span, .nav-btn span::before, .nav-btn span::after {
  content: ""; display: block; width: 19px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .2s ease, opacity .15s ease;
}
.nav-btn span { position: relative; }
.nav-btn span::before { position: absolute; left: 0; top: -6px; }
.nav-btn span::after { position: absolute; left: 0; top: 6px; }
.nav-toggle:checked ~ .nav-btn span { background: transparent; }
.nav-toggle:checked ~ .nav-btn span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle:checked ~ .nav-btn span::after { transform: translateY(-6px) rotate(-45deg); }

/* ── landing ────────────────────────────────────────────── */
.hero { display: flex; align-items: center; gap: 56px; padding: 104px 0 88px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0 -80px;
  background:
    radial-gradient(ellipse 40% 55% at 74% 48%, rgba(13,107,82,.09), transparent 70%),
    linear-gradient(to right, var(--border-strong) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-strong) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 62% 72% at 66% 46%, #000 18%, transparent 60%);
  mask-image: radial-gradient(ellipse 62% 72% at 66% 46%, #000 18%, transparent 60%);
  opacity: .75; pointer-events: none;
}
.hero > * { position: relative; }
.hero > div:first-child { flex: 1 1 30rem; min-width: 0; }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem); letter-spacing: -0.04em; margin: 0 0 20px;
  text-wrap: balance; line-height: 1.06;
  background: linear-gradient(180deg, var(--text) 55%, #4d4d4d);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.hero .lede { font-size: 1.06rem; color: var(--muted); max-width: 34rem; margin: 0 0 32px; text-wrap: pretty; }
.hero .lede strong { color: var(--text-2); font-weight: 500; }
.eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 22px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* the signature: a delivery receipt, arriving live */
.receipt {
  flex: 0 1 25rem; min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow:
    0 1px 1px rgba(0,0,0,.03),
    0 12px 32px rgba(0,0,0,.07),
    0 24px 80px rgba(13,107,82,.10);
  font-family: var(--mono); font-size: .78rem;
  overflow: hidden;
}
.receipt-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--muted); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
}
.receipt-head .ok {
  color: var(--accent); display: inline-flex; align-items: center; gap: 6px;
  animation: receipt-pop .45s cubic-bezier(.2,1.4,.4,1) 3.4s both;
}
.receipt-body { padding: 6px 0; }
.receipt-row {
  display: flex; gap: 14px; padding: 8px 16px; align-items: baseline;
  animation: receipt-in .5s cubic-bezier(.2,.8,.3,1) both;
}
.receipt-row:nth-child(1) { animation-delay: .5s; }
.receipt-row:nth-child(2) { animation-delay: 1.1s; }
.receipt-row:nth-child(3) { animation-delay: 1.7s; }
.receipt-row:nth-child(4) { animation-delay: 2.4s; }
.receipt-row:nth-child(5) { animation-delay: 3.0s; }
.receipt-row .t { color: var(--faint); flex: 0 0 auto; }
.receipt-row .e { color: var(--text-2); min-width: 0; }
.receipt-row .e b { color: var(--text); font-weight: 600; }
.receipt-row.verified .e { color: var(--accent); }
.receipt-foot {
  padding: 10px 16px; border-top: 1px dashed var(--border-strong);
  color: var(--faint); font-size: .7rem;
  animation: receipt-in .5s ease 3.6s both;
}
@keyframes receipt-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes receipt-pop {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: none; }
}

.section-label {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 14px;
}

/* how it works — a real sequence */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 12px 0 64px; }
.step { padding: 24px; background: var(--bg); }
.step + .step { border-left: 1px solid var(--border); }
.step .n { font-family: var(--mono); font-size: .72rem; color: var(--accent); margin-bottom: 10px; }
.step h3 { margin: 0 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: .875rem; }

/* features — bordered grid, Vercel-style */
.features {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin: 12px 0 64px;
}
.card { background: var(--bg); padding: 26px; }
.card .glyph { color: var(--accent); margin-bottom: 14px; display: inline-flex; }
.card h3 { margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: .875rem; }

/* honest limits strip */
.honest {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-subtle); padding: 28px; margin: 12px 0 72px;
}
.honest h3 { margin: 0 0 8px; }
.honest p { color: var(--muted); font-size: .9rem; margin: 0 0 8px; max-width: 46rem; }
.honest p:last-child { margin-bottom: 0; }

/* faq — native <details>, zero-JS accordion */
.faq { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 12px 0 72px; }
.faq details { background: var(--bg); }
.faq details + details { border-top: 1px solid var(--border); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 24px;
  font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--mono); color: var(--accent);
  font-size: 1.1rem; line-height: 1; flex: 0 0 auto;
}
.faq details[open] summary::after { content: "\2013"; }
.faq .answer { padding: 0 24px 22px; }
.faq .answer p { margin: 0 0 10px; color: var(--muted); font-size: .9rem; max-width: 46rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ── buttons ────────────────────────────────────────────── */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  border-radius: var(--radius-sm); padding: 9px 16px;
  font-size: .875rem; font-weight: 500; font-family: inherit; line-height: 1.45;
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
button:hover, .btn:hover { background: #383838; border-color: #383838; color: #fff; text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost, .btn.ghost { background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); }
button.ghost:hover, .btn.ghost:hover { background: var(--bg-inset); border-color: var(--border-strong); color: var(--text); }
button.danger { background: var(--bg); color: var(--danger); border: 1px solid var(--border-strong); }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
button.small, .btn.small { padding: 4px 10px; font-size: .8rem; border-radius: 5px; }

/* ── forms ──────────────────────────────────────────────── */
.panel {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 28px; margin: 28px 0;
  box-shadow: var(--shadow-sm);
}
.panel h2 { margin: 0 0 6px; }
.panel .sub { color: var(--muted); margin: 0 0 22px; font-size: .9rem; }
.panel > h3:first-child { margin-top: 0; }
.panel .panel { background: var(--bg); overflow-x: auto; box-shadow: none; margin: 20px 0 0; }
.table-panel { padding: 0; overflow-x: auto; }

/* CSP forbids inline style attributes (style-src 'self'), so layout tweaks
   live here as utilities and [hidden] is the only display toggle. */
[hidden] { display: none !important; }
.fit { flex: 0 0 auto; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.ml-8 { margin-left: 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  background: var(--accent-soft); border: 1px solid rgba(13,107,82,.22);
  border-radius: var(--radius); padding: 12px 16px; margin: 20px 0;
  font-size: .875rem; color: var(--text-2); line-height: 1.5;
}
.notice > span { flex: 1 1 16rem; }
.notice button { flex: 0 0 auto; }
td.empty-cell { padding: 22px 20px; }
td button + button { margin-left: 4px; }

label { display: block; font-size: .8rem; color: var(--text-2); margin: 18px 0 6px; font-weight: 500; }
input, textarea, select {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: .9rem; font-family: inherit; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
/* Checkboxes/radios must not inherit the full-width text-input sizing above. */
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 130px; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 34px;
}
input[type="file"] { padding: 8px; color: var(--muted); font-size: .85rem; }
input[type="file"]::file-selector-button {
  font-family: inherit; font-size: .8rem; font-weight: 500;
  color: var(--text); background: var(--bg-inset);
  border: 1px solid var(--border-strong); border-radius: 5px;
  padding: 4px 10px; margin-right: 10px; cursor: pointer;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

.hint { font-size: .8rem; color: var(--muted); margin-top: 7px; line-height: 1.55; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; }
.checkbox input { width: 15px; height: 15px; margin-top: 3px; accent-color: var(--accent); flex: 0 0 auto; }
.checkbox label { margin: 0; color: var(--text-2); font-weight: 400; font-size: .85rem; line-height: 1.55; }

/* ── dashboard chrome ───────────────────────────────────── */
/* app pages sit on a soft canvas with faint grain; cards float on top */
body.dash {
  background-color: var(--bg-subtle);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.022'/%3E%3C/svg%3E");
}
body.dash .panel {
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.03);
}
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 40px 0 4px;
}
.page-head h2 { margin: 0; font-size: 1.5rem; letter-spacing: -0.025em; }
.page-sub { font-size: .8rem; color: var(--muted); margin: 2px 0 0; }
.page-sub:empty { display: none; }

/* ── tables ─────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--bg-subtle); }
th {
  color: var(--faint); font-weight: 500;
  font-family: var(--mono); font-size: .68rem;
  text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td.small, td .small { font-size: .8rem; }

/* recipient identity: initial glyph + address */
.recip { display: flex; align-items: center; gap: 10px; }
.recip .avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
}

/* row actions: quiet until the row is engaged */
td button.small {
  background: transparent; border-color: transparent; color: var(--muted);
  transition: background .15s, color .15s, opacity .15s;
}
td button.small:hover { background: var(--bg-inset); color: var(--text); }
td button.danger.small { color: var(--muted); }
td button.danger.small:hover { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
@media (hover: hover) {
  tbody td button.small { opacity: 0; }
  tbody tr:hover td button.small,
  tbody tr:focus-within td button.small { opacity: 1; }
}

/* status: dot + mono label */
.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .02em;
  color: var(--muted); line-height: 1.5;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.status.sent { color: var(--accent); } .status.sent::before { background: var(--accent); }
.status.opened { color: var(--info); } .status.opened::before { background: var(--info); }
.status.draft { color: var(--warn); } .status.draft::before { background: var(--warn); }
.status.expired, .status.revoked { color: var(--faint); }

.mono { font-family: var(--mono); font-size: .8rem; word-break: break-all; }
.codebox {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-family: var(--mono); font-size: .78rem; line-height: 1.6;
  word-break: break-all; white-space: pre-wrap; color: var(--text-2); margin: 8px 0;
}

/* ── plan comparison (/subscription) ────────────────────── */
.compare-wrap { overflow-x: auto; margin: 4px 0 8px; }
table.compare { min-width: 620px; border-collapse: collapse; }
table.compare th, table.compare td {
  text-align: left; vertical-align: top;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
table.compare thead th {
  font-family: var(--sans); text-transform: none; letter-spacing: -0.01em;
  font-size: 1rem; font-weight: 600; color: var(--text); white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}
table.compare thead th .price {
  display: block; font-family: var(--mono); font-size: .78rem;
  color: var(--muted); font-weight: 400; margin-top: 3px;
}
table.compare tbody th {
  font-family: var(--sans); text-transform: none; letter-spacing: normal;
  font-size: .84rem; font-weight: 500; color: var(--text-2);
  white-space: normal; border-right: 1px solid var(--border);
}
table.compare tbody td { font-size: .88rem; color: var(--text); }
table.compare .current { background: var(--accent-soft); }
table.compare thead th.current { border-bottom-color: var(--accent); }
table.compare .tier-cta td, table.compare .tier-cta th { border-bottom: none; padding-top: 14px; }
table.compare .tier-cta button, table.compare .tier-cta .btn { width: 100%; }
.tier-badge {
  display: inline-block; font-family: var(--mono); font-size: .6rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 5px; padding: 1px 6px;
  margin-top: 5px; vertical-align: middle;
}
/* ── segmented interval toggle (pricing + subscription) ─────── */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 9px; padding: 3px; gap: 3px; background: var(--bg-inset); }
.seg button { background: transparent; border: none; color: var(--text-2); font-family: var(--sans); font-size: .86rem; font-weight: 500; padding: 7px 15px; border-radius: 6px; box-shadow: none; }
.seg button:hover { background: var(--bg); color: var(--text); border: none; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.07); }
.seg button .save { color: var(--accent); font-family: var(--mono); font-size: .72rem; margin-left: 7px; }
.price-note { display: block; font-family: var(--mono); font-size: .72rem; color: var(--faint); font-weight: 400; margin-top: 3px; }
.save-pill { display: inline-block; font-family: var(--mono); font-size: .72rem; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 1px 7px; margin-left: 8px; vertical-align: middle; }
.hero.tight { padding-bottom: 40px; }
.split { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.split h2 { margin: 0; }
.hero-actions.actions-center { justify-content: center; }

.plan-summary { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 4px 0 2px; }
.plan-summary .metric .k { font-size: .72rem; color: var(--faint); font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.plan-summary .metric .v { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }

/* ── read page states ───────────────────────────────────── */
.state { text-align: center; padding: 44px 0; }
.state .icon { font-size: 2.2rem; margin-bottom: 12px; color: var(--faint); }
.state h2 { margin: 0 0 6px; }
.msg-body {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px;
  white-space: pre-wrap; word-break: break-word; margin: 18px 0;
  font-size: .95rem;
}
.attach {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; margin: 8px 0;
  font-size: .875rem;
  transition: border-color .15s;
}
.attach:hover { border-color: var(--border-strong); }

/* ── modal / overlay ────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,10,10,.42);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px; overflow-y: auto;
}
.modal {
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow-md);
  width: 100%; max-width: 560px; padding: 24px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.modal-head h3 { margin: 0; font-size: 1.1rem; }
.modal-close {
  background: transparent; border: none; color: var(--muted);
  font-size: 1.4rem; line-height: 1; padding: 2px 8px; border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--bg-inset); border-color: transparent; color: var(--text); }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.faint { color: var(--faint); }

/* two side-by-side fields (date ranges etc.); stacks on narrow screens */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }

/* receipt viewer */
.rcpt-grid { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: .88rem; margin: 8px 0 16px; }
.rcpt-grid dt {
  color: var(--faint); font-family: var(--mono); font-size: .68rem;
  text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; white-space: nowrap;
}
.rcpt-grid dd { margin: 0; color: var(--text); }
.rcpt-timeline { list-style: none; padding: 0; margin: 8px 0 0; border-top: 1px solid var(--border); }
.rcpt-timeline li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: .84rem; }
.rcpt-timeline .ev { font-weight: 500; color: var(--text); }
.rcpt-timeline .ts { color: var(--muted); font-family: var(--mono); font-size: .78rem; white-space: nowrap; }

/* ── toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 12px); opacity: 0;
  background: var(--bg); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 11px 16px;
  font-size: .875rem; box-shadow: var(--shadow-md);
  transition: opacity .2s, transform .2s; z-index: 100; max-width: 90vw;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { border-color: var(--danger); color: var(--danger); }
.toast-success { border-color: var(--accent); color: var(--accent); }

/* ── docs (/agents) ─────────────────────────────────────── */
.doc { max-width: 800px; }
.doc-hero { padding: 76px 0 16px; }
.doc-hero h1 { font-size: clamp(1.9rem, 3.8vw, 2.6rem); letter-spacing: -0.035em; margin: 0 0 16px; text-wrap: balance; }
.doc-hero .lede { color: var(--muted); font-size: 1.02rem; max-width: 40rem; margin: 0; text-wrap: pretty; }
.doc-hero .lede strong { color: var(--text-2); font-weight: 500; }
.doc section { margin: 60px 0; }
.doc section > h2 { font-size: 1.25rem; margin: 8px 0 10px; }
.doc section > p { color: var(--muted); font-size: .92rem; max-width: 42rem; }
.doc section > p strong { color: var(--text-2); font-weight: 550; }

/* terminal block — dark, pine-tinted, the one dark surface on the site */
.term {
  background: #101613; border: 1px solid #222e28; border-radius: 10px;
  font-family: var(--mono); font-size: .8rem; line-height: 1.75;
  margin: 18px 0; overflow: hidden;
}
.term-head {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 16px; border-bottom: 1px solid #1c2622;
  color: #5f7169; font-size: .66rem; letter-spacing: .09em; text-transform: uppercase;
}
.term pre { margin: 0; padding: 14px 18px; overflow-x: auto; color: #d7e3dd; }
.term .p { color: #3fd0aa; }
.term .c { color: #5f7169; }
.term .f { color: #9db4ab; }

/* MCP tool chips */
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tools code {
  font-family: var(--mono); font-size: .74rem;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; color: var(--text-2);
}

/* in running docs text, mono terms wrap at spaces, never mid-flag */
.doc .mono { word-break: normal; }

/* command reference */
.cmds td:first-child { font-family: var(--mono); font-size: .78rem; color: var(--text); white-space: nowrap; }
.cmds td { vertical-align: top; }
.cmds td:last-child { color: var(--muted); font-size: .84rem; }

.log-quote {
  margin: 22px 0; padding: 16px 20px;
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
  background: var(--accent-soft); color: var(--text-2); font-size: .95rem;
}
.log-quote em { font-style: normal; font-weight: 600; color: var(--accent); }

/* ── misc ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border); margin-top: 72px; padding: 28px 0 40px;
  color: var(--muted); font-size: .8rem; line-height: 1.6;
}
.footer .container { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer .fine { max-width: 40rem; }
.small { font-size: .8rem; color: var(--muted); }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.center { text-align: center; }
.spacer { height: 20px; }
ul.clean { padding-left: 20px; margin: 10px 0 24px; }
ul.clean li { margin: 8px 0; color: var(--muted); font-size: .9rem; }
ul.clean li strong { color: var(--text); font-weight: 550; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 860px) {
  .hero { flex-direction: column; align-items: stretch; gap: 40px; padding: 56px 0 48px; }
  .hero::before {
    opacity: .5;
    -webkit-mask-image: radial-gradient(ellipse 70% 42% at 50% 62%, #000 12%, transparent 58%);
    mask-image: radial-gradient(ellipse 70% 42% at 50% 62%, #000 12%, transparent 58%);
  }
  .hero > div:first-child { flex: 0 0 auto; }
  .receipt { flex: 0 0 auto; }
  .steps { grid-template-columns: 1fr; }
  .step + .step { border-left: none; border-top: 1px solid var(--border); }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .panel { padding: 20px; }
  th, td { padding: 10px 10px; }

  /* Mobile nav collapses into a hamburger menu (CSS-only, no JS). */
  .nav-btn { display: inline-flex; }
  nav.top {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px -12px rgba(0,0,0,.18);
    padding: 8px;
  }
  .nav-toggle:checked ~ nav.top { display: flex; }
  nav.top a { padding: 11px 12px; font-size: .95rem; border-radius: var(--radius-sm); }
  nav.top a.cta { margin: 6px 0 2px; text-align: center; }
}

/* Microsoft marketplace landing page (/marketplace) */
.mp-summary { border: 1px solid var(--border, #e5e5e5); border-radius: 10px; padding: 16px 18px; background: var(--bg-inset, #fafafa); }
.mp-summary p { margin: 2px 0; }
p.ok { color: #1a7f37; font-weight: 600; }
