:root {
  /* Light theme */
  --bg: #FAFAFA;
  --sheet-bg: #FFFFFF;
  --text: #1D1D1F;
  --muted: #6E6E73;
  --border: #D2D2D7;
  --row-alt: #FBFBFD;
  --row: #FFFFFF;
  --header: #1D1D1F;
  --accent-red: #FF3B30; /* for errors */
  --sum-bg: #F5F5F7;
  --capsule-bg: #F5F5F7;
  --capsule-text: #1D1D1F;
  --shadow: 0 12px 24px rgba(0,0,0,.08);
  --brand-blue: #AF2D3C;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  font-size: clamp(14px, 1.2vw + 0.2rem, 16px);
  font-weight: 300;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sheet {
  max-width: 1200px;
  margin: 0 auto 8px;
  background: transparent;
  position: relative;
}

.page-banner {
  background: transparent;
  color: var(--text);
  padding: 32px 0 16px;
}
.page-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.page-banner h1 {
  margin: 0;
  font-size: clamp(24px, 2.4vw + 1rem, 34px);
  font-weight: 400;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}
.page-banner h1 span { display: block; }

.page-banner__subtitle {
  margin: 8px 0 0;
  font-size: clamp(13px, 1vw + 0.3rem, 15px);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.5;
  max-width: 560px;
}
.page-banner__subtitle strong {
  font-weight: 500;
  color: var(--text);
}

.page-banner__logo {
  display: block;
  max-width: clamp(200px, 40%, 340px);
}
.page-banner__logo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Layout */
.panel-row { display: grid; grid-template-columns: minmax(0, 760px) minmax(0, 360px); gap: 24px; align-items: start; padding: 0 24px 32px; }
.panel { background: var(--sheet-bg); border-radius: 18px; box-shadow: 0 24px 48px rgba(0,0,0,.14); position: relative; overflow: hidden; }
.panel-main { padding: 24px; }
.summary-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 16px;
  align-self: start;
  width: 100%;
  margin-top: -60px;
}
.panel-summary {
  padding: 24px;
  background: var(--sheet-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.summary-meta { display: grid; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); justify-items: start; }
.summary-years {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.summary-years label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: .3px;
  text-transform: none;
  white-space: nowrap;
  text-align: left;
  flex: 0 1 auto;
}
.summary-years input[type="number"] {
  width: 72px;
  max-width: 72px;
  text-align: center;
  padding: 6px 8px;
  margin-left: auto;
}
.summary-billing { display: flex; align-items: center; gap: 16px; margin: 0 0 0 -5px; flex-wrap: wrap; justify-content: flex-start; width: 100%; justify-self: start; }
.summary-billing__label { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: .2px; transition: color .15s ease; }
.summary-billing__label.is-active { color: var(--text); }
.summary-radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.summary-billing .summary-radio:last-of-type { margin-left: auto; }
.summary-radio input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  position: relative;
  flex-shrink: 0;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.summary-radio input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(175, 45, 60, 0.25);
}
.summary-radio input[type="radio"]:checked {
  border-color: var(--brand-blue);
}
.summary-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brand-blue);
}
/* Summary panel — price block */
.summary-total { margin-top: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.summary-total__label { font-size: 12px; font-weight: 500; color: var(--muted); display: block; margin-bottom: 4px; }
.summary-total__amount { font-size: 28px; font-weight: 400; color: var(--text); line-height: 1.1; margin-bottom: 6px; }
.summary-note-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.summary-note { font-size: 11px; color: var(--muted); text-align: right; margin-left: auto; }
#perUserMonth { margin-top: 10px; display: inline-block; background: #F5F5F7; border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--text); }

/* Summary list */
.summary-list { font-size: 12px; display: grid; gap: 6px; margin: 0; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.summary-list:empty { display: none; }
.summary-list .sum-item { display: grid; gap: 4px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.summary-list .sum-item:last-child { border-bottom: none; }
.summary-list .row.item-title { font-weight: 700; opacity: .95; }
.summary-list .row.breakdown { opacity: .95; }
.summary-list .row.total { font-weight: 400; }

/* Discount / support option rows */
.summary-section { margin-top: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.summary-section__header { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px; }
.option-row { display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px; cursor: pointer; user-select: none; }
.option-row + .option-row { margin-top: 12px; }
.option-row__content { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.option-row__label { font-size: 13px; font-weight: 500; color: var(--text); }
.option-row__desc { font-size: 11px; color: var(--muted); }

/* Support section — always-on item */
.support-always-on { cursor: default; pointer-events: none; }
.support-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.support-badge-incl { font-size: 10px; font-weight: 600; color: #1a7c3e; background: #e6f4ea; border-radius: 999px; padding: 2px 8px; white-space: nowrap; letter-spacing: .2px; }
.support-badge-custom { font-size: 10px; font-weight: 600; color: #1a5fa8; background: #e8f0fb; border-radius: 999px; padding: 2px 8px; white-space: nowrap; letter-spacing: .2px; }

.summary-extras { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 16px; justify-items: start; align-items: start; text-align: left; }
.summary-list .row { display: flex; justify-content: space-between; gap: 12px; }
.summary-list .row .num { font-weight: 400; }
.summary .btn-share { padding: 8px 10px; font-size: 12px; width: 100%; }
.summary-cta .btn-share { width: 100%; }
.summary-cta__tagline { margin: 8px 0 0; font-size: 11px; color: var(--muted); line-height: 1.5; text-align: center; }

.summary-lang-row { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding-top: 0; }
.summary-lang__controls { display: inline-flex; align-items: center; gap: 10px; }
.summary-lang__option { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.summary-lang__option.is-active { color: var(--text); }
.summary-switch { position: relative; width: 46px; height: 24px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.summary-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.summary-switch__track { width: 100%; height: 100%; background: #d2d2d7; border-radius: 999px; border: 1px solid var(--border); transition: background .18s ease, border-color .18s ease; }
.summary-switch__thumb {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.16);
  top: 50%;
  left: 2px;
  transform: translate(0, -50%);
  transition: left .18s ease, transform .18s ease;
}
.summary-switch input:checked + .summary-switch__track { background: var(--brand-blue); border-color: var(--brand-blue); }
.summary-switch input:checked + .summary-switch__track + .summary-switch__thumb { left: calc(100% - 20px - 2px); }


.nbp-rate { font-size: 11px; opacity: .9; text-transform: none; letter-spacing: 0; }

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px 24px;
  padding: 24px 36px 16px;
  border-bottom: 1px solid var(--border);
  align-items: end;
  grid-auto-flow: row dense;
}
.control { display: flex; flex-direction: column; gap: 6px; }
.control label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.control .static { font-weight: 600; color: var(--text); }
/* Unified styling for number inputs in top controls */
.controls input[type="number"] { font-size: 20px; padding: 14px 16px; width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.controls input[type="number"]::-webkit-outer-spin-button,
.controls input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.controls input[type="number"] { -moz-appearance: textfield; }

.features-toolbar { padding: 16px 36px 0; }
.btn-toggle-more { appearance: none; border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 999px; padding: 8px 12px; font-weight: 700; cursor: pointer; }
.btn-toggle-more:hover { background: #f5f5f7; }

input[type="number"] {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  width: 100%;
  font-family: inherit;
}
input[type="number"]:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 2px rgba(175,45,60,0.15); }
.input-invalid { border-color: var(--accent-red) !important; box-shadow: 0 0 0 2px rgba(231,76,60,.22); }
.input-hint-error { color: var(--accent-red); font-size: 11px; margin-top: 4px; }

.feature-card.core .scope {
  position: relative;
}
.feature-card.core .scope input#accounts {
  width: 100px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 6px 4px;
  box-shadow: none !important;
  transition: box-shadow .18s ease;
  outline: none;
}
.feature-card.core .scope input#accounts:hover {
  box-shadow: 0 1px 0 0 var(--text);
}
.feature-card.core .scope input#accounts:focus {
  box-shadow: 0 1px 0 0 var(--brand-blue);
}
.feature-card.core .scope input#accounts::-webkit-outer-spin-button,
.feature-card.core .scope input#accounts::-webkit-inner-spin-button {
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.feature-card.core .scope input#accounts:hover::-webkit-outer-spin-button,
.feature-card.core .scope input#accounts:hover::-webkit-inner-spin-button,
.feature-card.core .scope input#accounts:focus::-webkit-outer-spin-button,
.feature-card.core .scope input#accounts:focus::-webkit-inner-spin-button,
.feature-card.core:hover .scope input#accounts::-webkit-outer-spin-button,
.feature-card.core:hover .scope input#accounts::-webkit-inner-spin-button {
  opacity: 1;
  pointer-events: auto;
}
.feature-card.core .scope input#accounts::-moz-number-spin-box,
.feature-card.core .scope input#accounts::-moz-number-spin-up,
.feature-card.core .scope input#accounts::-moz-number-spin-down {
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.feature-card.core .scope input#accounts:hover::-moz-number-spin-box,
.feature-card.core .scope input#accounts:hover::-moz-number-spin-up,
.feature-card.core .scope input#accounts:hover::-moz-number-spin-down,
.feature-card.core .scope input#accounts:focus::-moz-number-spin-box,
.feature-card.core .scope input#accounts:focus::-moz-number-spin-up,
.feature-card.core .scope input#accounts:focus::-moz-number-spin-down,
.feature-card.core:hover .scope input#accounts::-moz-number-spin-box,
.feature-card.core:hover .scope input#accounts::-moz-number-spin-up,
.feature-card.core:hover .scope input#accounts::-moz-number-spin-down {
  opacity: 1;
  pointer-events: auto;
}

/* Toggle switch for features */
.option-cell { display: flex; align-items: center; gap: 10px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .switch { position: relative; width: 46px; height: 24px; background: #d2d2d7; border-radius: 999px; transition: background .18s ease, border-color .18s ease; border: 1px solid var(--border); }
.toggle .switch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transform: translate(0, -50%);
  transition: transform .18s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,.16);
}
.toggle input:checked + .switch { background: var(--brand-blue); border-color: var(--brand-blue); }
.toggle input:checked + .switch::after { transform: translate(22px, -50%); }

.controls .note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Share button */
.btn-share {
  appearance: none;
  border: 1px solid #151515;
  background: #151515;
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn-share:hover {
  background: #AF2D3C;
  border-color: #AF2D3C;
  color: #fff;
}
.btn-share:focus-visible {
  outline: none;
  background: #AF2D3C;
  border-color: #AF2D3C;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(175, 45, 60, 0.25);
}

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .18s ease; z-index: 1000; }
.modal-backdrop.show { opacity: 1; pointer-events: auto; }
.modal { width: min(680px, 92vw); background: var(--sheet-bg); color: var(--text); border-radius: 14px; box-shadow: var(--shadow); transform: scale(.96); opacity: 0; transition: transform .18s ease, opacity .18s ease; border: 1px solid var(--border); }
.modal-backdrop.show .modal { transform: scale(1); opacity: 1; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-close { appearance: none; border: none; background: transparent; color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.modal-body { padding: 14px; display: grid; gap: 12px; }
/* Share email form */
.modal-body .field { display: grid; gap: 6px; }
.modal-body .field label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.modal-body .field input { background: #fff; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 10px 12px; }
.modal-body .field input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 2px rgba(175,45,60,0.15); outline: none; }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.share-status { font-size: 12px; color: var(--muted); text-align: right; min-height: 1em; }
.share-status.error { color: var(--accent-red); }

/* Contact modal form */
.form-row { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-weight: 500; }
.form-row input:not([type="checkbox"]) {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
  color: var(--text);
}
.form-row input:not([type="checkbox"]):focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(175,45,60,0.15);
  outline: none;
}
.form-row--inline { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-row--inline .form-field { display: flex; flex-direction: column; gap: 4px; }
.consent-row { margin-top: 16px; }
.consent-checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.consent-checkbox input {
  margin-top: 0;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  accent-color: var(--brand-blue);
}
.consent-checkbox .consent-text { font-size: 12px; line-height: 1.45; color: var(--muted); max-width: 100%; text-align: justify; padding-right: 16px; }
.consent-checkbox.has-error .consent-text,
.consent-checkbox input.input-invalid + .consent-text { color: #d93025; }
.consent-row .input-hint-error { align-self: flex-start; }
.phone-input { display: flex; align-items: center; gap: 8px; }
.phone-prefix { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-weight: 700; }
.phone-code { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.phone-code-input { width: 70px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-weight: 700; }
.form-actions { margin-top: 14px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.form-actions button { padding: 10px 14px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.form-actions .btn-share { width: auto; }

.table-wrap { padding: 6px 10px 12px; overflow-x: visible; }
table { width: 100%; border-collapse: collapse; min-width: 0; font-size: 0.98em; table-layout: fixed; }
/* Stable widths that sum to 100% to avoid shifts */
col.col-feature { width: 38%; }
col.col-option { width: 16%; }
col.col-scope { width: 10%; }
col.col-val-a { width: 18%; }
col.col-val-p { width: 18%; }

/* Per-item qty input inside feature cards */
.card-qty { display: flex; align-items: center; }
.qty-input {
  width: 76px !important;
  text-align: right;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  padding: 5px 8px !important;
}
.qty-input:disabled { opacity: 0.38; cursor: pointer; }
/* Infra total count text for Replica */
.infra-count {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  margin-right: 8px;
}
/* Per-year note shown when years > 1 */
.summary-per-year {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}
/* Cards layout */
.cards { padding: 4px 0 20px; display: grid; gap: 12px; }
.calc-disclaimer {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 24px 0;
  line-height: 1.5;
}
.feature-group { display: grid; gap: 10px; }
.group-title { margin: 12px 0 4px; color: #a0a0a5; font-weight: 400; letter-spacing: .2px; font-size: 14px; text-transform: none; text-align: left; }
.group-body { display: grid; gap: 10px; }
.feature-card { background: var(--sheet-bg); border: 1px solid var(--border); border-radius: 12px; padding: 6px 8px; display: grid; }
.feature-card .card-header { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 32px; }
.feature-card:has(.help-panel.open) .card-header { padding-bottom: 6px; }
.card-preview { padding: 2px 2px 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.card-preview .help-panel__replaces { margin-bottom: 0; }
.card-preview .help-panel__desc { margin: 0; }
.feature-card .card-header .feature-title { flex: 1 1 auto; min-width: 0; }
.feature-card .card-header .option-cell { margin-left: auto; }
.feature-card .card-header .scope { white-space: nowrap; font-size: 12px; }
.feature-card.core .card-header .scope { margin-left: auto; }
.feature-card .scope .scope-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: .3px;
  margin-right: 8px;
}
.feature-card .scope input[type="number"] {
  width: 90px;
  text-align: center;
  padding: 6px 8px;
}
.feature-card.core .scope input#accounts {
  width: 110px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  text-align: center;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.feature-card.core .scope input#accounts:hover {
  border-color: var(--text);
}
.feature-card.core .scope input#accounts:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(175, 45, 60, 0.18);
  outline: none;
}
.feature-card .scope input[type="number"]:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.feature-card .feature-title { font-weight: 600; color: var(--text); font-size: 13px; display: flex; align-items: center; gap: 14px; }
.feature-card .card-details { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
.feature-card .scope { position: relative; }
input.native-number {
  appearance: auto;
  -moz-appearance: auto;
}
input.native-number::-webkit-outer-spin-button,
input.native-number::-webkit-inner-spin-button {
  -webkit-appearance: auto;
  margin: 0;
}
/* Inline error below without breaking layout */
.feature-card .scope .input-hint-error { position: absolute; top: calc(100% + 4px); left: 6px; font-size: 11px; color: var(--accent-red); white-space: nowrap; }
/* Nicer inline banner for hard limits */
.feature-card .scope .input-hint-error.limit {
  position: static;
  top: auto; left: auto;
  background: #FFF7E6; /* soft amber */
  border: 1px solid var(--border);
  color: var(--text);
  white-space: normal;
  padding: 8px 10px;
  margin-top: 6px;
  border-radius: 8px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 460px;
}
.feature-card .scope .input-hint-error.limit::before {
  content: '⚠️';
  display: inline-block;
}
.feature-card .scope .limit-link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--brand-blue);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
/* Removed per-tile price chips */
.feature-card.dependent-row { border-left: 3px solid rgba(0,0,0,0.06); margin-left: 20px; }
/* Second-level dependents: stronger indent */
.feature-card.dependent-row-2 { margin-left: 40px; }
/* Subtle gray arrow indicating dependency */
.feature-card.dependent-row .card-header .feature-title::before {
  content: '↳';
  color: #A0A0A5;
  display: inline-block;
  margin-right: 6px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  transform: translateY(-1px);
}

/* Totals section below cards */
.totals-section { padding: 0 12px 16px; }
.totals-cards { display: grid; gap: 10px; }
.totals-cards .sum-row { display: grid; grid-template-columns: 1fr auto 1fr auto auto; align-items: center; background: var(--sum-bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.totals-cards .sum-row .label { font-weight: 700; color: var(--text); }
.totals-cards .sum-row .spacer { height: 1px; }

/* Full-width totals capsules below the table */
.totals {
  display: flex;
  gap: 16px;
  padding: 0 18px 22px;
}
.totals .capsule { flex: 1 1 0; }
thead th {
  background: var(--row-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  font-weight: 700;
}
thead tr:first-child th { text-align: center; }
tbody td, tfoot td { border: 1px solid var(--border); padding: 8px 6px; }
/* Add a bit more right padding for the Toggle column to avoid clipping */
#calc thead th:nth-child(2),
#calc tbody td:nth-child(2),
#calc tfoot td:nth-child(2) { padding-right: 12px; }
tbody tr:nth-child(odd) { background: var(--row); }
tbody tr:nth-child(even) { background: var(--row-alt); }
tbody td.col-feature { font-weight: 600; overflow-wrap: anywhere; }
/* Subtle indent for dependent (child) rows */
tbody tr.dependent-row td.col-feature {
  padding-left: 16px;
  border-left: 3px solid rgba(0,0,0,0.06);
}
/* Double indent for second-level dependents (e.g., Chats Recording) */
tbody tr.dependent-row-2 td.col-feature {
  padding-left: 32px;
}
tbody td.num, tfoot td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody td.value { color: var(--text); font-weight: 400; }
tbody td.scope { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.option-cell { display: flex; align-items: center; gap: 8px; overflow: visible; }
.option-cell .state { white-space: nowrap; }
.summary-list .row > div:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.summary-list .row .num { flex: 0 0 auto; }
.option-cell label { font-size: 12px; color: var(--muted); }

/* Row appearance animation for dependent items — only when newly revealed */
tbody tr.dependent-row.appear { animation: rowFadeIn .22s ease-out; }
@keyframes rowFadeIn {
  from { opacity: 0; transform: translateY(-4px) scaleY(0.98); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

/* Hide SRP columns visually but keep them in layout for correct colspans */
#calc col.col-srp-a,
#calc col.col-srp-p { width: 0 !important; }
#calc #thSRP1,
#calc #thSRP2 {
  width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  visibility: hidden;
}
#calc td[id^="H"],
#calc td[id^="L"] {
  width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  visibility: hidden;
}

/* Feature hint button */
.feature-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  line-height: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.feature-hint svg {
  transition: transform .2s ease;
}
.feature-hint.open svg {
  transform: rotate(180deg);
}
.feature-hint:hover,
.feature-hint.open {
  background: #AF2D3C;
  border-color: #AF2D3C;
  color: #fff;
}
.feature-hint:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(175, 45, 60, 0.25);
}

/* Expandable help panel */
.help-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
  overflow: hidden;
}
.help-panel.open {
  grid-template-rows: 1fr;
}
.help-panel__inner {
  min-height: 0;
  overflow: hidden;
}
.help-panel__body {
  padding: 12px 10px 14px;
  border-top: 1px solid var(--border);
}
.help-panel__group + .help-panel__group--divided {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.help-panel__heading {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.help-panel__cols {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.hp-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text);
}
.hp-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.hp-item--yes .hp-icon {
  background: #e6f4ea;
  color: #1e7e34;
}
.hp-item--no {
  color: var(--muted);
}
.hp-item--no .hp-icon {
  background: #f0f0f2;
  color: #a0a0a5;
}
.hp-item--plus .hp-icon {
  background: #fde8eb;
  color: var(--brand-blue);
}
.hp-sep {
  grid-column: 1 / -1;
  height: 0;
  margin-top: 4px;
}
.help-panel__lock-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--muted);
}
.help-panel__replaces {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #1a5fa8;
  background: #e8f0fb;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  letter-spacing: .2px;
  margin-bottom: 8px;
}
.help-panel__desc {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.hp-tag {
  font-size: 9px;
  font-weight: 600;
  color: #9a4e00;
  background: #fff0db;
  border-radius: 999px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 720px) {
  /* Larger tap target on mobile */
  .feature-hint {
    height: 28px;
    padding: 0 11px;
    font-size: 13px;
    margin-left: 8px;
  }
  .help-panel__cols {
    grid-template-columns: 1fr;
  }
  .nbp-rate { display: none; }
}

/* tfoot styling */
tfoot tr.sum-row td { background: var(--sum-bg); font-weight: 400; }
tfoot tr.sum-row td.label { color: #fff; }
tfoot tr.caption-row td { background: var(--sum-bg); }
tfoot tr.grand-row td { background: transparent; border: none; padding-top: 16px; }
.capsule {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: none;
  width: 100%;
}
#sumCapsule {
  position: relative;
  margin-top: 12px;
  padding-top: 12px;
}
#sumCapsule::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, var(--border) 5%, var(--border) 95%, rgba(0,0,0,0) 100%);
}
.capsule .label { opacity: .75; font-weight: 500; text-transform: none; font-size: 12px; color: var(--text); }
.capsule .amount { font-weight: 400; font-size: 18px; white-space: nowrap; color: var(--text); }
.summary-note-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
#capsuleLicenseCount { font-size: 12px; font-weight: 500; color: var(--text); opacity: .75; }
.summary-list .summary-qty { color: var(--muted); font-size: 11px; }
/* Revert capsule label size to default; removed overrides for #capsuleRightLabel */
.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; }

/* Mobile adjustments */
@media (max-width: 720px) {
  .content-grid { grid-template-columns: 1fr; }
  .summary { order: 3; border-left: none; border-top: 1px solid var(--border); }
  .summary-sticky { position: static; }
  .summary-scroll { padding: 0; }
  .sheet { margin: 12px 8px 8px; border-radius: 10px; }
  header.sheet-header { padding: 12px 14px; }
  .controls { padding: 10px 12px 6px; gap: 10px 12px; }
  .controls .note { font-size: 11px; }
  .table-wrap { padding: 6px 10px 12px; }
  .toggle .state { display: none; }
  table { min-width: 0; font-size: 0.92em; }
  /* Adjusted to keep toggle text visible while summing to 100% */
  col.col-feature { width: 34%; }
  col.col-option { width: 16%; }
  col.col-scope { width: 10%; }
  col.col-val-a { width: 20%; }
  col.col-val-p { width: 20%; }
  thead th, tbody td, tfoot td { padding: 8px 6px; }
  .capsule { font-size: 16px; padding: 12px 14px; }
  .totals { flex-direction: column; gap: 12px; padding: 10px 12px 16px; }
  .summary-lang-row { gap: 12px; justify-content: flex-start; }
  .summary-meta { justify-content: flex-start; }
  .summary-billing { width: 100%; justify-content: flex-start; gap: 18px; }
  .summary-gov-block { text-align: left; }
  .summary-gov-block .gov-toggle { margin: 0; }
  .summary-years {
    width: 100%;
  }
  .panel-row__cta { grid-column: 1; padding: 12px 0 16px; }

  .page-banner { padding: 24px 0 12px; }
  .page-banner__inner { padding: 0 16px; }
}

/* Desktop: lay out top controls side-by-side with compact spacing */
@media (min-width: 900px) {
  .controls { display: flex; align-items: flex-end; gap: 12px 16px; padding-bottom: 10px; }
  .controls .control { flex: 0 0 auto; }
  /* Place GOV/EDU on the left and vertically center it within the row */
  .control-gov { order: 0; align-self: center; }
  /* Push Years to the far right for prominence */
  .control-years { order: 99; margin-left: auto; }
}

/* Default placement: controls auto-flow; accounts above years via DOM order */

/* Make the years control compact and not stretched across the grid column */
.control-years { align-items: center; }
/* Make the years label more prominent */
.control-years label { font-size: 14px; color: var(--text); text-align: center; }
.control-years input#years {
  max-width: 120px;
  text-align: center;
}

@media (min-width: 721px) and (max-width: 1100px) {
  .content-grid { grid-template-columns: minmax(0, 1fr) clamp(260px, 30vw, 320px); gap: 10px; }
}

@media (max-width: 420px) {
  table { min-width: 0; font-size: 0.9em; }
  header.sheet-header h1 { font-size: 16px; }
  .lang-toggle button { padding: 6px 10px; }
}
