:root {
  --bg: #d9e7e0;
  --panel: #ffffff;
  --grid: #969696;
  --header-bg: #8f8f8f;
  --header-text: #ffffff;
  --cell-bg: #f2f2f2;
  --latest: #f7f0be;
  --text: #1f1f1f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: "Noto Sans JP", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  width: min(1650px, 96vw);
  margin: 6px auto 4px;
  padding: 8px 10px;
  border: 1px solid #b4bdb8;
  background: #edf4ef;
  display: flex;
  justify-content: space-between;
  gap: 4px;
  align-items: flex-end;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.02rem, 2vw, 1.42rem);
}

.sub {
  margin: 2px 0 0;
  color: #4c5955;
  font-size: 0.72rem;
}

.latest-box {
  text-align: right;
}

.latest-box p {
  margin: 0;
  font-size: 0.72rem;
  color: #4d5b56;
}

.latest-box strong {
  display: block;
  margin: 2px 0;
  font-size: 0.98rem;
}

.latest-box small {
  color: #4f5a57;
}

.to-calendar {
  display: inline-block;
  margin-top: 4px;
  border: 1px solid #7f8f89;
  background: #f3f7f4;
  color: #2e4540;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
}

.to-calendar:hover {
  background: #e6efe9;
}

.page {
  width: min(1650px, 96vw);
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 auto;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  margin-bottom: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 0 2px;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  touch-action: manipulation;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.drag-scroll {
  cursor: grab;
}

.drag-scroll.is-dragging {
  cursor: grabbing;
}

.drag-scroll.is-dragging * {
  pointer-events: none;
}

.topbar.drag-scroll,
.controls.drag-scroll,
.tabs.drag-scroll {
  user-select: none;
  -webkit-user-select: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid #818181;
  background: #d7d7d7;
  color: #2a2a2a;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.tab-btn.is-active {
  background: #8f8f8f;
  color: #fff;
}

.tab-btn[hidden] {
  display: none !important;
}

.model-filter[hidden],
.model-filter[data-visible="false"] {
  display: none !important;
}

.controls {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 5px 8px;
  border: 1px solid #b4bdb8;
  background: #edf4ef;
  font-size: 0.72rem;
}

.zoom-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.zoom-control label {
  white-space: nowrap;
  font-weight: 700;
}

.controls input[type="range"] {
  width: min(320px, 42vw);
}

.model-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.model-filter-label {
  font-size: 0.72rem;
  color: #465753;
  font-weight: 700;
}

.model-filter-buttons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: min(52vw, 820px);
  scrollbar-width: none;
}

.model-filter-buttons::-webkit-scrollbar {
  display: none;
}

.model-filter-btn {
  border: 1px solid #818181;
  background: #ececec;
  color: #2a2a2a;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.model-filter-btn.is-active {
  background: #8f8f8f;
  color: #fff;
}

.model-filter-btn:disabled {
  opacity: 0.45;
  cursor: default;
}


.sheet {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #b4bdb8;
  background: var(--panel);
}

.sheet-scroll-top-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}

.sheet-scroll-top-bar[hidden] {
  display: none;
}

.sheet-scroll-top {
  position: relative;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  height: 10px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(244, 248, 247, 0.92), rgba(225, 233, 230, 0.98));
  box-shadow: var(--shadow-card);
  scrollbar-gutter: stable;
}

.scroll-nav-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(38, 67, 73, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #26434b;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(28, 48, 54, 0.08);
}

.scroll-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.sheet-scroll-top[hidden] {
  display: none;
}

.sheet-scroll-top-inner {
  height: 1px;
}

.sheet-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  max-height: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.history-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 0;
  margin: 0 auto;
  table-layout: fixed;
  font-size: calc(13px * var(--zoom, 1));
}

.history-table th,
.history-table td {
  border: 1px solid var(--grid);
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
  min-width: 72px;
  background: var(--cell-bg);
  line-height: 1.25;
}

.history-table thead th {
  background: var(--header-bg);
  color: var(--header-text);
  font-weight: 700;
}

.history-table thead th:first-child,
.history-table tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
}

.history-table thead tr th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.history-table tbody th {
  background: var(--header-bg);
  color: var(--header-text);
  min-width: 96px;
  font-weight: 700;
}

.history-table td.improved {
  background: #f2e37d;
  font-weight: 700;
}

.history-table tr.image-row td {
  height: calc(116px * var(--zoom, 1));
  background: var(--cell-bg);
  padding: 2px 0;
  vertical-align: middle;
}

.history-table td.image-cell {
  min-width: 180px;
}

.product-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(220px, 100%);
  margin: 0 auto;
}

.product-visual svg {
  display: block;
  width: min(220px, 100%);
  height: auto;
  margin-top: 0;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.16));
}

.phone-visual svg {
  max-width: 208px;
}

.tablet-visual svg {
  max-width: 198px;
}

.vision-visual svg {
  max-width: 204px;
}

.watch-visual svg {
  max-width: 192px;
}

.device-thumb {
  margin: 0 auto;
  position: relative;
  background: linear-gradient(160deg, #fafafa, #d8d8d8);
  border: 2px solid #4a4a4a;
}

.device-thumb.phone {
  width: calc(26px * var(--zoom, 1));
  height: calc(48px * var(--zoom, 1));
  border-radius: 7px;
}

.device-thumb.phone::before,
.device-thumb.ipad::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  width: 40%;
  height: 3px;
  margin-left: -20%;
  border-radius: 999px;
  background: #6b6b6b;
}

.device-thumb.ipad {
  width: calc(42px * var(--zoom, 1));
  height: calc(56px * var(--zoom, 1));
  border-radius: 6px;
}

.device-thumb.watch {
  width: calc(34px * var(--zoom, 1));
  height: calc(34px * var(--zoom, 1));
  border-radius: 10px;
}

.device-thumb.watch::before,
.device-thumb.watch::after {
  content: "";
  position: absolute;
  left: 50%;
  width: calc(10px * var(--zoom, 1));
  height: calc(10px * var(--zoom, 1));
  margin-left: calc(-5px * var(--zoom, 1));
  background: #666;
}

.device-thumb.watch::before {
  top: calc(-12px * var(--zoom, 1));
  border-radius: 4px 4px 0 0;
}

.device-thumb.watch::after {
  bottom: calc(-12px * var(--zoom, 1));
  border-radius: 0 0 4px 4px;
}

