/* ============================================================
   FRIDAY MINI-APPS — SHARED DESIGN SYSTEM (canonical source)
   ------------------------------------------------------------
   Each app copies this into its own assets/styles.css and
   overrides the --accent-* tokens on <body data-theme="app">.
   Dependency-free. Modern, responsive, no frameworks.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #fafafa;
  --bg-soft: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --border: #e6e8ef;
  --border-strong: #d4d8e2;
  --text: #171a21;
  --text-soft: #4b5162;
  --text-faint: #7a8095;

  /* Accent — Inky brand (teal) */
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: #e6f7f5;
  --accent-glow: rgba(13, 148, 136, 0.16);
  --accent-gradient: linear-gradient(135deg, #0d9488 0%, #2563eb 100%);

  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(23, 26, 33, 0.06), 0 1px 3px rgba(23, 26, 33, 0.08);
  --shadow: 0 4px 14px rgba(23, 26, 33, 0.08), 0 2px 4px rgba(23, 26, 33, 0.05);
  --shadow-lg: 0 18px 44px rgba(23, 26, 33, 0.13), 0 6px 14px rgba(23, 26, 33, 0.07);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
  --container: 1120px;
  --nav-h: 68px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--font-mono); }
::selection { background: var(--accent-glow); }

/* ---------- Layout ---------- */
.container { width: min(var(--container), 100% - 2.5rem); margin-inline: auto; }
.section { padding: 4.5rem 0; }
.section-tight { padding: 2.5rem 0; }
.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  padding: .3rem .8rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}
.center { text-align: center; }
.center .eyebrow { margin-inline: auto; }
.lead { font-size: 1.15rem; color: var(--text-soft); max-width: 56ch; }
.center .lead { margin-inline: auto; }
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-gradient);
  display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: .95rem;
  box-shadow: var(--shadow-sm);
}
.nav-links { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-soft); font-weight: 600; font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta { margin-left: .4rem; }
.nav-burger { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .45rem .6rem; cursor: pointer; color: var(--text); }
@media (max-width: 760px) {
  .nav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: .6rem 1.25rem 1rem; box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-top: 1px solid var(--border); }
  .nav-links a { display: block; padding: .8rem .2rem; }
  .nav-cta { margin: .8rem 0 0; }
  .nav-burger { display: inline-flex; }
}

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 700; font-size: 1rem;
  padding: .7rem 1.35rem; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 2px; }
.btn-primary {
  background: var(--accent-gradient); color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 8px 22px var(--accent-glow); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-lg { padding: .9rem 1.8rem; font-size: 1.05rem; }
.btn-sm { padding: .45rem .95rem; font-size: .88rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-weight: 650; font-size: .92rem; color: var(--text-soft); }
.field .hint { font-size: .82rem; color: var(--text-faint); }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], select, textarea {
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: .65rem .85rem;
  width: 100%; transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.input-row { display: flex; gap: .8rem; }
.input-row > * { flex: 1; }
.checkbox { display: flex; align-items: center; gap: .55rem; font-size: .95rem; cursor: pointer; }
.checkbox input { width: auto; accent-color: var(--accent); }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease;
}
.card.hoverable:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: .9rem;
  display: grid; place-items: center; font-size: 1.35rem;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.card h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.card p { color: var(--text-soft); font-size: .94rem; margin: 0; }

/* ---------- Hero ---------- */
.hero { padding: 5rem 0 4rem; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 300px at 15% 0%, var(--accent-glow), transparent 70%),
    radial-gradient(500px 280px at 85% 10%, var(--accent-glow), transparent 70%);
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 18ch; }
.hero .lead { margin: 1.2rem 0 1.8rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* Mockup window (used on landing pages) */
.mockup {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.mockup-bar { display: flex; align-items: center; gap: .45rem; padding: .8rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mockup-dot { width: 11px; height: 11px; border-radius: 50%; }
.mockup-title { margin-left: .5rem; font-size: .82rem; color: var(--text-faint); font-weight: 600; }
.mockup-body { padding: 1.25rem; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 1.25rem; }
.step { position: relative; padding-left: 3.2rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-gradient); color: #fff; font-weight: 800;
  box-shadow: 0 4px 10px var(--accent-glow);
}
.step h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.step p { color: var(--text-soft); font-size: .95rem; margin: 0; }

/* ---------- Pricing ---------- */
.pricing-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem; text-align: center;
  box-shadow: var(--shadow-sm); max-width: 420px; margin-inline: auto;
  position: relative;
}
.pricing-card.featured { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-lg); }
.price { font-size: 3.2rem; font-weight: 900; letter-spacing: -0.03em; }
.price small { font-size: 1rem; font-weight: 600; color: var(--text-faint); }
.price-note { color: var(--text-faint); font-size: .88rem; margin-top: -.4rem; }
.perks { list-style: none; padding: 0; margin: 1.5rem 0; text-align: left; }
.perks li { padding: .45rem 0 .45rem 1.7rem; position: relative; color: var(--text-soft); }
.perks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }

