/* Keep the television catalog's layout and controls in step with the refrigerator navigator. */
:root {
  --paper: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #fff;
  --surface-soft: rgba(247, 247, 250, 0.9);
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.11);
  --line-strong: rgba(0, 0, 0, 0.18);
  --teal: #0071e3;
  --teal-soft: rgba(0, 113, 227, 0.12);
  --blue: #0071e3;
  --focus: #0071e3;
  --apple-fill: rgba(118, 118, 128, 0.12);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-raised: 0 22px 58px rgba(0, 0, 0, 0.12), 0 4px 14px rgba(0, 0, 0, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  background: var(--paper);
}

html {
  background: var(--paper);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -8%, rgba(0, 113, 227, 0.1), transparent 32rem),
    radial-gradient(circle at 92% 4%, rgba(106, 92, 255, 0.07), transparent 28rem),
    var(--paper);
  letter-spacing: -0.006em;
}

.topbar {
  position: relative;
  isolation: isolate;
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(34px, 5vw, 72px) clamp(22px, 5vw, 72px) clamp(28px, 4vw, 52px);
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
}

.topbar::after {
  position: absolute;
  right: 0;
  bottom: -28px;
  left: 0;
  z-index: -1;
  height: 28px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.045), transparent);
  content: "";
  opacity: 0.38;
  pointer-events: none;
}

.brand h1 {
  max-width: 900px;
  font-size: clamp(2.45rem, 5vw, 4.75rem);
  font-weight: 740;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.kicker {
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: none;
}

.summary-strip {
  min-width: min(430px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
}

.summary-strip div {
  padding: 17px 20px;
  border-left-color: var(--line);
}

.summary-strip span {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 720;
  letter-spacing: -0.035em;
}

.summary-strip small {
  margin-top: 7px;
  font-size: 0.74rem;
  font-weight: 560;
}

main {
  width: min(1640px, 100%);
  margin: 0 auto;
  padding: clamp(30px, 4vw, 56px) clamp(16px, 3.5vw, 52px) 72px;
}

.workbench {
  grid-template-columns: minmax(270px, 318px) minmax(0, 1fr);
  gap: clamp(22px, 3vw, 34px);
}

.control-panel {
  top: 22px;
  max-height: calc(100vh - 44px);
  max-height: calc(100dvh - 44px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(175%);
  -webkit-backdrop-filter: blur(24px) saturate(175%);
}

.search-box,
.filter-block,
.filter-note {
  padding: 19px 18px;
  border-bottom-color: var(--line);
}

.search-box span,
.filter-block h2 {
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.015em;
}

.search-box input {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 11px 14px;
  background: var(--apple-fill);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.025);
}

.search-box input:focus {
  border-color: rgba(0, 113, 227, 0.55);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
}

.search-box input::placeholder {
  color: #86868b;
}

#makerFilters,
#gradeFilters,
#screenSizeFilters,
#screenTypeFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#makerFilters .chip,
#gradeFilters .chip,
#screenSizeFilters .chip,
#screenTypeFilters .chip {
  width: auto;
  padding-right: 14px;
  padding-left: 14px;
}

#makerFilters .chip:first-child,
#gradeFilters .chip:first-child,
#screenSizeFilters .chip:first-child,
#screenTypeFilters .chip:first-child {
  flex-basis: 100%;
}

.chip,
.ghost-button,
.compare-button,
.db-button {
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.chip {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.88);
  color: #343437;
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.025);
}

.chip.is-active {
  border-color: rgba(0, 113, 227, 0.18);
  background: var(--teal-soft);
  color: #0058b0;
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.26);
}

.selected-mark {
  width: 18px;
  height: 18px;
  background: var(--blue);
}

.filter-note {
  background: linear-gradient(145deg, rgba(0, 113, 227, 0.075), rgba(106, 92, 255, 0.045));
}

.result-head,
.section-head {
  margin-bottom: 18px;
}

.result-head h2,
.section-head h2 {
  font-size: clamp(1.72rem, 2.5vw, 2.35rem);
  font-weight: 720;
  line-height: 1.08;
}

.ghost-button {
  background: var(--apple-fill);
  color: #363638;
  box-shadow: none;
}

.ghost-button:disabled {
  background: rgba(118, 118, 128, 0.07);
  color: #a1a1a6;
}

.series-grid {
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 18px;
}

.series-card {
  grid-template-rows: 112px minmax(0, 1fr);
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.card-media {
  position: relative;
  height: 112px;
  border-bottom: 0;
  padding: 10px 24px;
  background: linear-gradient(180deg, #fff, #fafafa);
}

.card-media::after,
.maker-logo::after {
  position: absolute;
  right: 24px;
  bottom: 0;
  left: 24px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent, var(--blue));
  content: "";
  opacity: 0.85;
}

.card-media img.maker-logo-image {
  width: 100%;
  height: 84px;
  max-height: 84px;
  object-fit: contain;
}

.card-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 18px;
}

