@import url("/assets/vendor/mdi/materialdesignicons.min.css");

:root {
  --app-font: Inter, "Noto Sans", "Segoe UI", Arial, sans-serif;
  --row-label-width: 120px;
  --slot-height: 44px;
  --page-bg: #061017;
  --app-bg: var(--page-bg);
  --panel-bg: #081621;
  --table-bg: #081621;
  --header-bg: rgba(20, 45, 63, 0.95);
  --header-cell-bg: linear-gradient(180deg, #2b4052 0%, #213141 100%);
  --row-label-bg: linear-gradient(180deg, #464646 0%, #343434 100%);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --grid-border: rgba(255,255,255,0.1);
  --cell-bg: rgba(8, 22, 32, 0.92);
  --cell-border: rgba(125, 211, 252, 0.14);
  --cell-empty-bg: rgba(8, 22, 32, 0.84);
  --feature-bg: rgba(3, 16, 26, 0.78);
  --feature-border: rgba(56, 189, 248, 0.28);
  --slot-bg: var(--feature-bg);
  --slot-border: var(--feature-border);
  --muted-text-soft: var(--text-soft);
  --button-bg: linear-gradient(180deg, #15527a 0%, #0b3554 100%);
  --sidebar-text: #f4f7fb;
  --sidebar-icon: #f4f7fb;
  --corner-logo-color: rgba(255,255,255,0.82);
  --tech-logo-color: #ffffff;
  --control-height: 32px;
  --control-radius: 10px;
  --control-font: 12px;
  --control-icon: 16px;
  --toolbar-font-size: 14px;
  --toolbar-font-size-mobile: 13px;
  --toolbar-font-weight: 700;
  --toolbar-tab-height: 42px;
  --toolbar-tab-active-height: 48px;
  --toolbar-tab-radius: 16px 16px 0 0;
  --toolbar-tab-padding-x: 22px;
  --toolbar-tab-height-mobile: 38px;
  --toolbar-tab-active-height-mobile: 42px;
  --toolbar-tab-radius-mobile: 14px 14px 0 0;
  --toolbar-tab-padding-x-mobile: 16px;
  --toolbar-icon-btn-size: 34px;
  --toolbar-icon-size: 16px;
  --toolbar-icon-btn-radius: 10px;
  --page-x: 16px;
  --header-height: 44px;
  --section-gap: 16px;
}

html {
  scrollbar-gutter: stable;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

:is(html.dark, html[data-theme="night"]) { color-scheme: dark; }

:is(html.light, html[data-theme="day"]) {
  color-scheme: light;
  --page-bg: #eef7fb;
  --app-bg: var(--page-bg);
  --panel-bg: #e6f3fa;
  --table-bg: #eaf5fb;
  --header-bg: rgba(214, 235, 247, 0.95);
  --header-cell-bg: linear-gradient(180deg, #eaf6ff 0%, #d9ebf7 100%);
  --row-label-bg: linear-gradient(180deg, #f2f5f8 0%, #dfe7ee 100%);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --grid-border: rgba(20, 50, 70, 0.1);
  --cell-bg: rgba(255, 255, 255, 0.56);
  --cell-border: rgba(15, 76, 117, 0.16);
  --cell-empty-bg: rgba(248, 252, 255, 0.92);
  --feature-bg: rgba(255, 255, 255, 0.72);
  --feature-border: rgba(14, 165, 233, 0.30);
  --slot-bg: var(--feature-bg);
  --slot-border: var(--feature-border);
  --muted-text-soft: var(--text-soft);
  --button-bg: linear-gradient(180deg, #4aa3d8 0%, #1f6f9f 100%);
  --sidebar-text: #0f2433;
  --sidebar-icon: #0f2433;
  --corner-logo-color: rgba(15,36,51,0.82);
  --tech-logo-color: #050b10;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--app-font);
  background: var(--app-bg);
  color: var(--text-main);
}

.app-shell { height: 100vh; display: flex; flex-direction: column; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 12px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--grid-border);
  box-sizing: border-box;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.brand-block {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 10px;
}

.header-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.app-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 0 0 auto;
  height: 36px;
  margin-left: auto;
  position: relative;
  z-index: 3;
}

.bravia-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.app-header-actions .bravia-action-button {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px !important;
  border: 1px solid rgba(120, 190, 230, 0.45) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #eaf6ff !important;
  box-shadow: none !important;
  outline: none;
  appearance: none;
  cursor: pointer;
  line-height: 1 !important;
  vertical-align: middle;
  opacity: 1;
  position: relative;
  z-index: 1;
  transform: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 120ms ease;
}

.app-header-actions .bravia-action-button .toolbar-icon-mask,
.app-header-actions .bravia-action-button .toolbar-icon-img {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  display: block;
  flex-shrink: 0;
}

.app-header-actions .bravia-action-button:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(80, 180, 235, 0.75) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.app-header-actions .bravia-action-button:active {
  transform: translateY(1px);
}

.app-header-actions .bravia-action-button:focus-visible {
  border-color: rgba(125, 211, 252, 0.9) !important;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.22) !important;
}

.app-header-actions .bravia-action-button:disabled,
.app-header-actions .bravia-action-button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

:is(html.light, html[data-theme="day"]) .app-header-actions .bravia-action-button {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #0f172a !important;
  border-color: rgba(120, 190, 230, 0.45) !important;
}

:is(html.light, html[data-theme="day"]) .app-header-actions .bravia-action-button:hover {
  background: rgba(255, 255, 255, 0.45) !important;
  border-color: rgba(80, 180, 235, 0.75) !important;
}

.header-icon-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  margin: 0;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px !important;
  background: rgba(255,255,255,0.06);
  color: #eaf6ff;
  line-height: 1 !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.header-icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(21,209,232,0.16);
  border-color: rgba(21,209,232,0.58);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.22) !important;
}

.header-icon-btn::before,
.header-icon-btn::after {
  display: none !important;
  content: none !important;
}

.header-icon-btn .toolbar-icon-mask,
.header-icon-btn .toolbar-icon-img {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  display: block;
  flex: 0 0 auto;
  color: currentColor;
}

.header-action-label,
.header-icon-btn .button-text,
.header-icon-btn .sr-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.header-icon-btn span.icon,
.header-icon-btn .icon,
.header-icon-btn .material-icons,
.header-icon-btn .lucide {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.main-tabs { display: inline-flex; align-items: center; gap: 6px; }

.main-tab {
  min-height: var(--control-height);
  padding: 0 var(--toolbar-tab-padding-x);
  border-radius: var(--control-radius);
  border: 1px solid rgba(120,190,255,0.35);
  background: linear-gradient(180deg, #1b3950 0%, #122838 100%);
  color: #ffffff;
  font-size: var(--toolbar-font-size);
  font-weight: var(--toolbar-font-weight);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.main-tab.active {
  background: linear-gradient(90deg, #1689c6, #2f5f94);
  border-color: rgba(255,255,255,0.55);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
}

.theme-icon-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--control-radius);
  border: 1px solid rgba(255,255,255,0.35);
  background: linear-gradient(180deg, #24374a 0%, #162433 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.theme-icon-btn.header-icon-btn {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid rgba(255,255,255,0.24) !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,0.06) !important;
  color: #eaf6ff !important;
  box-shadow: none !important;
}

.toolbar-icon {
  font-size: var(--control-icon);
  line-height: 1;
  width: var(--control-icon);
  height: var(--control-icon);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar-icon-img {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;
  flex: 0 0 auto;
}

.toolbar-icon-mask {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 auto;
  background-color: currentColor;
  mask: var(--icon-url) center / contain no-repeat;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
}

:is(html.dark, html[data-theme="night"]) .toolbar-icon-img[src$=".svg"] {
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0,0,0,0.45));
}

:is(html.light, html[data-theme="day"]) .toolbar-icon-img[src$=".svg"] {
  filter: brightness(0) saturate(100%) drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 8px;
}

.toolbar-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar-actions.controls,
.main-tabs {
  flex-wrap: wrap;
}
.toolbar-actions.controls {
  row-gap: 6px;
}
.toolbar-divider { width: 1px; height: 24px; background: rgba(255,255,255,0.18); margin: 0 4px; }

.btn, .filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--control-height);
  padding: 0 11px;
  border-radius: var(--control-radius);
  font-size: var(--control-font);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

.btn-icon { width: var(--control-icon); height: var(--control-icon); object-fit: contain; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45)); }
.btn-icon.mdi {
  width: auto;
  height: auto;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
:is(html.dark, html[data-theme="night"]) .btn-icon[src$=".svg"] { filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0,0,0,0.45)); }
:is(html.light, html[data-theme="day"]) .btn-icon[src$=".svg"] { filter: brightness(0) saturate(100%) drop-shadow(0 1px 1px rgba(0,0,0,0.2)); }
.toolbar-actions .btn { background: linear-gradient(180deg, #4f3658 0%, #2f2039 100%); border: 1px solid rgba(231, 191, 255, 0.4); color: #ffffff; }
.toolbar-actions .btn:hover { background: linear-gradient(180deg, #5f416b 0%, #382744 100%); }
.toolbar-actions .btn span:last-child {
  display: inline-block;
  white-space: nowrap;
}
.toolbar-filters .filter-btn { background: linear-gradient(180deg, #27485f 0%, #18344a 100%); border: 1px solid rgba(140, 198, 235, 0.35); color: #e7f4ff; }
.toolbar-filters .filter-btn:hover { background: linear-gradient(180deg, #2e5772 0%, #1f405a 100%); }
.toolbar-filters .filter-btn.active { background: linear-gradient(180deg, #1f8ec1 0%, #20567a 100%); border-color: rgba(180, 230, 255, 0.75); color: #ffffff; }

.desktop-toolbar-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  box-sizing: border-box;
}

.control-separator {
  width: 1px;
  height: 24px;
  background: rgba(180, 220, 255, 0.25);
  margin: 0 4px;
  flex: 0 0 auto;
  font-size: 0;
}

.control-button {
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border-width: 1px;
  border-style: solid;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.control-button--content {
  color: #dff5ff;
  background: rgba(10, 42, 62, 0.82);
  border-color: rgba(64, 150, 200, 0.55);
}

.control-button--content.active,
.control-button--content.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #138fd4, #06d6b5);
  border-color: rgba(92, 225, 255, 0.85);
  box-shadow: 0 8px 22px rgba(0, 212, 170, 0.18);
}

.control-button--action {
  color: #f0e5ff;
  background: rgba(54, 30, 70, 0.82);
  border-color: rgba(170, 110, 210, 0.5);
}

.control-button--answer {
  color: #ffeaff;
  background: rgba(58, 28, 62, 0.82);
  border-color: rgba(210, 120, 200, 0.5);
}

.control-button--utility {
  color: #e5f4ff;
  background: rgba(33, 48, 64, 0.82);
  border-color: rgba(120, 170, 210, 0.5);
}

.control-button--utility.active,
.control-button--utility.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #1677ff, #00bcd4);
  border-color: rgba(140, 220, 255, 0.85);
  box-shadow: 0 8px 22px rgba(0, 188, 212, 0.18);
}

.save-status { margin: 2px 8px 6px; font-size: 11px; color: var(--text-muted); }
.save-status:empty { display: none; }
.save-status.is-faded { opacity: 0; transition: opacity 240ms ease; }

.main-layout {
  flex: 1;
  min-height: 0;
  display: block;
  overflow: hidden;
  padding: 10px;
}

.feature-bank-panel { display: none !important; }

.table-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: auto;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border: 1px solid var(--grid-border);
  border-radius: 10px;
  padding: 8px;
}

.hint-box { margin: 0; color: #9fd8ff; font-size: 12px; min-height: 0; }
.hint-box:empty { display: none; }
.table-scroll { width: 100%; height: 100%; min-height: 0; overflow-x: auto; overflow-y: visible; }

.lineup-table, #lineupTable {
  table-layout: fixed;
  width: 100%;
  min-width: 1420px;
  border-collapse: collapse;
  overflow: visible;
  background: var(--table-bg);
}

#lineupTable th, #lineupTable td {
  border: 1px solid var(--cell-border, var(--grid-border));
  padding: 7px;
  vertical-align: top;
}

#lineupTable tbody tr:hover .feature-cell,
#lineupTable tbody tr:hover .row-label-cell {
  background-color: rgba(120, 180, 220, 0.06);
}

.model-header-row { background: #223241; overflow: visible; }

.model-header-cell {
  background: var(--header-cell-bg) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  width: calc((100% - var(--row-label-width)) / 7);
  padding: 6px 8px 8px !important;
  position: relative;
  overflow: visible;
  text-align: center;
  vertical-align: middle;
}

.model-header-content {
  width: 100%;
  min-height: 132px;
  display: grid;
  grid-template-rows: 98px 20px 16px;
  align-items: center;
  justify-items: center;
  text-align: center;
  position: relative;
}

.tv-image-frame {
  width: 100%;
  height: 98px;
  min-height: 98px;
  max-height: 98px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
  z-index: 3;
  margin: 0 auto 2px auto;
  padding-top: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.tv-image-frame img, .tv-placeholder-img {
  display: block;
  width: auto;
  height: 82px;
  max-height: 82px;
  max-width: 92%;
  object-fit: contain;
  object-position: center center;
  margin: 0 auto;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.55));
  background: transparent;
}

.placeholder-label { position: absolute; color: #8ca0b2; font-size: 11px; }
.tv-image-frame:not(.no-image) .placeholder-label { display: none; }

.model-header-cell.panel-rgb .tv-image-frame::before,
.model-header-cell.panel-oled .tv-image-frame::before,
.model-header-cell.panel-mini-led .tv-image-frame::before,
.model-header-cell.panel-led .tv-image-frame::before {
  content: "";
  position: absolute;
  width: 76%;
  height: 70%;
  border-radius: 18px;
  filter: blur(14px);
  opacity: 0.72;
  z-index: -1;
  pointer-events: none;
}

.model-header-cell.panel-rgb .tv-image-frame::before {
  background: radial-gradient(circle at 20% 50%, rgba(255, 40, 60, 0.36), transparent 48%), radial-gradient(circle at 50% 45%, rgba(40, 140, 255, 0.30), transparent 52%), radial-gradient(circle at 78% 50%, rgba(20, 255, 150, 0.28), transparent 50%);
  animation: rgbSoftGlow 4s ease-in-out infinite;
}
.model-header-cell.panel-oled .tv-image-frame::before { background: radial-gradient(circle at 35% 50%, rgba(124, 58, 237, 0.28), transparent 55%), radial-gradient(circle at 70% 50%, rgba(37, 99, 235, 0.22), transparent 58%); }
.model-header-cell.panel-mini-led .tv-image-frame::before { background: radial-gradient(circle at 40% 50%, rgba(245, 158, 11, 0.30), transparent 55%), radial-gradient(circle at 70% 50%, rgba(249, 115, 22, 0.18), transparent 58%); }
.model-header-cell.panel-led .tv-image-frame::before { background: radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.18), transparent 58%); opacity: 0.52; }

.panel-badge {
  position: absolute;
  top: 6px;
  right: 10px;
  z-index: 5;
  padding: 3px 8px;
  min-width: 58px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.25px;
  color: #ffffff;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.48);
  box-shadow: 0 0 12px rgba(0,0,0,0.28);
  pointer-events: none;
}

.panel-badge--rgb {
  background: linear-gradient(90deg, #ff2d55 0%, #22c55e 50%, #2563eb 100%);
  box-shadow:
    0 0 12px rgba(255, 45, 85, 0.28),
    0 0 16px rgba(34, 197, 94, 0.22),
    0 0 18px rgba(37, 99, 235, 0.22);
}
.panel-badge--oled { background: linear-gradient(90deg, #7c3aed, #2563eb); box-shadow: 0 0 14px rgba(124,58,237,0.42); }
.panel-badge--mini-led { background: linear-gradient(90deg, #f59e0b, #f97316); box-shadow: 0 0 14px rgba(245,158,11,0.45); }
.panel-badge--led { background: linear-gradient(90deg, #475569, #0ea5e9); box-shadow: 0 0 10px rgba(14,165,233,0.26); }

@keyframes rgbSoftGlow { 0%, 100% { opacity: 0.72; transform: scale(1); } 50% { opacity: 0.95; transform: scale(1.04); } }

.tv-model-name {
  margin-top: 0;
  min-height: 16px;
  color: var(--text-main);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

.tv-model-sizes {
  margin-top: 1px;
  min-height: 13px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-muted);
  font-weight: 400;
  text-align: center;
  white-space: normal;
}

.row-label-cell {
  width: var(--row-label-width);
  min-width: var(--row-label-width);
  max-width: var(--row-label-width);
  padding: 0 6px !important;
  background: var(--row-label-bg);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  vertical-align: middle !important;
  border: 1px solid var(--grid-border) !important;
}

.row-label-inner {
  width: 100%;
  min-height: 38px;
  height: 100%;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: left;
}

.row-label-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--sidebar-icon);
  opacity: 0.95;
}
.row-label-icon-mask {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  mask: var(--icon-url) center / contain no-repeat;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
}

.row-label-text {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--sidebar-text);
  white-space: normal;
  overflow-wrap: anywhere;
}

.row-label-cell.no-icon .row-label-inner { grid-template-columns: 1fr; text-align: center; }
.row-label-cell.no-icon .row-label-text { text-align: center; }

.corner-logo-wrap {
  width: 100%;
  min-height: 98px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
}

.bravia-corner-logo {
  display: inline-block;
  width: min(92px, 88%);
  height: 72px;
  background: url("/assets/logo/userguide.png") center / contain no-repeat;
  opacity: 0.95;
}

.feature-cell { width: calc((100% - var(--row-label-width)) / 7); padding: 4px 5px; vertical-align: middle !important; background: var(--cell-bg); }
.no-feature-cell { background: var(--cell-empty-bg); pointer-events: none; }
.no-feature-mark { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: center; color: var(--muted-text-soft); font-size: 16px; font-weight: 500; line-height: 1; user-select: none; }
.no-feature-cell:hover { background: var(--cell-empty-bg); }
.feature-cell-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

.slot-stack { width: 100%; display: grid; grid-auto-rows: var(--slot-height); gap: 4px; }
.slot-stack.multi-slot .drop-slot, .slot-stack.multi-slot .slot { height: 34px; min-height: 34px; max-height: 34px; }
.slot-stack.multi-slot .selected-icon, .slot-stack.multi-slot .slot-icon { max-height: 30px; }

.drop-slot, .slot {
  width: 100%;
  height: var(--slot-height);
  min-height: var(--slot-height);
  max-height: var(--slot-height);
  border: 1px solid var(--slot-border);
  border-radius: 7px;
  background: var(--slot-bg);
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  padding: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.drop-slot.has-icon { border-color: transparent; background: transparent; }
.slot-stack > .drop-slot:not(.has-icon):not(.boolean-slot),
.slot-stack > .slot:not(.has-icon):not(.boolean-slot) {
  min-height: 42px;
  height: auto;
  max-height: none;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 6px 8px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}
.slot:hover { border-color: #5f839f; }
.slot.active { box-shadow: 0 0 0 1px rgba(57,181,255,0.45); }
.slot-stack > .drop-slot:not(.has-icon):not(.boolean-slot).active,
.slot-stack > .slot:not(.has-icon):not(.boolean-slot).active {
  box-shadow: none;
}
.slot.correct { border: 1px solid #18b368; }
.slot.wrong { border: 1px solid #d44f4f; }
.slot.missing { border: 1px solid #d2a741; }
.slot-placeholder { color: #8ca0b2; font-size: 10px; }

.slot-icon, .selected-icon {
  display: block;
  max-width: 94%;
  max-height: 34px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
  pointer-events: none;
}

.selected-tech-logo {
  width: 154px;
  max-width: 96%;
  height: 38px;
  max-height: 38px;
  object-fit: contain;
}

.feature-visual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.feature-icon {
  max-width: 88px;
  max-height: 44px;
  object-fit: contain;
  display: block;
}

.feature-text-fallback {
  display: none;
  font-size: 12px;
  line-height: 1.1;
  color: var(--text-main);
  font-weight: 700;
  text-align: center;
  white-space: normal;
}

.feature-visual.icon-missing .feature-text-fallback {
  display: inline-block;
}

.feature-visual.icon-missing .feature-icon {
  display: none;
}

.feature-visual-slot .feature-text-fallback {
  max-width: 100%;
}

.picker-feature-visual {
  width: 48px;
  height: 32px;
}

.picker-feature-icon {
  max-width: 72px;
  max-height: 42px;
}

.picker-feature-visual .feature-text-fallback {
  font-size: 10px;
  color: rgba(255,255,255,0.85);
}

.feature-picker-thumb {
  width: 54px;
  min-width: 54px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-picker-icon {
  max-width: 80px;
  max-height: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.tech-logo-icon {
  width: auto;
  height: auto;
  object-fit: contain;
}

.tech-logo-mask {
  display: block;
  flex: 0 0 auto;
  background-color: var(--tech-logo-color);
  mask: var(--tech-logo-url) center / contain no-repeat;
  -webkit-mask: var(--tech-logo-url) center / contain no-repeat;
}

.tech-logo-icon--picker {
  max-width: 165px !important;
  max-height: 58px !important;
}

.tech-logo-icon--slot {
  max-width: 200px !important;
  max-height: 70px !important;
}

/* Invert technology logos so they stand out against current day/night backgrounds */
.tech-logo-icon,
.tech-logo-img {
  filter: none !important;
}

.feature-picker-thumb--txt {
  color: var(--text-main);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.tech-logo-cell {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tech-logo-mask--cell {
  width: min(190px, 92%);
  height: 34px;
  max-width: 92% !important;
  max-height: none !important;
}

.tech-logo-mask--picker {
  width: 72px;
  height: 34px;
  max-width: 100%;
  max-height: none !important;
}

.tech-logo-mask--slot {
  width: min(160px, 96%) !important;
  height: 40px !important;
  max-width: 96% !important;
  max-height: none !important;
}

.tech-logo-img {
  display: block;
  max-height: 38px;
  max-width: 190px;
  object-fit: contain;
  filter: none !important;
  transition: filter .2s ease;
}

/* Day mode: black logo */
:is(html.light, html[data-theme="day"]) .tech-logo-icon,
:is(html.light, html[data-theme="day"]) .tech-logo-img {
  filter: brightness(0) saturate(100%) !important;
}

/* Night mode: white logo */
:is(html.dark, html[data-theme="night"]) .tech-logo-icon,
:is(html.dark, html[data-theme="night"]) .tech-logo-img {
  filter: brightness(0) invert(1) !important;
}


.tech-text {
  font-weight: 700;
  color: var(--text-main);
  font-size: 12px;
  text-align: center;
}

.bravia-comparison-table tbody td .bravia-spec-text {
  display: inline;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
}

.bravia-comparison-table tbody td .bravia-spec-text-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.bravia-comparison-table tbody td .bravia-spec-text-stack span {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.bravia-comparison-table tbody td .bravia-spec-empty {
  color: inherit;
  opacity: 0.75;
}

.bravia-comparison-table tbody td .chip,
.bravia-comparison-table tbody td .pill,
.bravia-comparison-table tbody td .badge,
.bravia-comparison-table tbody td .button,
.bravia-comparison-table tbody td [class*="chip"],
.bravia-comparison-table tbody td [class*="pill"],
.bravia-comparison-table tbody td [class*="badge"] {
  display: inline !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
  color: inherit !important;
  font: inherit !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
}

.slot-stack > .drop-slot:not(.has-icon):not(.boolean-slot) .tech-text,
.slot-stack > .slot:not(.has-icon):not(.boolean-slot) .tech-text,
.slot-stack > .drop-slot:not(.has-icon):not(.boolean-slot) .bravia-spec-text,
.slot-stack > .slot:not(.has-icon):not(.boolean-slot) .bravia-spec-text {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.tech-empty {
  color: rgba(148, 163, 184, 0.9);
}

.slot-stack > .drop-slot:not(.has-icon):not(.boolean-slot) .no-feature-mark,
.slot-stack > .slot:not(.has-icon):not(.boolean-slot) .no-feature-mark {
  min-height: 0;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 700;
}

:is(html.dark, html[data-theme="night"]) .slot-icon[src$=".svg"],
:is(html.dark, html[data-theme="night"]) .feature-picker-item img[src$=".svg"] {
  filter: brightness(0) invert(1) drop-shadow(0 1px 3px rgba(0,0,0,0.45));
}

:is(html.light, html[data-theme="day"]) .slot-icon[src$=".svg"],
:is(html.light, html[data-theme="day"]) .feature-picker-item img[src$=".svg"] {
  filter: brightness(0) saturate(100%) drop-shadow(0 1px 2px rgba(0,0,0,0.18));
}

.slot-fallback { font-size: 11px; line-height: 1.15; color: var(--text-main); font-weight: 600; white-space: normal; overflow-wrap: anywhere; }

.audio-speaker-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 76px;
  padding: 8px 6px;
  text-align: center;
}

.audio-speaker-main {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
  text-align: center;
  width: 100%;
  white-space: nowrap;
}

.audio-speaker-main-slot {
  width: 100%;
  min-height: 34px;
  height: 34px;
  max-height: 34px;
}

.audio-speaker-config {
  display: block;
  max-width: 220px;
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.audio-speaker-config-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--text-muted);
  font-weight: 600;
}

.audio-speaker-config-line {
  text-align: center;
  white-space: normal;
}

.audio-speaker-config-slot {
  min-height: 26px;
  height: 26px;
  max-height: 26px;
  padding: 2px 8px;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.audio-speaker-empty {
  color: var(--text-soft);
  font-weight: 700;
  text-align: center;
}

.audio-format-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 10px;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.audio-format-slot {
  min-height: 28px;
  height: 28px;
  max-height: 28px;
  padding: 3px 10px;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font-size: 12px;
}

.audio-format-sep {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-muted);
}

.audio-format-empty {
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 700;
}

.audio-power-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  padding: 8px 6px;
  text-align: center;
}

.audio-power-main {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
}

.audio-power-note {
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-muted);
  font-style: italic;
  font-weight: 600;
}

.audio-power-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
}

.audio-power-line {
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-muted);
  font-style: italic;
  font-weight: 600;
  white-space: nowrap;
}

.audio-power-empty {
  color: rgba(220, 235, 255, 0.45);
  font-weight: 700;
  text-align: center;
}

.series-value-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 42px;
  padding: 6px 8px;
  text-align: center;
}

.series-value-main {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main, #ffffff);
  line-height: 1.25;
}

.series-value-line {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
}

.series-value-empty {
  color: var(--text-soft);
  font-weight: 700;
  text-align: center;
}

.feature-boolean-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  text-align: center;
}

.boolean-slot {
  min-height: 32px;
  height: 32px;
  max-height: 32px;
  min-width: 32px;
  width: 32px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.feature-yes {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  border-radius: 0;
  color: var(--text-main);
  background: transparent;
  box-shadow: none;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.feature-no {
  color: var(--text-soft);
  font-size: 16px;
  font-weight: 700;
}

.feature-picker-popover {
  position: fixed;
  z-index: 9999;
  width: min(620px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: none;
  overflow: visible;
  background: var(--panel-bg);
  border: 1px solid var(--grid-border);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.45);
  padding: 8px;
}

.feature-picker-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.feature-picker-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feature-picker-actions { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }

.picker-clear-btn, .picker-add-btn, .feature-picker-close {
  min-height: 26px;
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}

.picker-clear-btn { border: 1px solid rgba(120, 190, 255, 0.34); background: linear-gradient(180deg, #17415f 0%, #0c2c44 100%); color: #ffffff; }
.picker-add-btn { border: 1px solid rgba(120, 230, 180, 0.42); background: linear-gradient(180deg, #1d7b5d 0%, #10523f 100%); color: #ffffff; }
.picker-add-btn:hover { background: linear-gradient(180deg, #24906f 0%, #145244 100%); }
.picker-add-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.feature-picker-close { width: 26px; padding: 0; font-size: 16px; border: 1px solid rgba(120, 190, 255, 0.34); background: rgba(30, 70, 100, 0.85); color: #ffffff; }
.picker-note { font-size: 11px; color: #f4ce7a; margin-bottom: 6px; }

.feature-picker-search {
  width: 100%;
  margin: 6px 0;
  padding: 6px;
  background: var(--table-bg);
  color: var(--text-main);
  border: 1px solid var(--grid-border);
  border-radius: 8px;
  font-size: 12px;
}

.feature-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feature-picker-item {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
}

.feature-picker-item:hover { background: rgba(80,160,220,0.16); border-color: rgba(120,190,255,0.35); }
.feature-picker-item img { max-width: 48px; max-height: 32px; object-fit: contain; }
.picker-media { max-width: 48px; max-height: 32px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; line-height: 1.1; }
.feature-picker-item-name { font-size: 12px; line-height: 1.15; }
.feature-picker-item.is-disabled { opacity: 0.56; cursor: not-allowed; }
.picker-used { display: inline-block; margin-left: 6px; font-size: 10px; color: rgba(255, 214, 136, 0.92); }

.empty-tab-state {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(255,255,255,0.86);
}

.empty-tab-state h2 { margin: 0 0 8px; font-size: 22px; }
.empty-tab-state p { margin: 0; color: rgba(255,255,255,0.7); }

:is(html.light, html[data-theme="day"]) .theme-icon-btn { background: linear-gradient(180deg, #fff6cc 0%, #f6dfa0 100%); color: #102030; border-color: rgba(170, 130, 60, 0.45); }
:is(html.light, html[data-theme="day"]) .app-header-actions .bravia-action-button.theme-icon-btn { background: rgba(255, 255, 255, 0.28) !important; color: #0f172a !important; border-color: rgba(120, 190, 230, 0.45) !important; }

:is(html.light, html[data-theme="day"]) .row-label-icon { color: var(--sidebar-icon); opacity: 0.9; }
:is(html.light, html[data-theme="day"]) .row-label-text { color: var(--sidebar-text); }
:is(html.light, html[data-theme="day"]) .tv-model-name,
:is(html.light, html[data-theme="day"]) .tv-model-sizes { color: #102030; text-shadow: none; }
:is(html.light, html[data-theme="day"]) .no-feature-mark { color: var(--muted-text-soft); }
:is(html.light, html[data-theme="day"]) .fallback-text,
:is(html.light, html[data-theme="day"]) .text-feature,
:is(html.light, html[data-theme="day"]) .slot-fallback { color: #102030; }
:is(html.light, html[data-theme="day"]) .feature-text-fallback { color: #102030; }
:is(html.light, html[data-theme="day"]) .empty-tab-state,
:is(html.light, html[data-theme="day"]) .empty-tab-state p { color: #102030; }
:is(html.light, html[data-theme="day"]) .feature-cell,
:is(html.light, html[data-theme="day"]) .b2ii-cell {
  color: var(--text-main);
}
:is(html.light, html[data-theme="day"]) .drop-slot,
:is(html.light, html[data-theme="day"]) .slot {
  background: var(--feature-bg);
  border-color: var(--feature-border);
  color: var(--text-main);
}

.table-scroll,
.spec-table-shell {
  scrollbar-width: thin;
}

:is(html.dark, html[data-theme="night"]) .table-scroll,
:is(html.dark, html[data-theme="night"]) .spec-table-shell {
  scrollbar-color: rgba(148, 163, 184, 0.55) rgba(15, 23, 42, 0.35);
}

:is(html.light, html[data-theme="day"]) .table-scroll,
:is(html.light, html[data-theme="day"]) .spec-table-shell {
  scrollbar-color: rgba(100, 116, 139, 0.45) rgba(226, 232, 240, 0.75);
}

.table-scroll::-webkit-scrollbar,
.spec-table-shell::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

:is(html.dark, html[data-theme="night"]) .table-scroll::-webkit-scrollbar-thumb,
:is(html.dark, html[data-theme="night"]) .spec-table-shell::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
}

:is(html.dark, html[data-theme="night"]) .table-scroll::-webkit-scrollbar-track,
:is(html.dark, html[data-theme="night"]) .spec-table-shell::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.35);
}

:is(html.light, html[data-theme="day"]) .table-scroll::-webkit-scrollbar-thumb,
:is(html.light, html[data-theme="day"]) .spec-table-shell::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
  border-radius: 999px;
}

:is(html.light, html[data-theme="day"]) .table-scroll::-webkit-scrollbar-track,
:is(html.light, html[data-theme="day"]) .spec-table-shell::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.75);
}

@media (max-width: 1024px) {
  :root { --row-label-width: 112px; }
  .brand-title { font-size: 13px; }
  .main-tab { padding: 0 var(--toolbar-tab-padding-x-mobile); }
}

@media (max-width: 900px) {
  .header-right { gap: 6px; }
  .app-header-actions,
  .bravia-actions {
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .feature-picker-header { flex-wrap: wrap; }
  .feature-picker-actions { margin-left: auto; }
  .audio-power-line { white-space: normal; }
  .series-value-line { white-space: normal; }
}

/* Holy Grail App Shell */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body { overflow: hidden; }

.app-shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  min-height: 44px;
}

.app-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 0 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  scrollbar-width: none;
}

.app-toolbar::-webkit-scrollbar { display: none; }

.tool-tab-box {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.tool-tab-box .tool-tab-wrap {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.tool-tab-box .tool-tab-content {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tool-tab-box .tool-tab-content::-webkit-scrollbar {
  display: none;
}

.tool-tab-box .tool-tab {
  --tab-bg: #1f6feb;
  --tab-bg-active: #15d1e8;
  --tab-text: #ffffff;
  position: relative;
  flex: 0 0 112px;
  width: 112px;
  min-width: 112px;
  max-width: 112px;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  margin-right: 0;
  border: none;
  outline: none;
  border-radius: var(--toolbar-tab-radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tab-bg) 92%, white 8%), var(--tab-bg));
  color: var(--tab-text);
  font-family: inherit;
  font-size: var(--toolbar-font-size);
  font-weight: var(--toolbar-font-weight);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 8px 18px rgba(0,0,0,0.16);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tool-tab-box .tool-tab:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 8px 18px rgba(0,0,0,0.28);
}

.tool-tab-box .tool-tab.active,
.tool-tab-box .tool-tab.is-active,
.tool-tab-box .tool-tab[aria-selected="true"] {
  height: 48px;
  min-height: 48px;
  line-height: 1;
  transform: translateY(0);
  color: #ffffff;
  z-index: 2;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tab-bg-active) 88%, white 12%), var(--tab-bg-active));
  box-shadow: 0 0 22px color-mix(in srgb, var(--tab-bg-active) 42%, transparent), inset 0 1px 0 rgba(255,255,255,0.32);
}

.tool-tab-box .desktop-toolbar-separator.control-separator {
  width: 1px;
  min-width: 1px;
  height: 30px;
  margin: 0 14px 7px 10px;
  color: transparent;
  background: rgba(255,255,255,0.28);
  border-radius: 999px;
}

.tool-tab-box .tool-tab--image { --tab-bg: #0891b2; --tab-bg-active: #15d1e8; }
.tool-tab-box .tool-tab--audio { --tab-bg: #2563eb; --tab-bg-active: #4893d2; }
.tool-tab-box .tool-tab--uxui { --tab-bg: #7c3aed; --tab-bg-active: #8b5cf6; }
.tool-tab-box .tool-tab--design { --tab-bg: #a21caf; --tab-bg-active: #c026d3; }
.tool-tab-box .tool-tab--all { --tab-bg: #0f766e; --tab-bg-active: #14b8a6; }
.tool-tab-box .tool-tab--motion { --tab-bg: #ea580c; --tab-bg-active: #f97316; }
.tool-tab-box .tool-tab--hdr { --tab-bg: #be123c; --tab-bg-active: #f43f5e; }
.tool-tab-box .tool-tab--view { --tab-bg: #15803d; --tab-bg-active: #22c55e; }

.model-tabs,
.product-tabs,
.series-tabs,
.mobile-model-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 18px 24px;
  margin: 0;
  scrollbar-width: none;
}

.model-tabs::-webkit-scrollbar,
.product-tabs::-webkit-scrollbar,
.series-tabs::-webkit-scrollbar,
.mobile-model-filters::-webkit-scrollbar {
  display: none;
}

.model-tab,
.product-tab,
.series-tab {
  flex: 0 0 132px;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  height: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  margin: 0;
  border: 1px solid rgba(72,147,210,0.55);
  border-radius: 9px;
  background: rgba(255,255,255,0.035);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.model-tab:hover,
.product-tab:hover,
.series-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(21,209,232,0.75);
  background: rgba(21,209,232,0.12);
}

.model-tab.active,
.product-tab.active,
.series-tab.active,
.model-tab[aria-selected="true"],
.product-tab[aria-selected="true"],
.series-tab[aria-selected="true"] {
  background: linear-gradient(135deg, #15d1e8, #14b8a6);
  border-color: rgba(21,209,232,0.95);
  box-shadow: 0 0 18px rgba(21,209,232,0.28);
}

.tool-tab--fullscreen,
.tool-tab--export,
.tab-fullscreen,
.tab-export {
  background: unset;
}

.tool-tab-box .toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0;
}

.tool-tab-box .toolbar-icon-btn,
.tool-tab-box .toolbar-action-btn,
button.toolbar-icon-btn,
button.toolbar-action-btn {
  flex: 0 0 auto;
  width: var(--toolbar-icon-btn-size);
  height: var(--toolbar-icon-btn-size);
  min-width: var(--toolbar-icon-btn-size);
  min-height: var(--toolbar-icon-btn-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  margin: 0 4px 7px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--toolbar-icon-btn-radius) !important;
  background: rgba(255,255,255,0.06) !important;
  color: #eaf6ff;
  box-shadow: none !important;
  cursor: pointer;
  line-height: 1 !important;
  white-space: nowrap;
  transform: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.tool-tab-box .toolbar-icon-btn:hover,
.tool-tab-box .toolbar-action-btn:hover {
  transform: translateY(-1px);
  background: rgba(21,209,232,0.16) !important;
  border-color: rgba(21,209,232,0.58);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.22) !important;
}

.tool-tab-box .toolbar-icon-btn::before,
.tool-tab-box .toolbar-icon-btn::after,
.tool-tab-box .toolbar-action-btn::before,
.tool-tab-box .toolbar-action-btn::after {
  display: none !important;
  content: none !important;
}

.tool-tab-box .toolbar-icon-btn .toolbar-icon-mask,
.tool-tab-box .toolbar-action-btn .toolbar-icon-mask {
  width: var(--toolbar-icon-size);
  height: var(--toolbar-icon-size);
  flex: 0 0 auto;
}

.toolbar-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.toolbar-cluster-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  display: none;
}

.app-main {
  min-height: 0;
  overflow: hidden;
  padding: 6px;
}

.matrix-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--grid-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-bg);
}

.table-panel {
  padding: 0;
  border: none;
  border-radius: 0;
}

.toolbar-row { width: 100%; }
.save-status { margin: 0 0 0 auto; }
.desktop-toolbar-separator { display: none; }

.table-scroll {
  width: 100%;
  height: 100%;
  overflow: auto;
}

/* Sticky Table */
.lineup-table {
  width: 100%;
  min-width: 1480px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.model-header-cell {
  position: sticky;
  top: 0;
  z-index: 20;
}

.row-label-cell {
  position: sticky;
  left: 0;
  z-index: 15;
}

.corner-cell {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 30;
}

/* Skeleton */
.skeleton-shell {
  display: none;
  height: 100%;
  padding: 12px;
  gap: 8px;
}

.app-shell.is-loading .skeleton-shell { display: grid; grid-template-rows: 22px 18px 1fr; }
.app-shell.is-loading .table-scroll,
.app-shell.is-loading .mobile-card-view,
.app-shell.is-loading #hintBox { display: none; }

.skeleton {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.14),
    rgba(255,255,255,0.06)
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s linear infinite;
  border-radius: 8px;
}

.skeleton-header { width: 56%; }
.skeleton-toolbar { width: 80%; }
.skeleton-matrix { width: 100%; border-radius: 12px; }

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

:is(html.light, html[data-theme="day"]) .skeleton {
  background: linear-gradient(
    90deg,
    rgba(0,0,0,0.05),
    rgba(0,0,0,0.10),
    rgba(0,0,0,0.05)
  );
  background-size: 200% 100%;
}

/* Mobile Card View */
.mobile-card-view { display: none; }
.mobile-model-filters { display: none; }
.model-chip { min-height: 30px; }

.b2ii-page {
  display: grid;
  gap: 10px;
  padding: 10px;
  min-height: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%);
}

.design-series-panel {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
}

.design-series-content {
  width: 100%;
  min-height: 0;
}

.b2ii-series-switch {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  margin: 0 0 12px 0;
  padding: 8px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  box-sizing: border-box;
}

.b2ii-series-btn {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 132px;
  min-width: 132px;
  height: 48px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(140, 198, 235, 0.3);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  color: #dceeff;
  background: rgba(16, 39, 56, 0.75);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.b2ii-series-btn.active {
  background: linear-gradient(135deg, #1d9bf0, #00d4aa);
  border-color: rgba(75, 220, 255, 0.85);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 212, 170, 0.22);
}

.b2ii-series-btn:hover {
  border-color: rgba(100, 210, 255, 0.9);
}

.b2ii-hero,
.b2ii-card {
  border: 1px solid var(--grid-border);
  border-radius: 18px;
  background: var(--panel-bg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

.b2ii-hero,
.design-hero {
  min-height: 260px;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 420px);
  align-items: center;
  gap: 32px;
  padding: 28px 32px;
  margin-bottom: 12px;
}

.b2ii-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.1;
}

.b2ii-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.b2ii-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(80, 180, 255, 0.45);
  background: linear-gradient(180deg, #1f8ec1 0%, #20567a 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.b2ii-badge--soft {
  background: rgba(255, 255, 255, 0.06);
}

.b2ii-desc {
  margin: 0;
  max-width: 980px;
  color: var(--text-muted);
  line-height: 1.45;
}

.b2ii-hero-media {
  display: flex;
  justify-content: center;
  align-items: center;
}

.b2ii-hero-media img,
.design-hero img {
  width: 100%;
  max-width: 360px;
  height: 160px;
  object-fit: contain;
  margin-left: auto;
  margin-right: auto;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.42));
}

.b2ii-card {
  padding: 10px;
  width: 100%;
  max-width: none;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.b2ii-table-card {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 !important;
}

.b2ii-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  overflow-x: auto;
  overflow-y: auto;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0;
}

.spec-table-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 16px;
  background: transparent;
}

.b2ii-table {
  width: 100%;
  margin: 0;
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.spec-table {
  width: 100%;
  min-width: 1280px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.b2ii-table th,
.b2ii-table td {
  padding: 10px 12px;
  border: 1px solid rgba(127, 156, 180, 0.42);
  vertical-align: middle;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.b2ii-table,
.spec-table {
  --design-table-text: #f8fafc;
  --design-table-muted: #cbd5e1;
  --design-table-header-text: #ffffff;
}

.spec-table th:first-child,
.spec-table td:first-child {
  width: 240px;
  white-space: pre-line;
  line-height: 1.35;
}

.b2ii-table thead th {
  position: sticky;
  top: 0;
  z-index: 8;
  background: linear-gradient(180deg, #4c6782 0%, #3a5269 100%);
  color: var(--design-table-header-text);
  font-weight: 800;
  text-align: center;
  box-shadow: inset 0 -1px 0 rgba(220, 236, 248, 0.22);
}

.b2ii-sticky-col {
  position: sticky;
  left: 0;
  z-index: 7;
  width: 230px;
  min-width: 230px;
  background: linear-gradient(180deg, #74899b 0%, #63798d 100%);
  color: var(--design-table-header-text);
  font-weight: 700;
  text-align: center;
  box-shadow: inset -1px 0 0 rgba(235, 245, 255, 0.18);
}

.b2ii-table thead .b2ii-sticky-col {
  z-index: 10;
}

.spec-table thead tr:first-child th:first-child {
  border-top-left-radius: 16px;
}

.spec-table thead tr:first-child th:last-child {
  border-top-right-radius: 16px;
}

.spec-table tbody tr:last-child th:first-child {
  border-bottom-left-radius: 16px;
}

.spec-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 16px;
}

.b2ii-model-col {
  min-width: 148px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.b2ii-cell {
  color: var(--design-table-text);
  white-space: normal;
  word-break: break-word;
  background: rgba(16, 28, 39, 0.82);
}

.b2ii-cell--model {
  font-weight: 800;
}

.b2ii-cell--muted {
  color: var(--design-table-muted);
}

.b2ii-action-cell {
  text-align: center;
}

.b2ii-action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 34px;
  padding: 0.58rem 1rem;
  border: none !important;
  border-radius: 0.7rem;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, #1d9bf0, #00d4aa) !important;
  box-shadow: 0 8px 24px rgba(29, 155, 240, 0.24);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.b2ii-action-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.12) 30%,
    rgba(255,255,255,0.38) 50%,
    rgba(255,255,255,0.12) 70%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.b2ii-action-btn:hover::before {
  left: 130%;
}

.b2ii-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(0, 212, 170, 0.3);
}

.b2ii-action-btn:active {
  transform: translateY(0) scale(0.98);
}

.b2ii-action-btn span,
.b2ii-action-btn {
  position: relative;
  z-index: 1;
}

.b2ii-table tbody tr:hover td,
.b2ii-table tbody tr:hover th {
  background-color: rgba(112, 154, 188, 0.16);
}

.design-spec-note {
  margin: 6px 0 0;
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(203, 213, 225, 0.85);
  text-align: left;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
}

.design-spec-note-icon {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1.2;
  margin-top: 1px;
}

:is(html.light, html[data-theme="day"]) .design-spec-note {
  color: #475569;
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(148, 163, 184, 0.25);
}

:is(html.light, html[data-theme="day"]) .b2ii-cell {
  color: var(--design-table-text);
  background: rgba(16, 28, 39, 0.82);
}

:is(html.light, html[data-theme="day"]) .b2ii-table,
:is(html.light, html[data-theme="day"]) .spec-table {
  --design-table-text: #f8fafc;
  --design-table-muted: #cbd5e1;
  --design-table-header-text: #ffffff;
}

.b2ii-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.b2ii-modal[hidden] {
  display: none !important;
}

.b2ii-modal-dialog {
  position: relative;
  width: fit-content;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  margin: 0;
  border: none;
  outline: none;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.b2ii-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(8, 20, 30, 0.72);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.b2ii-modal-close:hover {
  background: rgba(20, 120, 170, 0.85);
}

.b2ii-modal-content {
  padding: 0;
  margin: 0;
  display: block;
  overflow: visible;
  max-height: none;
}

.spec-modal-body {
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.b2ii-spec-stage {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.b2ii-spec-image {
  display: block;
  width: auto;
  max-width: calc(100vw - 72px);
  max-height: calc(100vh - 110px);
  width: auto;
  height: auto;
  margin: 0;
  border-radius: 14px;
  object-fit: contain;
}

.spec-modal-disclaimer {
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(220, 235, 255, 0.52);
  font-style: italic;
  text-align: center;
}

.b2ii-modal-empty {
  min-width: 320px;
  min-height: 160px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(220, 235, 255, 0.58);
  text-align: center;
  font-size: 14px;
  background: rgba(9, 20, 30, 0.96);
  border-radius: 14px;
}

.b2ii-modal-waiting {
  margin: 0;
  color: var(--text-muted);
}

.mobile-feature-icon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(140, 210, 255, 0.85);
}

.mobile-slot-stack {
  display: grid;
  gap: 4px;
}

.mobile-overview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 8px;
}

.mobile-overview-card {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--grid-border);
  border-radius: 14px;
  background: var(--header-cell-bg);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.mobile-overview-card:hover {
  border-color: rgba(80, 180, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.overview-tv-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
}

.overview-tv-image-wrap img {
  width: 110px;
  height: 66px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.45));
}

.overview-tv-image-wrap .panel-badge {
  top: 2px;
  right: 4px;
}

.overview-model-code {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.overview-model-name {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.overview-model-sizes {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.mobile-model-code {
  margin: 0 0 2px;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--text-main);
}

/* Desktop >= 1440 */
@media (min-width: 1440px) {
  .lineup-table { min-width: 1480px; }
  .row-label-cell { width: 128px; min-width: 128px; max-width: 128px; }
  .drop-slot { height: 38px; min-height: 38px; max-height: 38px; }
  .tv-image-frame { height: 100px; min-height: 100px; max-height: 100px; }
  .tv-image-frame img { height: 84px; max-height: 84px; }
}

@media (min-width: 768px) {
  .desktop-toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    padding: 7px 10px;
  }

  .desktop-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
  }

  .desktop-toolbar-group .main-tabs,
  .desktop-toolbar-group.toolbar-scroll-row,
  .desktop-toolbar-group .toolbar-group {
    overflow: visible;
    white-space: normal;
  }

  .desktop-toolbar-separator {
    display: inline-flex;
    align-items: center;
    color: rgba(255,255,255,0.38);
    font-weight: 700;
    padding: 0 2px;
    user-select: none;
  }

  :is(html.light, html[data-theme="day"]) .desktop-toolbar-separator {
    color: rgba(15,35,50,0.35);
  }

  .app-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
  }

  .mobile-model-filter-row {
    display: none;
  }

  .save-status {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.7;
    padding-right: 10px;
  }
}

/* Laptop 1024-1439 */
@media (max-width: 1439px) and (min-width: 1024px) {
  .brand-title { font-size: 14px; }
  .lineup-table { min-width: 1320px; }
  .row-label-cell { width: 112px; min-width: 112px; max-width: 112px; }
  .row-label-text { font-size: 10px; }
  .drop-slot { height: 34px; min-height: 34px; max-height: 34px; font-size: 10px; }
  .tv-image-frame { height: 88px; min-height: 88px; max-height: 88px; padding-top: 10px; }
  .tv-image-frame img { height: 72px; max-height: 72px; }
  .tv-model-name { font-size: 12px; }
  .tv-model-sizes { font-size: 9px; }
}

/* Tablet 768-1023 */
@media (max-width: 1023px) and (min-width: 768px) {
  .app-header {
    display: flex;
    justify-content: space-between;
    gap: 6px;
  }
  .brand-title { font-size: 13px; }
  .header-right { display: inline-flex; }
  .app-toolbar { overflow-x: auto; flex-wrap: nowrap; }
  .lineup-table { min-width: 1180px; }
  .row-label-cell { width: 104px; min-width: 104px; max-width: 104px; }
  .drop-slot { height: 32px; min-height: 32px; max-height: 32px; font-size: 10px; }
  .panel-badge { font-size: 8px; padding: 2px 6px; top: 6px; right: 8px; }
}

/* Mobile <= 767 */
@media (max-width: 767px) {
  .desktop-toolbar-row {
    display: contents;
  }
  .desktop-toolbar-separator {
    display: none !important;
  }
  .app-shell {
    height: 100dvh;
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  .app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    min-height: 40px;
    border-bottom: 1px solid var(--grid-border);
  }
  .brand-title {
    font-size: 11px;
    line-height: 1.15;
    font-weight: 800;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-right { display: inline-flex; justify-self: end; }
  .main-tabs,
  .toolbar-scroll-row,
  .toolbar-actions-row,
  .toolbar-filter-row,
  .mobile-model-filter-row,
  .main-tabs-row {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    min-height: 30px;
    width: 100%;
    min-width: 0;
  }

  .main-tabs::-webkit-scrollbar,
  .toolbar-scroll-row::-webkit-scrollbar,
  .toolbar-actions-row::-webkit-scrollbar,
  .toolbar-filter-row::-webkit-scrollbar,
  .mobile-model-filter-row::-webkit-scrollbar,
  .main-tabs-row::-webkit-scrollbar {
    display: none;
  }

  .main-tab {
    flex: 0 0 auto;
    position: static !important;
    transform: none !important;
    min-width: auto;
    min-height: var(--toolbar-tab-height-mobile);
    height: var(--toolbar-tab-height-mobile);
    padding: 0 var(--toolbar-tab-padding-x-mobile);
    border-radius: var(--toolbar-tab-radius-mobile);
    font-size: var(--toolbar-font-size-mobile);
    line-height: var(--toolbar-tab-height-mobile);
    white-space: nowrap;
  }

  .app-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 8px 0;
    border: none;
    background: transparent;
  }
  .toolbar-cluster {
    display: grid;
    gap: 4px;
  }
  .toolbar-cluster-label {
    font-size: 9px;
  }
  .toolbar-row,
  .toolbar-divider {
    display: none !important;
  }
  .toolbar-scroll-row {
    position: static;
  }
  .toolbar-scroll-row > * { flex: 0 0 auto; }

  .toolbar-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .tool-tab-box {
    padding: 0;
    border-radius: 0;
  }

  .tool-tab-box .tool-tab {
    flex-basis: 104px;
    width: 104px;
    min-width: 104px;
    max-width: 104px;
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 14px 14px 0 0;
    font-size: var(--toolbar-font-size-mobile);
    line-height: 1;
  }

  .tool-tab-box .tool-tab.active,
  .tool-tab-box .tool-tab.is-active,
  .tool-tab-box .tool-tab[aria-selected="true"] {
    height: 44px;
    min-height: 44px;
    line-height: 1;
  }

  .tool-tab-box .toolbar-icon-btn,
  .tool-tab-box .toolbar-action-btn,
  button.toolbar-icon-btn,
  button.toolbar-action-btn {
    width: var(--toolbar-icon-btn-size);
    height: var(--toolbar-icon-btn-size);
    min-width: var(--toolbar-icon-btn-size);
    min-height: var(--toolbar-icon-btn-size);
    margin-bottom: 5px;
  }

  .btn,
  .filter-btn,
  .model-filter-btn {
    position: static !important;
    transform: none !important;
    flex: 0 0 auto;
    min-height: var(--control-height);
    height: var(--control-height);
    padding: 0 9px;
    border-radius: var(--control-radius);
    font-size: 10.5px;
    line-height: 1;
    white-space: nowrap;
  }

  .mobile-secondary {
    display: none !important;
  }

  .mobile-model-filters {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    padding: 12px 8px;
  }
  .mobile-model-filter-row {
    display: flex;
    overflow-x: auto;
    gap: 5px;
  }
  .toolbar-actions-row,
  .toolbar-filter-row,
  .mobile-model-filter-row,
  .main-tabs-row {
    min-width: 0;
    width: 100%;
  }
  .model-filter-btn {
    border: 1px solid rgba(255,255,255,0.24);
    background: rgba(255,255,255,0.08);
    color: var(--text-main);
  }
  .model-filter-btn.active {
    background: linear-gradient(90deg, #0ea5e9, #7c3aed);
    color: #fff;
    border-color: rgba(255,255,255,0.55);
  }

  .mobile-model-filters .model-tab {
    flex-basis: 118px;
    width: 118px;
    min-width: 118px;
    max-width: 118px;
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  .save-status {
    font-size: 10px;
    line-height: 1.1;
    min-height: 12px;
    opacity: 0.55;
    text-align: right;
    padding: 0 2px;
    margin: 0;
    justify-self: end;
  }

  .app-main {
    min-height: 0;
    padding: 6px;
    overflow: hidden;
  }
  .matrix-panel {
    overflow: hidden;
  }
  .table-scroll { display: none; }
  .mobile-card-view {
    height: 100%;
    display: grid;
    gap: 10px;
    overflow-y: auto;
    padding: 6px;
  }
  .b2ii-page {
    padding: 8px;
    gap: 10px;
  }
  .b2ii-series-switch {
    justify-content: flex-start;
    padding: 6px 8px;
    margin-bottom: 10px;
  }
  .b2ii-series-btn {
    width: 132px;
    min-width: 132px;
    height: 52px;
    min-height: 52px;
    font-size: 12px;
  }
  .b2ii-hero,
  .b2ii-card {
    border-radius: 14px;
    padding: 12px;
  }
  .b2ii-hero,
  .design-hero {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
    padding: 18px 14px;
    margin-bottom: 8px;
  }
  .b2ii-hero-copy {
    text-align: center;
  }
  .b2ii-badges {
    justify-content: center;
  }
  .b2ii-desc {
    margin-left: auto;
    margin-right: auto;
  }
  .b2ii-hero-media img,
  .design-hero img {
    width: min(300px, 88%);
    max-width: 300px;
    height: 150px;
  }
  .b2ii-table-card {
    padding: 8px;
  }
  .b2ii-table,
  .spec-table {
    min-width: 1040px;
  }
  .b2ii-sticky-col {
    width: 185px;
    min-width: 185px;
  }
  .b2ii-modal {
    padding: 12px;
  }
  .b2ii-modal-dialog {
    width: fit-content;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    margin: 0;
  }
  .mobile-model-card {
    border: 1px solid var(--grid-border);
    border-radius: 14px;
    background: var(--panel-bg);
    overflow: hidden;
  }
  .mobile-model-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 92px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--header-cell-bg);
  }
  .mobile-model-header img {
    width: 86px;
    height: 52px;
    object-fit: contain;
  }
  .mobile-model-header h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.1;
  }
  .mobile-model-header p {
    margin: 3px 0 0;
    font-size: 10px;
    color: var(--text-muted);
  }
  .mobile-feature-list { display: grid; }
  .mobile-feature-row {
    display: grid;
    grid-template-columns: minmax(110px, 38%) 1fr;
    gap: 8px;
    align-items: center;
    padding: 7px 8px;
    border-top: 1px solid var(--grid-border);
  }
  .mobile-feature-label {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
  }
  .mobile-feature-row .drop-slot {
    height: 36px;
    min-height: 36px;
    max-height: 36px;
  }

  .mobile-feature-row .drop-slot:not(.boolean-slot):not(.has-icon) {
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .feature-picker-popover {
    position: fixed;
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    top: auto !important;
    width: auto !important;
    max-height: none;
    overflow: auto;
    border-radius: 16px;
  }
  .feature-picker-item { min-height: 48px; }

  :is(html.light, html[data-theme="day"]) .main-tab,
  :is(html.light, html[data-theme="day"]) .btn,
  :is(html.light, html[data-theme="day"]) .filter-btn,
  :is(html.light, html[data-theme="day"]) .model-filter-btn {
    box-shadow: 0 2px 8px rgba(30, 80, 120, 0.14);
  }
}

@media (max-width: 1200px) {
  .b2ii-table,
  .spec-table {
    min-width: 1120px;
  }
}

@media (min-width: 560px) and (max-width: 767px) {
  .mobile-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-overview-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .overview-meta {
    text-align: center;
  }
}

button:focus-visible {
  outline: 2px solid rgba(120, 200, 255, 0.85);
  outline-offset: 1px;
}

/* Unified horizontal gutter + overflow containment */
.app-shell,
.app-main,
.matrix-panel,
.table-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.app-shell,
.app-main {
  overflow-x: hidden;
}

.app-header {
  width: 100%;
  max-width: 100%;
  min-height: var(--header-height);
  padding-left: var(--page-x);
  padding-right: var(--page-x);
  overflow: hidden;
}

.brand-block {
  flex: 1 1 auto;
  min-width: 0;
}

.brand-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.app-header-actions {
  margin-left: 12px;
}

.app-toolbar {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-left: var(--page-x);
  padding-right: var(--page-x);
  box-sizing: border-box;
}

.desktop-toolbar-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

.desktop-toolbar-row::-webkit-scrollbar {
  display: none;
}

.toolbar-cluster,
.toolbar-scroll-row,
.tool-tab-box .tool-tab-content,
.tool-tab-box .tool-tab-wrap,
.main-tabs {
  min-width: 0;
}

.table-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-left: var(--page-x);
  padding-right: var(--page-x);
  padding-bottom: var(--section-gap);
  box-sizing: border-box;
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  box-sizing: border-box;
}

#lineupTable,
.lineup-table {
  width: max-content;
  min-width: 100%;
}

.save-status {
  padding-left: var(--page-x);
  padding-right: var(--page-x);
  text-align: right;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  :root {
    --page-x: 10px;
    --section-gap: 12px;
  }

  .app-header-actions {
    gap: 8px;
    margin-left: 8px;
  }

  .app-header-actions .bravia-action-button {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }

  .app-toolbar {
    padding-left: var(--page-x);
    padding-right: var(--page-x);
    gap: 7px;
  }

  .desktop-toolbar-row {
    display: flex;
  }

  .mobile-model-filter-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-left: var(--page-x);
    padding-right: var(--page-x);
    box-sizing: border-box;
    overflow-x: auto;
  }

  .mobile-model-filters {
    width: max-content;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  .table-panel {
    padding-left: var(--page-x);
    padding-right: var(--page-x);
    padding-bottom: var(--section-gap);
  }
}

/* BRAVIA page mobile-first cleanup */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.bravia-page {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

.bravia-page-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 12px;
}

.bravia-header {
  justify-content: flex-start;
  gap: 0;
  padding: 0;
}

.brand-block.bravia-page-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.brand-block .brand-mark,
.app-header-actions,
.bravia-actions,
.toolbar-actions,
.page-actions,
.floating-actions {
  display: none !important;
}

.brand-title {
  min-width: 0;
  font-size: clamp(16px, 4vw, 24px);
  font-weight: 700;
  line-height: 1.2;
}

.corner-spacer {
  width: 100%;
  min-height: 98px;
}

.corner-logo-wrap,
.bravia-corner-logo,
.bravia-hero,
.userguide-hero,
.guide-hero {
  display: none !important;
}

.app-toolbar,
.desktop-toolbar-row,
.main-tabs,
.toolbar-filter-row,
.mobile-model-filter-row,
.mobile-model-filters,
.row-group-filters {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.app-toolbar {
  padding: 8px 12px 0;
  overflow-x: hidden;
}

.desktop-toolbar-row {
  gap: 10px;
  overflow-x: hidden;
}

.main-tabs-row,
.toolbar-filter-row,
.mobile-model-filter-row,
.main-tabs,
.row-group-filters,
.mobile-model-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.main-tabs-row::-webkit-scrollbar,
.toolbar-filter-row::-webkit-scrollbar,
.mobile-model-filter-row::-webkit-scrollbar,
.main-tabs::-webkit-scrollbar,
.row-group-filters::-webkit-scrollbar,
.mobile-model-filters::-webkit-scrollbar {
  display: none;
}

.main-tab,
.row-filter-btn,
.mobile-model-filters .model-tab {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  max-width: none;
  min-height: 44px;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  scroll-snap-align: start;
}

.mobile-card-view {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 12px;
  padding: 8px;
}

.mobile-overview-grid {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 12px;
  grid-template-columns: 1fr;
  padding: 0;
}

.mobile-overview-card {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 10px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  padding: 12px;
  text-align: left;
}

.overview-tv-image-wrap {
  min-height: 96px;
}

.overview-tv-image-wrap img {
  width: 100%;
  max-width: 160px;
  height: auto;
  object-fit: contain;
  display: block;
}

.overview-meta {
  min-width: 0;
}

.overview-model-name,
.overview-model-sizes,
.mobile-model-header h3,
.mobile-model-header p {
  overflow-wrap: anywhere;
}

.mobile-model-card {
  min-width: 0;
  width: 100%;
}

.mobile-model-header {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.mobile-model-header .panel-badge {
  grid-column: 2;
  justify-self: start;
  margin-top: 2px;
}

.mobile-model-header img {
  width: 72px;
  height: 44px;
}

.mobile-feature-list,
.mobile-feature-row,
.mobile-feature-label,
.mobile-slot-stack {
  min-width: 0;
}

.mobile-feature-row {
  grid-template-columns: minmax(96px, 34%) 1fr;
}

@media (min-width: 480px) and (max-width: 767px) {
  .mobile-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .bravia-page-inner {
    padding: 10px 8px;
  }

  .bravia-header {
    min-height: auto;
  }

  .app-header {
    padding: 0;
  }

  .app-toolbar {
    padding: 8px 8px 0;
    gap: 8px;
  }

  .desktop-toolbar-row,
  .toolbar-cluster {
    display: grid;
    gap: 8px;
  }

  .main-tabs,
  .toolbar-filter-row,
  .mobile-model-filter-row,
  .row-group-filters,
  .mobile-model-filters {
    padding: 0;
    gap: 8px;
  }

  .main-tab,
  .row-filter-btn,
  .mobile-model-filters .model-tab {
    min-height: 42px;
    height: 42px;
    padding: 0 14px;
    font-size: 13px;
  }

  .mobile-card-view {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .mobile-model-header {
    position: static;
  }
}

@media (max-width: 420px) {
  .mobile-overview-grid {
    grid-template-columns: 1fr;
  }

  .mobile-overview-card {
    padding: 10px;
  }

  .mobile-model-header {
    grid-template-columns: 1fr;
  }

  .mobile-model-header img,
  .mobile-model-header .panel-badge {
    justify-self: start;
  }

  .mobile-feature-row {
    grid-template-columns: 1fr;
  }
}
