:root {
  --bg: #f3efe6;
  --bg-warm: #ebe4d6;
  --surface: #faf7f1;
  --surface-2: #fffdf8;
  --ink: #1c1917;
  --ink-soft: #3f3a34;
  --muted: #6f675e;
  --faint: #9a9288;
  --line: #ddd4c6;
  --teal: #1f4e46;
  --teal-fg: #f4f1ea;
  --teal-soft: #e4eeea;
  --forest: #163832;
  --olive: #5a6840;
  --danger: #9b2c2c;
  --warn: #8a5a12;
  --warn-soft: #f3ead4;
  --ok: #1f6b45;
  --ok-soft: #dceee4;
  --lamp: #c9a227;
  --cream: #f3e9d4;
  --sidebar: #163832;
  --sidebar-fg: #f4f1ea;
  --radius: 12px;
  --font-brand: "Lover's Quarrel", "Snell Roundhand", cursive;
  --font-display: "Cinzel", "Palatino Linotype", serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
html.dark {
  --bg: #161310; --bg-warm: #1d1914; --surface: #1f1b16; --surface-2: #27221c;
  --ink: #f3ece1; --ink-soft: #d9d0c3; --muted: #b3a898; --faint: #8c8274;
  --line: #3a332b; --teal: #cbb68a; --teal-fg: #1a1612; --teal-soft: #2a261c;
  --forest: #e8dcc8; --olive: #c5d4a4; --sidebar: #1a1612; --sidebar-fg: #f3ece1;
  --warn: #e0b56a; --warn-soft: #3a2e18; --ok: #8fcaa8; --danger: #e8a090;
}
html[data-festival="diwali"] { --teal: #8a3b12; --forest: #6b2a0c; --teal-soft: #f4e3c8; --lamp: #e0a106; }
html[data-festival="dussehra"], html[data-festival="navratri"] { --teal: #7a1f2b; --forest: #5c121c; --teal-soft: #f3ddd8; }
html[data-festival="vaisakhi"], html[data-festival="lohri"] { --teal: #8a4b12; --forest: #5c3410; --teal-soft: #f5e6c8; }
html[data-festival="holi"] { --teal: #7a3d5c; --forest: #5a2a44; --teal-soft: #f6e0ec; }
html[data-festival="rakhi"] { --teal: #8f2436; --forest: #6b1524; }
html[data-festival="eid"] { --teal: #1f4f3a; --forest: #143628; }
html[data-festival="christmas"] { --teal: #1f4a32; --forest: #123224; --lamp: #c43c3c; }
html[data-festival="newyear"] { --teal: #2a3344; --forest: #1a2230; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); min-height: 100dvh; line-height: 1.5; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; letter-spacing: 0.01em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, [type=submit] { font: inherit; cursor: pointer; }
button:not(:disabled):active, .btn:active { transform: scale(0.96); }
input, select, textarea { font: inherit; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; width: 100%; }
input[type=checkbox],
input[type=radio] {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--teal);
  flex: 0 0 auto;
}
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=button]):not([type=submit]):not([type=image]),
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.75rem;
  line-height: 1.25;
  box-sizing: border-box;
}
select {
  padding-right: 2rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236f675e' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 0.75rem;
}
html.dark select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23c5d4a4' d='M1 1l5 5 5-5'/></svg>");
}
textarea { min-height: 6rem; resize: vertical; padding: 0.55rem 0.75rem; line-height: 1.45; }
input[type="file"] {
  height: 2.5rem;
  min-height: 2.5rem;
  max-height: 2.5rem;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 2.5rem;
}
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  appearance: none;
  -webkit-appearance: none;
  height: 2.5rem;
  margin: 0 0.7rem 0 0;
  padding: 0 0.9rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 2.5rem;
  cursor: pointer;
  border-radius: 7px 0 0 7px;
}
.file-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.7rem 0 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-sizing: border-box;
  cursor: pointer;
  width: 100%;
}
.file-box input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
  border: 0;
  background: transparent;
}
.file-box-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.85rem;
  padding: 0 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  pointer-events: none;
}
.file-box-name {
  color: var(--muted);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.item-name, .print-lang, input[lang="hi"], input[lang="pa"] {
  font-family: "Source Sans 3", "Noto Sans Devanagari", "Noto Sans Gurmukhi", "Nirmala UI", sans-serif;
}
.item-name { white-space: pre-line; line-height: 1.25; }
.slip .item-name { display: block; line-height: 1.2; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3rem 0; }

.paper-grain {
  background-image:
    radial-gradient(1200px 400px at 10% -10%, color-mix(in oklab, var(--lamp) 18%, transparent), transparent 50%),
    radial-gradient(900px 320px at 110% 10%, color-mix(in oklab, var(--teal) 12%, transparent), transparent 46%);
}

.logo { display: inline-flex; align-items: center; flex-wrap: nowrap; color: var(--forest); gap: 0; text-decoration: none; }
.logo-lockup { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0.18rem; min-width: 0; line-height: 1; }
.logo-lockup-img {
  display: block;
  height: 2.6rem;
  width: auto;
  max-width: min(14rem, 58vw);
  object-fit: contain;
}
.logo-lockup-img.is-dark { display: none; }
html.dark .logo-lockup-img.is-light { display: none; }
html.dark .logo-lockup-img.is-dark { display: block; }
.sidebar .logo-lockup-img.is-light { display: none; }
.sidebar .logo-lockup-img.is-dark { display: block; }
.logo-lockup-img.is-lg,
.logo-lockup.is-lg .logo-lockup-img {
  height: 4.2rem;
  max-width: min(22rem, 88vw);
}
.logo-row { display: inline-flex; align-items: center; flex-wrap: nowrap; white-space: nowrap; }
.logo-slogan {
  font-family: "Source Sans 3", Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 0.64rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--olive);
  margin-left: 0.12rem;
  white-space: nowrap;
}
.logo-lockup.is-lg .logo-slogan { font-size: 0.92rem; margin-left: 0.2rem; letter-spacing: 0.02em; }
.logo-mark-wrap { display: inline-flex; align-items: center; }
.logo-mark {
  width: 2.75rem; height: 2.75rem; display: block; object-fit: contain;
  flex: 0 0 2.75rem; background: transparent;
}
.logo-mark-lg { width: 4.5rem; height: 4.5rem; flex-basis: 4.5rem; }
.logo-word {
  font-family: var(--font-brand);
  font-size: 2.05rem;
  line-height: 1;
  color: var(--olive);
  margin-left: -0.15rem;
  transform: translateY(0.18rem);
}
html.dark .logo { color: var(--olive); }
.sidebar .logo { color: var(--sidebar-fg); }
.sidebar .logo-slogan { color: var(--sidebar-fg); opacity: 0.78; white-space: normal; max-width: 11rem; }
.sidebar .logo-lockup-img { height: 2.35rem; max-width: 11rem; }
.logo-mark-collapsed-only { display: none; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
}
body.has-impersonation-banner { padding-top: 2.7rem; }
body.has-impersonation-banner .site-header { top: 2.7rem; }
.impersonation-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.45rem 1rem; min-height: 2.7rem;
  background: var(--forest); color: #f4efe4;
  font-size: 0.88rem; box-shadow: 0 2px 10px rgba(22, 56, 50, 0.28);
}
.impersonation-banner p { margin: 0; }
.impersonation-banner strong { color: #fff; }
.impersonation-sep { opacity: 0.55; margin: 0 0.25rem; }
.impersonation-banner .faint { color: rgba(244, 239, 228, 0.75); }
.impersonation-back {
  background: #e8c36a; color: #3b2f00; height: 2rem; padding: 0 0.85rem;
}
.impersonation-back:hover { background: #f0d48a; }
.byora-version-banner {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 95;
  width: min(22rem, calc(100vw - 1.6rem));
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  pointer-events: none;
}
.byora-version-banner.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.byora-version-banner-inner {
  display: grid; gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(22, 56, 50, 0.16);
}
.byora-version-title { font-weight: 600; font-size: 0.95rem; }
.byora-version-sub { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.byora-version-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.55rem; padding: 0.35rem 0; flex-wrap: nowrap; }
.nav { display: none; gap: 1.15rem; font-size: 0.92rem; }
.nav a { color: var(--muted); }
.nav a:hover, .nav a.is-active { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 0.4rem; overflow: visible; flex: 0 0 auto; }
.icon-btn { width: 2.5rem; height: 2.5rem; border: 0; border-radius: 8px; background: transparent; color: var(--ink); flex: 0 0 2.5rem; }
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  padding: 0.12rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  flex: 0 0 auto;
}
.theme-btn {
  width: 1.85rem;
  height: 1.85rem;
  flex: 0 0 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-btn svg { width: 1.05rem; height: 1.05rem; display: block; }
html:not(.dark) .theme-btn[data-theme-set="light"],
html.dark .theme-btn[data-theme-set="dark"],
.theme-btn.is-on {
  background: var(--teal);
  color: var(--teal-fg);
}
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0; line-height: 0; overflow: hidden;
}
.nav-toggle::before {
  content: "";
  display: block;
  width: 1.05rem;
  height: 0.12rem;
  background: currentColor;
  box-shadow: 0 -0.32rem 0 currentColor, 0 0.32rem 0 currentColor;
}
.mobile-nav { display: none; flex-direction: column; padding: 0.5rem 0 1rem; }
.mobile-nav.is-open { display: flex; }
.mobile-nav a { padding: 0.6rem 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  height: 2.5rem; padding: 0 1rem; border-radius: 8px; border: 0;
  background: var(--teal); color: var(--teal-fg); font-weight: 600;
  transition: transform 150ms var(--ease), background 150ms var(--ease);
}
.btn-secondary, .btn.sec { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-sm { height: 2.1rem; font-size: 0.85rem; padding: 0 0.8rem; }
.btn-lg { height: 2.9rem; padding: 0 1.2rem; }
.btn-block { width: 100%; }
/* Post / Save / Submit / Record sit below the last control, not flush against it. */
form.card > .btn[type="submit"],
.form-grid + .btn,
.field + .btn,
.table-wrap + .btn,
table + .btn,
textarea + .btn,
p.muted + .btn {
  margin-top: 1.25rem;
}
form.form-grid > .btn[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
}
.inline-form > .btn,
.inline-form.card > .btn,
.inline-form.card > .btn[type="submit"],
form.inline-form.card > .btn[type="submit"],
.clerk form .btn,
.hero-cta .btn,
.header-actions .btn,
.doc-actions .btn,
.print-bar .btn,
.rpt-filters .btn {
  margin-top: 0;
}
.doc-actions { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.row-menu { position: relative; display: inline-block; vertical-align: middle; }
.row-menu-btn {
  list-style: none;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
}
.row-menu-btn::-webkit-details-marker { display: none; }
.row-menu-btn svg { width: 1.1rem; height: 1.1rem; display: block; }
.row-menu[open] .row-menu-btn { border-color: var(--teal); }
.row-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 35;
  min-width: 10.5rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.28rem;
  box-shadow: 0 10px 28px color-mix(in oklab, var(--ink) 14%, transparent);
  text-align: left;
}
.row-menu-panel a,
.row-menu-panel button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.48rem 0.75rem;
  border: 0;
  background: none;
  border-radius: 7px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}
.row-menu-panel a:hover,
.row-menu-panel button:hover { background: var(--bg-warm); }
.row-menu-panel form { margin: 0; }
.row-menu-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  color: var(--teal);
}
.row-menu-ico .row-menu-svg,
.row-menu-svg { width: 1rem; height: 1rem; display: block; }
.row-menu-txt { flex: 1 1 auto; min-width: 0; }
.row-menu-panel .row-menu-danger,
.row-menu-panel .row-menu-danger .row-menu-ico { color: #b42318; }
.btn.btn-ghost.btn-sm .row-menu-ico { color: var(--teal); }
.btn.btn-ghost.btn-sm { display: inline-flex; align-items: center; gap: 0.4rem; }
td:has(.row-menu) { width: 3rem; text-align: right; white-space: nowrap; }
tr.row-off td { opacity: 0.55; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.5rem; }
.plan-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.8rem 1rem;
  margin: 0.35rem 0 0;
}
.plan-opts .field { max-width: 100%; }
.plan-opts .field-billing { width: 18.5rem; }
.plan-opts .field-pay { width: 12rem; }
.print-bar {
  margin: 1rem auto 1.25rem;
  max-width: 46rem;
  padding: 0.9rem 1.1rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.print-bar p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.doc-wish {
  margin: 1.5rem 0 0;
  padding: 0.85rem 0.2rem 0;
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
.print-app-foot { display: none; }
.doc-credit { margin-top: 1.5rem; }
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.6rem 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.pager p { margin: 0; }
.rpt-filters .form-grid { margin-top: 0; }
.rpt-filters .btn { margin-top: 1rem; margin-right: 0.4rem; }
.report-doc { margin-top: 0.5rem; }

.kicker { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.lede { margin-top: 0.8rem; max-width: 38rem; font-size: 1.12rem; color: var(--ink-soft); }

.hero { display: grid; gap: 2rem; padding: 3rem 0; }
.stagger-in > * {
  opacity: 0; transform: translateY(12px); filter: blur(4px);
  animation: fade-up 520ms var(--ease) forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 40ms; }
.stagger-in > *:nth-child(2) { animation-delay: 120ms; }
.stagger-in > *:nth-child(3) { animation-delay: 200ms; }
.stagger-in > *:nth-child(4) { animation-delay: 280ms; }
.stagger-in > *:nth-child(5) { animation-delay: 360ms; }
@keyframes fade-up { to { opacity: 1; transform: none; filter: none; } }

.card, .mod-card, .plan-card, .mini-demo {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease);
}
.card:hover, .mod-card:hover, .plan-card:hover { transform: translateY(-2px); }
.plan-card.popular { border-color: var(--teal); }
.plan-price { font-family: var(--font-display); font-size: 2rem; margin-top: 0.3rem; }
.grid-2, .grid-3 { display: grid; gap: 1rem; }
.band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.cta-dark { background: var(--forest); color: var(--teal-fg); }
.cta-dark .muted, .cta-dark p { color: color-mix(in oklab, var(--teal-fg) 80%, transparent); }
.icon-dot { width: 2rem; height: 2rem; display: grid; place-items: center; color: var(--teal); }
.video-slot { aspect-ratio: 16/9; display: grid; place-items: center; background: var(--teal-soft); color: var(--forest); border-radius: 8px; font-size: 1.6rem; }
.lang-bill-demo {
  max-width: 36rem;
  padding: 1.15rem 1.25rem;
  background: linear-gradient(145deg, rgba(27, 94, 59, 0.06), rgba(224, 122, 47, 0.08));
  border: 1px solid var(--line);
  border-radius: 12px;
}
.lang-name-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.lang-name-list li {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  font-size: 1.05rem;
  line-height: 1.35;
}
.lang-chip {
  flex: 0 0 2.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--forest);
  background: var(--teal-soft);
  border-radius: 6px;
  text-align: center;
  padding: 0.2rem 0;
}

.mini-demo { box-shadow: 0 12px 32px -16px rgba(28,25,23,0.25); }
.mini-lines { list-style: none; padding: 0; margin: 1rem 0 0; }
.mini-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.gst-box { margin-top: 0.8rem; padding: 0.7rem 0.9rem; background: var(--teal); color: var(--teal-fg); border-radius: 8px; font-weight: 600; }

.flash { padding: 0.7rem 1rem; margin: 0.5rem 1.25rem; border-radius: 8px; }
.flash[data-flash-autohide] {
  overflow: hidden;
  max-height: 8rem;
  transition: opacity 0.45s ease, transform 0.45s ease, margin 0.45s ease, padding 0.45s ease, max-height 0.45s ease;
}
.flash[data-flash-autohide].is-hiding {
  opacity: 0;
  transform: translateY(-0.35rem);
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  max-height: 0;
}
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-warn { background: var(--warn-soft); color: var(--warn); }
.flash-err { background: #f6e4e0; color: var(--danger); }
.confirm-mask {
  position: fixed; inset: 0; z-index: 80;
  background: color-mix(in oklab, var(--ink) 35%, transparent);
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
}
.confirm-box {
  width: min(26rem, 100%);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem 1.2rem 1.2rem;
  box-shadow: 0 16px 40px color-mix(in oklab, var(--ink) 18%, transparent);
}
.confirm-box p { margin: 0 0 1rem; font-size: 1rem; line-height: 1.45; }
.confirm-box .hero-cta { margin-top: 0; }
.banner-maint, .banner-demo, .banner-dev { position: relative; z-index: 10; padding: 0.4rem 1rem; text-align: center; font-size: 0.82rem; }
.banner-maint, .banner-demo { background: var(--warn-soft); color: var(--warn); }
.banner-dev { background: var(--teal-soft); color: var(--forest); }

.chip-row, .tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1rem 0; }
.chip {
  display: inline-flex; align-items: center; height: 2.2rem; padding: 0 0.9rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 0.88rem;
}
.chip.is-on { background: var(--teal); color: var(--teal-fg); border-color: transparent; }
.field { display: grid; gap: 0.3rem; font-size: 0.88rem; align-content: start; }
.field span { color: var(--muted); }
.field-check {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.55rem;
  grid-column: 1 / -1;
}
.field-check input[type="checkbox"] {
  margin-top: 0.28em;
  flex: 0 0 auto;
}
.field-check span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.45;
}
.field-check.flash-warn {
  margin: 0;
  padding: 0.7rem 1rem;
  color: var(--warn);
}
.field-check.flash-warn span {
  color: var(--warn);
}
.form-grid { display: grid; gap: 0.8rem; margin-top: 0.8rem; align-items: start; }
.form-stack { display: grid; gap: 0.9rem; grid-template-columns: 1fr; }
.form-stack > .btn[type="submit"] { justify-self: start; }
.pill { display: inline-block; font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 999px; background: var(--teal-soft); color: var(--forest); }
.check-grid { display: grid; gap: 0.45rem 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.check-grid label { display: flex; gap: 0.45rem; align-items: center; font-size: 0.9rem; }
.staff-pages { border: 1px dashed var(--line); border-radius: 10px; padding: 0.7rem 0.9rem 0.9rem; }
.staff-pages legend { font-size: 0.88rem; padding: 0 0.3rem; }
.creds-card { margin-bottom: 1rem; }
.creds-box {
  margin: 0.5rem 0 0; padding: 0.75rem 0.9rem; background: var(--bg-warm);
  border-radius: 8px; white-space: pre-wrap; font-family: ui-monospace, monospace; font-size: 0.86rem;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); background: var(--bg-warm); }