.maker-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.series-title {
  align-items: center;
  gap: 9px;
}

.series-title h3 {
  font-size: 1.43rem;
  font-weight: 710;
  line-height: 1.12;
}

.grade {
  border-radius: 999px;
  padding: 4px 8px;
  background: color-mix(in srgb, var(--accent, var(--blue)) 11%, white);
  color: var(--accent-text, #0058b0);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.year-badge {
  border-color: rgba(0, 113, 227, 0.18);
  padding: 4px 8px;
  background: var(--teal-soft);
  color: #0058b0;
  font-size: 0.7rem;
  font-weight: 700;
}

.headline {
  min-height: 46px;
  color: #363638;
  font-size: 0.93rem;
  font-weight: 560;
}

.card-model,
.card-stand,
.card-fit {
  color: var(--muted);
  font-size: 0.78rem;
}

.card-fit {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(0, 113, 227, 0.065);
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.08);
  color: #363638;
}

.card-fit strong {
  width: fit-content;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.7rem;
}

.card-feature-chip {
  border-color: rgba(132, 89, 0, 0.2);
  background: #fff8dd;
  color: #5e4300;
}

.card-actions {
  grid-template-columns: minmax(104px, 0.85fr) minmax(0, 1.4fr);
  margin-top: auto;
  padding-top: 4px;
}

.card-actions .db-button,
.card-actions .compare-button {
  min-height: 44px;
  border-radius: 13px;
}

.db-button {
  background: #1d1d1f;
  color: #fff;
}

.compare-button {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.18);
}

.compare-button.is-selected {
  border-color: rgba(0, 113, 227, 0.18);
  background: var(--teal-soft);
  color: #0058b0;
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.22);
}

.comparison-band,
.guide-band {
  margin-top: 52px;
}

.maker-logo {
  position: relative;
  border-bottom: 0;
  background: linear-gradient(180deg, #fff, #fafafa);
}

.compare-fab strong,
.dialog-compare-jump span,
.mobile-jumpbar span {
  background: var(--blue);
}

.compare-difference-button[aria-pressed="true"] {
  border-color: rgba(0, 113, 227, 0.28);
  background: var(--teal-soft);
  color: #0058b0;
}

.compare-diff-summary,
.category-port-total {
  color: #0058b0;
}

.compare-table .compare-category-heading th,
.compare-card-category h4 {
  background: rgba(0, 113, 227, 0.1);
  color: #0058b0;
}

.category-feature {
  border-color: rgba(0, 113, 227, 0.18);
  background: rgba(0, 113, 227, 0.035);
}

.category-feature summary {
  color: #004d99;
}

.category-feature[open] summary {
  border-bottom-color: rgba(0, 113, 227, 0.18);
}

@media (hover: hover) and (pointer: fine) {
  .db-button:hover {
    background: #333336;
    color: #fff;
  }

  .compare-button:not(:disabled):not(.is-selected):hover {
    background: #087be9;
  }
}

@media (max-width: 980px) {
  .topbar {
    align-items: stretch;
    gap: 24px;
  }

  .summary-strip {
    min-width: 0;
  }

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

  .control-panel {
    position: static;
    max-height: none;
    overflow: visible;
    overscroll-behavior-y: auto;
    scrollbar-gutter: auto;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 20px;
    padding: 28px 16px 24px;
  }

  .brand h1 {
    font-size: clamp(2rem, 10vw, 2.75rem);
    line-height: 1.02;
  }

  .summary-strip {
    border-radius: 18px;
  }

  .summary-strip div {
    padding: 14px 10px;
  }

  main {
    padding: 22px 12px 58px;
  }

  .control-panel {
    border-radius: 22px;
  }

  .search-box,
  .filter-block,
  .filter-note {
    padding: 17px 16px;
  }

  .chip {
    min-height: 44px;
  }

  .result-head h2,
  .section-head h2 {
    font-size: 1.72rem;
  }

  .series-grid {
    gap: 15px;
  }

  .series-card {
    grid-template-rows: 96px minmax(0, 1fr);
    border-radius: 21px;
  }

  .card-media {
    height: 96px;
    padding: 8px 20px;
  }

  .card-media img.maker-logo-image {
    height: 76px;
    max-height: 76px;
  }

  .card-body {
    padding: 16px;
  }

  .card-actions {
    grid-template-columns: minmax(100px, 0.9fr) minmax(0, 1.25fr);
  }

  .mobile-jumpbar span {
    background: var(--blue);
  }
}

@media (max-width: 380px) {
  .topbar {
    padding-right: 12px;
    padding-left: 12px;
  }

  main {
    padding-right: 10px;
    padding-left: 10px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar,
  .summary-strip,
  .control-panel {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #444448;
    --line: rgba(0, 0, 0, 0.38);
    --line-strong: rgba(0, 0, 0, 0.7);
  }

  .topbar,
  .summary-strip,
  .control-panel,
  .series-card {
    border-color: var(--line);
    background: #fff;
  }
}
