:root {
  --ink: #1a1a1a;
  --muted: #666;
  --line: #e1e5e9;
  --line-strong: #cbd3d9;
  --soft: #f7f7f5;
  --soft-blue: #f2f7fa;
  --green: #2f6250;
  --green-light: #d7e5da;
  --blue: #315d78;
  --orange: #a76332;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--white);
  color: var(--ink);
  font-family: Roboto, Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="radio"] {
  cursor: pointer;
}

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

.site-header {
  border-bottom: 1px solid #e8eaed;
  background: var(--white);
  box-shadow: 0 4px 18px rgba(20, 28, 38, .05);
}

.header-inner,
.footer-inner,
.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: flex;
  width: 188px;
  height: 58px;
  align-items: center;
}

.brand img {
  display: block;
  width: 176px;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav a {
  color: #16191d;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--blue);
}

.page-shell {
  padding: 22px 0 64px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
  color: #6b6b6b;
  font-size: 12px;
}

.breadcrumbs a {
  color: #555;
  text-decoration: none;
}

.page-intro {
  max-width: 820px;
  margin-bottom: 24px;
}

.eyebrow,
.panel-label {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.page-intro h1 {
  margin: 7px 0 10px;
  color: var(--ink);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

.page-intro > p:last-child {
  max-width: 760px;
  margin: 0;
  color: #555;
  font-size: 18px;
}

.calculator {
  display: grid;
  grid-template-columns: minmax(310px, 390px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 18px 44px rgba(20, 28, 38, .07);
}

.controls,
.results {
  min-width: 0;
  padding: 24px;
}

.controls {
  border-right: 1px solid var(--line);
  background: var(--soft);
}

.panel-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  margin: 18px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0;
  background: var(--white);
}

.mode-toggle label {
  position: relative;
}

.mode-toggle label + label {
  border-left: 1px solid var(--line-strong);
}

.mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-toggle span {
  display: block;
  min-height: 40px;
  padding: 9px 12px;
  color: #4f5961;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.mode-toggle input:checked + span {
  background: var(--green);
  color: var(--white);
}

.mode-toggle input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.quick-result {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  border-left: 3px solid var(--green);
  padding: 8px 11px;
  background: var(--white);
}

.quick-result span,
.quick-result small,
.quick-result strong {
  display: block;
}

.quick-result small {
  color: #68727a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.quick-result strong {
  margin-top: 2px;
  color: #263039;
  font-size: 18px;
  line-height: 1.2;
}

.quick-result > b {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 13px;
  line-height: 1.2;
  text-align: right;
}

.field {
  margin-top: 18px;
}

.field > label,
.advanced-grid label {
  color: #30343a;
  font-size: 13px;
  font-weight: 700;
}

select,
input[type="number"],
input[type="text"] {
  border: 1px solid #bfc8cf;
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
}

.field > select {
  width: 100%;
  min-height: 43px;
  margin-top: 7px;
  padding: 8px 36px 8px 11px;
}

.value-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 7px;
  margin-top: 7px;
}

.value-unit input,
.value-unit select {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 8px 11px;
}

select:focus,
input:focus,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.field-help {
  margin: 5px 0 0;
  color: #5f686f;
  font-size: 11px;
  line-height: 1.4;
}

.calculator[data-plan="capture"] .target-only,
.calculator[data-plan="target"] .capture-only {
  display: none;
}

.advanced {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.advanced summary {
  color: #394149;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.advanced-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.advanced-grid label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.advanced-grid label > span:first-child small {
  display: block;
  color: #737b81;
  font-size: 10px;
  font-weight: 500;
}

.number-wrap {
  display: inline-flex;
  min-height: 39px;
  flex: 0 0 auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid #bfc8cf;
  border-radius: 4px;
  background: var(--white);
}

.number-wrap input {
  width: 86px;
  height: 37px;
  border: 0;
  border-radius: 0;
  padding: 6px 4px 6px 9px;
  text-align: right;
}

.number-wrap > span {
  min-width: 31px;
  padding: 0 8px 0 3px;
  color: #66717a;
  font-size: 12px;
  font-weight: 700;
}

.form-error {
  margin: 14px 0 0;
  border-left: 3px solid #b42318;
  padding: 8px 10px;
  background: #fff1f0;
  color: #7a271a;
  font-size: 13px;
}

.form-actions,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.form-actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}

.button--primary {
  min-width: 126px;
  background: var(--green);
  color: var(--white);
}

.button--primary:hover {
  background: #244d3e;
}

.button--quiet {
  border-color: var(--line-strong);
  background: var(--white);
  color: #3b434a;
}

.button--quiet:hover {
  background: #eef1f3;
}

.results {
  padding: 27px 30px 30px;
}

.results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.results h2 {
  margin: 5px 0 0;
  font-size: 25px;
  letter-spacing: 0;
  line-height: 1.2;
}

.result-summary {
  max-width: 335px;
  margin: 0;
  color: #4f5961;
  font-size: 13px;
  text-align: right;
}

.result-assumption {
  margin: 7px 0 0;
  color: #5d666d;
  font-size: 11px;
  font-weight: 600;
}

.primary-results,
.secondary-results {
  display: grid;
  margin: 0;
}

.primary-results {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.primary-results > div {
  min-width: 0;
  padding: 19px 14px 18px 0;
}

.primary-results > div + div {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.calculator[data-plan="capture"] #video-result-box dd,
.calculator[data-plan="target"] #interval-result-box dd {
  color: var(--green);
}

dt {
  color: #67727b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.compression-figure {
  margin: 25px 0 0;
}

.compression-figure figcaption {
  color: #30343a;
  font-size: 13px;
  font-weight: 700;
}

.time-equation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 0;
  margin-top: 13px;
}

.time-equation span {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 13px 15px;
  background: var(--soft-blue);
}

.time-equation span:last-child {
  border-color: #aec5b6;
  background: #edf5ef;
}

.time-equation strong,
.time-equation small {
  display: block;
}

.time-equation strong {
  font-size: 20px;
  line-height: 1.15;
}

.time-equation small {
  margin-top: 3px;
  color: #626c73;
  font-size: 11px;
  font-weight: 700;
}

.time-equation i {
  position: relative;
  height: 2px;
  background: var(--orange);
}

.time-equation i::after {
  position: absolute;
  top: 50%;
  right: -1px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--orange);
  border-right: 2px solid var(--orange);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.figure-note {
  margin: 10px 0 0;
  color: #6b747b;
  font-size: 11px;
}

.result-notice {
  margin: 18px 0 0;
  border-left: 3px solid var(--orange);
  padding: 9px 11px;
  background: #fff7ed;
  color: #74451e;
  font-size: 12px;
}

.result-notice[data-level="error"] {
  border-left-color: #b42318;
  background: #fff1f0;
  color: #7a271a;
}

.result-notice[data-level="good"] {
  border-left-color: var(--green);
  background: #edf5ef;
  color: #234c3b;
}

.secondary-results {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.secondary-results > div {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  background: var(--soft-blue);
}

.secondary-results dd {
  font-size: 16px;
}

.guide {
  max-width: 900px;
  margin: 48px auto 0;
}

.tool-representative {
  width: min(560px, 100%);
  margin: 34px auto 0;
}

.tool-representative img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--soft);
}

.tool-representative figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.guide > section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.guide h2 {
  margin: 0 0 12px;
  font-size: 25px;
  letter-spacing: 0;
  line-height: 1.2;
}

.guide h3 {
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: 0;
  line-height: 1.25;
}

.guide p {
  margin: 0;
  color: #444b51;
}

.guide p + p {
  margin-top: 12px;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.faq summary {
  color: #2e3439;
  font-weight: 700;
  cursor: pointer;
}

.faq details p {
  padding: 10px 24px 2px 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #f6f7f7;
}

.footer-inner {
  min-height: 78px;
  color: #586168;
  font-size: 13px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-inner a {
  color: #3f494f;
}

@media (max-width: 900px) {
  .calculator {
    grid-template-columns: 1fr;
  }

  .controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .primary-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-results > div:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .primary-results > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .header-inner,
  .footer-inner,
  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .header-inner {
    min-height: 58px;
    gap: 14px;
  }

  .brand {
    width: 132px;
    height: 52px;
  }

  .brand img {
    width: 130px;
  }

  .site-nav {
    gap: 12px;
  }

  .site-nav a {
    font-size: 11px;
  }

  .site-nav a:nth-child(2) {
    display: none;
  }

  .page-shell {
    padding-top: 15px;
  }

  .breadcrumbs {
    margin-bottom: 18px;
  }

  .page-intro h1 {
    font-size: 31px;
  }

  .page-intro > p:last-child {
    font-size: 16px;
  }

  .controls,
  .results {
    padding: 20px 16px;
  }

  .quick-result {
    position: sticky;
    top: 6px;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(20, 28, 38, .08);
  }

  .results-head {
    display: block;
  }

  .result-summary {
    max-width: none;
    margin-top: 10px;
    text-align: left;
  }

  .primary-results > div,
  .primary-results > div + div {
    min-height: 80px;
    padding: 14px 10px;
  }

  .primary-results > div:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }

  .primary-results dd {
    font-size: 18px;
  }

  .time-equation {
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  }

  .time-equation span {
    padding: 11px;
  }

  .time-equation strong {
    font-size: 17px;
  }

  .secondary-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide {
    margin-top: 34px;
  }

  .guide > section {
    padding: 23px 0;
  }

  .guide h2 {
    font-size: 22px;
  }

  .guide-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .footer-inner {
    min-height: 92px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }
}

@media (max-width: 380px) {
  .site-nav a:nth-child(1) {
    display: none;
  }

  .value-unit {
    grid-template-columns: minmax(0, 1fr) 116px;
  }

  .quick-result strong {
    font-size: 16px;
  }

  .quick-result > b {
    font-size: 12px;
  }

  .secondary-results dt {
    font-size: 11px;
  }

  .secondary-results dd {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
