/* GrandBill — customer site */
:root {
  --forest: #173F35;
  --green: #118765;
  --green-dark: #0C6B50;
  --mint: #EAF6EF;
  --mint-deep: #D3EBDD;
  --paper: #FFFFFF;
  --ink: #16241F;
  --muted: #536660;
  --line: #C9DCD1;
  --amber-bg: #FFF3D6;
  --amber-ink: #7A4D00;
  --red: #B42318;
  --radius: 14px;
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --zig: 9px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.55;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
h1, h2, h3 { color: var(--forest); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.0625rem; font-weight: 700; }
p { margin: 0 0 .9em; }
a { color: var(--green-dark); text-underline-offset: 3px; }
a:hover { color: var(--forest); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--forest); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* header / footer */
.site-header { background: var(--paper); }
.page-home .site-header { background: var(--mint); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--forest); text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand-mark { width: 28px; height: 28px; }
.header-nav { display: flex; align-items: center; gap: 20px; font-weight: 600; }
.header-nav a { color: var(--forest); text-decoration: none; }
.header-nav a:hover { text-decoration: underline; }
.inline { display: inline; margin: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--forest); cursor: pointer; }
.linklike:hover { text-decoration: underline; }

.site-footer { border-top: 1px solid var(--line); margin-top: 64px; font-size: .9375rem; color: var(--muted); }
.page-home .site-footer { margin-top: 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center; padding-top: 22px; padding-bottom: 22px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-inner a { color: var(--forest); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
.footer-inner p { margin: 0; }

/* buttons + forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--forest); color: #fff; }
.btn-quiet { background: var(--paper); color: var(--forest); border-color: var(--forest); }
.btn-quiet:hover { background: var(--mint); color: var(--forest); }
.btn-danger { background: var(--paper); color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #FDECEA; }

.field { display: grid; gap: 6px; font-weight: 600; color: var(--forest); }
.field input, .field select {
  font: inherit; font-weight: 400; color: var(--ink); min-height: 48px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 10px; background: #fff; width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(17,135,101,.25); }
.field.invalid input { border-color: var(--red); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .9375rem; line-height: 1.45; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--green); cursor: pointer; }
.check.invalid { color: var(--red); }
.check.invalid input { outline: 2px solid var(--red); outline-offset: 2px; }
.hint { color: var(--muted); font-size: .9375rem; margin: 0; }
.error { color: var(--red); font-weight: 600; font-size: .9375rem; margin: 0; }
.error:empty { display: none; }
.note { color: var(--muted); font-size: .9375rem; }
.stack { display: grid; gap: 16px; }
.after { margin-top: 18px; }
.mt { margin-top: 1.5em; }

.flash { margin: 16px 0 0; padding: 12px 16px; background: var(--mint); border-left: 4px solid var(--green); border-radius: 6px; color: var(--forest); font-weight: 600; }
.flash p { margin: 0; }
.page-home .flash { margin-bottom: 8px; }

/* ===== the bill sheet: the one bold element ===== */
.sheet {
  position: relative; background: var(--paper); border-radius: 12px 12px 0 0;
  padding: 26px 24px calc(28px + var(--zig));
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zig)) 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zig)) 100%;
}
.sheet-head { font-weight: 800; color: var(--forest); font-size: 1.125rem; margin: 0 0 4px; letter-spacing: -0.01em; }
.sheet-file { color: var(--muted); font-size: .875rem; margin: 0 0 14px; overflow-wrap: anywhere; }
.sheet-lines { margin-bottom: 22px; }
.sheet-lines dl { margin: 0; }
.line { display: flex; align-items: baseline; gap: 8px; padding: 9px 0; font-size: .9375rem; color: var(--muted); }
.line > i { flex: 1; min-width: 16px; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.line .ph { display: inline-flex; align-items: center; gap: 6px; }
.line .ph::before { content: ""; width: 2.6em; height: .62em; border-radius: 4px; background: var(--mint-deep); }

.upload-sheet .sheet-lines { padding-bottom: 6px; border-bottom: 2px solid var(--forest); }
.drop { display: grid; gap: 14px; }
.btn-upload { width: 100%; min-height: 58px; font-size: 1.125rem; }
.file-input { font: inherit; font-size: .9375rem; }
.js .file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.js-only { display: none; }
.js .js-only { display: inline-flex; }
.js .no-js { display: none; }
.upload-sheet.dragging { background: #F6FBF8; }
.upload-sheet.dragging .drop { outline: 2px dashed var(--green); outline-offset: 8px; border-radius: 8px; }
.reading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(255,255,255,.94); color: var(--forest); font-weight: 700; }
.reading[hidden] { display: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--mint-deep); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* home */
.hero { background: var(--mint); padding: 24px 0 72px; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
.hero-title {
  font-size: clamp(2.9rem, 11vw, 6rem); line-height: .95; letter-spacing: -0.045em; font-weight: 800;
  margin: 8px 0 0; max-width: 9ch;
}
.intro { background: var(--forest); color: var(--mint); padding: 56px 0; }
.intro p { max-width: 46ch; margin: 0; font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.4; font-weight: 500; letter-spacing: -0.01em; }
@media (min-width: 900px) {
  .hero { padding: 48px 0 104px; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 56px; }
  .upload-sheet { transform: rotate(1.2deg); }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* result */
.result { padding-top: 24px; }
.result-head { max-width: 62ch; margin-bottom: 28px; }
.lede { font-size: 1.125rem; color: var(--ink); }
.result-grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .result-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; } }
.sheet-stage { background: var(--mint); border-radius: var(--radius); padding: 20px 16px 28px; }
@media (min-width: 720px) { .sheet-stage { padding: 32px 32px 40px; } }
.filled-sheet .sheet-lines { margin-bottom: 14px; }
.line.filled { display: grid; grid-template-columns: auto minmax(12px, 1fr) auto; align-items: baseline; gap: 0 8px; color: var(--ink); padding: 10px 0; }
.line.filled dt { color: var(--muted); }
.line.filled dd { margin: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.line.filled .line-flag { grid-column: 1 / -1; }
.val { font-weight: 700; color: var(--forest); font-variant-numeric: tabular-nums; font-size: 1rem; }
.sub { color: var(--muted); font-size: .875rem; }
.line-flag { flex-basis: 100%; margin: 4px 0 0; padding: 8px 10px; background: var(--amber-bg); color: var(--amber-ink); font-size: .875rem; border-radius: 6px; }
.conf { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.conf::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.conf-high { color: var(--green-dark); }
.conf-reviewed { color: var(--forest); }
.conf-medium { color: var(--muted); }
.conf-medium::before { background: transparent; border: 2px solid currentColor; width: 9px; height: 9px; }
.conf-check { color: var(--amber-ink); background: var(--amber-bg); padding: 2px 8px; border-radius: 999px; }
.conf-check::before { display: none; }
.sheet-notes { font-size: .9375rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin: 0; }
.sheet-notes p { margin: 0 0 4px; }
.empty-sheet { color: var(--muted); }

.result-side { display: grid; gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; background: var(--paper); }
.panel h2 { font-size: 1.0625rem; margin-bottom: 10px; }
.panel p:last-child, .panel details:last-child { margin-bottom: 0; }
.figure { font-size: clamp(2rem, 6vw, 2.6rem); font-weight: 800; color: var(--forest); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.figure span { display: block; font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-top: 4px; }
.figure-none { font-size: 1.5rem; color: var(--muted); }
.sums { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-bottom: 12px; font-size: .9375rem; }
.sums th { text-align: left; font-weight: 400; color: var(--muted); padding: 5px 0; }
.sums td { text-align: right; padding: 5px 0; }
.sums .total th, .sums .total td { font-weight: 700; color: var(--forest); border-top: 2px solid var(--forest); padding-top: 8px; }
.ok { color: var(--green-dark); font-weight: 600; }
.estimate-tag { display: inline-block; border: 2px dashed var(--green); color: var(--green-dark); font-weight: 700; font-size: .8125rem; padding: 1px 10px; border-radius: 999px; margin-bottom: 8px; }
details summary { cursor: pointer; font-weight: 600; color: var(--green-dark); }
details ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: .9375rem; }
.panel-save { background: var(--forest); border-color: var(--forest); color: var(--mint); }
.panel-save h2 { color: #fff; font-size: 1.25rem; }
.panel-save a { color: #fff; }
.panel-save form { display: grid; gap: 14px; margin-top: 4px; }
.panel-save .field span { color: #fff; }
.panel-save .check.invalid { color: #FFC9C2; }
.panel-save .error { color: #FFC9C2; }
.panel-save .btn-primary { background: var(--mint); color: var(--forest); }
.panel-save .btn-primary:hover { background: #fff; }
.more-data h2 { font-size: 1rem; }
.more-data ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.soon { font-size: .8125rem; font-weight: 600; color: var(--muted); background: #F1F4F2; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }

/* My Savings */
.savings { padding-top: 28px; }
.temp-banner { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; background: var(--amber-bg); color: var(--amber-ink); padding: 16px 20px; border-radius: var(--radius); margin-bottom: 24px; }
.temp-banner p { margin: 0; max-width: 60ch; }
.temp-banner form { margin: 0; }
.totals { display: grid; gap: 16px; margin-bottom: 36px; }
@media (min-width: 760px) { .totals { grid-template-columns: 1fr 1fr; } }
.total-card { border-radius: var(--radius); padding: 22px 24px; }
.total-card h2 { font-size: 1rem; margin-bottom: 8px; }
.total-card p:last-child { margin-bottom: 0; }
.total-estimate { border: 2px dashed var(--green); background: var(--paper); }
.total-actual { background: var(--forest); color: var(--mint); }
.total-actual h2, .total-actual .figure { color: #fff; }
.block { margin-bottom: 40px; }
.todo { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.bills { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.bills th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--forest); padding: 8px 12px 8px 0; }
.bills td { border-bottom: 1px solid var(--line); padding: 12px 12px 12px 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .bills thead { display: none; }
  .bills tr { display: grid; grid-template-columns: 1fr auto; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .bills td { border: 0; padding: 2px 0; }
  .bills td:nth-child(2), .bills td:nth-child(3) { color: var(--muted); }
}
.more { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.more li { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.more li > div { max-width: 62ch; }
.more h3 { margin: 0 0 2px; }
.more p { margin: 0; color: var(--muted); font-size: .9375rem; }
.more li.later h3 { color: var(--muted); }
.more form { display: flex; gap: 12px; align-items: center; margin: 0; }
.more .linklike { color: var(--green-dark); font-size: .9375rem; }
.two-col { display: grid; gap: 32px; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; gap: 48px; } }
.danger-zone { border: 1px solid #F1C5C0; border-radius: var(--radius); padding: 18px 20px; }
.danger-zone p { margin: 0; }

/* narrow pages */
.narrow { max-width: 480px; padding-top: 40px; }

/* legal */
.legal { max-width: 720px; padding-top: 32px; }
.legal h2 { margin-top: 1.6em; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.meta { color: var(--muted); }
.draft-note { background: var(--amber-bg); color: var(--amber-ink); padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: .9375rem; }
.cookie-table { width: 100%; border-collapse: collapse; font-size: .9375rem; margin: 16px 0 8px; }
.cookie-table th, .cookie-table td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.cookie-table th { border-bottom: 2px solid var(--forest); color: var(--muted); }
@media (max-width: 640px) {
  .cookie-table thead { display: none; }
  .cookie-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .cookie-table td { display: block; border: 0; padding: 2px 0; }
  .cookie-table td:first-child { font-weight: 700; color: var(--forest); }
}

/* cookie banner */
.cookie-banner { position: sticky; bottom: 0; z-index: 5; background: var(--paper); border-top: 2px solid var(--forest); }
.cookie-inner { max-width: 1120px; margin: 0 auto; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.cookie-inner p { margin: 0; font-size: .9375rem; max-width: 70ch; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.cookie-actions .btn { min-height: 44px; }
@media (max-width: 520px) { .cookie-actions { width: 100%; } .cookie-actions .btn { flex: 1; padding: 0 12px; } }
.conditions { margin: 0 0 10px; padding-left: 20px; font-size: .9375rem; }
.area-choice { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