td, th { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); }
.num { text-align: right; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.row-warn { background: var(--warn-soft); }
.kpi-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.kpi span { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.kpi b { display: block; font-family: var(--font-display); font-size: 1.45rem; margin-top: 0.2rem; }
.kpi em { display: block; font-style: normal; font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.kpi-warn { border-color: color-mix(in oklab, var(--warn) 40%, var(--line)); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 0.5rem; }
.page-head h1 { font-size: 2rem; }

.books { display: flex; min-height: 100dvh; }
.books-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 70;
  background: color-mix(in oklab, #000 42%, transparent);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.books-scrim.is-open { display: block; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: min(13.5rem, 72vw); background: var(--sidebar); color: var(--sidebar-fg);
  padding: max(1rem, env(safe-area-inset-top)) 0 max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-100%); z-index: 80;
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform 200ms var(--ease), width 200ms var(--ease);
  box-shadow: 8px 0 28px color-mix(in oklab, #000 28%, transparent);
}
.sidebar.is-open { transform: none; }
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.25rem;
  padding: 0 0.55rem 1rem 0.85rem; flex: 0 0 auto;
}
.sidebar nav {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sidebar nav a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.9rem; color: var(--sidebar-fg); opacity: 0.82;
  min-height: 2.45rem;
}
.sidebar nav a.is-active, .sidebar nav a:hover { background: color-mix(in oklab, white 10%, transparent); opacity: 1; }
.sidebar nav a.is-off { opacity: 0.38; pointer-events: none; }
.nav-ico { width: 1.25rem; height: 1.25rem; flex: 0 0 1.25rem; }
.nav-label { white-space: nowrap; }
.sidebar-toggle {
  display: none; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; flex: 0 0 1.6rem; padding: 0;
  border-radius: 999px; border: 1px solid color-mix(in oklab, var(--sidebar-fg) 28%, transparent);
  background: color-mix(in oklab, var(--sidebar) 80%, black); color: var(--sidebar-fg);
  cursor: pointer;
}
.sidebar-toggle svg { width: 0.9rem; height: 0.9rem; display: block; transition: transform 200ms var(--ease); }
.sidebar-foot { padding: 1rem 1.1rem; font-size: 0.78rem; opacity: 0.7; flex: 0 0 auto; }
.sidebar-foot a { color: inherit; text-decoration: underline; text-underline-offset: 0.12em; }
.books-main { flex: 1; min-width: 0; }
.books-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--line); overflow: visible; position: relative; z-index: 30; }
.books-house {
  flex: 1 1 8rem;
  min-width: 0;
  margin: 0;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wh-scope { position: relative; z-index: 20; }
.wh-scope details[open] { z-index: 25; }
.wh-scope details { position: relative; }
.wh-scope summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  padding: 0.22rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  min-width: 10.5rem;
  max-width: 16rem;
}
.wh-scope summary::-webkit-details-marker { display: none; }
.wh-scope-k { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.wh-scope-v { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 15rem; }
.wh-scope-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.3rem);
  z-index: 50;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem 0.75rem;
  min-width: 16.5rem;
  max-width: min(22rem, calc(100vw - 1.5rem));
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: 0 10px 28px color-mix(in oklab, var(--ink) 14%, transparent);
}
.wh-scope-menu label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.38rem 0.35rem;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--ink);
  cursor: pointer;
}
.wh-scope-menu label:hover { background: var(--bg-warm); }
.wh-scope-menu label span { flex: 1; min-width: 0; }
.wh-scope-menu input[type=checkbox] {
  width: 1rem;
  height: 1rem;
  margin-top: 0.18rem;
}
.wh-scope-menu .btn { margin-top: 0.45rem; align-self: flex-start; }
.page { padding: 1.4rem 1.1rem 3rem; }
.watermark { position: fixed; inset: 40% 0 auto; text-align: center; font-family: var(--font-display); font-size: 6rem; color: color-mix(in oklab, var(--ink) 6%, transparent); pointer-events: none; z-index: 0; }
.watermark-inline { color: var(--warn); font-size: 0.85rem; margin: 0.6rem 0; }
.paywall { max-width: 36rem; margin: 4rem auto; text-align: center; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 2.5rem 0 1.5rem; margin-top: 2rem; }
.footer-grid { display: grid; gap: 1.5rem; }
.footer-grid > div > a { display: block; color: var(--muted); margin-top: 0.35rem; }
.footer-grid > div > a.logo { display: inline-flex; margin-top: 0; color: var(--forest); }
html.dark .footer-grid > div > a.logo { color: var(--olive); }
.footer-blurb { margin-top: 0.75rem; }
.footer-blurb a { display: inline; color: inherit; }
.footer-legal { margin-top: 1.5rem; }
.gst-extra { display: block; margin-top: 0.2rem; font-family: var(--font-sans); font-size: 0.78rem; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.foot-copy { margin: 0.45rem 0 0; padding: 0; font-size: 0.78rem; color: var(--faint); }
.desk-foot { margin-top: 2.5rem; padding: 1rem 0 1.5rem; border-top: 1px solid var(--line); }
.desk-foot .faint { margin: 0; font-size: 0.8rem; }
.foot-refund { margin: 0; color: var(--faint); font-size: 0.82rem; max-width: none; text-align: left; }

.clerk-btn {
  position: fixed; right: 1rem; bottom: 1rem; width: 3rem; height: 3rem; border-radius: 999px; border: 0;
  background: var(--teal); color: var(--teal-fg); z-index: 50; font-size: 1.2rem;
}
.clerk {
  position: fixed; right: 1rem; bottom: 5rem; width: min(22rem, calc(100vw - 2rem)); height: 22rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  display: none; flex-direction: column; overflow: hidden; z-index: 50;
}
.clerk.is-open { display: flex; }
.clerk-head { background: var(--forest); color: var(--teal-fg); padding: 0.55rem 0.8rem; display: flex; justify-content: space-between; align-items: center; }
.clerk-log { flex: 1; overflow: auto; padding: 0.8rem; font-size: 0.85rem; display: grid; gap: 0.5rem; }
.clerk-log .bot { background: var(--teal-soft); padding: 0.5rem 0.7rem; border-radius: 8px; }
.clerk-log .you { justify-self: end; background: var(--bg-warm); padding: 0.5rem 0.7rem; border-radius: 8px; }
.clerk form { display: flex; gap: 0.4rem; padding: 0.5rem; border-top: 1px solid var(--line); }

.doc { background: var(--surface); padding: 1.5rem; border: 1px solid var(--line); border-radius: 12px; }
.cgi-wrap { margin-top: 1.5rem; }
.cgi-grid { width: 100%; border-collapse: collapse; }
.cgi-grid td { border: 1px solid var(--line); vertical-align: top; padding: 0.7rem 0.85rem; }
.cgi-declare { width: 58%; }
.cgi-declare-h { font-weight: 700; text-decoration: underline; margin-bottom: 0.35rem; font-size: 0.85rem; }
.cgi-declare p { margin: 0; font-size: 0.85rem; line-height: 1.4; }
.cgi-sign { width: 42%; text-align: right; position: relative; min-height: 5.5rem; }
.cgi-sign-for { font-weight: 700; }
.cgi-sign-auth { position: absolute; right: 0.85rem; bottom: 0.7rem; font-style: italic; }
.cgi-line { text-align: center; margin: 0.8rem 0 0; font-size: 0.9rem; }
.doc-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.doc-seller { margin: 0 0 0.2rem; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.04em; }
.doc-totals { margin-top: 1rem; text-align: right; display: grid; gap: 0.25rem; }
.slip {
  width: 4in;
  max-width: 100%;
  margin: 1rem auto 2rem;
  background: #fff;
  color: #111;
  padding: 0.45rem 0.55rem 0.9rem;
  font-size: 0.78rem;
  line-height: 1.35;
  border: 1px dashed var(--line);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.slip p { margin: 0.08rem 0; }
.slip-head { text-align: center; margin-bottom: 0.45rem; }
.slip-shop { font-weight: 700; font-size: 0.98rem; letter-spacing: 0.01em; }
.slip-kind { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.25rem; }
.slip-row { display: flex; justify-content: space-between; gap: 0.6rem; }
.slip-grand { font-size: 0.95rem; font-weight: 700; margin-top: 0.2rem; }
.slip-words { font-size: 0.72rem; color: #333; margin-top: 0.25rem; }
.slip-rule { border-top: 1px dashed #333; margin: 0.4rem 0; height: 0; }
.slip-lines { width: 100%; font-size: 0.75rem; border: 0; }
.slip-lines th, .slip-lines td { padding: 0.18rem 0; border: 0; vertical-align: top; }
.slip-lines thead th { border-bottom: 1px dashed #333; font-weight: 600; }
.slip-meta { display: block; font-size: 0.68rem; color: #444; }
.slip-foot { text-align: center; margin-top: 0.7rem; font-weight: 600; }
.slip-app { text-align: center; font-size: 0.68rem; margin-top: 0.3rem; word-break: break-all; color: #444; }
.grand { font-size: 1.2rem; margin-top: 0.4rem; }
.login-card { max-width: 24rem; margin: 4rem auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; }
.login-card .logo-slogan { font-size: 0.78rem; }
.login-card .field { width: 100%; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.inline-form > p { margin: 0; }
.inline-form select, .inline-form input { width: auto; }
.notes { margin-top: 0.8rem; font-size: 0.88rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 0.7rem; }
.pitch-list { display: grid; gap: 1rem; margin-top: 1.5rem; }
.stars { color: var(--lamp); letter-spacing: 0.1em; }
.prose { max-width: 42rem; }
.prose h2 { margin-top: 1.8rem; font-size: 1.4rem; }
.prose p, .prose li { margin-top: 0.6rem; color: var(--ink-soft); }
.prose ol, .prose ul { padding-left: 1.2rem; }
.office-card {
  margin: 1.2rem 0 1.4rem;
  padding: 1.1rem 1.2rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.office-card dt {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.office-card dd {
  margin: 0.15rem 0 0.85rem;
  color: var(--ink);
}
code { font-family: ui-monospace, monospace; font-size: 0.86em; background: var(--bg-warm); padding: 0.05rem 0.3rem; border-radius: 4px; }

@media (max-width: 799px) {
  html, body {
    overflow-x: hidden;
  }
  .wrap {
    padding-left: 1.75rem !important;
    padding-right: 1.75rem !important;
  }
  .site-header .wrap,
  .site-footer .wrap,
  main .wrap {
    padding-left: 1.75rem !important;
    padding-right: 1.75rem !important;
  }
  .hero {
    padding: 2rem 0 2.25rem;
    gap: 1.35rem;
  }
  .hero .logo-word {
    margin-left: 0;
  }
  .hero h1 {
    font-size: clamp(1.6rem, 7vw, 2.1rem);
    line-height: 1.22;
    letter-spacing: 0;
  }
  .lede {
    font-size: 1.02rem;
    max-width: none;
    margin-top: 0.7rem;
  }
  .hero-cta {
    gap: 0.6rem;
    margin-top: 1.25rem;
  }
  .hero-cta .btn,
  .hero-cta .btn-lg {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 0;
    text-align: center;
    justify-content: center;
  }
  .mini-demo {
    margin: 0;
    padding: 1.2rem 1.15rem 1.3rem;
    border-radius: 16px;
  }
  .section {
    padding: 2.1rem 0;
  }
  .mod-card,
  .plan-card,
  .card {
    padding: 1.15rem 1.1rem;
  }
  .site-footer {
    padding: 2rem 0 1.75rem;
  }
  .footer-grid {
    gap: 1.25rem;
  }
  .site-header-inner {
    min-height: 3.35rem;
    gap: 0.5rem;
    padding: 0.45rem 0;
  }
  .site-header .logo { min-width: 0; flex: 1 1 auto; }
  .site-header .logo-lockup-img { height: 2.15rem; max-width: min(11.5rem, 52vw); }
  .site-header .logo-slogan { display: none; }
  .header-bar-extra { display: none !important; }
  .sidebar .logo-slogan {
    display: block;
    white-space: nowrap;
    max-width: none;
    font-size: 0.58rem;
  }
  .books-top {
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
  }
  .page {
    padding: 1.25rem 1.25rem 3rem;
  }
  .flash {
    margin-left: 1.25rem;
    margin-right: 1.25rem;
  }
  .books-house { font-size: 0.82rem; }
  .wh-scope summary {
    min-width: 0;
    max-width: 7.8rem;
    padding: 0.16rem 0.5rem;
  }
  .wh-scope-k { display: none; }
  .wh-scope-v { max-width: 7.2rem; font-size: 0.78rem; }
  .wh-scope-menu { min-width: min(16.5rem, calc(100vw - 2.2rem)); z-index: 26; }
  .clerk-btn {
    right: 1.25rem;
    bottom: 5.5rem;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .books-top,
  body.nav-open .banner-demo,
  body.nav-open .banner-dev,
  body.nav-open .wh-scope,
  body.nav-open .wh-scope details,
  body.nav-open .wh-scope-menu { z-index: 1; }
}
@media (min-width: 800px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .nav { display: flex; }
  .nav-toggle { display: none; }
  .hero { grid-template-columns: 1.1fr 0.9fr; align-items: center; padding: 4rem 0; }
  .sidebar { transform: none; width: 13.5rem; box-shadow: none; padding: 1rem 0; }
  .books-scrim { display: none !important; }
  .sidebar-toggle { display: inline-flex; }
  .books-main { margin-left: 13.5rem; transition: margin-left 200ms var(--ease); }
  html.sidebar-collapsed .sidebar { width: 4.4rem; }
  html.sidebar-collapsed .books-main { margin-left: 4.4rem; }
  html.sidebar-collapsed .sidebar-head { flex-direction: column; padding: 0 0.4rem 0.7rem; }
  html.sidebar-collapsed .sidebar .logo-lockup-img,
  html.sidebar-collapsed .sidebar .logo-slogan,
  html.sidebar-collapsed .nav-label,
  html.sidebar-collapsed .sidebar-foot { display: none; }
  html.sidebar-collapsed .sidebar .logo-mark-collapsed-only {
    display: block;
    width: 2.2rem;
    height: 2.2rem;
    flex-basis: 2.2rem;
    margin: 0 auto;
  }
  html.sidebar-collapsed .sidebar nav a { justify-content: center; padding: 0.6rem 0.4rem; }
  html.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
  .page { padding: 1.6rem 1.8rem 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
html.pdf-capture .no-print { display: none !important; }
html.pdf-capture, html.pdf-capture body { background: #fff !important; }
@media print {
  @page { size: A4 portrait; margin: 8mm 10mm 10mm; }
  .no-print, .sidebar, .site-header, .clerk, .clerk-btn, .banner-demo, .banner-dev, .watermark, .print-bar, .rpt-filters, .tabs, .doc-actions, .row-menu, .page-head, .impersonation-banner, .byora-version-banner { display: none !important; }
  .books, .books-main { margin: 0; }
  body { background: white; }
  .doc { border: 0; box-shadow: none; padding: 0; }
  .doc-head { margin-bottom: 0.55rem; }
  .page { padding: 0; }
  table th, table td { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .print-app-foot {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    font-size: 7pt;
    color: #555;
    padding: 1pt 0 0;
    border-top: 0.3pt solid #ccc;
    background: #fff;
  }
  html[data-slip="1"] .print-app-foot { display: none !important; }
  html[data-slip="1"] body { background: #fff; }
  html[data-slip="1"] .slip {
    width: 4in;
    max-width: 4in;
    margin: 0;
    border: 0;
    padding: 0;
  }
}
