/* NetSheet.org — public site styles
   One family (Instrument Sans): condensed width for headlines, normal for text,
   tabular figures for money. Ledger green is the brand; highlighter yellow is
   reserved for the net-to-seller line. */

:root {
  --ink: #13241b;
  --ink-2: #33463c;
  --muted: #5b6b62;
  --rule: #d5dfd9;
  --rule-strong: #b9c8bf;
  --page: #f2f5f3;
  --paper: #ffffff;
  --green: #1e5b42;
  --green-hover: #174a35;
  --green-soft: #e3eee8;
  --leaf: #8dbfa5;
  --highlight: #f5dc5a;
  --danger: #a3312a;
  --danger-soft: #fbeceb;
  --ok-soft: #e6f2ea;

  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
  --step-4: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);

  --radius-sm: 6px;
  --radius: 10px;
  --shadow-sheet: 0 1px 0 var(--rule), 0 18px 40px -24px rgba(19, 36, 27, 0.35);
  --wrap: 1160px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-stretch: 82%;
  font-variation-settings: "wdth" 82;
  color: var(--ink);
}
h1 { font-size: var(--step-4); letter-spacing: -0.025em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-stretch: 90%; font-variation-settings: "wdth" 90; letter-spacing: -0.005em; }

p { margin: 0 0 1em; max-width: 68ch; }

a { color: var(--green); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--green-hover); }

.num, .money { font-variant-numeric: tabular-nums; }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--ink); color: #fff; padding: 0.5rem 0.9rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(242, 245, 243, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }

.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  color: var(--ink); text-decoration: none; font-weight: 650; font-size: 1.2rem; letter-spacing: -0.01em;
}
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .tld { color: var(--muted); font-weight: 500; }
.brand:hover { color: var(--ink); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.975rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
}
.site-nav a:hover { color: var(--ink); background: rgba(30, 91, 66, 0.07); }
.site-nav a[aria-current="page"] { color: var(--green); box-shadow: inset 0 -2px 0 var(--green); border-radius: 0; }
.site-nav .nav-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.75rem; }
.site-nav .nav-actions .btn { padding: 0.55rem 1rem; }
.site-nav .nav-actions .btn-primary, .site-nav .nav-actions .btn-primary:hover { color: #fff; }

.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--rule-strong);
  background: var(--paper); border-radius: var(--radius-sm); cursor: pointer; color: var(--ink);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; inset: 100% 0 auto 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1rem; box-shadow: 0 16px 30px -20px rgba(19, 36, 27, 0.4);
    display: none;
  }
  .site-header.is-open .site-nav { display: flex; }
  .site-nav a { padding: 0.85rem 0.25rem; border-bottom: 1px solid var(--rule); border-radius: 0; font-size: 1.05rem; }
  .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--green); padding-left: 0.75rem; }
  .site-nav .nav-actions { margin: 1rem 0 0; flex-direction: column; align-items: stretch; }
  .site-nav .nav-actions a { border: 0; text-align: center; }
  .site-nav .nav-actions .btn { padding: 0.8rem 1rem; }
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  padding: 0.8rem 1.3rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-hover); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--rule-strong); }
.btn-secondary:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); background: rgba(30, 91, 66, 0.07); }
.btn-on-dark { background: #fff; color: var(--green); }
.btn-on-dark:hover { background: var(--green-soft); color: var(--green-hover); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: 0.65; cursor: progress; }
.btn svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------------- forms */

.field { margin-bottom: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

label, .label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.35rem; color: var(--ink); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.label-row a { font-size: 0.9rem; font-weight: 500; }
.hint { font-size: var(--step--1); color: var(--muted); margin-top: 0.35rem; }

.input, input.input, select.input, textarea.input {
  display: block; width: 100%;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem; min-height: 48px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: #8a988f; }
.input:hover { border-color: #9fb1a6; }
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 91, 66, 0.18); }
.input[aria-invalid="true"], .input.is-invalid { border-color: var(--danger); }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%2333463c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 16px;
}
.input-affix { position: relative; }
.input-affix .affix { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-affix .input { padding-left: 1.75rem; }
.input-affix .affix-end { left: auto; right: 0.85rem; }
.input-affix.has-end .input { padding-left: 0.85rem; padding-right: 2rem; }

.password-field { position: relative; }
.password-field .input { padding-right: 4.5rem; }
.password-toggle {
  min-height: 40px; min-width: 3.6rem;
  position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--green); font: inherit; font-weight: 600; font-size: 0.9rem;
  padding: 0.5rem 0.6rem; cursor: pointer; border-radius: var(--radius-sm);
}

.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; font-size: 0.95rem; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin-top: 0.2rem; accent-color: var(--green); flex: none; }

