:root {
  color-scheme: light;
  --ink: #101010;
  --muted: #5f6266;
  --line: #dedede;
  --paper: #f6f6f6;
  --panel: #ffffff;
  --brand: #e30613;
  --brand-strong: #050505;
  --accent: #e30613;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.6)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.18)),
    url("background.png");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 18px;
}

.calculator,
.reference,
.deals-panel {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.calculator {
  display: grid;
  gap: 20px;
  padding: 22px;
}

.masthead {
  display: grid;
  gap: 6px;
}

.lede,
.section-heading p,
.result-detail,
.result-label {
  color: var(--muted);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo-link,
.brand-logo {
  width: min(42vw, 190px);
}

.brand-logo-link {
  display: block;
}

.brand-logo {
  height: auto;
  display: block;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 12ch;
  font-size: clamp(2.15rem, 9vw, 3.95rem);
  line-height: 0.96;
}

.lede {
  max-width: 32rem;
  font-size: 1rem;
  line-height: 1.5;
}

.controls {
  display: grid;
  gap: 14px;
}

fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

legend {
  padding: 0 8px;
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ececec;
}

.segment {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.segment {
  background: transparent;
  color: var(--muted);
}

.segment.is-active {
  background: var(--panel);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(31, 64, 61, 0.12);
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.check-row span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

select,
input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #becdca;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 0 12px;
}

select:focus,
input:focus,
button:focus-visible {
  outline: 3px solid rgba(227, 6, 19, 0.22);
  outline-offset: 2px;
}

.custom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.check-row input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--brand);
}

.result-panel {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 8px;
  background: var(--brand-strong);
  color: #fff;
  border-top: 6px solid var(--brand);
}

.result-label {
  color: rgba(255, 255, 255, 0.74);
  font-weight: 800;
}

.result-time {
  overflow-wrap: anywhere;
  font-size: clamp(2.7rem, 16vw, 5.6rem);
  font-weight: 900;
  line-height: 0.95;
}

.result-detail {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.reference,
.deals-panel {
  margin-top: 18px;
  overflow: hidden;
}

.deal-card {
  display: grid;
  gap: 14px;
  padding: 0 18px 16px;
  touch-action: pan-y;
  user-select: none;
}

.deal-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: #111;
}

.deal-copy {
  display: grid;
  gap: 8px;
}

.deal-copy h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.15;
}

.deal-copy p {
  color: var(--muted);
  line-height: 1.45;
  min-height: 4.35em;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.deal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 44px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  padding: 0 16px;
  text-decoration: none;
}

.deal-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px 18px;
}

.deal-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.deal-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 16, 16, 0.24);
  cursor: pointer;
  padding: 0;
}

.deal-dot.is-active {
  background: var(--brand);
}

.site-footer {
  padding: 18px 8px 4px;
  color: rgba(16, 16, 16, 0.72);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.section-heading {
  display: grid;
  gap: 4px;
  padding: 18px 18px 8px;
}

h2 {
  font-size: 1.25rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 360px;
}

th,
td {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  font-weight: 700;
}

@media (min-width: 720px) {
  .app-shell {
    padding: 34px;
  }

  .calculator {
    padding: 30px;
  }

  .deal-card {
    grid-template-columns: 0.9fr 1fr;
    align-items: center;
  }
}