.device-thumb.pencil {
  width: calc(54px * var(--zoom, 1));
  height: calc(6px * var(--zoom, 1));
  border-radius: 999px;
  border-width: 1px;
  transform: rotate(-20deg);
  transform-origin: center;
}

.device-thumb.pro {
  background: linear-gradient(160deg, #ebe8d7, #bcae8e);
}

.device-thumb.value {
  background: linear-gradient(160deg, #d8f3d9, #9bcf9f);
}

.device-thumb.special {
  background: linear-gradient(160deg, #e3ecff, #a6bae7);
}


.os-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding: 12px;
  align-items: start;
}

.os-platform-column {
  border: 1px solid rgba(38, 67, 73, 0.14);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(241, 246, 244, 0.96));
  box-shadow: 0 14px 28px rgba(28, 48, 54, 0.08);
  overflow: hidden;
}

.os-column-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(38, 67, 73, 0.1);
}

.os-column-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-transform: none;
}

.os-column-heading {
  display: grid;
  gap: 4px;
}

.os-column-series {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
}

.os-column-stats {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.os-column-count {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 700;
}

.os-column-range {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}

.os-version-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.os-version-card {
  border-radius: 16px;
  border: 1px solid rgba(38, 67, 73, 0.1);
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
}

.os-version-card.recent {
  border-color: rgba(197, 117, 73, 0.26);
  box-shadow: inset 0 0 0 1px rgba(216, 135, 84, 0.08);
}

.os-version-card.latest {
  background: linear-gradient(180deg, rgba(255, 248, 241, 0.98), rgba(255, 255, 255, 0.92));
}

.os-version-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.os-version-meta {
  min-width: 0;
}

.os-version-year {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.os-version-name {
  display: block;
  font-size: 0.98rem;
  line-height: 1.3;
}

.os-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(213, 117, 73, 0.14);
  color: #aa4b25;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.os-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.os-feature-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(242, 246, 249, 0.92);
  border: 1px solid rgba(38, 67, 73, 0.09);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.os-platform-empty {
  margin: 0;
  color: var(--text-muted);
}

.os-platform-iphone .os-column-label { color: #a44a2a; }
.os-platform-ipad .os-column-label { color: #2f6787; }
.os-platform-watch .os-column-label { color: #3d5664; }
.os-platform-other .os-column-label { color: #6a5a7d; }

.source {
  margin-top: 4px;
  border: 1px solid #b4bdb8;
  background: #edf4ef;
  padding: 10px 12px;
}

.source h2 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.source ul {
  margin: 0;
  padding-left: 18px;
}

.source a {
  color: #2e5c8a;
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .latest-box {
    text-align: left;
  }

  .controls {
    align-items: flex-start;
  }

  .zoom-control {
    width: 100%;
  }

  .zoom-control input[type="range"] {
    flex: 1 1 auto;
    width: auto;
  }

  .model-filter {
    margin-left: 0;
    width: 100%;
  }

  .model-filter-buttons {
    max-width: 100%;
  }

  .history-table {
    font-size: calc(12px * var(--zoom, 1));
  }
}


.history-table tbody td {
  white-space: normal;
  min-width: 96px;
  vertical-align: middle;
}

.history-table tbody th {
  white-space: nowrap;
}

.section-row th,
.section-row td {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong)) !important;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}

.section-row td {
  letter-spacing: 0.04em;
}

.history-table tr.row-network th {
  background: linear-gradient(135deg, #d97750, #b9522d) !important;
  color: #fff8f2;
}

.history-table tr.row-network td {
  background: linear-gradient(180deg, rgba(255, 238, 231, 0.98), rgba(255, 247, 242, 0.98)) !important;
  color: #8d3f24;
  font-weight: 800;
}


.empty-state th,
.empty-state td {
  background: linear-gradient(180deg, rgba(245, 250, 249, 0.98), rgba(233, 240, 237, 0.98)) !important;
  color: #284248;
}

.muted,
.image-loading,
.image-missing,
.icon-caption {
  color: var(--text-muted);
}

.icon-token {
  border-color: rgba(24, 57, 63, 0.18);
  background: rgba(255, 255, 255, 0.88);
}

.source {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 249, 247, 0.92));
  box-shadow: var(--shadow-card);
}

@media (max-width: 900px) {
  .topbar,
  .controls,
  .sheet {
    border-radius: 16px;
  }

  .topbar {
    margin-top: 14px;
    padding: 16px;
  }

  .latest-box {
    width: 100%;
    min-width: 0;
  }

  .tabs {
    padding: 6px;
  }

  .tab-btn {
    min-height: 38px;
    padding: 5px 8px;
  }

  .controls {
    padding: 10px 12px;
    gap: 4px;
  }

  .sheet {
    padding: 3px 6px;
  }

  .history-table th,
  .history-table td {
    padding: 6px 8px;
  }

  .history-table tbody th {
    min-width: 98px;
  }

  .history-table td.image-cell {
    min-width: 172px;
  }

  .os-board {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 4px;
  }

  .os-year-card {
    padding: 16px;
    border-radius: 16px;
  }

  .os-platform-grid {
    grid-template-columns: 1fr;
  }
}
/* Theme Refresh End */

/* Balance Refresh */
:root {
  --bg: #dfe8e2;
  --panel: rgba(255, 255, 255, 0.9);
  --grid: #c8d3cd;
  --header-bg: #24424b;
  --header-text: #f7fbfa;
  --cell-bg: #fbfdfc;
  --latest: #fff4d8;
  --text: #18272d;
  --text-muted: #61757b;
  --accent: #d37c56;
  --accent-strong: #b85735;
  --shadow-card: 0 14px 28px rgba(28, 48, 54, 0.08);
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(180deg, #dde7e2 0%, #d5e1db 100%);
  color: var(--text);
}

body[data-category="iphone"] {
  --accent: #d37c56;
  --accent-strong: #b85735;
}

body[data-category="ipad"] {
  --accent: #4f88ac;
  --accent-strong: #275b83;
}

body[data-category="vision"] {
  --accent: #6e7fb1;
  --accent-strong: #495b91;
}

body[data-category="watch"] {
  --accent: #4f6d78;
  --accent-strong: #2f4a55;
}

body[data-category="os"] {
  --accent: #7b658d;
  --accent-strong: #5d4d73;
}

.topbar,
.controls,
.sheet,
.source {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(243, 248, 246, 0.94));
  box-shadow: var(--shadow-card);
}

.topbar {
  margin: 10px auto 8px;
  padding: 18px 22px;
  gap: 18px;
  align-items: center;
}

.topbar h1 {
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  letter-spacing: -0.03em;
}

.sub {
  margin-top: 8px;
  font-size: 1rem;
  color: var(--text-muted);
}

.latest-box {
  min-width: 260px;
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248, 241, 238, 0.9), rgba(243, 234, 229, 0.96));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.latest-box p,
.latest-box small {
  color: #7e5f58;
}

.latest-box strong {
  margin: 8px 0 10px;
  font-size: 2rem;
  line-height: 1.05;
}

.to-calendar {
  border-radius: 999px;
  border-color: rgba(179, 94, 61, 0.25);
  background: rgba(255, 255, 255, 0.82);
  color: #aa4b25;
  padding: 10px 16px;
  box-shadow: 0 8px 18px rgba(28, 48, 54, 0.08);
}

.tabs,
.controls {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(241, 246, 244, 0.92));
}

.tabs {
  gap: 10px;
  min-height: 58px;
}

.tab-btn,
.model-filter-btn {
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 999px;
  border-color: rgba(38, 67, 73, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #26434b;
  font-size: 0.98rem;
  font-weight: 800;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.tab-btn.is-active,
.model-filter-btn.is-active {
  border-color: rgba(185, 87, 53, 0.28);
  background: linear-gradient(180deg, rgba(248, 230, 219, 0.96), rgba(241, 214, 197, 0.98));
  color: #a64a24;
}

.controls {
  gap: 18px;
  align-items: center;
}

.zoom-control,
.model-filter {
  gap: 12px;
}

.zoom-control label,
.model-filter-label {
  font-size: 1rem;
  color: #934c2f;
}

.controls input[type="range"] {
  width: min(430px, 45vw);
}

.sheet {
  padding: 10px 12px 12px;
}

.sheet-scroll-top {
  height: 16px;
  margin: 0 0 10px;
  border-color: rgba(255, 255, 255, 0.82);
  background: linear-gradient(180deg, rgba(244, 248, 247, 0.92), rgba(220, 230, 227, 0.98));
}

.history-table {
  width: max-content;
  margin: 0 auto;
  border-spacing: 0;
  table-layout: auto;
  font-size: calc(14px * var(--zoom, 1));
}

.history-table th,
.history-table td {
  padding: 4px 10px;
  min-width: 146px;
  border-color: var(--grid);
  line-height: 1.1;
}

.history-table thead th {
  background: linear-gradient(180deg, #27454d, #1e3941);
  color: var(--header-text);
  padding-top: 4px;
  padding-bottom: 4px;
}

.history-table thead th:first-child,
.history-table tbody th {
  width: 168px;
  min-width: 168px;
  max-width: 168px;
  background: linear-gradient(180deg, #28464f, #213b43);
  color: var(--header-text);
  padding-top: 4px;
  padding-bottom: 4px;
}

.history-table tbody td {
  min-width: 188px;
  background: rgba(255, 252, 243, 0.92);
}

.history-table th.model-name {
  background: linear-gradient(180deg, rgba(255, 242, 220, 0.98), rgba(248, 232, 198, 0.96));
  color: #7a5221;
}

.history-table th.model-name.latest {
  background: linear-gradient(180deg, #ffedc5, #f7d98b);
  color: #7a4a10;
}

.history-table td.improved {
  background: linear-gradient(180deg, #fff0b8, #f9e08a);
  color: #6f4b0b;
}

.history-table tr.image-row td {
  height: calc(154px * var(--zoom, 1));
  background: rgba(248, 250, 249, 0.96);
  padding: 6px 10px;
}

.history-table td.image-cell {
  min-width: 240px;
}

.product-visual {
  width: min(240px, 100%);
}

.product-visual svg {
  width: min(200px, 100%);
}

.phone-visual svg {
  max-width: 166px;
}

.tablet-visual svg {
  max-width: 190px;
}

.vision-visual svg {
  max-width: 190px;
}

.watch-visual svg {
  max-width: 150px;
}

.section-row th,
.section-row td {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong)) !important;
}

.history-table tr.row-network td {
  background: linear-gradient(180deg, rgba(255, 239, 229, 0.98), rgba(255, 248, 242, 0.98)) !important;
}

.source {
  margin-top: 10px;
  padding: 16px 18px;
}

.os-board {
  gap: 18px;
  padding: 8px;
}

.os-platform-column {
  border-color: rgba(38, 67, 73, 0.12);
  border-radius: 22px;
}

.os-column-header {
  padding: 18px 18px 14px;
}

.os-version-list {
  padding: 14px;
}

.os-version-card {
  padding: 14px;
}

@media (max-width: 900px) {
  .topbar {
    padding: 16px;
    gap: 12px;
  }

  .topbar h1 {
    font-size: 1.6rem;
  }

  .sub {
    font-size: 0.9rem;
  }

  .latest-box {
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
  }

  .latest-box strong {
    font-size: 1.5rem;
  }

  .tabs,
  .controls {
    padding: 8px 10px;
    border-radius: 18px;
  }

  .tab-btn,
  .model-filter-btn {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 0.9rem;
  }

  .controls {
    gap: 10px;
  }

  .history-table {
    font-size: calc(12px * var(--zoom, 1));
  }

  .history-table thead th:first-child,
  .history-table tbody th {
    width: 132px;
    min-width: 132px;
    max-width: 132px;
  }

  .history-table tbody td {
    min-width: 150px;
  }

  .history-table td.image-cell {
    min-width: 186px;
  }

  .history-table tr.image-row td {
    height: calc(132px * var(--zoom, 1));
  }

  .os-board {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 4px;
  }
}


.pencil-visual svg {
  max-width: 196px;
}

body[data-category="pencil"] {
  --accent: #8a7a62;
  --accent-strong: #645640;
}

/* Harmony Refresh */
.topbar {
  width: min(1560px, 94vw);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: 8px auto 6px;
  padding: 14px 18px;
}

.topbar > :first-child {
  min-width: 0;
}

.topbar h1 {
  font-size: clamp(1.55rem, 2.6vw, 2.55rem);
  line-height: 1.05;
}

.sub {
  margin-top: 6px;
  max-width: 72ch;
  font-size: 0.94rem;
  line-height: 1.45;
}

.page {
  width: min(1560px, 94vw);
}

.latest-box {
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 18px;
}

.latest-box strong {
  margin: 6px 0 8px;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
}

.to-calendar {
  padding: 8px 14px;
  font-size: 0.88rem;
}

.tabs,
.controls {
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 18px;
}

.tabs {
  gap: 8px;
  min-height: 50px;
}

.tab-btn,
.model-filter-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.92rem;
}

.controls {
  gap: 12px;
}

.zoom-control {
  flex: 1 1 320px;
  min-width: 280px;
}

.model-filter {
  flex: 1 1 auto;
  min-width: 260px;
  justify-content: flex-end;
  gap: 10px;
}

.model-filter-buttons {
  gap: 6px;
  max-width: min(56vw, 860px);
}

.zoom-control label,
.model-filter-label {
  font-size: 0.92rem;
  line-height: 1.1;
}

.controls input[type="range"] {
  width: min(360px, 38vw);
}

.sheet {
  padding: 8px 10px 10px;
}

.sheet-scroll-top-bar {
  gap: 6px;
  margin: 0 0 8px;
}

.scroll-nav-btn {
  width: 24px;
  height: 24px;
  font-size: 0.84rem;
}

.sheet-scroll-top {
  height: 13px;
  margin: 0;
}

.history-table {
  font-size: calc(13.5px * var(--zoom, 1));
}

.history-table th,
.history-table td {
  padding: 4px 9px;
  min-width: 136px;
  line-height: 1.12;
}

.history-table thead th {
  padding-top: 5px;
  padding-bottom: 5px;
}

.history-table thead th:first-child,
.history-table tbody th {
  width: 152px;
  min-width: 152px;
  max-width: 152px;
}

.history-table tbody td {
  min-width: 170px;
}

.history-table th.model-name {
  min-width: 174px;
  white-space: normal;
  line-height: 1.2;
}

.history-table tr.image-row td {
  height: calc(142px * var(--zoom, 1));
  padding: 6px 8px;
}

.history-table td.image-cell {
  min-width: 210px;
}

.product-visual {
  width: min(212px, 100%);
}

.product-visual svg {
  width: min(182px, 100%);
}

.phone-visual svg {
  max-width: 156px;
}

.tablet-visual svg,
.vision-visual svg {
  max-width: 180px;
}

.watch-visual svg {
  max-width: 144px;
}

.os-board {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
  padding: 4px;
}

.os-platform-column {
  border-radius: 20px;
}

.os-column-header {
  align-items: flex-start;
  padding: 16px 16px 12px;
}

.os-column-label {
  font-size: 0.96rem;
}

.os-column-series {
  font-size: 0.76rem;
}

.os-column-stats {
  text-align: right;
}

.os-column-count,
.os-column-range {
  font-size: 0.72rem;
}

.os-version-list {
  gap: 8px;
  padding: 12px;
}

.os-version-card {
  padding: 12px;
}

.os-version-header {
  margin-bottom: 8px;
}

.os-version-name {
  font-size: 0.94rem;
}

.os-feature-list {
  gap: 6px;
}

.os-feature-tag {
  min-height: 24px;
  padding: 5px 8px;
  font-size: 0.74rem;
}

.source {
  margin-top: 8px;
  padding: 14px 16px;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .sub {
    font-size: 0.86rem;
  }

  .latest-box {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
  }

  .tabs,
  .controls {
    padding: 7px 8px;
    border-radius: 16px;
  }

  .tabs {
    min-height: 44px;
    gap: 6px;
  }

  .tab-btn,
  .model-filter-btn {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.86rem;
  }

  .controls {
    gap: 8px;
  }

  .zoom-control,
  .model-filter {
    width: 100%;
    min-width: 0;
  }

  .model-filter {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
  }

  .model-filter-buttons {
    max-width: 100%;
  }

  .controls input[type="range"] {
    width: min(100%, 280px);
  }

  .sheet {
    padding: 6px 7px 8px;
  }

  .sheet-scroll-top-bar {
    margin-bottom: 6px;
  }

  .history-table {
    font-size: calc(12px * var(--zoom, 1));
  }

  .history-table thead th:first-child,
  .history-table tbody th {
    width: 126px;
    min-width: 126px;
    max-width: 126px;
  }

  .history-table tbody td {
    min-width: 146px;
  }

  .history-table td.image-cell {
    min-width: 176px;
  }

  .history-table tr.image-row td {
    height: calc(128px * var(--zoom, 1));
  }

  .os-board {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 2px;
  }
}

.history-table tr.image-row td img,
.history-table tr.image-row td picture,
.history-table tr.image-row td figure:not(.product-visual),
.history-table tr.image-row td canvas,
.history-table tr.image-row td video {
  display: none !important;
}

.history-table tr.image-row td .product-visual,
.history-table tr.image-row td .product-visual svg {
  display: flex !important;
}

.history-table tr.image-row td .product-visual.product-photo {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 104px;
}

.history-table tr.image-row td .product-visual.product-photo img {
  display: block !important;
  width: auto;
  max-width: 168px;
  max-height: 118px;
  object-fit: contain;
  mix-blend-mode: normal;
}

/* Yellow Neutralize */
.history-table tbody td {
  background: rgba(248, 250, 249, 0.96);
}

.history-table td.improved {
  background: linear-gradient(180deg, rgba(232, 241, 237, 0.98), rgba(221, 233, 227, 0.98));
  color: #284248;
  box-shadow: inset 0 0 0 1px rgba(79, 109, 120, 0.18);
}


/* Topbar Readability */
.topbar {
  margin: 10px auto 8px;
  padding: 18px 20px;
  gap: 20px;
  border-radius: 22px;
  box-shadow: 0 12px 24px rgba(29, 45, 41, 0.08);
}

.topbar h1 {
  font-size: clamp(1.8rem, 2.9vw, 2.8rem);
  line-height: 1.06;
}

.sub {
  margin-top: 8px;
  max-width: 68ch;
  font-size: 1rem;
  line-height: 1.5;
}

.latest-box {
  min-width: 248px;
  padding: 16px 18px;
  border-radius: 20px;
}

.latest-box strong {
  font-size: clamp(1.45rem, 2.1vw, 2rem);
}

.tabs,
.controls {
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(30, 48, 44, 0.05);
}

.tabs {
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
}

.tab-btn,
.model-filter-btn {
  min-height: 38px;
  padding: 7px 14px;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.controls {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  align-items: center;
  gap: 14px 20px;
  padding: 10px 12px;
}

.zoom-control {
  min-width: 0;
  gap: 10px;
}

.zoom-control label,
.model-filter-label {
  font-size: 0.94rem;
  font-weight: 800;
}

.controls input[type="range"] {
  width: min(100%, 320px);
}

.model-filter {
  min-width: 0;
  justify-content: flex-end;
  gap: 10px;
}

.model-filter-buttons {
  max-width: 100%;
  gap: 8px;
}

/* Header Seam Fix */
.history-table thead tr + tr th {
  border-top-color: transparent !important;
}

.history-table tbody tr:first-child th,
.history-table tbody tr:first-child td {
  border-top-color: transparent !important;
}

@media (max-width: 980px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .model-filter {
    justify-content: flex-start;
  }
}


/* Table Seam Fix */
.history-table {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}

.history-table th,
.history-table td {
  background-clip: padding-box;
  padding-top: 2px;
  padding-bottom: 2px;
}

.history-table thead th,
.history-table tbody th {
  background-image: none !important;
}

.history-table tbody td {
  background: #edf1ee !important;
}

.history-table td.improved {
  background: #dfe9e4 !important;
  box-shadow: none !important;
}

.history-table tr.image-row td {
  background: #eef2ef !important;
}


/* Balance Reset */
.topbar,
.page {
  width: min(1480px, 95vw) !important;
}

.topbar {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 272px) !important;
  align-items: end !important;
  gap: 16px !important;
  margin: 10px auto 8px !important;
  padding: 14px 18px !important;
}

.topbar h1 {
  font-size: clamp(1.7rem, 2.6vw, 2.55rem) !important;
}

.sub {
  max-width: 58ch !important;
  margin-top: 6px !important;
  font-size: 0.92rem !important;
  line-height: 1.45 !important;
}

.latest-box {
  min-width: 0 !important;
  width: 100% !important;
  padding: 14px 16px !important;
  text-align: right !important;
}

.latest-box strong {
  margin: 4px 0 6px !important;
  font-size: clamp(1.35rem, 2vw, 1.85rem) !important;
}

.latest-box small {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.tabs,
.controls {
  padding: 8px 10px !important;
  margin-bottom: 6px !important;
  border-radius: 18px !important;
}

.tabs {
  flex-wrap: wrap !important;
  gap: 8px !important;
  min-height: auto !important;
  overflow-x: visible !important;
}

.tab-btn,
.model-filter-btn {
  min-height: 36px !important;
  padding: 6px 12px !important;
  font-size: 0.92rem !important;
}

.controls {
  display: grid !important;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr) !important;
  gap: 10px 16px !important;
  align-items: center !important;
}

.zoom-control {
  min-width: 0 !important;
  gap: 8px !important;
}

.controls input[type="range"] {
  width: min(100%, 320px) !important;
}

.zoom-control label,
.model-filter-label {
  font-size: 0.9rem !important;
  font-weight: 800 !important;
}

.model-filter {
  min-width: 0 !important;
  gap: 8px !important;
  justify-content: flex-start !important;
  margin-left: 0 !important;
}

.model-filter-buttons {
  max-width: 100% !important;
  gap: 6px !important;
}

.sheet {
  padding: 6px 8px 10px !important;
}

.sheet-scroll {
  padding-bottom: 6px;
}

.history-table {
  width: max-content !important;
  min-width: 0 !important;
  margin: 0 !important;
  table-layout: fixed !important;
}

.history-table th,
.history-table td {
  padding: 3px 8px !important;
  line-height: 1.08 !important;
}

.history-table thead th:first-child,
.history-table tbody th {
  width: 164px !important;
  min-width: 164px !important;
  max-width: 164px !important;
}

.history-table tbody td,
.history-table th.model-name {
  min-width: 236px !important;
}

.history-table.is-compact-models tbody td,
.history-table.is-compact-models th.model-name {
  min-width: 280px !important;
}

.history-table.is-single-model tbody td,
.history-table.is-single-model th.model-name {
  min-width: 360px !important;
}

.history-table.is-single-model thead th:first-child,
.history-table.is-single-model tbody th {
  width: 178px !important;
  min-width: 178px !important;
  max-width: 178px !important;
}

.history-table tr.image-row td {
  height: calc(132px * var(--zoom, 1)) !important;
}

.history-table td.image-cell {
  min-width: 250px !important;
}

.product-visual {
  width: min(188px, 100%) !important;
}

.product-visual svg {
  width: min(152px, 100%) !important;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr !important;
    align-items: start !important;
  }

  .latest-box {
    text-align: left !important;
  }

  .controls {
    grid-template-columns: 1fr !important;
  }
}


/* Balance Polish */
.topbar,
.page {
  width: min(1380px, 94vw) !important;
}

.topbar {
  grid-template-columns: minmax(0, 1fr) 300px !important;
  align-items: center !important;
  gap: 18px !important;
  padding: 16px 18px !important;
}

.topbar h1 {
  font-size: clamp(1.65rem, 2.4vw, 2.35rem) !important;
}

.sub {
  max-width: 54ch !important;
  font-size: 0.9rem !important;
}

.latest-box {
  display: grid;
  gap: 4px;
  align-content: center;
}

.latest-box p {
  font-size: 0.78rem !important;
}

.latest-box strong {
  font-size: clamp(1.25rem, 1.8vw, 1.7rem) !important;
}

.latest-box small {
  font-size: 0.78rem !important;
}

.tabs {
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  min-height: 48px !important;
}

.controls {
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr) !important;
}

.model-filter {
  justify-content: flex-end !important;
}

.history-table {
  margin-inline: auto !important;
}

.history-table thead th:first-child,
.history-table tbody th {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
}

.history-table tbody td,
.history-table th.model-name,
.history-table thead th:not(:first-child) {
  min-width: 220px !important;
}

.history-table.is-compact-models tbody td,
.history-table.is-compact-models th.model-name,
.history-table.is-compact-models thead th:not(:first-child) {
  min-width: 260px !important;
}

.history-table.is-single-model tbody td,
.history-table.is-single-model th.model-name,
.history-table.is-single-model thead th:not(:first-child) {
  width: clamp(460px, 42vw, 560px) !important;
  min-width: clamp(460px, 42vw, 560px) !important;
  max-width: clamp(460px, 42vw, 560px) !important;
}

.history-table.is-single-model thead th:first-child,
.history-table.is-single-model tbody th {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
}

.history-table.is-single-model td.image-cell {
  min-width: clamp(460px, 42vw, 560px) !important;
}

.history-table.is-single-model tr.image-row td {
  height: calc(144px * var(--zoom, 1)) !important;
}

.history-table.is-single-model .product-visual {
  width: min(210px, 100%) !important;
}

.history-table.is-single-model .product-visual svg {
  width: min(168px, 100%) !important;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr !important;
  }

  .controls {
    grid-template-columns: 1fr !important;
  }

  .model-filter {
    justify-content: flex-start !important;
  }

  .history-table.is-single-model tbody td,
  .history-table.is-single-model th.model-name,
  .history-table.is-single-model thead th:not(:first-child) {
    width: 360px !important;
    min-width: 360px !important;
    max-width: 360px !important;
  }
}

/* Topbar Tighten */
.topbar {
  align-items: start !important;
  gap: 12px !important;
  margin: 6px auto 6px !important;
  padding: 10px 16px !important;
}

.topbar h1 {
  margin: 0 !important;
  font-size: clamp(1.45rem, 2vw, 2rem) !important;
  line-height: 1.04 !important;
}

.sub {
  margin-top: 4px !important;
  font-size: 0.82rem !important;
  line-height: 1.3 !important;
}

.latest-box {
  gap: 2px !important;
  padding: 8px 12px !important;
  min-height: 0 !important;
}

.latest-box p {
  margin: 0 !important;
  font-size: 0.74rem !important;
}

.latest-box strong {
  margin: 0 !important;
  font-size: clamp(1.1rem, 1.55vw, 1.45rem) !important;
  line-height: 1.05 !important;
}

.latest-box small {
  margin: 0 !important;
  font-size: 0.74rem !important;
  line-height: 1.22 !important;
}

.to-calendar {
  margin-top: 2px !important;
  padding: 5px 12px !important;
  min-height: 0 !important;
}

/* Top Horizontal Rail */
.sheet-scroll-top-bar {
  position: sticky !important;
  top: 0 !important;
  z-index: 18 !important;
  margin: 0 0 6px !important;
  padding: 4px 8px !important;
  border: 1px solid rgba(116, 133, 127, 0.46);
  border-radius: 14px;
  background: rgba(236, 243, 239, 0.94);
  backdrop-filter: blur(10px);
}

.sheet-scroll-top {
  height: 16px !important;
  cursor: ew-resize;
}

.scroll-nav-btn {
  width: 28px !important;
  height: 28px !important;
  font-size: 0.92rem !important;
}

/* OS Column Board */
body[data-category="os"] .os-board {
  min-width: 1440px;
  grid-template-columns: repeat(5, minmax(248px, 1fr)) !important;
  gap: 12px !important;
  align-items: start;
}

body[data-category="os"] .os-platform-column {
  min-width: 0;
}

body[data-category="os"] .os-column-header {
  min-height: 88px;
}

@media (max-width: 1100px) {
  body[data-category="os"] .os-board {
    min-width: 0;
    grid-template-columns: repeat(3, minmax(240px, 1fr)) !important;
  }
}

@media (max-width: 880px) {
  body[data-category="os"] .os-board {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  body[data-category="os"] .os-board {
    grid-template-columns: 1fr !important;
  }
}

/* Global Top Rail */
.sheet-scroll-top-bar.is-static {
  opacity: 0.88;
}

.sheet-scroll-top-bar.is-static .scroll-nav-btn {
  opacity: 0.45;
}

.sheet-scroll-top-bar.is-scrollable .sheet-scroll-top {
  cursor: ew-resize;
}

/* Top Compact */
.topbar {
  gap: 8px !important;
  margin: 4px auto 4px !important;
  padding: 7px 14px !important;
}

.topbar h1 {
  font-size: clamp(1.32rem, 1.75vw, 1.82rem) !important;
  line-height: 1.02 !important;
}

.sub {
  margin-top: 2px !important;
  font-size: 0.76rem !important;
  line-height: 1.22 !important;
}

.latest-box {
  gap: 1px !important;
  padding: 6px 10px !important;
}

.latest-box strong {
  font-size: clamp(1rem, 1.35vw, 1.28rem) !important;
}

.latest-box small,
.latest-box p {
  font-size: 0.7rem !important;
  line-height: 1.16 !important;
}

.to-calendar {
  margin-top: 1px !important;
  padding: 4px 10px !important;
  font-size: 0.8rem !important;
}

.page {
  padding-bottom: 4px !important;
}

.sheet-scroll-top-bar {
  margin: 0 0 4px !important;
  padding: 2px 6px !important;
}

.sheet-scroll-top {
  height: 13px !important;
}

.scroll-nav-btn {
  width: 24px !important;
  height: 24px !important;
}

.tabs,
.controls {
  padding: 5px 8px !important;
  margin-bottom: 4px !important;
}

.tabs {
  min-height: 42px !important;
  gap: 6px !important;
}

.tab-btn,
.model-filter-btn {
  min-height: 32px !important;
  padding: 5px 10px !important;
  font-size: 0.86rem !important;
}

.controls {
  gap: 8px !important;
}

.zoom-control label,
.model-filter-label {
  font-size: 0.84rem !important;
}


/* OS Header Cleanup */
body[data-category="os"] .os-column-heading {
  gap: 0 !important;
}

body[data-category="os"] .os-column-series {
  display: none !important;
}

body[data-category="os"] .os-column-label {
  font-size: 1.08rem !important;
  line-height: 1.15 !important;
}


/* iPad Single-Column Balance */
body[data-category="ipad"] .history-table.is-single-model tbody td,
body[data-category="ipad"] .history-table.is-single-model th.model-name,
body[data-category="ipad"] .history-table.is-single-model thead th:not(:first-child),
body[data-category="ipad"] .history-table:has(thead tr:nth-child(2) > th:nth-child(2):last-child) tbody td,
body[data-category="ipad"] .history-table:has(thead tr:nth-child(2) > th:nth-child(2):last-child) th.model-name,
body[data-category="ipad"] .history-table:has(thead tr:nth-child(2) > th:nth-child(2):last-child) thead th:not(:first-child) {
  width: clamp(340px, 30vw, 420px) !important;
  min-width: clamp(340px, 30vw, 420px) !important;
  max-width: clamp(340px, 30vw, 420px) !important;
}

body[data-category="ipad"] .history-table.is-single-model thead th:first-child,
body[data-category="ipad"] .history-table.is-single-model tbody th,
body[data-category="ipad"] .history-table:has(thead tr:nth-child(2) > th:nth-child(2):last-child) thead th:first-child,
body[data-category="ipad"] .history-table:has(thead tr:nth-child(2) > th:nth-child(2):last-child) tbody th {
  width: 156px !important;
  min-width: 156px !important;
  max-width: 156px !important;
}

body[data-category="ipad"] .history-table.is-single-model td.image-cell,
body[data-category="ipad"] .history-table:has(thead tr:nth-child(2) > th:nth-child(2):last-child) td.image-cell {
  min-width: clamp(340px, 30vw, 420px) !important;
}

body[data-category="ipad"] .history-table.is-single-model tr.image-row td,
body[data-category="ipad"] .history-table:has(thead tr:nth-child(2) > th:nth-child(2):last-child) tr.image-row td {
  height: calc(132px * var(--zoom, 1)) !important;
}

body[data-category="ipad"] .history-table.is-single-model .product-visual,
body[data-category="ipad"] .history-table:has(thead tr:nth-child(2) > th:nth-child(2):last-child) .product-visual {
  width: min(244px, 100%) !important;
}

body[data-category="ipad"] .history-table.is-single-model .tablet-visual svg,
body[data-category="ipad"] .history-table:has(thead tr:nth-child(2) > th:nth-child(2):last-child) .tablet-visual svg {
  width: min(208px, 100%) !important;
  max-width: 208px !important;
}


/* Uniform Column Balance */
.history-table thead th:not(:first-child),
.history-table tbody td,
.history-table td.image-cell,
.history-table th.model-name {
  width: var(--model-col-width, 220px) !important;
  min-width: var(--model-col-width, 220px) !important;
  max-width: var(--model-col-width, 220px) !important;
}

.history-table.is-compact-models thead th:not(:first-child),
.history-table.is-compact-models tbody td,
.history-table.is-compact-models td.image-cell,
.history-table.is-compact-models th.model-name {
  width: var(--model-col-width-compact, 260px) !important;
  min-width: var(--model-col-width-compact, 260px) !important;
  max-width: var(--model-col-width-compact, 260px) !important;
}

.history-table.is-single-model thead th:not(:first-child),
.history-table.is-single-model tbody td,
.history-table.is-single-model td.image-cell,
.history-table.is-single-model th.model-name {
  width: var(--model-col-width-single, 360px) !important;
  min-width: var(--model-col-width-single, 360px) !important;
  max-width: var(--model-col-width-single, 360px) !important;
}

.history-table tbody td,
.history-table th.model-name,
.history-table thead th:not(:first-child) {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.28 !important;
}

.history-table .cell-copy {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  line-height: 1.28;
}


/* Top Rail Always Visible */
.sheet-scroll-top-bar {
  display: flex !important;
  align-items: center !important;
  min-height: 30px;
}

.sheet-scroll-top {
  display: block !important;
}


/* Tab Balance Polish */
:root {
  --tab-pill-width: 156px;
  --tab-pill-height: 42px;
  --tab-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 244, 241, 0.94));
  --tab-surface-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 240, 236, 0.98));
  --tab-surface-active: linear-gradient(135deg, #46646d, #29444c);
  --tab-border: rgba(39, 64, 71, 0.18);
  --tab-border-active: rgba(29, 50, 57, 0.42);
  --tab-shadow: 0 10px 18px rgba(28, 48, 54, 0.08);
}

