/* =========================================================
   Plywoodify Tools — Mobile-first stylesheet
   Hand-crafted to replace the Tailwind CDN (~3 MB saved).
   Target: low-end Android, slow 3G/4G networks (India)
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Brand */
  --brand-blue: #3b82f6;
  --brand-blue-600: #2563eb;
  --brand-blue-700: #1d4ed8;
  --brand-teal: #14b8a6;
  --brand-teal-600: #0d9488;
  --brand-grad: linear-gradient(90deg, var(--brand-blue-600) 0%, var(--brand-teal-600) 100%);

  /* Neutrals (slate scale) */
  --c-bg: #f1f5f9;
  --c-surface: #ffffff;
  --c-surface-2: #f8fafc;
  --c-input: #f1f5f9;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e1;
  --c-text: #0f172a;
  --c-text-2: #334155;
  --c-text-3: #64748b;
  --c-text-4: #94a3b8;

  /* Feedback */
  --c-success: #10b981;
  --c-danger: #ef4444;
  --c-danger-600: #dc2626;
  --c-warn: #f59e0b;

  /* Typography — clamp() for fluid scale */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --fs-xs:  clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
  --fs-sm:  clamp(0.82rem, 0.78rem + 0.18vw, 0.9rem);
  --fs-base: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  --fs-md:  clamp(1.02rem, 0.95rem + 0.3vw, 1.15rem);
  --fs-lg:  clamp(1.12rem, 1.02rem + 0.45vw, 1.3rem);
  --fs-xl:  clamp(1.25rem, 1.1rem + 0.7vw, 1.55rem);
  --fs-2xl: clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
  --fs-3xl: clamp(1.9rem, 1.5rem + 1.6vw, 2.7rem);

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.10);
  --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.35);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur: 220ms;

  /* Layout */
  --bottom-nav-h: 64px;
  --header-h: 56px;
  --container-max: 64rem;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Reserve space for the sticky bottom nav so content isn't hidden */
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  overflow-x: hidden; /* defensive — kills horizontal scroll */
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.2;
  color: var(--c-text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

p { margin: 0; }

a {
  color: var(--brand-blue-600);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Custom scrollbar (desktop only — mobile uses OS) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-4); }

/* Focus ring — keyboard only */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Visually hidden (sr-only) */
.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;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

.app {
  padding-top: max(var(--sp-4), env(safe-area-inset-top));
  padding-bottom: var(--sp-6);
}

/* ---------- Header / hero ---------- */
.hero {
  text-align: center;
  margin-bottom: var(--sp-5);
}

.hero__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.brand {
  font-size: var(--fs-3xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Fallback for older browsers — text will simply be the blue color */
  -webkit-text-fill-color: transparent;
}

.hero__tagline {
  margin-top: var(--sp-2);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
}

.hero__tagline strong {
  color: var(--c-text);
  font-weight: 600;
}

/* ---------- Install button (PWA) ---------- */
.install-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--brand-blue);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: var(--sp-2) var(--sp-4);
  border: 0;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  min-height: 40px;
}
.install-btn:hover { background: var(--brand-blue-600); }
.install-btn:active { transform: scale(0.97); }
.install-btn[hidden] { display: none; }
.install-btn svg { width: 18px; height: 18px; }

/* ---------- Top tab bar (desktop / tablet) ---------- */
.tabs {
  margin: var(--sp-5) 0 var(--sp-6);
  border-bottom: 1px solid var(--c-border-strong);
  /* hide on mobile — bottom-nav takes over */
  display: none;
}

@media (min-width: 640px) {
  .tabs { display: block; }
}

.tabs__list {
  display: flex;
  gap: var(--sp-1);
  margin: 0; padding: 0;
  list-style: none;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--c-text-3);
  font-weight: 500;
  font-size: var(--fs-sm);
  padding: var(--sp-3) var(--sp-2);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  min-height: 44px;
  /* margin-bottom: -1px to overlap the border-bottom of .tabs */
  margin-bottom: -1px;
  border-radius: 6px 6px 0 0;
}
.tab-btn:hover { background: var(--c-surface-2); color: var(--c-text); }
.tab-btn[aria-selected="true"] {
  color: var(--brand-blue-600);
  border-bottom-color: var(--brand-blue);
  font-weight: 600;
}

/* ---------- Bottom navigation (mobile only) ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.06);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 640px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

.bottom-nav__btn {
  flex: 1;
  background: transparent;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-1);
  color: var(--c-text-3);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  min-height: var(--bottom-nav-h);
  position: relative;
  transition: color var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav__btn svg {
  width: 22px; height: 22px;
  stroke-width: 2;
  transition: transform var(--dur-fast) var(--ease);
}
.bottom-nav__btn[aria-selected="true"] {
  color: var(--brand-blue-600);
}
.bottom-nav__btn[aria-selected="true"]::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px;
  background: var(--brand-grad);
  border-radius: 0 0 3px 3px;
}
.bottom-nav__btn[aria-selected="true"] svg {
  transform: translateY(-1px) scale(1.05);
}
.bottom-nav__btn:active { background: var(--c-surface-2); }

/* ---------- Ad banner ---------- */
.adstrip {
  margin: var(--sp-4) 0;
  text-align: center;
}
.adstrip__link {
  display: block;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease);
  text-decoration: none;
}
.adstrip__link:hover { text-decoration: none; transform: translateY(-1px); }
.adstrip__link strong { display: block; font-size: var(--fs-md); margin-top: 2px; }

