:root {
  --bg: #050806;
  --paper: #0c1110;
  --paper-2: #111917;
  --ink: #edf8ef;
  --subtle: #8fa49a;
  --line: #1f3a31;
  --line-soft: #172821;
  --blue: #00ff88;
  --blue-dark: #69ff4f;
  --teal: #00f5d4;
  --coral: #ff4d7d;
  --yellow: #d7ff45;
  --neon: #6dff2e;
  --shadow: 0 22px 70px rgba(0, 255, 114, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(109, 255, 46, 0.18), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(0, 245, 212, 0.1), transparent 24%),
    linear-gradient(180deg, #050806 0%, #07110c 46%, #030504 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 96px;
}

.page-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}

.work-mark {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.title-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.title-icon {
  align-items: center;
  background: linear-gradient(135deg, var(--blue), var(--teal), var(--yellow));
  border-radius: 6px;
  color: white;
  display: inline-flex;
  font-size: 14px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

h1 {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.2;
  margin: 0;
}

.page-header p {
  color: var(--subtle);
  line-height: 1.7;
  margin: 12px 0 0;
  max-width: 830px;
}

.pill {
  background: #e8f4ff;
  border: 1px solid #cde8ff;
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.pill.muted {
  background: #eef1f4;
  border-color: #e1e5e9;
  color: #58606c;
}

.control-surface {
  padding: 26px 0 14px;
}

.search-wrap {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
  display: flex;
  gap: 10px;
  min-height: 56px;
  padding: 0 18px;
  width: 100%;
}

.search-wrap span {
  color: var(--blue);
  font-size: 25px;
  line-height: 1;
}

.search-wrap input {
  background: transparent;
  border: 0;
  color: var(--ink);
  min-width: 0;
  outline: 0;
  width: 100%;
}

.filter-stack {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.filter-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
  min-width: 0;
}

.filter-card summary {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 18px;
}

.filter-card summary::marker {
  content: "";
}

.filter-card h3 {
  font-size: 14px;
  margin: 0;
}

.filter-card summary span {
  color: #a0a7b2;
  font-size: 12px;
  transition: transform 160ms ease;
}

.filter-card[open] summary span {
  transform: rotate(180deg);
}

.check-list {
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 7px;
  max-height: 196px;
  overflow: auto;
  padding: 12px 16px 16px;
}

.check-list label {
  align-items: center;
  color: #303641;
  display: flex;
  gap: 9px;
}

.check-list input {
  accent-color: var(--blue);
  height: 16px;
  width: 16px;
}

.year-filter {
  margin-top: 12px;
  max-width: 360px;
  padding: 18px;
}

.year-filter h3 {
  font-size: 14px;
  margin: 0 0 12px;
}

.year-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto 1fr;
}

select {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 34px 0 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, #8a93a3 50%),
    linear-gradient(135deg, #8a93a3 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.reset-btn {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #475467;
  font-weight: 800;
  margin-top: 14px;
  min-height: 48px;
  width: 100%;
}

.reset-btn:hover {
  border-color: #b8c2ce;
  color: var(--ink);
}

.result-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 0 16px;
}

.result-count {
  color: var(--subtle);
  font-weight: 800;
}

.result-count strong {
  color: var(--ink);
}

.axis-select {
  align-items: center;
  display: flex;
  gap: 9px;
  margin-left: auto;
}

.axis-select span {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 800;
}

.view-switch {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  overflow: hidden;
}

.view-switch button {
  background: transparent;
  border: 0;
  color: #596273;
  font-weight: 800;
  min-height: 42px;
  padding: 0 16px;
}

.view-switch button.active {
  background: var(--blue);
  color: white;
}

.view-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.view-panel.hidden {
  display: none;
}

.view-caption {
  color: var(--subtle);
  font-size: 13px;
  margin: 0 0 14px;
}

.view-caption:empty {
  display: none;
}

.timeline-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
}

.timeline-grid {
  display: grid;
  grid-template-columns: 154px repeat(var(--year-count), minmax(178px, 1fr));
  min-width: calc(154px + var(--year-count) * 178px);
}

.corner-cell,
.year-head,
.row-head,
.timeline-cell {
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
}

.corner-cell,
.year-head {
  align-items: center;
  display: flex;
  font-weight: 900;
  justify-content: center;
  min-height: 42px;
}

.year-head {
  font-size: 17px;
}

.row-head {
  align-items: center;
  color: #252b36;
  display: flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: flex-end;
  min-height: 110px;
  padding: 10px 14px;
  text-align: right;
}

.timeline-cell {
  align-content: start;
  display: grid;
  gap: 8px;
  min-height: 110px;
  padding: 8px;
}

.mini-card {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-top: 4px solid var(--teal);
  min-height: 94px;
  padding: 10px 36px 10px 10px;
  position: relative;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.mini-card:hover,
.product-card:hover {
  border-color: #b9c5d4;
  box-shadow: 0 12px 22px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.mini-card.upcoming,
.product-card.upcoming {
  border-style: dashed;
}

.mini-card .brand {
  color: var(--subtle);
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.24;
  margin-top: 2px;
}

.mini-card small,
.mini-card em {
  color: var(--subtle);
  display: block;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  margin-top: 5px;
}

.add-btn {
  align-items: center;
  background: #eef3f8;
  border: 1px solid #d6e0ea;
  border-radius: 999px;
  color: #526174;
  display: inline-flex;
  font-size: 16px;
  font-weight: 900;
  height: 26px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 26px;
}

.add-btn.selected {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.product-card {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 190px;
  padding: 16px 48px 16px 16px;
  position: relative;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.device-visual {
  align-self: start;
  border-radius: 8px;
  display: grid;
  height: 120px;
  justify-items: center;
  overflow: hidden;
  place-items: center;
  position: relative;
  width: 76px;
}

.device-visual.phone {
  background: #1d2430;
  border: 5px solid #0e1218;
  border-radius: 20px;
}

.device-visual.handheld {
  background: #161b22;
  border-radius: 34px;
  height: 82px;
  margin-top: 20px;
  width: 126px;
}

.device-visual.handheld::before,
.device-visual.handheld::after {
  background: #232a35;
  border-radius: 50%;
  content: "";
  height: 16px;
  position: absolute;
  top: 33px;
  width: 16px;
  z-index: 2;
}

.device-visual.handheld::before {
  left: 12px;
}

.device-visual.handheld::after {
  right: 12px;
}

.screen-glow {
  border-radius: 7px;
  height: 74%;
  width: 74%;
}

.phone .screen-glow {
  height: 80%;
  width: 82%;
}

.device-letter {
  color: rgba(255, 255, 255, 0.9);
  font-size: 26px;
  font-weight: 900;
  position: absolute;
}

.sony .screen-glow { background: linear-gradient(140deg, #3b82f6, #0f172a); }
.sharp .screen-glow { background: linear-gradient(140deg, #15b8a6, #d6f35d); }
.kyocera .screen-glow { background: linear-gradient(140deg, #ef4444, #f59e0b); }
.balmuda .screen-glow { background: linear-gradient(140deg, #24262d, #8b95a5); }
.fcnt .screen-glow { background: linear-gradient(140deg, #8b5cf6, #22d3ee); }
.nintendo .screen-glow { background: linear-gradient(140deg, #e60012, #0aa7ff); }
.valve .screen-glow { background: linear-gradient(140deg, #0f172a, #94a3b8); }
.cloud .screen-glow { background: linear-gradient(140deg, #38bdf8, #a7f3d0); }
.asus .screen-glow { background: linear-gradient(140deg, #ef4444, #7c3aed); }
.lenovo .screen-glow { background: linear-gradient(140deg, #0ea5e9, #f43f5e); }
.playstation .screen-glow { background: linear-gradient(140deg, #0057b8, #78a8ff); }
.msi .screen-glow { background: linear-gradient(140deg, #dc2626, #111827); }

.product-main {
  min-width: 0;
}

.card-meta {
  color: var(--subtle);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 900;
  gap: 8px;
}

.product-card h2 {
  font-size: 18px;
  line-height: 1.24;
  margin: 7px 0 8px;
}

.product-card p {
  color: var(--subtle);
  line-height: 1.55;
  margin: 0;
}

.spec-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.spec-strip span {
  background: #eef3f8;
  border-radius: 999px;
  color: #445264;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

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

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

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

th {
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

td {
  color: #303641;
}

.link-btn {
  background: transparent;
  border: 0;
  color: var(--blue-dark);
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.compare-tab {
  align-items: center;
  background: rgba(68, 83, 104, 0.82);
  border: 0;
  border-radius: 8px 0 0 8px;
  bottom: 34px;
  color: white;
  display: flex;
  gap: 9px;
  min-height: 48px;
  padding: 0 14px;
  position: fixed;
  right: 0;
  z-index: 20;
}

.compare-tab strong {
  align-items: center;
  background: #e8f4ff;
  border-radius: 999px;
  color: var(--blue-dark);
  display: inline-flex;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 7px;
}

.compare-drawer {
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px rgba(16, 24, 40, 0.16);
  height: 100vh;
  max-width: 520px;
  overflow: auto;
  padding: 20px;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(104%);
  transition: transform 220ms ease;
  width: min(92vw, 520px);
  z-index: 30;
}

.compare-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.drawer-head h2 {
  font-size: 20px;
  margin: 0;
}

.drawer-actions {
  display: flex;
  gap: 8px;
}

.drawer-head button,
.primary-action {
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  color: white;
  font-weight: 900;
  min-height: 38px;
  padding: 0 13px;
}

.drawer-head .icon-action {
  align-items: center;
  background: #eef3f8;
  border: 1px solid #d7e0eb;
  color: #516071;
  display: inline-flex;
  font-size: 20px;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 38px;
}

.compare-cards {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.compare-item {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 44px 12px 12px;
  position: relative;
}

.compare-item strong,
.compare-item span {
  display: block;
}

.compare-item span {
  color: var(--subtle);
  font-size: 13px;
  margin-top: 4px;
}

.compare-item button,
.modal-close {
  align-items: center;
  background: #eef3f8;
  border: 1px solid #d7e0eb;
  border-radius: 999px;
  color: #516071;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  position: absolute;
  right: 10px;
  top: 12px;
  width: 28px;
}

.compare-table {
  min-width: 620px;
}

.compare-table td:first-child,
.compare-table th:first-child {
  color: var(--subtle);
  font-weight: 900;
  width: 92px;
}

.modal-layer {
  align-items: center;
  background: rgba(13, 18, 28, 0.52);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 40;
}

.modal-layer.hidden {
  display: none;
}

.detail-modal {
  background: var(--paper);
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(10, 14, 22, 0.24);
  max-height: calc(100vh - 44px);
  max-width: 780px;
  overflow: auto;
  padding: 24px;
  position: relative;
  width: min(100%, 780px);
}

.modal-close {
  right: 18px;
  top: 18px;
}

.modal-top {
  display: grid;
  gap: 24px;
  grid-template-columns: 140px minmax(0, 1fr);
  padding-right: 40px;
}

.modal-top .device-visual {
  height: 170px;
  width: 108px;
}

.modal-top .device-visual.handheld {
  height: 104px;
  margin-top: 32px;
  width: 180px;
}

.modal-kicker {
  color: var(--blue-dark);
  display: block;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 8px;
}

.detail-modal h2 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 10px;
}

.detail-modal p {
  color: var(--subtle);
  line-height: 1.65;
  margin: 0 0 18px;
}

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

.detail-grid div {
  background: #f7f9fb;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
}

.detail-grid dt {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}

.detail-grid dd {
  font-weight: 800;
  margin: 0;
}

.empty {
  color: var(--subtle);
  margin: 0;
  padding: 18px;
  text-align: center;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 24px, 720px);
    padding-top: 22px;
  }

  .filter-stack {
    grid-template-columns: 1fr;
  }

  .year-filter {
    max-width: none;
  }

  .result-toolbar {
    align-items: stretch;
    display: grid;
  }

  .axis-select {
    display: grid;
    margin-left: 0;
  }

  .view-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .view-panel {
    padding: 12px;
  }

  .product-card {
    grid-template-columns: 76px minmax(0, 1fr);
    min-height: 174px;
  }

  .device-visual.handheld {
    height: 68px;
    width: 98px;
  }

  .modal-top {
    grid-template-columns: 1fr;
  }

  .modal-top .device-visual.handheld {
    margin-top: 0;
  }

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

@media (max-width: 520px) {
  .title-line {
    align-items: flex-start;
  }

  h1 {
    flex-basis: calc(100% - 44px);
  }

  .product-card {
    grid-template-columns: 1fr;
    padding-right: 44px;
  }

  .compare-tab {
    bottom: 18px;
  }
}

/* Dark gaming skin */
.app-shell {
  position: relative;
}

.page-header {
  border-bottom-color: rgba(109, 255, 46, 0.22);
}

.work-mark {
  color: var(--neon);
  text-shadow: 0 0 18px rgba(109, 255, 46, 0.42);
}

.title-icon {
  background: linear-gradient(135deg, #6dff2e, #00f5d4);
  box-shadow: 0 0 26px rgba(109, 255, 46, 0.45);
  color: #061007;
}

h1 {
  color: #f4fff6;
  text-shadow: 0 0 24px rgba(109, 255, 46, 0.22);
}

.page-header p {
  color: #b4c6bd;
}

.pill {
  background: rgba(109, 255, 46, 0.11);
  border-color: rgba(109, 255, 46, 0.42);
  color: #b8ff75;
}

.pill.muted {
  background: rgba(16, 28, 24, 0.9);
  border-color: rgba(0, 245, 212, 0.26);
  color: #b9cbc2;
}

.search-wrap,
.filter-card,
.view-panel,
.view-switch,
.compare-drawer,
.detail-modal {
  background:
    linear-gradient(180deg, rgba(18, 30, 26, 0.96), rgba(9, 15, 13, 0.96));
  border-color: rgba(109, 255, 46, 0.2);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.search-wrap:focus-within,
.filter-card[open],
.view-panel {
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(109, 255, 46, 0.1),
    0 0 36px rgba(109, 255, 46, 0.08);
}

.search-wrap span,
.filter-card summary span {
  color: var(--neon);
}

.search-wrap input::placeholder {
  color: #7f9289;
}

select {
  background-color: #07100d;
  border-color: rgba(109, 255, 46, 0.22);
  color: #eaffed;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--neon) 50%),
    linear-gradient(135deg, var(--neon) 50%, transparent 50%);
}

.check-list {
  border-top-color: rgba(109, 255, 46, 0.15);
}

.check-list label,
.result-count,
.axis-select span,
.view-caption,
.mini-card small,
.mini-card em,
.product-card p,
.card-meta,
.compare-item span,
td,
.empty {
  color: #9db3aa;
}

.check-list input {
  accent-color: var(--neon);
}

.reset-btn {
  background: #0a1511;
  border-color: rgba(109, 255, 46, 0.22);
  color: #cbffd2;
}

.reset-btn:hover {
  border-color: rgba(109, 255, 46, 0.8);
  color: white;
  box-shadow: 0 0 24px rgba(109, 255, 46, 0.2);
}

.view-switch button {
  color: #9db3aa;
}

.view-switch button.active,
.drawer-head button,
.primary-action {
  background: linear-gradient(135deg, #6dff2e, #00f5d4);
  color: #031007;
  text-shadow: none;
}

.drawer-head .icon-action {
  background: #12201b;
  border-color: rgba(109, 255, 46, 0.24);
  color: #baff8b;
}

.corner-cell,
.year-head,
.row-head,
.timeline-cell,
th,
td {
  border-color: rgba(109, 255, 46, 0.12);
}

.year-head {
  background: rgba(109, 255, 46, 0.07);
  color: #d8ff9b;
  text-shadow: 0 0 18px rgba(109, 255, 46, 0.3);
}

.row-head {
  background: rgba(6, 12, 9, 0.72);
  color: #effff2;
}

th {
  color: #baff8b;
}

.link-btn {
  color: #7aff66;
}

.timeline-scroll {
  position: relative;
}

.timeline-grid {
  position: relative;
  z-index: auto;
}

.mini-card,
.product-card,
.compare-item,
.detail-grid div {
  background:
    linear-gradient(180deg, rgba(16, 28, 24, 0.96), rgba(7, 12, 10, 0.96));
  border-color: rgba(109, 255, 46, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mini-card {
  border-top-color: var(--price-color, var(--neon));
  border-top-width: 4px;
  z-index: 4;
}

.product-card {
  border-left: 4px solid var(--price-color, var(--neon));
}

.price-ultra { --price-color: #ff4d7d; }
.price-high { --price-color: #c084fc; }
.price-mid { --price-color: #00f5d4; }
.price-low { --price-color: #6dff2e; }
.price-entry { --price-color: #d7ff45; }

.mini-card:hover,
.product-card:hover {
  border-color: rgba(109, 255, 46, 0.76);
  box-shadow:
    0 0 0 1px rgba(109, 255, 46, 0.3),
    0 0 28px rgba(109, 255, 46, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mini-card::after,
.product-card::after {
  border-radius: 10px;
  content: "";
  inset: -2px;
  opacity: 0;
  padding: 1px;
  pointer-events: none;
  position: absolute;
  transition: opacity 140ms ease;
  background: conic-gradient(from var(--spin, 0deg), #6dff2e, #00f5d4, #2a7fff, #6dff2e);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.mini-card:hover::after,
.product-card:hover::after,
.mini-card.lineage-focus::after,
.product-card.lineage-focus::after {
  animation: neon-spin 2.4s linear infinite;
  opacity: 1;
}

.mini-card strong,
.product-card h2,
.compare-item strong,
.detail-grid dd {
  color: #f6fff8;
}

.brand-line {
  align-items: center;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.brand-line .brand {
  color: #baff8b;
  display: inline;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.display-line,
.sales-line {
  color: #b8c8c0;
  display: block;
  font-size: 11px;
  line-height: 1.3;
  margin-top: 5px;
}

.sales-line {
  color: #d7ff45;
  font-weight: 800;
}

.timeline-price {
  align-items: center;
  background: rgba(109, 255, 46, 0.09);
  border: 1px solid rgba(109, 255, 46, 0.24);
  border-radius: 999px;
  color: #ccff9a;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  gap: 5px;
  line-height: 1;
  margin-top: 6px;
  max-width: 100%;
  min-height: 20px;
  overflow: hidden;
  padding: 3px 7px 3px 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-price span {
  background: rgba(0, 245, 212, 0.16);
  border-radius: 999px;
  color: #aafff2;
  flex: 0 0 auto;
  font-size: 9px;
  padding: 3px 5px;
}

.has-samsung-oled {
  overflow: visible;
}

.mini-card.has-samsung-oled {
  padding-top: 34px;
}

.product-card.has-samsung-oled {
  padding-top: 28px;
}

.samsung-flag {
  animation: flag-wave 1.8s ease-in-out infinite, samsung-shine 2.6s linear infinite;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)) 0 0 / 42px 100% no-repeat,
    linear-gradient(135deg, #0d5cff, #6fb5ff 48%, #ffffff 52%, #0d5cff);
  border: 1px solid rgba(148, 210, 255, 0.8);
  border-radius: 4px;
  box-shadow: 0 0 18px rgba(55, 149, 255, 0.6);
  color: white;
  font-size: 9px;
  font-weight: 900;
  left: 8px;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 5px 9px 5px 7px;
  position: absolute;
  text-transform: uppercase;
  top: 8px;
  transform-origin: left center;
  z-index: 3;
}

.samsung-flag::after {
  border-bottom: 9px solid transparent;
  border-left: 9px solid #0d5cff;
  border-top: 9px solid transparent;
  content: "";
  position: absolute;
  right: -9px;
  top: 0;
}

.flag {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 2px;
  box-shadow: 0 0 9px rgba(255, 255, 255, 0.14);
  display: inline-block;
  flex: 0 0 auto;
  height: 12px;
  overflow: hidden;
  position: relative;
  vertical-align: -1px;
  width: 18px;
}

.flag-jp {
  background: #fff;
}

.flag-jp::after {
  background: #bc002d;
  border-radius: 50%;
  content: "";
  height: 7px;
  left: 5px;
  position: absolute;
  top: 2px;
  width: 7px;
}

.flag-us {
  background: repeating-linear-gradient(180deg, #b22234 0 1.5px, #fff 1.5px 3px);
}

.flag-us::before {
  background: #3c3b6e;
  content: "";
  height: 7px;
  left: 0;
  position: absolute;
  top: 0;
  width: 8px;
}

.flag-tw {
  background: #fe0000;
}

.flag-tw::before {
  background: #000095;
  content: "";
  height: 7px;
  left: 0;
  position: absolute;
  top: 0;
  width: 9px;
}

.flag-tw::after {
  background: #fff;
  border-radius: 50%;
  content: "";
  height: 3px;
  left: 3px;
  position: absolute;
  top: 2px;
  width: 3px;
}

.flag-cn {
  background: #de2910;
}

.flag-cn::after {
  color: #ffde00;
  content: "★";
  font-size: 7px;
  left: 2px;
  line-height: 1;
  position: absolute;
  top: 1px;
}

.flag-ch {
  background: #d52b1e;
}

.flag-ch::before,
.flag-ch::after {
  background: #fff;
  content: "";
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.flag-ch::before {
  height: 8px;
  width: 3px;
}

.flag-ch::after {
  height: 3px;
  width: 8px;
}

.flag-global {
  background: linear-gradient(135deg, #6dff2e, #00f5d4);
}

.add-btn {
  background: #13221c;
  border-color: rgba(109, 255, 46, 0.28);
  color: #baff8b;
}

.add-btn.selected {
  background: linear-gradient(135deg, #6dff2e, #00f5d4);
  border-color: transparent;
  color: #061007;
}

.spec-strip span {
  background: rgba(109, 255, 46, 0.09);
  border: 1px solid rgba(109, 255, 46, 0.16);
  color: #caffc4;
}

.device-visual.phone,
.device-visual.handheld {
  box-shadow:
    0 0 0 1px rgba(109, 255, 46, 0.18),
    0 0 34px rgba(109, 255, 46, 0.16);
}

.screen-glow {
  box-shadow: 0 0 28px rgba(109, 255, 46, 0.16);
}

.compare-tab {
  background: linear-gradient(135deg, rgba(14, 26, 21, 0.94), rgba(27, 45, 36, 0.94));
  border: 1px solid rgba(109, 255, 46, 0.35);
  border-right: 0;
  box-shadow: 0 0 28px rgba(109, 255, 46, 0.22);
}

.compare-tab strong {
  background: var(--neon);
  color: #061007;
}

.modal-layer {
  background: rgba(0, 0, 0, 0.72);
}

.compare-item button,
.modal-close {
  background: #12201b;
  border-color: rgba(109, 255, 46, 0.24);
  color: #baff8b;
}

.lineage-svg {
  left: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  top: 0;
  z-index: 3;
}

.lineage-svg path {
  animation: dash-flow 1.4s linear infinite;
  fill: none;
  stroke: #6dff2e;
  stroke-dasharray: 2 3;
  stroke-linecap: round;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 8px rgba(109, 255, 46, 0.7));
  vector-effect: non-scaling-stroke;
}

body.lineage-active [data-product-id].lineage-muted {
  filter: grayscale(0.9) saturate(0.25);
  opacity: 0.24;
}

body.lineage-active [data-product-id].lineage-related,
body.lineage-active [data-product-id].lineage-focus {
  border-color: rgba(109, 255, 46, 0.85);
  box-shadow:
    0 0 0 1px rgba(109, 255, 46, 0.34),
    0 0 30px rgba(109, 255, 46, 0.2);
  opacity: 1;
}

tr[data-product-id].lineage-focus,
tr[data-product-id].lineage-related {
  outline: 1px solid rgba(109, 255, 46, 0.7);
  outline-offset: -1px;
}

@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes neon-spin {
  to {
    --spin: 360deg;
  }
}

@keyframes flag-wave {
  0%, 100% {
    transform: skewY(-4deg) translateY(0);
  }
  50% {
    transform: skewY(5deg) translateY(-1px);
  }
}

@keyframes samsung-shine {
  from {
    background-position: -50px 0, 0 0;
  }
  to {
    background-position: 120px 0, 0 0;
  }
}

@keyframes dash-flow {
  to {
    stroke-dashoffset: -14;
  }
}

/* Refined sidebar layout and Samsung-style badges */
.app-shell {
  width: min(1560px, calc(100% - 24px));
}

.roadmap-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: 272px minmax(0, 1fr);
  margin-top: 22px;
}

.roadmap-content {
  min-width: 0;
}

.control-surface {
  background:
    linear-gradient(180deg, rgba(11, 20, 17, 0.98), rgba(5, 10, 8, 0.98));
  border: 1px solid rgba(109, 255, 46, 0.2);
  border-radius: 8px;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 10px;
  padding: 14px;
  position: sticky;
  top: 12px;
  z-index: 8;
}

.sidebar-title {
  border-bottom: 1px solid rgba(109, 255, 46, 0.16);
  display: grid;
  gap: 3px;
  padding: 2px 2px 12px;
}

.sidebar-title span {
  color: var(--neon);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.sidebar-title strong {
  color: #f6fff8;
  font-size: 17px;
  line-height: 1.1;
}

.filter-stack {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 0;
}

.search-wrap {
  min-height: 48px;
  padding: 0 12px;
}

.search-wrap span {
  font-size: 20px;
}

.filter-card summary {
  min-height: 46px;
  padding: 0 12px;
}

.filter-card h3,
.year-filter h3 {
  font-size: 13px;
}

.check-list {
  max-height: 150px;
  padding: 10px 12px 12px;
}

.year-filter {
  margin-top: 0;
  max-width: none;
  padding: 12px;
}

.year-row {
  gap: 7px;
}

.reset-btn {
  margin-top: 0;
}

.result-toolbar {
  padding-top: 0;
}

.timeline-scroll {
  overflow: visible;
  padding: 14px 0 0 10px;
}

.timeline-grid {
  grid-template-columns: 96px repeat(var(--year-count), minmax(82px, 1fr));
  min-width: 0;
  width: 100%;
}

.row-head {
  font-size: 11px;
  min-height: 104px;
  padding: 8px;
}

.timeline-cell {
  gap: 7px;
  min-height: 104px;
  padding: 7px;
}

.mini-card {
  border-radius: 7px;
  min-height: 116px;
  padding: 12px 30px 10px 10px;
}

.mini-head {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  min-height: 16px;
}

.mini-head .brand {
  color: #baff8b;
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-dot {
  border: 1px solid rgba(109, 255, 46, 0.2);
  border-radius: 999px;
  color: #a9beb5;
  font-size: 9px;
  font-weight: 900;
  max-width: 50px;
  overflow: hidden;
  padding: 2px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-name {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.18;
  margin-top: 7px;
  min-height: 31px;
  overflow: hidden;
}

.mini-card small,
.display-line,
.sales-line,
.timeline-price,
.mini-card em {
  font-size: 10.5px;
}

.display-line {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  min-height: 27px;
  overflow: hidden;
}

.sales-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-card.has-samsung-oled,
.product-card.has-samsung-oled {
  overflow: visible;
}

.mini-card.has-samsung-oled {
  padding-top: 12px;
}

.product-card.has-samsung-oled {
  padding-top: 18px;
}

.samsung-flag {
  animation: samsung-clip-glint 2.35s linear infinite;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 42%, rgba(255, 255, 255, 0) 64%) -54px 0 / 42px 100% no-repeat,
    linear-gradient(135deg, #032a86 0%, #0b63ff 45%, #18b8ff 100%);
  border: 1px solid rgba(141, 205, 255, 0.95);
  border-radius: 4px 4px 4px 2px;
  box-shadow:
    0 0 0 1px rgba(0, 42, 168, 0.55),
    0 7px 18px rgba(0, 82, 255, 0.42),
    0 0 24px rgba(25, 154, 255, 0.32);
  color: white;
  font-size: 8.5px;
  font-weight: 950;
  left: -9px;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 5px 7px 5px 9px;
  position: absolute;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.38);
  text-transform: uppercase;
  top: -9px;
  transform: none;
  transform-origin: center;
  white-space: nowrap;
  z-index: 6;
}

.product-card .samsung-flag {
  left: 12px;
  top: -10px;
}

.samsung-flag::after {
  background: linear-gradient(135deg, #18b8ff, #032a86);
  border: 1px solid rgba(141, 205, 255, 0.75);
  border-left: 0;
  border-radius: 0 4px 4px 0;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  content: "";
  height: calc(100% + 2px);
  position: absolute;
  right: -11px;
  top: -1px;
  width: 11px;
}

.product-card {
  display: block;
  min-height: 205px;
  padding: 22px 48px 18px 18px;
}

.card-meta {
  align-items: center;
}

.lineage-svg {
  z-index: 3;
}

.timeline-grid {
  z-index: auto;
}

.lineage-svg path {
  stroke: #7cff4a;
  stroke-dasharray: 2 3;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

@keyframes samsung-clip-glint {
  0% {
    background-position: -56px 0, 0 0;
  }
  100% {
    background-position: 96px 0, 0 0;
  }
}

@media (max-width: 1100px) {
  .roadmap-layout {
    gap: 12px;
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .control-surface {
    position: sticky;
  }

  .filter-stack {
    grid-template-columns: 1fr;
  }
}

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

  .filter-stack {
    grid-template-columns: 1fr;
  }

  .timeline-scroll {
    overflow: visible;
  }

  .timeline-grid {
    grid-template-columns: 76px repeat(var(--year-count), minmax(58px, 1fr));
    min-width: 0;
  }

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

.product-card .product-main {
  display: grid;
  gap: 10px;
}

.product-card .card-meta {
  min-height: 22px;
}

.product-card h2 {
  margin: 0;
}

.product-card p {
  min-height: 68px;
}

@media (max-width: 640px) {
  .roadmap-layout {
    grid-template-columns: 1fr;
  }

  .control-surface {
    position: static;
  }
}