.tabs {
  align-items: stretch !important;
  gap: 10px !important;
  padding: 6px 2px 8px !important;
}

.tab-btn {
  flex: 0 0 var(--tab-pill-width) !important;
  width: var(--tab-pill-width) !important;
  min-width: var(--tab-pill-width) !important;
  max-width: var(--tab-pill-width) !important;
  min-height: var(--tab-pill-height) !important;
  padding: 0 16px !important;
  border-radius: 15px !important;
  border: 1px solid var(--tab-border) !important;
  background: var(--tab-surface) !important;
  color: #24383f !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em !important;
  box-shadow: var(--tab-shadow) !important;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.tab-btn:hover {
  background: var(--tab-surface-hover) !important;
  border-color: rgba(39, 64, 71, 0.28) !important;
  transform: translateY(-1px);
}

.tab-btn.is-active {
  background: var(--tab-surface-active) !important;
  color: #f7fbfa !important;
  border-color: var(--tab-border-active) !important;
  box-shadow: 0 12px 22px rgba(34, 58, 63, 0.16) !important;
}

.model-filter-buttons {
  gap: 10px !important;
}

.model-filter-btn {
  min-height: 38px !important;
  border-radius: 13px !important;
  border: 1px solid rgba(39, 64, 71, 0.14) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 246, 244, 0.96)) !important;
  color: #294149 !important;
  box-shadow: 0 8px 16px rgba(28, 48, 54, 0.05) !important;
}