.notice {
  border-radius: var(--radius-sm); padding: 0.7rem 0.5rem 0.7rem 0.9rem; margin-bottom: 1rem;
  font-size: 0.95rem; line-height: 1.45; border: 1px solid;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; align-items: start;
}
.notice > :first-child { overflow-wrap: anywhere; padding-block: 0.2rem; }
.notice:not(:has(.notice-close)) { grid-template-columns: minmax(0, 1fr); padding-right: 0.9rem; }
.notice-error { background: var(--danger-soft); border-color: #efc9c6; color: #6e1f1a; }
.notice-success { background: var(--ok-soft); border-color: #c4dccd; color: #1c4a33; }
.notice-info { background: #eef3f6; border-color: #d3dfe6; color: #213845; }
.notice-warning { background: #fdf6dc; border-color: #eedc9a; color: #5a4608; }
.notice .notice-close {
  grid-column: 2; grid-row: 1; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: var(--radius-sm); font: inherit; font-size: 1.25rem; line-height: 1;
  color: inherit; cursor: pointer; opacity: 0.75;
}
.notice .notice-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }

.divider { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.9rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* -------------------------------------------------------------- the sheet */

.sheet {
  position: relative; background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow-sheet); border: 1px solid var(--rule);
}
.sheet-stack::before {
  content: ""; position: absolute; inset: 10px -10px -10px 10px; z-index: -1;
  background: #e8eeea; border: 1px solid var(--rule); border-radius: var(--radius);
}
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.5rem 1rem; border-bottom: 1px solid var(--rule); }
.sheet-title { font-weight: 650; font-size: 1.05rem; margin: 0; letter-spacing: -0.005em; }
.sheet-sub { color: var(--muted); font-size: var(--step--1); margin: 0.15rem 0 0; }
.sheet-head > .sheet-sub { white-space: nowrap; margin: 0; }
.sheet-body { padding: 0.5rem 1.5rem 1.25rem; }

.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ledger td { padding: 0.55rem 0; border-bottom: 1px dashed var(--rule); vertical-align: baseline; }
.ledger td:last-child { text-align: right; white-space: nowrap; padding-left: 1rem; }
.ledger .deduct td:last-child { color: var(--ink-2); }
.ledger .deduct td:last-child::before { content: "\2212\00a0"; color: var(--muted); }
.ledger .subtle td { color: var(--muted); font-size: var(--step--1); }
.ledger .total td {
  border-bottom: 0; padding-top: 0.9rem; font-weight: 650; font-size: 1.15rem;
}
.ledger .total td:last-child span {
  background: linear-gradient(transparent 12%, var(--highlight) 12%, var(--highlight) 88%, transparent 88%);
  padding: 0 0.3rem; border-bottom: 3px double var(--ink);
}

/* ------------------------------------------------------------------ layout */

.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section-tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section-paper { background: var(--paper); border-block: 1px solid var(--rule); }
.lede { font-size: var(--step-1); color: var(--ink-2); line-height: 1.5; max-width: 38ch; }
.muted { color: var(--muted); }

/* ------------------------------------------------ shared page components */

.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem); }
.page-head h1 { max-width: 18ch; margin-bottom: 1rem; text-wrap: balance; }
.page-head .lede { max-width: 46ch; margin-bottom: 0; }
.page-head .cluster { margin-top: 1.75rem; }
.page-head-meta { margin: 0.75rem 0 0; color: var(--muted); font-size: var(--step--1); }

.section-head { max-width: 46rem; margin-bottom: 2rem; }
.section-head p { color: var(--ink-2); }

/* ------------------------------------------ shared with the homepage */

.steps { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(step); display: block; font-weight: 650; font-size: 2.25rem; line-height: 1; color: var(--green); margin-bottom: 0.75rem; font-variant-numeric: tabular-nums; }
.steps p { color: var(--ink-2); margin: 0; }