/* ---------- Card (the print-area surface) ---------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: var(--sp-4);
  margin-inline: auto;
}

@media (min-width: 640px) {
  .card { padding: var(--sp-6); }
}

@media (min-width: 768px) {
  .card { padding: var(--sp-8); }
}

.card__title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--c-border);
}

/* ---------- Forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--c-text-3);
  font-weight: 500;
}

.input,
.select,
.input--line {
  width: 100%;
  font: inherit;
  font-size: var(--fs-base);
  color: var(--c-text);
  background: var(--c-input);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 0.65rem 0.75rem;
  min-height: 44px; /* touch target */
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.input:focus,
.select:focus,
.input--line:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-focus);
  background: var(--c-surface);
}

/* Number inputs — remove the spinner on mobile (it's a tap target thief) */
.input[type="number"] {
  -moz-appearance: textfield;
}
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Underline-style input (for From/To names) */
.input--line {
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--c-border-strong);
  border-radius: 0;
  padding: var(--sp-2) var(--sp-1);
  min-height: 40px;
}
.input--line:focus {
  background: transparent;
  border-bottom-color: var(--brand-blue);
  box-shadow: none;
}

/* Select dropdown — custom chevron */
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.25rem;
}

/* Right-aligned numeric input (for amounts) */
.input--amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Centered numeric input (for pieces/rate cells) */
.input--cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-base);
  padding: 0.7rem 1.25rem;
  min-height: 44px;
  border: 0;
  border-radius: var(--r-md);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--brand-teal);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--brand-teal-600); }

.btn--secondary {
  background: var(--c-text-3);
  color: #fff;
}
.btn--secondary:hover { background: var(--c-text-2); }

.btn--ghost {
  background: transparent;
  color: var(--brand-blue-600);
  padding: var(--sp-2) var(--sp-3);
  min-height: 40px;
}
.btn--ghost:hover { background: rgba(59, 130, 246, 0.08); }

.btn--block { width: 100%; }

.btn-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
}
@media (min-width: 640px) {
  .btn-row {
    flex-direction: row;
    justify-content: flex-end;
  }
  .btn-row .btn { width: auto; }
  .btn { font-size: var(--fs-sm); }
}

/* Icon-only "x" delete button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  border-radius: var(--r-md);
  color: var(--c-danger);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover { background: rgba(239, 68, 68, 0.1); color: var(--c-danger-600); }
.btn-icon:active { transform: scale(0.92); }

/* Add-row pill button */
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(59, 130, 246, 0.08);
  color: var(--brand-blue-600);
  border: 1px dashed var(--brand-blue);
  border-radius: var(--r-pill);
  padding: var(--sp-2) var(--sp-5);
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
  min-height: 44px;
  transition: background var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn-add:hover { background: rgba(59, 130, 246, 0.14); }
.btn-add:active { transform: scale(0.98); }
.btn-add svg { width: 18px; height: 18px; }

