:root {
  --bg: #f3f5f4;
  --panel: #ffffff;
  --text: #192124;
  --muted: #687176;
  --line: #d8dedc;
  --accent: #007782;
  --accent-dark: #005f68;
  --wash: #e5f4f2;
  --warn: #9b5b00;
  --shadow: 0 12px 36px rgba(18, 38, 43, .10);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 16px;
  max-width: 1120px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px;
  align-content: start;
}

.form-pane,
.category-pane {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}

.form-pane {
  align-self: start;
  position: sticky;
  top: 16px;
}

.topbar,
.category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.field.compact {
  margin-bottom: 10px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(0, 119, 130, .22);
  outline-offset: 1px;
  border-color: var(--accent);
}

.selected-brands,
.brand-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.brand-chip,
.brand-option {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 9px;
  min-height: 34px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.brand-chip {
  background: var(--wash);
  border-color: rgba(0, 119, 130, .28);
}

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

button {
  border: 0;
  border-radius: 6px;
  min-height: 42px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  background: var(--wash);
  color: var(--accent-dark);
}

.status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--warn);
  font-size: 13px;
}

.breadcrumbs {
  min-height: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.crumb {
  background: #f0f2f1;
  color: var(--text);
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
}

.category-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 1fr);
  gap: 10px;
  overflow-x: auto;
  min-height: 360px;
  padding-bottom: 4px;
}

.category-list {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fbfcfc;
}

