:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --text: #172033;
  --text-soft: #5f6b7e;
  --border: #dce2eb;
  --border-strong: #c9d2df;
  --accent: #e11d48;
  --accent-dark: #be123c;
  --accent-soft: #fff1f2;
  --navy: #0f172a;
  --success: #147d55;
  --success-soft: #e8f7f0;
  --warning: #a35a00;
  --warning-soft: #fff6df;
  --danger: #b42318;
  --danger-soft: #fff0ef;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 15% 0%, rgba(225, 29, 72, 0.07), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid rgba(201, 210, 223, 0.72);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  font-size: 0.98rem;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.2);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  fill: #fff;
}

.brand-mark .brand-arrow {
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.github-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.github-button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.github-button:hover {
  border-color: #98a5b7;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.hero {
  padding-block: 68px 34px;
}

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

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 15px;
  color: var(--navy);
  font-size: clamp(2.25rem, 5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero-description {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.8vw, 1.17rem);
  line-height: 1.7;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(380px, 0.97fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(201, 210, 223, 0.84);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel,
.result-panel {
  padding: clamp(22px, 3vw, 32px);
}

.result-panel {
  position: sticky;
  top: 24px;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.panel-heading h2,
.content-heading h2 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.text-button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

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

.drop-zone {
  min-height: 144px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1.5px dashed #aeb9c8;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone.is-dragging {
  transform: scale(1.005);
}

.drop-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 13px;
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.09);
}

.drop-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.drop-title {
  color: var(--navy);
  font-weight: 780;
}

.drop-subtitle {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.file-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}

.file-summary div {
  min-width: 0;
}

.file-summary strong,
.file-summary span {
  display: block;
}

.file-summary strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-summary span {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.icon-button {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text-soft);
  font-size: 1.25rem;
  line-height: 1;
}

.compatibility {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 650;
}

.compatibility.is-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
  margin-top: 24px;
}

.field {
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 750;
}

.optional {
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  outline: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input {
  padding: 10px 13px;
}

select {
  padding: 10px 36px 10px 13px;
}

input:hover,
select:hover {
  border-color: #9ca9ba;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.11);
}

.input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px;
}

.input-group input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group select {
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-muted);
  font-weight: 700;
}

.input-suffix {
  position: relative;
}

.input-suffix input {
  padding-right: 90px;
}

.input-suffix span {
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  transform: translateY(-50%);
  pointer-events: none;
}

.speed-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.speed-presets button {
  min-width: 48px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

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

.field-help,
.field-error {
  display: block;
  margin-top: 6px;
  font-size: 0.76rem;
  line-height: 1.4;
}

.field-help {
  color: var(--text-soft);
}

.field-error {
  min-height: 1.05em;
  color: var(--danger);
  font-weight: 650;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 11px;
  font-weight: 760;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 23px;
  padding: 12px 18px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(225, 29, 72, 0.2);
}

.primary-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.primary-button:hover {
  background: var(--accent-dark);
  box-shadow: 0 12px 26px rgba(190, 18, 60, 0.24);
  transform: translateY(-1px);
}

.status-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.status-neutral {
  background: #eef2f7;
  color: #596579;
}

.status-success {
  background: var(--success-soft);
  color: var(--success);
}

.status-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.result-empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 36px;
  color: var(--text-soft);
  text-align: center;
}

.result-empty p {
  max-width: 300px;
  margin-bottom: 0;
}

.result-empty-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--surface-muted);
  color: #8491a4;
}

.result-empty-icon svg {
  width: 39px;
  height: 39px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.primary-result {
  margin-bottom: 18px;
  padding: 24px;
  border-radius: 18px;
  background: var(--navy);
  color: #fff;
}

.primary-result > span,
.primary-result small {
  display: block;
  color: #bac4d4;
}

.primary-result > span {
  font-size: 0.82rem;
  font-weight: 700;
}

.primary-result strong {
  display: block;
  margin: 4px 0 8px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.primary-result small {
  font-size: 0.78rem;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 106px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-muted);
}

.metric-card span,
.reverse-results span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  color: var(--navy);
  font-size: 1.02rem;
  line-height: 1.3;
}

.metric-card-accent {
  border-color: #fecdd3;
  background: var(--accent-soft);
}

.metric-card-accent strong {
  color: var(--accent-dark);
}

.timeline {
  margin-top: 16px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.timeline-row strong {
  color: var(--navy);
  font-size: 0.82rem;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-dot-secondary {
  background: #64748b;
}

.timeline-line {
  width: 1px;
  height: 15px;
  margin: 3px 0 3px 4px;
  background: var(--border-strong);
}

.reverse-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.reverse-results article {
  padding: 15px;
  border-radius: 13px;
  background: #f1f5f9;
}

.reverse-results strong {
  color: var(--navy);
  font-size: 0.98rem;
}

.status-message {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef2f7;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 650;
}

.status-message.is-success {
  background: var(--success-soft);
  color: var(--success);
}

.status-message.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-message.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.secondary-button {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--navy);
  font-size: 0.8rem;
}

.secondary-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.secondary-button:hover {
  border-color: #95a3b6;
  background: var(--surface-muted);
}

.content-section {
  padding-block: 88px 0;
}

.content-heading {
  max-width: 660px;
  margin-bottom: 26px;
}

.steps-grid,
.details-grid {
  display: grid;
  gap: 16px;
}

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

.steps-grid article,
.details-grid > div {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
}

.steps-grid article > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 850;
}

.steps-grid h3,
.details-grid h3 {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 1rem;
}

.steps-grid p,
.details-grid p {
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.65;
}

.compact-content {
  padding-bottom: 88px;
}

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

.site-footer {
  display: grid;
  place-items: center;
  min-height: 82px;
  border-top: 1px solid var(--border);
  background: #fff;
  color: var(--text-soft);
  font-size: 0.82rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(225, 29, 72, 0.35);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .calculator-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  }

  .result-panel {
    top: 14px;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 28px, 680px);
  }

  .hero {
    padding-block: 46px 26px;
  }

  .calculator-layout {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }

  .steps-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .content-section {
    padding-top: 64px;
  }

  .compact-content {
    padding-bottom: 64px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 560px);
  }

  .header-inner {
    min-height: 61px;
  }

  .brand span:last-child {
    display: none;
  }

  .github-button {
    min-height: 38px;
    padding-inline: 12px;
  }

  h1 {
    font-size: clamp(2.15rem, 13vw, 3.4rem);
  }

  .input-panel,
  .result-panel {
    padding: 19px;
    border-radius: 19px;
  }

  .panel-heading {
    margin-bottom: 19px;
  }

  .result-heading {
    align-items: center;
  }

  .form-grid,
  .time-grid,
  .reverse-results,
  .result-actions {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .drop-zone {
    min-height: 132px;
  }

  .metric-card {
    min-height: auto;
  }

  .primary-result {
    padding: 20px;
  }

  .primary-result strong {
    font-size: 2.35rem;
  }
}

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