:root {
  --ink: #0b1f33;
  --ink-2: #14324c;
  --paper: #f6f8f5;
  --panel: #ffffff;
  --line: #c9d3dc;
  --muted: #526171;
  --text: #102235;
  --accent: #12884d;
  --accent-2: #28c76f;
  --danger: #a83434;
  --warn-bg: #fff7df;
  --shadow: 0 18px 45px rgba(11, 31, 51, 0.12);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--text);
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  line-height: 1.5;
}

a {
  color: var(--ink-2);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: var(--ink);
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.brand:hover,
.site-header a:hover {
  color: #d9ffe9;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 0.22rem;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
}

.brand-mark span {
  border-radius: 0.14rem;
  background: #fff;
}

.brand-mark span:nth-child(1) {
  width: 70%;
}

.brand-mark span:nth-child(2) {
  width: 92%;
}

.brand-mark span:nth-child(3) {
  width: 58%;
  background: var(--accent-2);
}

.site-header nav,
.site-footer nav,
.more-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
}

.site-header a {
  color: #fff;
}

.section-wrap {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  padding: clamp(2.5rem, 7vw, 5rem) 0 1.5rem;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 0.84rem;
  margin: 0 0 0.65rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.08;
  letter-spacing: 0;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  margin: 0;
  max-width: 12ch;
}

.lede {
  max-width: 760px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--muted);
  margin: 1rem 0 0;
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.8fr);
  gap: 1rem;
  align-items: start;
  padding: 1rem 0 3rem;
}