/* ---------- FAQ ---------- */
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: .8rem;
}
.faq summary { cursor: pointer; font-weight: 700; font-size: 1rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); font-weight: 700; transition: transform .15s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-soft); font-size: .95rem; margin: .8rem 0 0; }

/* ---------- Testimonials / quotes ---------- */
.quote { font-size: 1.02rem; color: var(--text-soft); font-style: italic; }
.quote-author { margin-top: .8rem; font-weight: 700; color: var(--text); font-style: normal; font-size: .9rem; }
.quote-author small { color: var(--text-faint); font-weight: 500; }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  padding: .25rem .7rem; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft);
}
.badge-accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent); }
.badge-ok { background: #ecfdf5; border-color: #a7f3d0; color: var(--ok); }

/* ---------- Toolbar / app shell (shared by tool pages) ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.toolbar .spacer { flex: 1; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .tool-grid { grid-template-columns: 1fr; } }
.output-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
  min-height: 140px; white-space: pre-wrap; font-size: .98rem;
  box-shadow: var(--shadow-sm);
}
.output-box:empty::before { content: "Your result will appear here…"; color: var(--text-faint); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.toast {
  background: var(--text); color: #fff; font-weight: 600; font-size: .92rem;
  padding: .65rem 1.2rem; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  max-width: min(90vw, 480px); text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 2.5rem 0; margin-top: 4rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; color: var(--text-faint); font-size: .9rem; }
.footer-links { display: flex; gap: 1.4rem; list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--text-faint); }
.footer-links a:hover { color: var(--text); }

/* ---------- Small utilities ---------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.muted { color: var(--text-faint); } .small { font-size: .85rem; } .mono { font-family: var(--font-mono); }
.divider { height: 1px; background: var(--border); border: 0; margin: 2.5rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

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

/* ============================================================
   INKY — APP-SPECIFIC STYLES
   Segmented tabs, invoice sheet, drafts, stat cards, print.
   ============================================================ */

/* ---------- Segmented tabs ---------- */
.tabs {
  display: inline-flex; gap: .25rem; padding: .25rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.tabs button {
  font: inherit; font-weight: 700; font-size: .92rem;
  color: var(--text-soft); background: transparent;
  border: 0; border-radius: var(--radius-pill);
  padding: .5rem 1.3rem; cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.tabs button:hover { color: var(--text); }
.tabs button.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 3px 10px var(--accent-glow);
}
.tabs button:focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 1px; }
.tab-panel[hidden] { display: none; }

/* ---------- Tool page shell ---------- */
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0; }

.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
}
.form-card + .form-card { margin-top: 1.1rem; }
.form-card fieldset { border: 0; margin: 0; padding: 0; }
.form-card legend {
  font-weight: 800; font-size: .8rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-strong);
  padding: 0; margin-bottom: .9rem;
}
.preview-col { position: sticky; top: calc(var(--nav-h) + 1rem); }
@media (max-width: 860px) { .preview-col { position: static; } }
.preview-label { font-weight: 700; font-size: .85rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem; }

/* ---------- Line items table ---------- */
.items-table { width: 100%; border-collapse: collapse; margin-bottom: .7rem; }
.items-table th {
  text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); font-weight: 700; padding: .3rem .4rem;
  border-bottom: 1px solid var(--border-strong);
}
.items-table td { padding: .3rem .4rem; vertical-align: middle; }
.items-table td input { padding: .5rem .6rem; }
.items-table .num { text-align: right; }
.items-table .num input { text-align: right; }
.items-table .line-total { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.items-table .col-desc { width: 46%; }
.items-table .col-qty { width: 12%; }
.items-table .col-price { width: 16%; }
.items-table .col-total { width: 16%; }
.items-table .col-remove { width: 34px; }
.item-remove {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-faint); font-size: .85rem; line-height: 1; cursor: pointer;
  display: inline-grid; place-items: center; padding: 0;
}
.item-remove:hover { border-color: var(--danger); color: var(--danger); background: #fef2f2; }
.item-remove:focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 1px; }