.model-filter-btn.is-active {
  background: linear-gradient(135deg, rgba(211, 124, 86, 0.18), rgba(184, 87, 53, 0.22)) !important;
  color: #8b3f22 !important;
  border-color: rgba(184, 87, 53, 0.32) !important;
}

@media (max-width: 980px) {
  :root {
    --tab-pill-width: 132px;
    --tab-pill-height: 38px;
  }

  .tabs {
    gap: 8px !important;
  }

  .tab-btn {
    font-size: 0.84rem !important;
    padding: 0 12px !important;
  }
}


/* Long Copy Balance */
.history-table tbody td {
  padding-top: 5px !important;
  padding-bottom: 5px !important;
}

.history-table .cell-copy {
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: pretty;
  line-height: 1.42 !important;
}

.history-table tbody td:has(.cell-copy br) {
  line-height: 1.4 !important;
}


/* OS Board Layout Reset */
body[data-category="os"] .os-board {
  display: grid !important;
  gap: 18px !important;
  min-width: 0 !important;
  padding: 10px !important;
}

body[data-category="os"] .os-board-row {
  display: grid;
  gap: 14px;
  align-items: start;
}

body[data-category="os"] .os-board-row-primary {
  grid-template-columns: repeat(3, minmax(240px, 1fr)) !important;
}