.tool-panel,
.results-panel,
.contact-form,
.content-page {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

.tool-panel,
.results-panel {
  padding: clamp(1rem, 2vw, 1.5rem);
}

.tool-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.tool-head h2,
.results-panel h2,
.use-section h2,
.contact-section h2,
.content-page h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.tool-head p,
.helper,
.contact-copy p {
  color: var(--muted);
}

.team-size {
  display: grid;
  gap: 0.35rem;
  min-width: 8rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.38rem;
  padding: 0.55rem 0.65rem;
  color: var(--text);
  background: #fff;
}

textarea {
  resize: vertical;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.tool-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.tool-table th {
  padding: 0.65rem;
  text-align: left;
  font-size: 0.82rem;
  color: var(--muted);
  background: #eef3f2;
  white-space: nowrap;
}

.tool-table td {
  padding: 0.55rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.tool-table .price-cell {
  min-width: 8rem;
}

.field-hint {
  display: none;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--danger);
}

.invalid-price .field-hint {
  display: block;
}

.seats-wrap {
  display: grid;
  gap: 0.25rem;
}

.flat-row .seats-input {
  opacity: 0.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  border: 1px solid var(--line);
  border-radius: 0.42rem;
  padding: 0.62rem 0.9rem;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: #0f7542;
  color: #fff;
}

.button.danger {
  color: var(--danger);
}

.remove-row {
  min-width: 2.7rem;
  padding: 0.45rem 0.55rem;
}

.copy-status,
.form-status {
  min-height: 1.5rem;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.metrics div {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.85rem;
  background: #f8fbfa;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.metrics strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink);
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.report-block {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1rem;
}

.report-block h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

/* :WHY? zero side padding let "Annual cost" run into "Share" in the narrow results column (seen live at 800px, 10-01). */
.breakdown-table th,
.breakdown-table td {
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.breakdown-table th:nth-child(2),
.breakdown-table td:nth-child(2) {
  text-align: right;
  padding-right: 0.75rem;
  white-space: nowrap;
}

.bar-track {
  height: 0.62rem;
  border-radius: 1rem;
  background: #dfe8e3;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: var(--bar-width, 0%);
  background: var(--accent);
}

.warning-list {
  padding-left: 1.1rem;
  margin: 0;
}

.warning-list li {
  margin-bottom: 0.55rem;
}

.empty-note {
  color: var(--muted);
  margin: 0;
}

.renewal-month {
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.65rem;
  margin-bottom: 0.6rem;
}

.renewal-month strong {
  color: var(--ink);
}

.renewal-month ul {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}

.use-section,
.contact-section {
  padding: 2.5rem 0;
}

.tips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.tips article {
  border-left: 4px solid var(--accent);
  padding: 0.1rem 0 0.1rem 1rem;
}

.tips h3 {
  margin: 0 0 0.4rem;
}

.tips p {
  color: var(--muted);
  margin: 0;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: 1rem;
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 0.85rem;
  padding: clamp(1rem, 2vw, 1.5rem);
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: start;
  font-weight: 600;
}

.check-row input {
  width: auto;
  margin-top: 0.28rem;
}

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

.content-page {
  padding: clamp(1.2rem, 4vw, 2.5rem);
  margin-top: 2rem;
  margin-bottom: 3rem;
  max-width: 820px;
}

.content-page h1 {
  max-width: 14ch;
}

.content-page h2 {
  margin-top: 1.8rem;
}

.site-footer {
  padding: 2rem clamp(1rem, 4vw, 3rem);
  background: var(--ink);
  color: #fff;
}

.site-footer a {
  color: #d9ffe9;
}

.site-footer p {
  margin: 0 0 0.65rem;
}

.more-links {
  margin-top: 1rem;
}

.more-links span {
  font-weight: 800;
}

@media (max-width: 920px) {
  .calculator-shell,
  .contact-section,
  .tips {
    grid-template-columns: 1fr;
  }

  .results-panel {
    order: 2;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-head {
    flex-direction: column;
  }

  .team-size {
    width: 100%;
  }

  .table-scroll {
    overflow: visible;
    border: 0;
  }

  .tool-table {
    min-width: 0;
  }

  .tool-table thead {
    display: none;
  }

  .tool-table,
  .tool-table tbody,
  .tool-table tr,
  .tool-table td {
    display: block;
    width: 100%;
  }

  .tool-table tr {
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    padding: 0.65rem;
    margin-bottom: 0.8rem;
    background: #fbfdfc;
  }

  .tool-table td {
    border-top: 0;
    padding: 0.35rem 0;
  }

  .tool-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
  }

  .metrics {
    grid-template-columns: 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #081522;
    --panel: #0f2235;
    --line: #385069;
    --muted: #b7c5d1;
    --text: #edf4f8;
    --ink: #f4faf7;
    --ink-2: #c8ffe0;
    --warn-bg: #2a240f;
    --shadow: none;
  }

  .site-header,
  .site-footer {
    background: #07111c;
  }

  input,
  select,
  textarea,
  .button {
    color: var(--text);
    background: #0a1a2a;
  }

  .tool-table th,
  .metrics div,
  .tool-table tr {
    background: #10283e;
  }

  .bar-track {
    background: #254057;
  }
}

@media print {
  :root {
    --paper: #fff;
    --panel: #fff;
    --text: #000;
    --ink: #000;
    --muted: #333;
    --line: #999;
    --shadow: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .actions,
  .contact-section,
  .site-footer,
  .copy-status,
  .helper,
  .remove-row {
    display: none !important;
  }

  .section-wrap {
    width: 100%;
  }

  .hero {
    padding: 0 0 1rem;
  }

  h1 {
    font-size: 2rem;
    max-width: none;
  }

  .calculator-shell {
    display: block;
    padding: 0;
  }

  .tool-panel,
  .results-panel {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .table-scroll {
    overflow: visible;
  }

  .tool-table {
    min-width: 0;
    font-size: 0.75rem;
  }

  input,
  select,
  textarea {
    border: 0;
    padding: 0;
    color: #000;
    background: transparent;
    appearance: none;
  }

  .metrics {
    grid-template-columns: repeat(4, 1fr);
  }
}

.breakdown-table th:first-child,
.breakdown-table td:first-child { padding-left: 0; }
.breakdown-table th:last-child,
.breakdown-table td:last-child { padding-right: 0; width: 34%; }