/* ---------- Tab content ---------- */
.tab-content { display: none; }
.tab-content.is-active {
  display: block;
  animation: fadeIn 220ms var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Meta strip (From / To / Date) ---------- */
.meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.meta__date {
  font-size: var(--fs-sm);
  color: var(--c-text-3);
}
.meta__date strong {
  color: var(--c-text);
  font-weight: 600;
  font-size: var(--fs-base);
}

@media (min-width: 640px) {
  .meta {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .meta__date { text-align: right; }
}

.meta__fields {
  display: grid;
  gap: var(--sp-3);
}

/* ---------- Calc rows (responsive table → cards) ----------
   On mobile each row becomes a card with stacked label/value pairs.
   On ≥640px we present a tabular grid. */

.calc-row {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  transition: border-color var(--dur-fast) var(--ease);
}
.calc-row:focus-within { border-color: var(--brand-blue); }

/* Each cell: label above value (mobile) */
.calc-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.calc-cell__label {
  font-size: var(--fs-xs);
  color: var(--c-text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.calc-cell__value {
  font-weight: 600;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

/* Pricing cells use right-aligned tabular numbers */
.calc-cell__value--amount { color: var(--c-text); font-size: var(--fs-md); }
.calc-cell__value--size { color: var(--brand-blue-700); font-size: var(--fs-md); }

/* Tabular layout — only on larger screens */
.calc-grid--3 { grid-template-columns: 1fr; }
.calc-grid--4 { grid-template-columns: 1fr; }
.calc-grid--5 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .calc-row {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--c-border);
    border-radius: 0;
    padding: var(--sp-3) var(--sp-2);
  }
  .calc-grid--3 {
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
  }
  .calc-grid--4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    align-items: center;
  }
  .calc-grid--5 {
    grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr;
    align-items: center;
  }
  .calc-cell { justify-content: flex-start; }
  .calc-cell__label { display: none; } /* labels become column headers */
  .calc-grid__head {
    display: grid;
    gap: var(--sp-3);
    padding: 0 var(--sp-2) var(--sp-2);
    border-bottom: 1px solid var(--c-border-strong);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    color: var(--c-text-3);
    letter-spacing: 0.04em;
  }
  .calc-grid__head.calc-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
  .calc-grid__head.calc-grid--4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .calc-grid__head.calc-grid--5 { grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr; }
}

/* Hide table headers on mobile (info is in per-cell labels) */
.calc-grid__head { display: none; }
@media (min-width: 640px) {
  .calc-grid__head { display: grid; }
}

/* Compact in-row size selector + delete button cluster */
.calc-cell__size {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.calc-cell__size .input { width: 64px; padding: 0.5rem 0.5rem; min-height: 40px; }
.calc-cell__size span { color: var(--c-text-3); font-size: var(--fs-xs); }

/* ---------- Plywood thickness group card ---------- */
.group {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  background: var(--c-surface-2);
  margin-bottom: var(--sp-4);
}
.group__header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: var(--sp-3);
}
.group__header .input { flex: 1; min-width: 0; }
.group__rate { width: 100%; flex: 1; }
@media (min-width: 640px) {
  .group__rate { width: 9rem; flex: 0 0 9rem; }
}
.group__rows { display: flex; flex-direction: column; gap: var(--sp-2); }
.group__add {
  display: flex; gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--c-border-strong);
}
.group__add .select { flex: 1; }
.group__subtotal {
  text-align: right;
  font-weight: 700;
  font-size: var(--fs-md);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
}
.group__subtotal span { color: var(--brand-teal-600); }

/* ---------- Section heading (e.g. "4 Feet Section") ---------- */
.section-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-6) 0 var(--sp-3);
  color: var(--brand-teal-600);
  font-size: var(--fs-lg);
  font-weight: 700;
}
.section-head:first-of-type { margin-top: 0; }

.toggle-btn {
  background: transparent;
  border: 0;
  color: var(--c-text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.toggle-btn:hover { background: var(--c-surface-2); }
.toggle-btn svg { transition: transform var(--dur) var(--ease); width: 20px; height: 20px; }
.toggle-btn[aria-expanded="false"] svg { transform: rotate(-90deg); }

[data-collapsible] {
  overflow: hidden;
  transition: max-height var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
[data-collapsible][hidden] {
  max-height: 0 !important;
  opacity: 0;
  margin: 0;
  display: block;
}

/* ---------- Totals & final amount ---------- */
.totals {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 2px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.totals__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-text-2);
}
.totals__row .input {
  width: clamp(7rem, 40vw, 10rem);
  text-align: right;
}

.totals__row--sub {
  color: var(--c-text-3);
  font-weight: 500;
  font-size: var(--fs-sm);
}

.final {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 2px solid var(--brand-blue);
}
.final__label {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.final__amount {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--brand-teal-600);
  font-variant-numeric: tabular-nums;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  margin-top: var(--sp-10);
  color: var(--c-text-3);
  font-size: var(--fs-sm);
}

/* ---------- Print styles ---------- */
@media print {
  body {
    background: #fff !important;
    padding: 0 !important;
  }
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; color: #000 !important; }
  .print-area {
    position: absolute;
    inset: 0 0 auto 0;
    width: 100%;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    padding: 1rem !important;
  }
  .no-print { display: none !important; }
  .print-show { display: inline-block !important; }
  .hidden { display: revert !important; }
  .input, .input--line, .select {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  .final__amount, .calc-cell__value--amount, .totals__row .input,
  .brand { color: #000 !important; -webkit-text-fill-color: #000 !important; }
  .brand { background: none !important; }
}

.print-show { display: none; }

/* ---------- Standalone (installed PWA) tweaks ---------- */
@media all and (display-mode: standalone) {
  .app { padding-top: calc(env(safe-area-inset-top) + var(--sp-5)); }
}

/* ---------- Tiny-screen polish (≤340 px) ---------- */
@media (max-width: 340px) {
  :root { --container-max: 100%; }
  .container { padding-inline: var(--sp-3); }
  .card { padding: var(--sp-3); }
  .calc-row { padding: var(--sp-2); }
}

/* ---------- Reduced data / connection hints ---------- */
@media (prefers-reduced-data: reduce) {
  .adstrip__link { background: var(--brand-blue-600); }
}