/* ---------- Live totals: small stat cards ---------- */
.calc { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 1.1rem 0; }
@media (max-width: 520px) { .calc { grid-template-columns: 1fr; } }
.calc-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .7rem .9rem;
}
.calc-card .calc-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.calc-card .calc-value { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.calc-card.total { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.calc-card.total .calc-value { color: var(--accent-strong); }

/* ---------- Invoice sheet (screen preview + print) ---------- */
.invoice-sheet {
  background: #fff; color: #171a21;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 760px;
  margin-inline: auto;
  padding: 2rem 2.2rem 1.8rem;
  font-size: .92rem;
}
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; padding-bottom: 1.1rem; border-bottom: 2px solid var(--accent); margin-bottom: 1.1rem; flex-wrap: wrap; }
.invoice-business { max-width: 55%; }
.invoice-business .business-name { font-size: 1.05rem; font-weight: 800; margin-bottom: .15rem; }
.invoice-business .business-details { color: #4b5162; font-size: .85rem; line-height: 1.5; white-space: pre-line; }
.invoice-title-block { text-align: right; }
.invoice-title-block .doctype { font-size: 1.7rem; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; }
.invoice-title-block .doc-number { color: var(--accent-strong); font-weight: 700; font-size: .95rem; }
.invoice-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem;
  margin-bottom: 1.1rem; padding: .9rem 0; border-bottom: 1px solid var(--border);
}
.invoice-meta .meta-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #7a8095; }
.invoice-meta .meta-value { font-weight: 600; font-size: .9rem; }
.invoice-meta .meta-value.vat-badge { color: var(--accent-strong); }
.invoice-client { margin-bottom: 1.2rem; }
.invoice-client .meta-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #7a8095; margin-bottom: .15rem; }
.invoice-client .client-name { font-weight: 700; }
.invoice-client .client-details { color: #4b5162; font-size: .85rem; line-height: 1.5; white-space: pre-line; }

.invoice-table { width: 100%; border-collapse: collapse; margin-bottom: 1.1rem; }
.invoice-table th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: #7a8095; font-weight: 700; padding: .5rem .6rem;
  border-bottom: 1px solid var(--border-strong); background: #f7f8fb;
}
.invoice-table td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.invoice-table tr:nth-child(even) td { background: #fafbfd; }
.invoice-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-table .col-desc { width: auto; }
.invoice-table .empty-row td { color: #7a8095; font-style: italic; text-align: center; }

.invoice-totals { margin-left: auto; max-width: 260px; margin-bottom: 1.1rem; }
.invoice-totals .total-row { display: flex; justify-content: space-between; padding: .3rem 0; font-size: .9rem; color: #4b5162; }
.invoice-totals .total-row.grand {
  border-top: 2px solid var(--accent); margin-top: .35rem; padding-top: .6rem;
  font-size: 1.15rem; font-weight: 800; color: #171a21;
}
.invoice-totals .total-row .amount { font-variant-numeric: tabular-nums; }

.invoice-notes { font-size: .85rem; color: #4b5162; margin-bottom: 1.1rem; white-space: pre-line; }
.invoice-notes .notes-label { font-weight: 700; color: #171a21; text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; margin-bottom: .2rem; }

.invoice-footer {
  border-top: 1px solid var(--border); padding-top: .9rem;
  font-size: .82rem; color: #4b5162;
  display: flex; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap;
}
.invoice-footer .footer-block .footer-label { font-weight: 700; color: #171a21; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .15rem; }
.invoice-footer .footer-block p { margin: 0 0 .2rem; white-space: pre-line; }

/* Receipt sheet shares the invoice-sheet look, with a paid badge */
.receipt-paid {
  display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ok);
  background: #ecfdf5; border: 1px solid #a7f3d0;
  border-radius: var(--radius-pill); padding: .15rem .6rem; margin-top: .3rem;
}

/* ---------- Drafts ---------- */
.drafts-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
}
.drafts-card h2 { font-size: 1.05rem; margin-bottom: .9rem; }
.drafts-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.draft-item {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .6rem .9rem;
}
.draft-item .draft-icon {
  width: 30px; height: 30px; border-radius: var(--radius-sm); flex: none;
  display: grid; place-items: center; font-size: .9rem;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.draft-item .draft-info { flex: 1; min-width: 0; }
.draft-item .draft-title { font-weight: 700; font-size: .92rem; }
.draft-item .draft-sub { font-size: .8rem; color: var(--text-faint); }
.draft-item .draft-actions { display: flex; gap: .4rem; flex: none; }
.draft-item .btn-sm { padding: .35rem .8rem; }
.drafts-empty { color: var(--text-faint); font-size: .92rem; padding: .5rem 0; }

/* ---------- Receipt form ---------- */
.receipt-amount { font-size: 1.3rem; font-weight: 800; color: var(--text); }

/* ---------- Print styles ----------
   When .print-mode is on the <body>, only the active invoice sheet
   is printed: everything else (nav, tabs, toolbar, forms, drafts,
   toasts) is hidden. The preview sheet itself loses its card
   chrome so it prints as a clean A4 document. */
@media print {
  @page { size: A4; margin: 14mm; }
  html, body { background: #fff !important; }
  body.print-mode nav,
  body.print-mode .tabs,
  body.print-mode .toolbar,
  body.print-mode .form-card,
  body.print-mode .drafts-card,
  body.print-mode .tool-head,
  body.print-mode .toolbar-row,
  body.print-mode .preview-label,
  body.print-mode .calc,
  body.print-mode .footer,
  body.print-mode .toast-wrap,
  body.print-mode .tab-panel[hidden] {
    display: none !important;
  }
  body.print-mode .tool-grid { display: block; }
  body.print-mode .invoice-sheet {
    max-width: 100%; width: 100%;
    margin: 0; padding: 0;
    border: 0; border-radius: 0; box-shadow: none;
    font-size: 11pt;
  }
  body.print-mode .invoice-sheet * { box-shadow: none !important; }
  body.print-mode .invoice-table,
  body.print-mode .invoice-table tr,
  body.print-mode .invoice-table th,
  body.print-mode .invoice-table td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* Keep the sheet on one page where possible, avoid orphan rows */
  body.print-mode .invoice-sheet { break-inside: avoid; }
  body.print-mode .invoice-table tr { break-inside: avoid; }
}