body[data-category="os"] .os-board-extra {
  display: grid;
  gap: 10px;
}

body[data-category="os"] .os-board-extra-title {
  margin: 0;
  padding: 0 4px;
  color: #50666d;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

body[data-category="os"] .os-board-row-secondary {
  grid-template-columns: repeat(2, minmax(260px, 1fr)) !important;
}

body[data-category="os"] .os-platform-column {
  min-width: 0 !important;
}

@media (max-width: 1080px) {
  body[data-category="os"] .os-board-row-primary {
    grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
  }

  body[data-category="os"] .os-board-row-secondary {
    grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  body[data-category="os"] .os-board-row-primary,
  body[data-category="os"] .os-board-row-secondary {
    grid-template-columns: 1fr !important;
  }
}


/* Final Table Header Polish */
.history-table {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}

.history-table thead,
.history-table thead tr,
.history-table thead th {
  background: #6d7479 !important;
  background-image: none !important;
}

.history-table thead th {
  border-top-color: #6d7479 !important;
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

.history-table thead th:first-child,
.history-table tbody th {
  position: sticky !important;
  left: 0 !important;
  z-index: 6 !important;
  background: linear-gradient(180deg, #7d8488, #666d72) !important;
  background-color: #687176 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

.history-table tbody th {
  font-weight: 800 !important;
  box-shadow: 1px 0 0 rgba(255,255,255,0.08) inset !important;
}

.history-table tbody th,
.history-table tbody th .cell-copy,
.history-table thead th:first-child,
.history-table tbody th *,
.history-table thead th:first-child * {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

.section-row th,
.section-row td {
  background: linear-gradient(180deg, #72797e, #5f676d) !important;
  color: #f7fbfa !important;
}

.history-table thead tr + tr th {
  border-top: 0 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08) !important;
}

.history-table thead th:first-child,
.history-table tbody th {
  border-right-color: rgba(255, 255, 255, 0.12) !important;
}
/* Unified Header Seam Removal */
.history-table thead th {
  border-top-color: #6d7479 !important;
  border-bottom-color: #6d7479 !important;
  box-shadow: none !important;
}

.history-table thead tr + tr th {
  border-top-color: #6d7479 !important;
  box-shadow: none !important;
}

.history-table tbody tr:first-child th,
.history-table tbody tr:first-child td {
  border-top-color: #6d7479 !important;
  box-shadow: none !important;
}

/* Final Readability Pass */
:root {
  --table-head-bg: #566469;
  --table-head-bg-2: #46575d;
  --table-left-bg: #53646a;
  --table-left-bg-2: #43545a;
  --table-section-bg: #6f7a7d;
  --table-network-bg: #bf5d3b;
  --table-network-cell: #fff4ee;
  --table-grid-soft: #bfcbc7;
}

.history-table {
  color: #12272d !important;
  border-color: var(--table-grid-soft) !important;
}

.history-table th,
.history-table td {
  border-color: var(--table-grid-soft) !important;
}

.history-table thead,
.history-table thead tr,
.history-table thead th {
  background: linear-gradient(180deg, var(--table-head-bg), var(--table-head-bg-2)) !important;
  color: #f8fcfb !important;
  -webkit-text-fill-color: #f8fcfb !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18) !important;
}

.history-table thead th {
  padding-top: 7px !important;
  padding-bottom: 7px !important;
  font-weight: 900 !important;
  letter-spacing: 0.02em !important;
}

.history-table thead th:first-child,
.history-table tbody th {
  background: linear-gradient(180deg, var(--table-left-bg), var(--table-left-bg-2)) !important;
  color: #f9fffd !important;
  -webkit-text-fill-color: #f9fffd !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.22) !important;
  border-right-color: rgba(255, 255, 255, 0.22) !important;
}

.history-table tbody th {
  padding: 6px 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.02em !important;
}

.history-table tbody th .cell-copy,
.history-table tbody th *,
.history-table thead th:first-child * {
  color: #f9fffd !important;
  -webkit-text-fill-color: #f9fffd !important;
}

.history-table th.model-name {
  color: #fff7ec !important;
  -webkit-text-fill-color: #fff7ec !important;
  font-weight: 900 !important;
}

.section-row th,
.section-row td {
  background: linear-gradient(180deg, #788286, var(--table-section-bg)) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 900 !important;
}

.history-table tr.row-network th {
  background: linear-gradient(180deg, #d66f48, var(--table-network-bg)) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) !important;
}

.history-table tr.row-network td {
  background: linear-gradient(180deg, #fff8f3, var(--table-network-cell)) !important;
  color: #8f3b22 !important;
  -webkit-text-fill-color: #8f3b22 !important;
  font-weight: 900 !important;
}

.history-table tr.image-row th {
  background: linear-gradient(180deg, #5b6b71, #4a5a60) !important;
}

.history-table tr.image-row td {
  background: #eef4f1 !important;
}

.product-placeholder {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: min(180px, 100%);
  min-height: 96px;
  margin: 0 auto;
  border: 1px dashed rgba(70, 90, 96, 0.34);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(233, 241, 238, 0.82));
  color: #41585f;
}

.product-placeholder-mark {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(191, 93, 59, 0.1);
  color: #a24c2e;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.product-placeholder-name {
  max-width: 92%;
  color: #263f46;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* OS Board Non-Overlap Fix */
body[data-category="os"] .os-board {
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

body[data-category="os"] .os-board-row {
  display: grid !important;
  gap: 16px !important;
  width: 100% !important;
  align-items: start !important;
}

body[data-category="os"] .os-board-row-primary {
  grid-template-columns: repeat(3, minmax(250px, 1fr)) !important;
}

body[data-category="os"] .os-board-extra {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
  margin-top: 4px !important;
  clear: both !important;
}

body[data-category="os"] .os-board-row-secondary {
  grid-template-columns: repeat(2, minmax(250px, 1fr)) !important;
}

body[data-category="os"] .os-platform-column {
  position: relative !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  transform: none !important;
  z-index: auto !important;
}

body[data-category="os"] .os-column-header {
  min-height: 76px !important;
}

@media (max-width: 1120px) {
  body[data-category="os"] .os-board-row-primary {
    grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  body[data-category="os"] .os-board-row-primary,
  body[data-category="os"] .os-board-row-secondary {
    grid-template-columns: 1fr !important;
  }
}
