/* A stable task rail and one continuous data workspace. */
:root {
  --page: #f5f6f4;
  --surface: #fff;
  --ink: #172521;
  --muted: #74817a;
  --border: #e2e7e3;
  --accent: #226451;
  --radius: 14px;
  --shadow: 0 5px 24px #173c2906;
  --sidebar-width: 224px;
  --page-gutter: 32px;
  --header-offset: 0px;
}
html {
  scroll-padding-top: calc(var(--header-offset) + 16px);
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -70px;
  z-index: 100;
  padding: 10px 16px;
  background: white;
  border: 1px solid var(--accent);
  border-radius: 8px;
}
.skip-link:focus {
  top: 12px;
}
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 0;
  border-right: 1px solid var(--border);
  backdrop-filter: none;
  overflow-y: auto;
  z-index: 30;
}
.sidebar-top {
  padding: 0 8px 23px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.app-sidebar .brand {
  gap: 9px;
}
.app-sidebar .brand img {
  width: 38px;
  height: 45px;
}
.app-sidebar .brand span {
  font-size: 23px;
  letter-spacing: 0.3px;
  font-weight: 800;
}
.app-sidebar .game-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: 18px;
  font-size: 14px;
}
.app-sidebar .game-name strong {
  font-weight: 600;
}
.app-sidebar .game-name .game-mode {
  display: block;
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 0;
  color: var(--muted);
  font-size: 12px;
}
.app-sidebar .main-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: auto;
}
.app-sidebar .main-nav button,
.sidebar-utilities button {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 10px 15px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 6px;
  text-align: left;
  color: #617067;
  font-size: 14px;
  font-weight: 500;
}
.app-sidebar .main-nav button svg,
.sidebar-utilities button svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.7;
}
.app-sidebar .main-nav button:hover,
.sidebar-utilities button:hover {
  color: var(--accent);
  background: #f6f9f6;
}
.app-sidebar .main-nav button.active {
  color: var(--accent);
  background: #eef6f2;
  border-left-color: var(--accent);
  font-weight: 700;
}
.app-sidebar .count-badge {
  margin-left: auto;
  font-size: 10px;
  flex-shrink: 0;
}
.sidebar-utilities {
  margin-top: auto;
  padding-top: 24px;
  display: grid;
  gap: 6px;
}
.sidebar-utilities button {
  font-size: 13px;
  min-height: 43px;
}
.app-main {
  width: calc(100% - var(--sidebar-width));
  max-width: none;
  margin: 0 0 0 var(--sidebar-width);
  padding: 30px var(--page-gutter) 132px;
}
.hero {
  margin: 0 0 24px;
  min-height: 74px;
  gap: 20px;
}
h1 {
  font-size: 36px;
  font-weight: 780;
  letter-spacing: -0.8px;
  line-height: 1.24;
  margin-bottom: 7px;
}
.hero p {
  font-size: 14px;
  line-height: 1.6;
}
.preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  color: #738078;
  padding: 6px 0 6px 8px;
}
.preview-badge svg {
  width: 16px;
  height: 16px;
}
.workspace[data-view='ranking'] {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.workspace[data-view='ranking'] .filter-panel {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: none;
  margin-bottom: 0;
}
.workspace[data-view='ranking'] .table-panel {
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: none;
  overflow: visible;
}
.filter-panel {
  padding: 20px 24px 18px;
}
.filter-grid {
  grid-template-columns: 1fr 1fr 1.12fr 1fr auto;
  gap: 18px;
}
.filter-field {
  gap: 6px;
  padding-right: 18px;
  border-color: #edf0ee;
}
.filter-field > span {
  font-size: 12px;
  color: #617067;
}
select {
  min-height: 40px;
  border-color: #dce4de;
  border-radius: 8px;
  font-size: 14px;
  background-color: #fcfdfc;
}
.more-button {
  font-size: 13px;
  padding-left: 2px;
}
.condition-summary {
  margin-top: 14px;
  width: auto;
  font-size: 12px;
  line-height: 1.7;
  gap: 8px;
}
.preset-tag {
  background: none;
  border: 0;
  color: #697b6d;
  border-radius: 4px;
  font-size: 12px;
  padding: 0;
  font-weight: 500;
}
.preset-tag::after {
  content: '·';
  color: #b4bfc2;
  margin-left: 8px;
}
.preset-tag:hover {
  background: none;
  color: var(--accent);
  text-decoration: underline;
}
.table-toolbar {
  padding: 18px 24px;
  gap: 18px;
  align-items: center;
}
.table-heading {
  gap: 20px;
  min-width: 0;
}
.table-heading h2 {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.2px;
}
.table-heading > span {
  font-size: 12px;
}
.table-tools {
  gap: 12px;
  flex-shrink: 0;
}
.search-field {
  border-radius: 8px;
  border-color: #dce4de;
  min-width: 0;
  width: 210px;
  height: 38px;
  background: #fff;
}
.table-tools select {
  min-height: 38px;
  min-width: 130px;
  width: 130px;
}
.ranking-table th,
.facts-table th,
.analysis-table th {
  text-align: left;
}
.ranking-table th {
  height: 42px;
  font-size: 12px;
  font-weight: 500;
  color: #526258;
  background: #f6f8f6;
  border-bottom-color: #e4eae5;
}
.ranking-table td {
  height: 76px;
  padding-block: 10px;
  border-bottom-color: #e7ece8;
}
.ranking-table th,
.ranking-table td {
  padding-inline: 22px;
}
.ranking-table .rank-col {
  width: 7%;
}
.ranking-table th:nth-child(2) {
  width: 36%;
}
.ranking-table .time-col {
  width: 18%;
}
.ranking-table .ammo-col {
  width: 24%;
}
.ranking-table .action-col {
  width: 15%;
  text-align: left;
}
.sort-button {
  color: #304738;
  font-size: 12px;
  gap: 8px;
}
.weapon-row.is-leading {
  background: #f1f8f4b0;
}
.weapon-row.is-leading > td:first-child {
  box-shadow: inset 3px 0 var(--accent);
}
.weapon-row:hover {
  background: #f5f9f5;
}
.rank-number {
  font-size: 19px;
  font-weight: 650;
  color: #7b887f;
}
.weapon-picture {
  width: 118px;
  height: 50px;
}
.weapon-cell {
  gap: 16px;
}
.weapon-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.1px;
}
.weapon-sub {
  color: #78857c;
  font-size: 11px;
  margin-top: 3px;
}
.ttk-value {
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -0.45px;
  line-height: 1.22;
}
.ttk-value small {
  font-size: 12px;
  font-weight: 600;
  margin-left: 4px;
}
.ms-label {
  font-size: 11px;
  margin-top: 3px;
  color: #87928b;
}
.bullet-name {
  color: #44554a;
  font-size: 12px;
}
.bullet-detail {
  margin-top: 4px;
}
.row-actions {
  justify-content: flex-start;
  gap: 14px;
}
.outline-button {
  border-color: #b4cec0;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  min-width: 66px;
}
.outline-button.selected {
  border-color: #6f9a80;
  background: #e7f1e9;
}
.icon-button {
  color: #7b8a80;
}
.table-footer {
  padding: 11px 24px;
  min-height: 49px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 11px;
}
.table-footer .text-button {
  font-size: 12px;
}
.comparison-tray {
  left: var(--sidebar-width);
  padding: 0 var(--page-gutter) 16px;
  background: none;
}
.tray-inner {
  max-width: none;
  border-radius: 10px;
  min-height: 62px;
  padding: 10px 20px;
  gap: 18px;
  background: #fff;
  backdrop-filter: none;
  box-shadow: 0 5px 22px #173c2908;
  border-color: var(--border);
}
.tray-inner > p {
  max-width: none;
  white-space: nowrap;
}
.selection-chip {
  border-color: #e0e8e1;
  background: #f6f8f6;
  border-radius: 6px;
}
.primary-button {
  border-radius: 7px;
  background: #226451;
  box-shadow: none;
}
.primary-button:hover {
  background: #1c5745;
  color: #fff;
}
.selected-tray .primary-button {
  min-width: 118px;
  min-height: 40px;
  margin-left: 6px;
}
.page-footnote {
  color: #87958a;
  font-size: 11px;
  padding-top: 12px;
}
.empty-state,
.white-panel {
  border-radius: var(--radius);
}
.analysis-layout {
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
}
.analysis-side {
  padding: 20px;
}
#toast {
  left: calc(50% + var(--sidebar-width) / 2);
}
@media (min-width: 761px) {
  .ranking-table thead th {
    position: sticky;
    top: var(--header-offset);
    z-index: 10;
    box-shadow: inset 0 -1px #dfe7e1;
  }
  .ranking-table .time-cell,
  .ranking-table .actions-cell {
    text-align: left;
  }
}
@media (min-width: 1600px) {
  :root {
    --sidebar-width: 232px;
    --page-gutter: 40px;
  }
  .app-main {
    padding-top: 34px;
  }
  .weapon-picture {
    width: 130px;
  }
}
@media (min-width: 1101px) and (max-width: 1300px) {
  :root {
    --sidebar-width: 196px;
    --page-gutter: 24px;
  }
  .app-sidebar {
    padding-inline: 12px;
  }
  .sidebar-top {
    padding-inline: 7px;
  }
  .app-sidebar .brand {
    gap: 7px;
  }
  .app-sidebar .brand img {
    width: 34px;
    height: 40px;
  }
  .app-sidebar .brand span {
    font-size: 21px;
  }
  .app-sidebar .main-nav button {
    padding-inline: 12px;
    gap: 11px;
  }
  .filter-panel,
  .table-toolbar {
    padding-inline: 20px;
  }
  .filter-grid {
    gap: 12px;
  }
  .filter-field {
    padding-right: 12px;
  }
  .filter-field select {
    padding-left: 10px;
    font-size: 13px;
  }
  .table-heading {
    display: block;
  }
  .table-heading > span {
    display: block;
    margin-top: 3px;
  }
  .table-heading h2 {
    font-size: 18px;
  }
  .search-field {
    width: 176px;
  }
  .table-tools select {
    min-width: 116px;
    width: 116px;
  }
  .ranking-table th,
  .ranking-table td {
    padding-inline: 16px;
  }
  .weapon-picture {
    width: 80px;
  }
  .weapon-cell {
    gap: 12px;
  }
  .weapon-name {
    font-size: 15px;
  }
  .ttk-value {
    font-size: 21px;
  }
  .row-actions {
    gap: 8px;
  }
  .outline-button {
    min-width: 58px;
    padding-inline: 8px;
  }
  .analysis-layout {
    grid-template-columns: 235px minmax(0, 1fr);
    gap: 16px;
  }
}
@media (max-width: 1100px) {
  :root {
    --sidebar-width: 0px;
    --page-gutter: 24px;
    --header-offset: 108px;
  }
  .app-sidebar {
    position: sticky;
    inset: auto;
    top: 0;
    width: 100%;
    height: auto;
    padding: 0;
    display: block;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-top {
    display: flex;
    align-items: center;
    height: 62px;
    padding: 10px var(--page-gutter);
    margin: 0;
    border: 0;
  }
  .app-sidebar .brand img {
    width: 34px;
    height: 40px;
  }
  .app-sidebar .brand span {
    font-size: 22px;
  }
  .app-sidebar .game-name {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin: 0 84px 0 auto;
    font-size: 13px;
  }
  .app-sidebar .game-name .game-mode {
    font-size: 11px;
  }
  .app-sidebar .main-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    height: 46px;
    width: calc(100% - 48px);
    max-width: 620px;
    margin: 0 auto;
  }
  .app-sidebar .main-nav button {
    justify-content: center;
    min-height: 46px;
    height: 46px;
    padding: 9px 8px;
    gap: 8px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 5px 5px 0 0;
    font-size: 14px;
  }
  .app-sidebar .main-nav button.active {
    border-bottom-color: var(--accent);
  }
  .app-sidebar .main-nav button svg {
    width: 17px;
    height: 17px;
  }
  .app-sidebar .count-badge {
    margin-left: 0;
  }
  .sidebar-utilities {
    position: absolute;
    right: var(--page-gutter);
    top: 15px;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
  }
  .sidebar-utilities button {
    min-height: 32px;
    width: 32px;
    height: 32px;
    justify-content: center;
    padding: 0;
    border: 0;
  }
  .sidebar-utilities button span {
    display: none;
  }
  .app-main {
    width: 100%;
    margin: 0;
    padding-top: 26px;
  }
  .hero {
    min-height: 64px;
    margin-bottom: 20px;
  }
  h1 {
    font-size: 32px;
  }
  .hero p {
    font-size: 13px;
  }
  .filter-grid {
    grid-template-columns: 1fr 1fr 1.12fr 1fr;
    gap: 13px;
  }
  .filter-field {
    padding-right: 13px;
  }
  .more-button {
    grid-column: 1 / -1;
    justify-self: end;
    margin: 0;
    padding: 0;
  }
  .condition-summary {
    margin-top: -22px;
    width: calc(100% - 100px);
    font-size: 11px;
    gap: 7px;
    line-height: 1.8;
  }
  .preset-tag {
    font-size: 11px;
  }
  .table-heading {
    display: block;
  }
  .table-heading > span {
    display: block;
    margin-top: 3px;
  }
  .table-heading h2 {
    font-size: 18px;
  }
  .table-tools .search-field {
    width: 190px;
  }
  .ranking-table th,
  .ranking-table td {
    padding-inline: 16px;
  }
  .weapon-picture {
    width: 95px;
  }
  .weapon-cell {
    gap: 12px;
  }
  .weapon-name {
    font-size: 15px;
  }
  .ttk-value {
    font-size: 22px;
  }
  .row-actions {
    gap: 9px;
  }
  .outline-button {
    min-width: 60px;
    padding-inline: 9px;
  }
  .analysis-layout {
    grid-template-columns: 245px minmax(0, 1fr);
    gap: 16px;
  }
}
@media (min-width: 761px) and (max-width: 900px) {
  :root {
    --page-gutter: 18px;
  }
  .filter-panel,
  .table-toolbar {
    padding-inline: 18px;
  }
  .filter-grid {
    gap: 10px;
  }
  .filter-field {
    padding-right: 10px;
  }
  .filter-field select {
    padding-left: 9px;
    font-size: 13px;
  }
  .table-tools {
    gap: 9px;
  }
  .table-tools .search-field {
    width: 170px;
  }
  .table-tools select {
    min-width: 110px;
    width: 110px;
  }
  .ranking-table th,
  .ranking-table td {
    padding-inline: 12px;
  }
  .weapon-picture {
    width: 66px;
  }
  .weapon-cell {
    gap: 9px;
  }
  .weapon-name {
    font-size: 14px;
  }
  .weapon-sub,
  .bullet-name {
    font-size: 11px;
  }
  .ttk-value {
    font-size: 20px;
  }
  .row-actions {
    gap: 6px;
  }
  .outline-button {
    min-width: 52px;
    padding-inline: 7px;
  }
}
@media (max-width: 760px) {
  :root {
    --page-gutter: 14px;
    --header-offset: 102px;
  }
  .sidebar-top {
    height: 56px;
    padding-block: 8px;
  }
  .app-sidebar .brand {
    gap: 7px;
  }
  .app-sidebar .brand img {
    width: 30px;
    height: 35px;
  }
  .app-sidebar .brand span {
    font-size: 20px;
  }
  .app-sidebar .game-name {
    margin-right: 74px;
    font-size: 11px;
  }
  .app-sidebar .game-name .game-mode {
    display: none;
  }
  .sidebar-utilities {
    top: 12px;
    gap: 4px;
  }
  .sidebar-utilities button {
    width: 30px;
    height: 30px;
    min-height: 30px;
  }
  .sidebar-utilities button svg {
    width: 18px;
    height: 18px;
  }
  .app-sidebar .main-nav {
    width: calc(100% - 28px);
    max-width: none;
    gap: 0;
  }
  .app-sidebar .main-nav button {
    gap: 4px;
    padding-inline: 4px;
    font-size: 13px;
  }
  .app-sidebar .main-nav button svg {
    display: none;
  }
  .app-main {
    padding: 19px var(--page-gutter) 150px;
  }
  .hero {
    align-items: flex-start;
    min-height: 0;
    gap: 10px;
    margin-bottom: 17px;
  }
  h1 {
    font-size: 28px;
    letter-spacing: -0.6px;
    margin-bottom: 6px;
  }
  .hero p {
    font-size: 11px;
    max-width: 260px;
  }
  .preview-badge {
    padding: 6px 0;
    font-size: 10px;
    gap: 5px;
    flex-shrink: 0;
  }
  .preview-badge svg {
    width: 13px;
    height: 13px;
  }
  .workspace[data-view='ranking'] {
    border-radius: 12px;
  }
  .workspace[data-view='ranking'] .filter-panel {
    border-radius: 12px 12px 0 0;
  }
  .filter-panel {
    padding: 14px;
  }
  .filter-grid {
    grid-template-columns: 1fr 1fr;
    gap: 11px 13px;
  }
  .filter-field {
    padding: 0;
    gap: 4px;
  }
  .filter-field > span {
    font-size: 11px;
  }
  .filter-field select {
    min-height: 36px;
    font-size: 12px;
  }
  .more-button {
    font-size: 11px;
    min-height: 26px;
  }
  .condition-summary {
    margin-top: -26px;
    width: calc(100% - 87px);
    font-size: 10px;
    gap: 4px;
    line-height: 1.8;
  }
  .preset-tag {
    font-size: 10px;
  }
  .preset-tag::after {
    margin-left: 4px;
  }
  .table-toolbar {
    padding: 14px;
  }
  .table-heading h2 {
    font-size: 17px;
  }
  .table-heading > span {
    font-size: 10px;
  }
  .table-tools .search-field {
    height: 35px;
    width: auto;
    min-width: 0;
    max-width: none;
  }
  .table-tools select {
    min-height: 35px;
    min-width: 104px;
    width: 104px;
  }
  .ranking-table .weapon-row {
    min-height: 110px;
    padding: 14px 12px 12px;
  }
  .ranking-table .weapon-row td {
    padding: 0;
    height: auto;
  }
  .weapon-row .time-cell {
    text-align: right;
    grid-column: 3;
    grid-row: 1;
    padding-top: 1px;
  }
  .weapon-row .ammo-cell {
    text-align: left;
    grid-column: 2;
    grid-row: 2;
    margin-left: 62px;
    margin-top: 3px;
    align-self: end;
  }
  .weapon-row.is-leading > td:first-child {
    box-shadow: none;
  }
  .weapon-row.is-leading {
    box-shadow: inset 3px 0 var(--accent);
  }
  .rank-number {
    font-size: 15px;
  }
  .weapon-picture {
    width: 54px;
    height: 41px;
  }
  .weapon-cell {
    gap: 8px;
  }
  .weapon-name {
    font-size: 14px;
  }
  .weapon-sub {
    font-size: 10px;
    margin-top: 2px;
  }
  .ttk-value {
    font-size: 19px;
  }
  .ttk-value small {
    font-size: 10px;
    margin-left: 2px;
  }
  .ms-label {
    font-size: 10px;
    margin-top: 1px;
  }
  .bullet-name {
    font-size: 10px;
  }
  .bullet-detail {
    display: inline;
    margin: 0;
  }
  .row-actions {
    justify-content: flex-end;
    gap: 7px;
  }
  .table-footer {
    padding: 9px 13px;
    font-size: 10px;
  }
  .table-footer .text-button {
    font-size: 11px;
  }
  .comparison-tray {
    padding: 0 10px 10px;
  }
  .tray-inner {
    padding: 9px 11px;
    border-radius: 10px;
    gap: 7px;
  }
  .tray-inner > p {
    font-size: 10px;
    order: 2;
    flex: 0 0 100%;
  }
  .selected-tray {
    flex-wrap: wrap;
    white-space: normal;
  }
  .selected-tray .primary-button {
    min-width: 96px;
    min-height: 34px;
    margin-left: auto;
  }
  .page-footnote {
    font-size: 10px;
    align-items: flex-start;
  }
  .analysis-layout {
    display: block;
  }
  .analysis-side {
    padding: 16px;
  }
}
@media (max-width: 360px) {
  .app-sidebar .main-nav button {
    font-size: 12px;
    gap: 3px;
  }
  .app-sidebar .count-badge {
    min-width: 14px;
    height: 14px;
    font-size: 9px;
  }
  .app-sidebar .game-name {
    font-size: 10px;
  }
  .preview-badge {
    font-size: 9px;
    gap: 4px;
  }
}
/* Phone controls remain visible and comfortable to use with one hand. */
.mobile-sort-button {
  display: none;
}
@media (max-width: 760px) {
  .app-sidebar .game-name {
    margin-right: 44px;
  }
  .sidebar-utilities {
    top: 6px;
  }
  .sidebar-utilities button,
  .dialog-header .icon-button {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .table-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .table-tools .search-field {
    grid-column: 1 / -1;
    width: 100%;
    height: 44px;
  }
  .table-tools .search-field input,
  .library-search input {
    font-size: 16px;
  }
  .table-tools select {
    min-width: 0;
    width: 100%;
    min-height: 42px;
    font-size: 13px;
  }
  .mobile-sort-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fcfdfc;
    color: var(--accent);
    font-size: 12px;
    white-space: nowrap;
  }
  .mobile-sort-button svg {
    width: 16px;
    height: 16px;
  }
  .ranking-table .weapon-row {
    grid-template-columns: 24px minmax(0, 1fr) 82px;
    grid-template-rows: auto auto auto;
    gap: 3px 7px;
  }
  .weapon-row td:first-child {
    grid-row: 1 / 4;
  }
  .weapon-row .ammo-cell {
    grid-column: 2 / -1;
    align-self: start;
    margin-top: 2px;
  }
  .weapon-row td:nth-child(5) {
    grid-column: 2 / -1;
    grid-row: 3;
    padding-top: 7px;
  }
  .weapon-name {
    overflow-wrap: anywhere;
  }
  .row-actions .outline-button,
  .variant-actions .outline-button {
    min-height: 42px;
    min-width: 72px;
    font-size: 12px;
  }
  .row-actions .icon-button,
  .compare-card .icon-button {
    width: 44px;
    height: 44px;
  }
  .variant-actions .text-button,
  .library-row .text-button,
  .table-footer .text-button {
    min-height: 42px;
    padding-inline: 8px;
    font-size: 12px;
  }
  .table-footer #group-mode {
    min-height: 42px;
    margin-top: 0;
    padding: 5px 8px;
  }
  .selected-tray .primary-button {
    min-height: 44px;
    font-size: 12px;
  }
  .selection-chip {
    min-height: 36px;
    padding: 0 3px 0 7px;
  }
  .selection-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 36px;
  }
  .comparison-tray {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .app-main {
    padding-bottom: calc(174px + env(safe-area-inset-bottom));
  }
  .chart-container {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .ttk-chart {
    min-width: 540px;
  }
  .sub-tabs button {
    min-height: 44px;
    padding-inline: 8px;
  }
  .library-search {
    min-height: 44px;
  }
}
@media (max-width: 600px) {
  .compare-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .compare-card {
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .compare-card:last-child {
    border-bottom: 0;
  }
  .compare-card h2 {
    font-size: 20px;
  }
  .compare-card img {
    height: 105px;
  }
  .compare-config {
    min-height: 0;
    font-size: 12px;
  }
  .compare-card .large-ttk {
    margin-top: 14px;
    font-size: 32px;
  }
  .compare-card .comparison-note {
    min-height: 0;
    font-size: 12px;
  }
  .compare-card .stat-lines {
    gap: 10px;
    font-size: 12px;
  }
  .compare-card .stat-lines > div {
    display: flex;
    align-items: start;
    justify-content: space-between;
  }
  .compare-card .stat-lines dd {
    text-align: right;
  }
  .compare-card .text-button {
    min-height: 44px;
    font-size: 13px;
  }
}
