:root {
  --ink-950: #101820;
  --ink-900: #16212b;
  --ink-800: #24313d;
  --ink-700: #3e4b57;
  --ink-600: #5d6872;
  --ink-500: #7c8791;
  --line: #dce2e6;
  --line-strong: #c8d0d6;
  --surface: #ffffff;
  --surface-soft: #f5f7f8;
  --surface-blue: #f0f5f8;
  --navy: #153b52;
  --navy-light: #1f526f;
  --cyan: #19a7a0;
  --cyan-dark: #087b77;
  --orange: #f08a36;
  --orange-dark: #c86618;
  --green: #16805c;
  --green-soft: #e9f6f0;
  --red: #c74444;
  --red-soft: #fff0ee;
  --amber: #a9680d;
  --amber-soft: #fff6df;
  --blue-soft: #edf6fa;
  --shadow: 0 16px 46px rgba(17, 33, 43, 0.08);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 11px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink-900);
  background:
    linear-gradient(rgba(21, 59, 82, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 59, 82, 0.025) 1px, transparent 1px),
    #eef2f4;
  background-size: 32px 32px;
  font-family:
    Pretendard,
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    system-ui,
    sans-serif;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  color: #fff;
  background: rgba(16, 31, 42, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(1440px, calc(100% - 44px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 8px 7px;
  border-radius: 9px;
  background: var(--orange);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.brand-mark span {
  display: block;
  height: 100%;
  border: 2px solid #fff;
  border-top-width: 3px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.88rem;
  line-height: 1.2;
  letter-spacing: 0.12em;
}

.brand small {
  margin-top: 2px;
  color: #b9c7d0;
  font-size: 0.73rem;
}

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: #dbe8ed;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4be0ac;
  box-shadow: 0 0 0 4px rgba(75, 224, 172, 0.12);
}

.page-shell {
  width: min(1440px, calc(100% - 44px));
  margin: 0 auto;
  padding: 46px 0 54px;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 28px;
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  color: var(--orange-dark);
  font-size: 0.71rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.intro h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3.1vw, 2.75rem);
  line-height: 1.22;
  letter-spacing: -0.045em;
}

.intro p:not(.eyebrow) {
  max-width: 690px;
  margin: 12px 0 0;
  color: var(--ink-600);
  font-size: 0.98rem;
}

.intro-equation {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(197, 208, 214, 0.85);
  border-radius: 12px;
  color: var(--ink-600);
  font-size: 0.75rem;
  font-weight: 700;
}

.intro-equation b {
  color: var(--orange-dark);
  font-size: 1rem;
}

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid #cce0e9;
  border-radius: 12px;
  background: var(--blue-soft);
  color: #315367;
  font-size: 0.82rem;
}

.notice.is-hidden {
  display: none;
}

.notice-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #4f8ba8;
  font-family: Georgia, serif;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 0.72fr) minmax(620px, 1.55fr);
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(196, 206, 212, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.settings-card,
.calculator-card {
  padding: 25px;
}

.settings-card {
  position: sticky;
  top: 94px;
}

.card-heading,
.breakdown-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-heading {
  margin-bottom: 23px;
}

.card-heading > div,
.assumptions > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-heading h2,
.assumptions h2 {
  margin: 0;
  font-size: 1.13rem;
  letter-spacing: -0.03em;
}

.step-number {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink-900);
  color: white;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.draft-state,
.live-label {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 800;
}

.draft-state {
  color: var(--ink-600);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.draft-state.is-saved {
  color: var(--green);
  background: var(--green-soft);
  border-color: #b9decf;
}

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan-dark);
  background: #e8f7f6;
}

.live-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}

.preset-toolbar {
  display: flex;
  align-items: end;
  gap: 7px;
  padding-bottom: 19px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.grow-field {
  flex: 1 1 auto;
  min-width: 0;
}

.field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.field > span:first-child,
.field > label:first-child {
  color: var(--ink-700);
  font-size: 0.76rem;
  font-weight: 800;
}

.field input,
.field select,
.preset-toolbar select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink-900);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field input:hover,
.field select:hover,
.preset-toolbar select:hover {
  border-color: #9eabb4;
}

.field input:focus,
.field select:focus,
.preset-toolbar select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(25, 167, 160, 0.13);
}

.field input:disabled {
  color: var(--ink-500);
  background: #edf0f2;
  cursor: not-allowed;
}

.field-grid {
  display: grid;
  gap: 15px;
}

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

.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-two {
  grid-column: 1 / -1;
}

