:root {
  color-scheme: light;
  --page: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --surface-blue: #f1f7ff;
  --line: #dce4eb;
  --line-strong: #c8d3de;
  --ink: #17212b;
  --ink-soft: #44515d;
  --muted: #596773;
  --accent: #1168d4;
  --accent-dark: #0755b5;
  --accent-soft: #eaf3ff;
  --green: #087a45;
  --green-soft: #effaf4;
  --amber: #966000;
  --shadow: 0 8px 24px rgba(24, 43, 61, .06);
  --shadow-soft: 0 2px 8px rgba(24, 43, 61, .05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--page); scrollbar-gutter: stable; }
body { margin: 0; color: var(--ink); background: var(--page); font-size: 14px; line-height: 1.5; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a, input { touch-action: manipulation; -webkit-tap-highlight-color: rgba(0, 113, 227, .18); }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }
button:focus-visible, a:focus-visible, input:focus-visible, .workspace:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Only country controls in pointer mode suppress the inherited modal ring.
   Keyboard navigation/activation restores :focus-visible; Escape preserves the mode. */
html[data-country-history-pointer] .country-history-button:focus-visible { outline: none; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.noscript-notice {
  margin: 14px 0 0;
  padding: 12px 14px;
  color: #674500;
  background: #fff8e6;
  border: 1px solid #e7c873;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  font-weight: 650;
}

.app-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.app-header-inner, .page-main, .page-footer { width: min(1280px, calc(100% - 48px)); margin: 0 auto; }
.page-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

.app-header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.app-brand { min-width: 0; display: flex; align-items: center; gap: 11px; color: inherit; }
.app-brand:hover .brand-copy h1 { color: var(--accent-dark); }
.app-brand:focus-visible { outline-offset: 5px; border-radius: 8px; }
.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #cfe2fa;
  border-radius: 8px;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-copy { min-width: 0; }
.brand-copy h1 { margin: 0; overflow: hidden; font-size: 19px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.data-status { min-width: 0; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.data-status svg { width: 16px; height: 16px; }
.freshness-warning { color: var(--amber); font-weight: 650; }
.freshness-warning::before { content: " · "; color: var(--muted); }

.overview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 14px; }
.overview-reference, .workspace { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.overview-reference { min-width: 0; padding: 20px 22px 18px; }
.overview-copy h2 { margin: 0; font-size: 29px; line-height: 1.14; letter-spacing: -.02em; }
.overview-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.minimum-stats {
  display: grid;
  grid-template-columns: repeat(var(--plan-count, 4), minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}
.minimum-card {
  min-width: 0;
  min-height: 85px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: inherit;
  background: var(--surface-soft);
  border: 1px solid #e1e8ee;
  border-radius: 7px;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.minimum-card:disabled { cursor: default; opacity: 1; }
.minimum-card:focus-visible { background: var(--surface-blue); border-color: #b9d6f7; }
.minimum-plan-label {
  max-width: 100%;
  padding: 1px 5px;
  overflow: hidden;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #cfe2fa;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.minimum-country {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.minimum-price { display: block; color: var(--accent-dark); font-size: 16px; font-weight: 780; line-height: 1; }
@media (hover: hover) and (pointer: fine) {
  .minimum-card:not(:disabled):hover { background: var(--surface-blue); border-color: #b9d6f7; transform: translateY(-1px); }
}

.overview-stats { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; }
.overview-stats div {
  min-width: 0;
  padding: 7px 11px;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.overview-stats dt { color: var(--muted); font-size: 12px; line-height: 1.25; }
.overview-stats dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 720; line-height: 1; font-variant-numeric: tabular-nums; }

.workspace { overflow: clip; scroll-margin-top: 16px; }
.workspace-toolbar {
  min-height: 78px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.workspace-heading { min-width: 230px; }
.workspace-heading h2 { margin: 0; font-size: 19px; line-height: 1.2; letter-spacing: -.01em; }
.workspace-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

.filters { width: min(430px, 46%); }
.search-field { position: relative; display: block; }
.search-field input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px 8px 36px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}
.search-field input::placeholder { color: #83909b; }
.search-field svg { position: absolute; left: 12px; top: 11px; z-index: 1; width: 17px; height: 17px; color: #778491; pointer-events: none; }
.mobile-plan-picker { display: none; }

.table-scroll { max-width: 100%; overflow-x: auto; background: var(--surface); scrollbar-gutter: stable; }
@media (min-width: 1101px) {
  .workspace.price-ui-ready .table-scroll.table-fits { overflow: visible; scrollbar-gutter: auto; }
}
.price-table { width: 100%; min-width: var(--table-min-width, 1030px); border-collapse: collapse; table-layout: fixed; }
.price-table th, .price-table td { padding: 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.price-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  color: #33485c;
  background: #edf2f6;
  border-bottom-color: #cbd6df;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  box-shadow: inset 0 -1px #cbd6df, 0 2px 5px rgba(24, 43, 61, .06);
}
.price-table .rank-column, .price-table td:first-child { width: 48px; text-align: center; color: var(--muted); }
.price-table th:nth-child(2), .price-table td:nth-child(2) { width: 220px; text-align: left; }
.price-table th[data-plan-header], .price-table td[data-plan] { width: 190px; }
.price-table th button {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: inherit;
  background: transparent;
  border: 0;
  font-weight: inherit;
}
.price-table th:nth-child(2) button { justify-content: flex-start; }
th button svg { width: 15px; height: 15px; stroke-width: 2.25; }
.price-table th[aria-sort="ascending"], .price-table th[aria-sort="descending"] {
  color: var(--accent-dark);
  background: #e3effd;
  box-shadow: inset 0 -3px var(--accent), 0 2px 5px rgba(24, 43, 61, .06);
}
.price-table tbody tr:last-child td { border-bottom: 0; }
.price-table tbody tr[data-market-id] td { transition: background-color 180ms ease, box-shadow 180ms ease; }
.price-table tbody tr[data-market-id]:hover td, .price-table tbody tr[data-market-id]:focus-within td { background: #f8fbfe; }
.price-table tbody tr.is-highlighted td { animation: row-highlight 1.8s ease-out; }
@keyframes row-highlight { 0%, 35% { background: #fff2c6; } 100% { background: transparent; } }

.country-history-button {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 62px;
  padding: 9px 30px 9px 14px;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}
.country-history-button:disabled { cursor: default; opacity: 1; }
.country-history-button:disabled .history-affordance { display: none; }
.country-name { display: block; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 680; line-height: 1.18; text-overflow: ellipsis; white-space: nowrap; }
.country-name-en { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.history-affordance { position: absolute; top: 50%; right: 10px; color: var(--muted); font-size: 20px; line-height: 1; transform: translateY(-50%); }
.rank-top { color: var(--accent) !important; font-weight: 760; }
.mobile-rank { display: none; }

.price-cell { min-width: 0; padding: 9px 12px !important; overflow: hidden; font-variant-numeric: tabular-nums; }
.price-cell.is-sorted { background: #f5faff; box-shadow: inset 1px 0 #e3eef9, inset -1px 0 #e3eef9; }
.price-cell.is-minimum { background: var(--green-soft); box-shadow: inset 1px 0 #d5ecdf, inset -1px 0 #d5ecdf; }
.price-option + .price-option { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.price-cny { min-width: 0; display: flex; align-items: baseline; justify-content: flex-end; gap: 2px; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 740; line-height: 1.2; }
.price-symbol { flex: 0 0 auto; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.price-amount { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.price-local { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.2; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.minimum-badge { flex: 0 0 auto; margin-right: 2px; padding: 2px 6px; color: #fff; background: var(--green); border-radius: 999px; font-size: 9px; font-weight: 760; line-height: 1.15; }
.missing-price { color: #98a3ad; text-align: center; }

.empty-state { margin: 0; padding: 28px 18px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); }
.workspace-footer { padding: 10px 18px; background: var(--surface-soft); border-top: 1px solid var(--line); font-size: 12px; line-height: 1.55; }
.source-links { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); }
.source-group { min-width: 0; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.source-item { white-space: nowrap; }
.source-separator { width: 1px; height: 16px; background: var(--line-strong); }
.data-disclaimer { margin: 0; padding: 10px 18px 12px; color: var(--muted); background: var(--surface-soft); border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; font-size: 12px; line-height: 1.6; }
.data-disclaimer p { max-width: 1120px; margin: 0; }

.control-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 680; }
.segmented { max-width: 100%; display: grid; grid-template-columns: repeat(var(--plan-count), minmax(62px, 1fr)); padding: 3px; min-height: 40px; overflow-x: auto; overscroll-behavior-x: contain; background: #e7edf2; border-radius: 7px; }
.segmented button { min-width: 0; padding: 5px 9px; color: #53616d; background: transparent; border: 0; border-radius: 5px; font-weight: 650; white-space: nowrap; }
.segmented button[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(28, 44, 58, .17); }

.history-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(20, 34, 46, .24);
}
.history-dialog::backdrop { background: rgba(24, 34, 44, .42); }
.dialog-header { padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.dialog-eyebrow { margin: 0 0 3px; color: var(--accent-dark); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.dialog-header h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.dialog-header p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.icon-button { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; padding: 0; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 7px; }
.icon-button svg { width: 18px; height: 18px; }
.history-current { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 16px 20px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.history-current div { min-width: 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.history-current span { display: block; color: var(--muted); font-size: 11px; }
.history-current strong { display: block; margin-top: 4px; overflow: hidden; font-size: 15px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; }
.history-toolbar { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.history-list { padding: 0 20px 20px; }
.section-heading h3 { margin: 16px 0 8px; font-size: 14px; }
.history-table-scroll { max-height: 310px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; }
.history-list table { width: 100%; border-collapse: collapse; font-size: 12px; }
.history-list th, .history-list td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; font-variant-numeric: tabular-nums; }
.history-list th { position: sticky; top: 0; z-index: 1; color: var(--ink-soft); background: #f4f7fa; }
.history-list tr:last-child td { border-bottom: 0; }
.history-list .empty-cell { padding: 24px 10px; color: var(--muted); text-align: center; }

.back-to-table-button {
  position: fixed;
  right: calc(14px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 20;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 140ms ease, transform 140ms ease;
}
.back-to-table-button.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-table-button:hover { background: var(--accent-soft); border-color: #9abce7; }
.back-to-table-button:focus-visible { outline: 3px solid rgba(17, 104, 212, .22); outline-offset: 2px; }
.back-to-table-button svg { width: 19px; height: 19px; }

.page-footer { margin-top: 20px; margin-bottom: 28px; color: var(--muted); font-size: 12px; text-align: center; }
.page-footer p { margin: 3px 0; }

@media (max-width: 1100px) {
  .workspace-toolbar { align-items: stretch; flex-direction: column; gap: 11px; }
  .workspace-heading { min-width: 0; }
  .filters { width: 100%; }
  .search-field input { height: 44px; font-size: 16px; }
  .search-field svg { top: 13px; }
  .workspace.price-ui-ready .mobile-plan-picker { display: block; }
  .workspace.price-ui-ready .table-scroll { overflow: visible; }
  .workspace.price-ui-ready .price-table { width: 100%; min-width: 0; table-layout: fixed; }
  .price-table th:first-child, .price-table td:first-child { display: none; }
  .workspace.price-ui-ready .price-table [data-plan]:not(.is-active-plan), .workspace.price-ui-ready .price-table [data-plan-header]:not(.is-active-plan) { display: none; }
  .workspace.price-ui-ready .price-table th:nth-child(2), .workspace.price-ui-ready .price-table td:nth-child(2) { width: 46%; }
  .workspace.price-ui-ready .price-table th[data-plan-header].is-active-plan, .workspace.price-ui-ready .price-table td[data-plan].is-active-plan { width: auto; }
  .price-table td[data-plan].is-active-plan { padding-right: 18px !important; }
  .price-table tbody tr { height: 70px; }
  .country-history-button {
    min-height: 44px;
    padding: 5px 28px 5px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 2px;
    align-items: center;
  }
  .country-history-button .country-name {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
    white-space: nowrap;
  }
  .country-history-button .country-name-en {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    margin-top: 0;
    white-space: nowrap;
  }
  .mobile-rank {
    position: static;
    grid-column: 2;
    grid-row: 2;
    min-width: 28px;
    height: 22px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: none;
    color: var(--accent-dark);
    background: var(--accent-soft);
    border: 1px solid #cfe2fa;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 760;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .app-header-inner, .page-main, .page-footer { width: min(100% - 24px, 1280px); }
  .app-header-inner { min-height: 74px; padding: 9px 0; align-items: flex-start; flex-direction: column; gap: 5px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .brand-copy h1 { font-size: 17px; }
  .data-status { width: 100%; justify-content: flex-end; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; text-align: right; white-space: normal; }
  .data-status svg { display: none; }
  .freshness-warning { display: block; margin-top: 2px; }
  .freshness-warning::before { content: ""; }

  .page-main { gap: 12px; }
  .overview { padding: 12px 0 0; gap: 12px; }
  .overview-reference { padding: 17px 15px 15px; }
  .overview-note { font-size: 12px; }
  .overview-copy h2 { font-size: 25px; }
  .minimum-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
  .minimum-card { min-height: 79px; padding: 9px; }
  .minimum-country { font-size: 16px; }
  .minimum-price { font-size: 15px; }
  .overview-stats { gap: 6px; }
  .overview-stats div { padding: 7px 10px; }

  .workspace-toolbar { min-height: 0; padding: 14px 12px; }
  .workspace-heading h2 { font-size: 17px; }
  .workspace-heading p { font-size: 12px; }
  .search-field input { height: 40px; font-size: 16px; }

  .source-links { align-items: flex-start; flex-direction: column; gap: 8px; }
  .source-group { width: 100%; align-items: flex-start; }
  .source-separator { display: none; }
  .data-disclaimer { padding: 10px 12px; }

  .history-dialog { width: calc(100% - 18px); max-height: calc(100dvh - 18px); }
  .dialog-header { padding: 17px 16px 14px; }
  .history-current { grid-template-columns: 1fr 1fr; }
  .history-current > div:last-child { grid-column: 1 / -1; }
  .history-toolbar, .history-list { padding-left: 16px; padding-right: 16px; }

  .workspace.price-ui-ready .price-table th:nth-child(2), .workspace.price-ui-ready .price-table td:nth-child(2) { width: 47%; padding-left: 18px; }
  .price-table th, .price-table td { padding-inline: 9px; }
  .price-table th button { margin-inline: -9px; padding-inline: 9px; }
  .country-name { font-size: 14px; }
  .price-cny { font-size: 14px; }
}

@media (max-width: 359px) {
  .minimum-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .minimum-card:hover, .overview-stats div:hover { transform: none; }
}

@media (forced-colors: active) {
  .segmented button[aria-pressed="true"] {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }

  .price-table th[aria-sort="ascending"],
  .price-table th[aria-sort="descending"] {
    border-bottom: 3px solid Highlight;
  }

  .price-cell.is-minimum {
    outline: 1px solid Highlight;
    outline-offset: -2px;
  }
}


/* iCloud-aligned minimum-history action and responsive ranking layout. */
.overview-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.overview-heading h2 { margin: 0; }
.minimum-history-button { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--accent-dark); font: inherit; font-size: 13px; }
.minimum-history-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.minimum-history-dialog { width: min(860px, calc(100% - 24px)); }
.minimum-history-dialog .dialog-header { position: sticky; top: 0; z-index: 3; background: var(--surface); display: grid; grid-template-columns: max-content max-content minmax(0, 1fr) 44px; align-items: center; gap: 12px; }
.minimum-history-dialog .dialog-header h2 { grid-column: 1; font-size: 23px; }
.minimum-history-dialog .dialog-header .icon-button { grid-column: 4; }
.minimum-history-toolbar { grid-column: 2; display: flex; align-items: center; min-width: 0; }
.minimum-history-toolbar[hidden] { display: none; }
.minimum-history-filter { display: flex; align-items: center; min-width: 0; color: var(--muted); font-size: 13px; }
.minimum-history-filter select { min-width: 132px; height: 38px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.minimum-history-status { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.minimum-history-dialog .history-list { padding-top: 12px; }
.minimum-history-note { margin: 14px 0 0; padding: 10px 12px; color: var(--muted); background: var(--surface-soft); border-radius: 6px; font-size: 12px; line-height: 1.55; }
#minimumHistoryEvents { border-top: 0; }
.minimum-history-event { display: grid; grid-template-columns: 190px minmax(0, 1fr) max-content; align-items: center; gap: 14px; min-width: 0; padding: 13px 0; overflow-wrap: anywhere; }
.minimum-history-event + .minimum-history-event { border-top: 1px solid var(--line); }
.minimum-history-event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.minimum-history-date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.minimum-history-plan { flex: 0 0 auto; padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--ink-soft); font-size: 12px; line-height: 1.45; white-space: nowrap; }
.minimum-history-change { min-width: 0; font-size: 14px; line-height: 1.45; font-weight: 720; }
.minimum-history-cause { max-width: 110px; color: var(--muted); font-size: 12px; line-height: 1.45; white-space: normal; }
.minimum-history-empty { margin: 18px 0 6px; color: var(--muted); font-size: 13px; }
#minimumHistoryMore, #minimumHistoryRetry { margin-top: 16px; }

@media (max-width: 720px) {
  .data-status { flex: 0 1 auto; justify-content: flex-end; line-height: 1.3; text-align: right; white-space: normal; }
  #updatedAt { min-width: 0; }
}

@media (max-width: 640px) {
  .minimum-history-dialog { width: min(100% - 16px, 860px); }
  .minimum-history-dialog .dialog-header { grid-template-columns: minmax(0, 1fr) 44px; gap: 10px 12px; align-items: start; }
  .minimum-history-dialog .dialog-header h2 { grid-column: 1; grid-row: 1; align-self: center; }
  .minimum-history-dialog .dialog-header .icon-button { grid-column: 2; grid-row: 1; }
  .minimum-history-toolbar { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .minimum-history-filter { width: 100%; }
  .minimum-history-filter select { width: 100%; min-width: 0; height: 44px; font-size: 16px; }
  .minimum-history-event { grid-template-columns: minmax(0, 1fr) max-content; gap: 6px 10px; padding: 14px 0; }
  .minimum-history-event-meta { grid-column: 1; grid-row: 1; gap: 8px; }
  .minimum-history-cause { grid-column: 2; grid-row: 1; align-self: center; }
  .minimum-history-change { grid-column: 1 / -1; grid-row: 2; }
}

@media (forced-colors: active) {
  .minimum-history-button, .minimum-history-filter select, .minimum-history-plan { border-color: ButtonText; color: ButtonText; }
}