.category-list-title {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.category-row {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 0 11px;
  text-align: left;
  border-bottom: 1px solid #edf0ef;
}

.category-row:hover {
  background: #f6faf9;
}

.category-row.active {
  background: var(--wash);
  color: var(--accent-dark);
}

.category-row .arrow {
  color: var(--muted);
}

.mobile-action {
  display: none;
}

@media (max-width: 760px) {
  body {
    background: var(--panel);
  }

  .shell {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: none;
    min-height: 100dvh;
    padding: 0 0 calc(78px + env(safe-area-inset-bottom, 0px));
  }

  .form-pane {
    position: static;
  }

  .form-pane,
  .category-pane {
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 14px 16px;
    box-shadow: none;
  }

  .topbar,
  .category-head {
    margin-bottom: 12px;
  }

  h1 {
    font-size: 21px;
  }

  h2 {
    font-size: 18px;
  }

  .muted {
    font-size: 13px;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .field {
    margin-bottom: 12px;
  }

  input,
  select,
  button {
    min-height: 48px;
  }

  #submit {
    display: none;
  }

  .category-columns {
    display: block;
    min-height: 0;
    overflow: visible;
    padding-bottom: 0;
  }

  .category-list {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    background: #fff;
  }

  .category-list:not(:last-child) {
    display: none;
  }

  .category-list-title {
    position: sticky;
    top: 0;
    z-index: 1;
    min-height: 36px;
    background: #fff;
  }

  .category-row {
    min-height: 50px;
    padding: 0 4px 0 2px;
  }

  .category-row .arrow {
    font-size: 20px;
  }

  .breadcrumbs {
    flex-wrap: nowrap;
    overflow-x: auto;
    min-height: 36px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .breadcrumbs::-webkit-scrollbar {
    display: none;
  }

  .crumb {
    flex: 0 0 auto;
    min-height: 34px;
    max-width: 78vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-action {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: block;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .94);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }
}
[hidden] { display: none !important; }
button:disabled { opacity: .55; cursor: not-allowed; }
.subscription-panel { grid-column: 1 / -1; align-self: start; padding: 26px; margin-bottom: 16px; border: 1px solid #bcd9d4; border-radius: 20px; background: linear-gradient(125deg, #edf7f3, #fff 78%); color: #183b38; box-shadow: 0 10px 30px #163d3510; }
.subscription-overview { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.subscription-eyebrow { margin: 0 0 12px; color: #39766c; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.subscription-panel h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.035em; line-height: 1.15; }
.subscription-description { margin: 10px 0 0; max-width: 630px; color: #49655f; font-size: 14px; line-height: 1.6; }
.subscription-badge { flex-shrink: 0; border: 1px solid #c5d8d0; border-radius: 999px; padding: 7px 11px; background: #fff9; font-size: 12px; font-weight: 750; }
.subscription-panel[data-state="active"] .subscription-badge { background: #d8f4e7; color: #206347; }
.subscription-panel[data-state="expired"] .subscription-badge { background: #fff0d6; color: #775017; }
.subscription-stats { display: flex; flex-wrap: wrap; gap: 12px 30px; margin-top: 22px; }
.subscription-stat { display: grid; gap: 4px; }
.subscription-stat strong { font-size: 20px; letter-spacing: -.025em; }
.subscription-stat span { color: #547268; font-size: 12px; }
.subscription-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.subscription-actions button { width: auto; min-height: 44px; border-radius: 10px; }
.subscription-link { color: #006872; font-size: 13px; font-weight: 700; padding: 10px 4px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.subscription-plans { border-top: 1px solid #cfe0da; margin-top: 24px; padding-top: 22px; }
.plans-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.plans-heading h3 { margin: 0 0 5px; font-size: 19px; letter-spacing: -.02em; }
.plans-heading p { color: #547268; font-size: 13px; line-height: 1.5; }
.plan-speeds { display: flex; padding: 4px; gap: 4px; background: #e1ece7; border-radius: 12px; }
.plan-speeds button { background: transparent; color: #3a6057; border-radius: 9px; min-height: 40px; font-size: 13px; }
.plan-speeds button[aria-pressed="true"] { background: #fff; color: #153f34; box-shadow: 0 2px 6px #1d453218; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.plan-card { display: flex; flex-direction: column; padding: 20px; background: #fff; border: 1px solid #d8e4df; border-radius: 14px; min-width: 0; }
.plan-card[data-current="true"] { border: 2px solid #007782; padding: 19px; }
.plan-card h4 { font-size: 20px; margin: 0 0 8px; letter-spacing: -.03em; }
.plan-caption { min-height: 20px; font-size: 12px; color: #597069; }
.plan-price { font-size: 25px; font-weight: 800; letter-spacing: -.04em; margin: 22px 0 4px; overflow-wrap: anywhere; }
.plan-period { font-size: 12px; color: #597069; }
.plan-feature { font-size: 13px; line-height: 1.6; margin: 18px 0; color: #3c5b52; flex: 1; }
.plan-card button { width: 100%; border-radius: 9px; min-height: 44px; white-space: normal; }
.plan-terms { margin: 16px 0 0; font-size: 12px; line-height: 1.65; color: #597069; }
.subscription-notice { font-size: 13px; line-height: 1.6; color: #754b17; margin: 14px 0 0; }
.subscription-notice:empty { display: none; }
.subscription-checkout { display: inline-block; margin-top: 12px; color: #006872; font-weight: 700; }
.subscription-panel a:focus-visible { outline: 3px solid #00778277; outline-offset: 3px; }
@media (max-width: 760px) {
  .subscription-panel { margin: 12px; padding: 20px; border-radius: 16px; }
  .subscription-overview { flex-direction: column-reverse; gap: 14px; }
  .subscription-stats { gap: 16px 24px; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 18px; }
  .plan-card[data-current="true"] { padding: 17px; }
  .plan-card h4, .plan-caption { grid-column: 1; }
  .plan-price { grid-column: 2; grid-row: 1; margin: 0; font-size: 22px; text-align: right; }
  .plan-period { grid-column: 2; grid-row: 2; text-align: right; }
  .plan-feature, .plan-card button { grid-column: 1 / -1; }
  .plan-feature { margin: 12px 0; }
  .plan-speeds { width: 100%; }
  .plan-speeds button { flex: 1; }
}