.input-with-unit {
  position: relative;
  display: block;
}

.input-with-unit input {
  padding-right: 46px;
  font-variant-numeric: tabular-nums;
}

.input-with-unit em {
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--ink-500);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
  transform: translateY(-50%);
  pointer-events: none;
}

.icon-button {
  min-width: 45px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink-700);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.icon-button:hover:not(:disabled) {
  border-color: var(--navy-light);
  color: var(--navy);
}

.icon-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.danger-button:hover:not(:disabled) {
  color: var(--red);
  border-color: #e2a5a5;
}

.setting-block {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.setting-block-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.setting-block-heading strong,
.setting-block-heading small {
  display: block;
}

.setting-block-heading strong {
  font-size: 0.79rem;
}

.setting-block-heading small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 0.68rem;
}

.switch {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

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

.switch span {
  position: relative;
  width: 35px;
  height: 20px;
  border-radius: 999px;
  background: #aeb8be;
  transition: background 0.18s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
  transition: transform 0.18s ease;
}

.switch input:checked + span {
  background: var(--cyan);
}

.switch input:checked + span::after {
  transform: translateX(15px);
}

.switch input:focus-visible + span {
  outline: 3px solid rgba(25, 167, 160, 0.2);
  outline-offset: 2px;
}

.switch b {
  min-width: 27px;
  color: var(--ink-600);
  font-size: 0.67rem;
}

.compact-field {
  grid-template-columns: 1fr 120px;
  align-items: center;
  margin-top: 13px;
}

.field-hint {
  margin: 10px 0 0;
  color: var(--ink-500);
  font-size: 0.67rem;
  line-height: 1.5;
}

.safety-field {
  grid-template-columns: 1fr 130px;
  align-items: center;
  margin-top: 18px;
}

.help-button {
  width: 17px;
  height: 17px;
  padding: 0;
  margin-left: 3px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--ink-500);
  font-size: 0.63rem;
  font-weight: 800;
  cursor: help;
  vertical-align: 1px;
}

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

.advanced-settings summary {
  padding: 13px 1px;
  color: var(--ink-600);
  font-size: 0.73rem;
  font-weight: 800;
  cursor: pointer;
}