.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1.5rem; padding: 1.25rem 0; border-bottom: 1px solid var(--rule); }
.feature-list li:first-child { border-top: 1px solid var(--rule); }
.feature-list h3 { margin: 0; }
.feature-list p { grid-column: 1; margin: 0; color: var(--ink-2); }
.feature-list .plan-tag { grid-column: 2; grid-row: 1; }

.plan-tag {
  display: inline-block; align-self: start; font-size: 0.8rem; font-weight: 600; line-height: 1.5;
  color: var(--green); background: var(--green-soft); padding: 0.15rem 0.55rem; border-radius: 999px; white-space: nowrap;
}

.closing { background: var(--green); color: #e2eee7; }
.closing-grid { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.closing h2 { color: #fff; margin: 0 0 0.4rem; }
.closing p { color: #cfe0d6; margin: 0; }
.closing .closing-link { color: #fff; }
.closing .closing-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .closing .cluster { width: 100%; }
  .closing .cluster .btn { flex: 1 1 auto; }
}

.prose { max-width: 70ch; }
.prose > * { max-width: 70ch; }
.prose h2 { font-size: var(--step-2); margin: 2.5rem 0 0.75rem; padding-top: 1.75rem; border-top: 1px solid var(--rule); }
.prose > h2:first-child, .prose > section:first-child > h2 { margin-top: 0; }
.prose section:first-child h2 { border-top: 0; padding-top: 0; }
.prose h3 { font-size: var(--step-1); margin: 1.75rem 0 0.5rem; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.35rem; margin: 0 0 1.1rem; }
.prose li { margin-bottom: 0.4rem; padding-left: 0.2rem; }
.prose li::marker { color: var(--green); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { overflow-wrap: anywhere; }

h1, h2 { text-wrap: balance; }
.ledger .subtle td:last-child { white-space: normal; text-align: left; padding-left: 0; }

/* ------------------------------------------------------------------ footer */

.site-footer { background: var(--ink); color: #c9d6ce; font-size: 0.95rem; }
.site-footer .wrap { padding-block: 3rem 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; }
.site-footer .brand { color: #fff; }
.site-footer .brand .tld { color: #9fb3a7; }
.site-footer p { color: #9fb3a7; margin-top: 0.75rem; max-width: 34ch; }
.site-footer h2 { font-size: 0.95rem; color: #fff; font-stretch: 100%; font-variation-settings: "wdth" 100; letter-spacing: 0; margin-bottom: 0.75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.site-footer a { color: #c9d6ce; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 2.5rem; padding-top: 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; color: #8ea398; font-size: 0.875rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ----------------------------------------------------------- auth screens */

.auth { min-height: calc(100vh - 4rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: clamp(2rem, 6vw, 4rem) var(--gutter); }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-size: var(--step-3); margin-bottom: 0.35rem; }
.auth-box .lead { color: var(--muted); margin-bottom: 1.75rem; }
.auth-foot { margin-top: 1.5rem; color: var(--muted); font-size: 0.95rem; }
.auth-aside {
  background: var(--green); color: #e7f0eb; padding: clamp(2rem, 5vw, 4rem);
  display: flex; flex-direction: column; justify-content: center; gap: 1.75rem; position: relative; overflow: hidden;
}
.auth-aside h2 { color: #fff; max-width: 18ch; }
.auth-aside p { color: #cfe0d6; max-width: 40ch; }
.auth-aside .sheet { color: var(--ink); max-width: 420px; }
.auth-aside .sheet p { color: inherit; }
.auth-aside .sheet .sheet-sub { color: var(--muted); }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; min-height: auto; }
  .auth-aside { display: none; }
}

.field-error { color: var(--danger); font-size: var(--step--1); font-weight: 500; margin-top: 0.35rem; }

.link-button {
  display: inline-flex; align-items: center; min-height: 44px;
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600; font-size: 0.95rem;
  color: var(--green); cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px;
}
.link-button:hover { color: var(--green-hover); }
.link-button.disabled, .link-button[aria-disabled="true"] { color: var(--muted); text-decoration: none; cursor: default; }

.spinner {
  width: 1em; height: 1em; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: ns-spin 0.7s linear infinite;
}
@keyframes ns-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- utility */

.stack > * + * { margin-top: var(--stack, 1rem); }
.cluster { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.center { text-align: center; }

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

[hidden] { display: none !important; }