.details-content {
  padding: 0 0 15px;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  color: white;
  border: 0;
  border-radius: 12px;
  background: var(--navy);
  box-shadow: 0 8px 20px rgba(21, 59, 82, 0.18);
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.primary-button:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.storage-note {
  margin: 9px 0 0;
  color: var(--ink-500);
  text-align: center;
  font-size: 0.65rem;
}

.calculator-card {
  min-width: 0;
}

.calculation-inputs {
  margin-bottom: 13px;
}

.featured-field {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.featured-field > span:first-child {
  color: var(--ink-600);
}

.featured-field small {
  color: var(--ink-500);
  font-size: 0.67rem;
}

.large-input input {
  min-height: 54px;
  background: white;
  font-size: 1.34rem;
  font-weight: 900;
}

.large-input em {
  color: var(--ink-700);
}

.accent-field {
  border-color: #efc59e;
  background: #fff7ef;
}

.accent-field .large-input input {
  border-color: #e8ad78;
  color: #9d4e11;
}

.definition-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  margin-bottom: 15px;
  color: var(--ink-600);
  border-left: 3px solid var(--cyan);
  background: #f2f8f8;
  font-size: 0.7rem;
}

.definition-note > span {
  color: var(--cyan-dark);
  font-size: 1rem;
  line-height: 1.2;
}

.definition-note p {
  margin: 0;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.result-card::after {
  content: "";
  position: absolute;
  top: -55px;
  right: -38px;
  width: 165px;
  height: 165px;
  border: 22px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  pointer-events: none;
}

.hc-capacity-banner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
  padding: 15px 18px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: linear-gradient(120deg, var(--navy) 0%, #176b73 100%);
  box-shadow: 0 9px 22px rgba(21, 59, 82, 0.18);
}

.hc-capacity-banner > div,
.hc-capacity-banner span,
.hc-capacity-banner strong,
.hc-capacity-banner small {
  min-width: 0;
  display: block;
}

.hc-capacity-banner span {
  margin-bottom: 2px;
  color: #8ee5db;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.hc-capacity-banner strong {
  font-size: 0.93rem;
  letter-spacing: -0.02em;
}

.hc-capacity-banner small {
  margin-top: 3px;
  overflow: hidden;
  color: #c9dde2;
  font-size: 0.63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hc-capacity-banner > b {
  flex: 0 0 auto;
  color: #ffd08a;
  font-size: clamp(1.85rem, 3.4vw, 2.45rem);
  line-height: 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
}

.hc-capacity-banner.is-impossible {
  background: linear-gradient(120deg, #7b2929 0%, #b23a3a 100%);
}

.hc-capacity-banner.is-impossible span {
  color: #ffc3ba;
}

.hc-capacity-banner.is-impossible > b {
  color: #fff0c7;
}

.result-fit {
  color: #105d46;
  border-color: #a7d4c3;
  background: var(--green-soft);
}

.result-over {
  color: #9d2f2f;
  border-color: #e8b0a9;
  background: var(--red-soft);
}

.result-warning,
.result-boundary {
  color: #7f510d;
  border-color: #e9cd87;
  background: var(--amber-soft);
}

.result-neutral {
  color: var(--ink-700);
  background: var(--surface-soft);
}

.result-status-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.result-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 14px;
  background: var(--ink-700);
  box-shadow: 0 8px 18px rgba(16, 24, 32, 0.1);
  font-size: 0;
  font-weight: 900;
}

.result-fit .result-icon {
  background: var(--green);
}

.result-over .result-icon {
  background: var(--red);
}

.result-warning .result-icon,
.result-boundary .result-icon {
  background: var(--amber);
}

.result-icon::after {
  content: attr(data-symbol);
  color: white;
  font-size: 1.35rem;
}

.result-status-row p {
  margin: 0 0 2px;
  color: currentColor;
  opacity: 0.78;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.result-status-row h3 {
  margin: 0;
  font-size: clamp(1.38rem, 2.5vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.045em;
}

.result-explanation {
  position: relative;
  z-index: 1;
  margin: 13px 0 0 62px;
  color: currentColor;
  font-size: 0.78rem;
  opacity: 0.84;
}

.height-comparison {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.height-comparison > div {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid rgba(74, 91, 100, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.height-comparison span,
.height-comparison strong,
.height-comparison small {
  display: block;
}

.height-comparison span {
  color: var(--ink-600);
  font-size: 0.65rem;
  font-weight: 800;
}

.height-comparison strong {
  margin: 2px 0;
  color: currentColor;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.height-comparison small {
  overflow: hidden;
  color: var(--ink-500);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.59rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.height-comparison > b {
  color: var(--ink-500);
  font-size: 0.67rem;
  text-align: center;
}

.result-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid rgba(74, 91, 100, 0.13);
  border-radius: 12px;
  background: rgba(74, 91, 100, 0.11);
}

.result-metrics > div {
  min-width: 0;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.62);
}

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

.result-metrics span {
  margin-bottom: 3px;
  color: var(--ink-600);
  font-size: 0.65rem;
  font-weight: 700;
}

.result-metrics strong {
  overflow: hidden;
  color: currentColor;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-disclaimer {
  position: relative;
  z-index: 1;
  margin: 10px 2px 0;
  color: var(--ink-600);
  font-size: 0.61rem;
  font-weight: 700;
  text-align: right;
  opacity: 0.82;
}

.inline-messages {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.inline-messages:empty {
  display: none;
}

.inline-message {
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 0.68rem;
}

.inline-message.error {
  color: #913535;
  background: #fff0ef;
  border: 1px solid #f0c5c0;
}

.inline-message.warning {
  color: #79500f;
  background: #fff7e5;
  border: 1px solid #ecd69f;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(310px, 1.14fr);
  gap: 14px;
  margin-top: 15px;
}

.breakdown-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fbfcfc;
}

.breakdown-heading {
  align-items: flex-end;
  margin-bottom: 15px;
}

.breakdown-heading .section-label {
  margin-bottom: 2px;
  font-size: 0.6rem;
}

.breakdown-heading h3 {
  margin: 0;
  font-size: 0.88rem;
}

.stack-legend {
  display: flex;
  gap: 9px;
  color: var(--ink-500);
  font-size: 0.59rem;
  font-weight: 700;
}

.stack-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stack-legend i {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 2px;
}

.legend-fr {
  background: var(--orange);
}

.legend-hc {
  background: var(--cyan);
}

.legend-empty {
  border: 1px dashed #9aa6ae;
  background: transparent;
}

.hatch-line,
.tank-top-line {
  position: relative;
  height: 16px;
  color: var(--ink-500);
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: center;
}

.hatch-line::before,
.tank-top-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--ink-700) 0 12px, transparent 12px 16px);
}

.hatch-line::before {
  top: 0;
}

.tank-top-line::before {
  bottom: 0;
}

.hatch-line span,
.tank-top-line span {
  position: relative;
  z-index: 1;
  padding: 0 7px;
  background: #fbfcfc;
}

.hatch-line span {
  top: -5px;
}

.tank-top-line span {
  top: 5px;
}

.stack-note {
  margin: 10px 0 0;
  color: var(--ink-500);
  font-size: 0.58rem;
  text-align: center;
}

.stack-diagram {
  display: grid;
  gap: 3px;
  padding: 5px 0;
}

.tier-row {
  min-height: 22px;
  display: grid;
  grid-template-columns: 47px 1fr 58px;
  align-items: center;
  gap: 7px;
}

.tier-number,
.tier-detail {
  color: var(--ink-500);
  font-size: 0.58rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tier-number {
  text-align: right;
}

.tier-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-box {
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #aeb9bf;
  border-radius: 3px;
  background: #e6ebee;
  color: #54636c;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.tier-row.is-empty .tier-box {
  color: #8c999f;
  border-style: dashed;
  background: transparent;
}

.tier-row.is-fr .tier-box {
  color: white;
  border-color: var(--orange-dark);
  background: repeating-linear-gradient(
    135deg,
    var(--orange) 0 8px,
    #e77b29 8px 16px
  );
}

.tier-row.is-hc .tier-box {
  color: white;
  border-color: var(--cyan-dark);
  background: var(--cyan);
}

.formula-list {
  margin: 0;
}

.formula-list > div {
  display: grid;
  grid-template-columns: minmax(105px, 0.8fr) minmax(160px, 1.2fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.formula-list dt {
  color: var(--ink-600);
  font-size: 0.68rem;
  font-weight: 700;
}

.formula-list dd {
  margin: 0;
  color: var(--ink-800);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.69rem;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.formula-total {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
}

.formula-total span {
  color: var(--ink-600);
  font-size: 0.68rem;
  font-weight: 800;
}

.formula-total strong {
  color: var(--navy);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.assumptions {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 20px;
  padding: 23px 25px;
}

.assumptions .step-number {
  color: var(--ink-900);
  background: #f1b35c;
}

.assumptions ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink-600);
  font-size: 0.75rem;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 44px));
  padding: 12px 16px;
  color: white;
  border-radius: 11px;
  background: var(--ink-900);
  box-shadow: 0 12px 32px rgba(16, 24, 32, 0.26);
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: minmax(290px, 0.8fr) minmax(500px, 1.2fr);
  }

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

  .settings-card {
    top: 86px;
  }

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

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

@media (max-width: 880px) {
  .page-shell,
  .header-inner {
    width: min(100% - 28px, 720px);
  }

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

  .intro {
    display: block;
  }

  .intro-equation {
    width: fit-content;
    margin-top: 19px;
  }

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

  .settings-card {
    position: static;
  }

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

@media (max-width: 600px) {
  .header-inner {
    min-height: 64px;
  }

  .offline-badge {
    padding: 6px 9px;
    font-size: 0.63rem;
  }

  .brand small {
    display: none;
  }

  .intro h1 {
    font-size: 1.72rem;
  }

  .intro-equation {
    width: 100%;
    justify-content: center;
    gap: 7px;
    font-size: 0.65rem;
  }

  .settings-card,
  .calculator-card,
  .assumptions {
    padding: 18px;
    border-radius: 17px;
  }

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

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

  .calculation-inputs .accent-field {
    grid-column: 1 / -1;
  }

  .result-card {
    padding: 18px;
  }

  .hc-capacity-banner {
    align-items: flex-start;
    padding: 14px;
  }

  .hc-capacity-banner small {
    white-space: normal;
  }

  .result-explanation {
    margin-left: 0;
  }

  .height-comparison {
    grid-template-columns: 1fr;
  }

  .height-comparison > b {
    display: none;
  }

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

  .result-metrics > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .result-metrics span {
    margin: 0;
  }

  .formula-list > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .formula-list dd {
    text-align: left;
  }
}

@media (max-width: 410px) {
  .page-shell,
  .header-inner {
    width: min(100% - 20px, 720px);
  }

  .offline-badge {
    max-width: 105px;
    line-height: 1.25;
  }

  .preset-toolbar {
    flex-wrap: wrap;
  }

  .grow-field {
    flex-basis: 100%;
  }

  .two-columns,
  .calculation-inputs {
    grid-template-columns: 1fr;
  }

  .span-two,
  .calculation-inputs .accent-field {
    grid-column: auto;
  }

  .setting-block-heading {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
