:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #202632;
  background: #f7f9fc;
  font-synthesis: none;
  --blue: #1a73e8;
  --ink: #202632;
  --muted: #667085;
  --line: #e2e7ee;
  --purple: #7656bd;
  --red: #b93838;
  --green: #18805c;
  --amber: #9a6515;
  --amber-bg: #fff8e6;
  --amber-border: #efd79b;
  --indigo: #434ca8;
  --indigo-bg: #eef0ff;
  --indigo-border: #ccd2fa;
  --teal: #0f766e;
  --teal-bg: #e9fbf8;
  --teal-border: #a7e5dc;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; margin: 0; }
button, input, select { font: inherit; }
button, a, input, select, summary { touch-action: manipulation; }
button { cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--blue); text-underline-offset: 3px; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible, .table-scroll:focus-visible {
  outline: 3px solid #a8cbff;
  outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }
h2 { font-size: 19px; letter-spacing: -.3px; }

.page-shell { width: min(1540px, calc(100% - 72px)); margin: 0 auto; }
.page-header { padding: 28px 0 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: #5e687b; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.brand-symbol {
  display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--blue);
  font-size: 24px; background: linear-gradient(135deg, #d7eaff, #f1e6fe); border-radius: 10px;
}
.local-label {
  margin-left: auto; border: 1px solid var(--line); border-radius: 30px; padding: 5px 11px;
  color: #6b778c; font-size: 11px; font-weight: 500; background: #fff;
}
.admin-entry-btn {
  border: 1px solid #d5deeb; background: #fff; color: #4c5b73; border-radius: 30px;
  padding: 5px 12px; font-size: 11px; font-weight: 600;
}
.admin-entry-btn:hover { background: #eef4fd; border-color: #a9c4ee; color: var(--blue); }
.admin-entry-btn.authed { background: var(--teal-bg); border-color: var(--teal-border); color: var(--teal); }

.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 26px; }
.eyebrow { color: #8a94a5; font-weight: 650; letter-spacing: 1.5px; font-size: 10px; margin-bottom: 8px; }
.hero-row h1 { font-size: clamp(32px, 4.2vw, 50px); font-weight: 600; line-height: 1.12; letter-spacing: -1.8px; }
.hero-row h1 span {
  background: linear-gradient(110deg, #1a73e8 15%, #6556cc 60%, #be65a2);
  color: transparent; background-clip: text; -webkit-background-clip: text;
}
.hero-description { margin-top: 12px; font-size: 13px; color: var(--muted); line-height: 1.7; max-width: 760px; }
.header-status { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 11px; color: #7a8699; white-space: nowrap; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line);
  border-radius: 40px; padding: 7px 11px; background: #fff; color: #5f6d84;
}
.status-pill:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #a3afbd; }
.status-pill[data-state=ready]:before { background: #27a577; }
.status-pill[data-state=error]:before { background: #d84f4f; }

.product-tabs { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.product-tab {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid #dbe2ec; background: #fff;
  color: #55637a; border-radius: 12px; padding: 10px 16px; font-size: 13px; font-weight: 600;
}
.product-tab:hover { border-color: #afc9ef; background: #f8fbff; }
.product-tab.active {
  border-color: var(--blue); background: #edf4ff; color: #1659b7;
  box-shadow: 0 2px 8px #1a73e814;
}
.tab-badge {
  font-size: 10px; padding: 2px 7px; border-radius: 20px; background: #e3edfc; color: #3d6fb8; font-weight: 650;
}
.tab-badge-purple { background: #f0e8fb; color: #7253a8; }

.coverage-strip {
  display: flex; align-items: center; gap: 26px; border-top: 1px solid var(--line);
  margin-top: 20px; padding-top: 18px; flex-wrap: wrap;
}
.coverage-strip > div { display: flex; align-items: baseline; gap: 8px; }
.coverage-strip strong { font-weight: 600; font-size: 22px; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.coverage-strip span, .coverage-strip p { font-size: 11px; color: #778296; }
.coverage-strip p { margin-left: auto; max-width: 340px; text-align: right; line-height: 1.6; }

.minimum-section { margin-top: 10px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.subtle { font-size: 11px; color: #7b8799; }
.minimum-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.minimum-card {
  border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 16px 18px;
  text-align: left; color: var(--ink); min-height: 138px; position: relative; overflow: hidden; width: 100%;
}
.minimum-card:hover { border-color: #adc9ef; background: #fcfdff; }
.minimum-card.selected { border-color: #76a9ec; background: #f0f6ff; box-shadow: 0 0 0 1px #76a9ec inset; }
.minimum-card.purple.selected { border-color: #a58acf; background: #f6f3fd; box-shadow: 0 0 0 1px #a58acf inset; }
.minimum-card:before {
  content: ""; height: 3px; width: 42px; position: absolute; top: 0; left: 18px;
  background: #74aaf2; border-radius: 0 0 3px 3px;
}
.minimum-card.purple:before { background: #ab8cd6; }
.minimum-card.teal:before { background: #369e8e; }
.minimum-card .card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 600; color: #5b6982; }
.minimum-card .source-label { font-size: 10px; color: #919cad; font-weight: 500; }
.minimum-card .minimum-country { margin-top: 14px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minimum-card .minimum-local { margin-top: 6px; font-size: 20px; font-weight: 600; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.minimum-card .minimum-eur { font-size: 11px; color: #72829a; margin-top: 4px; font-variant-numeric: tabular-nums; }
.minimum-card .card-tag {
  display: inline-block; margin-top: 6px; font-size: 9px; padding: 1px 6px; border-radius: 10px;
  background: var(--indigo-bg); color: var(--indigo); border: 1px solid var(--indigo-border);
}
.minimum-card .card-tag.teal { background: var(--teal-bg); color: var(--teal); border-color: var(--teal-border); }
.minimum-card .empty-minimum { margin-top: 22px; color: #98a3b3; font-size: 12px; }

.guard-notice {
  margin-top: 12px; padding: 10px 14px; border-radius: 10px;
  background: var(--amber-bg); border: 1px solid var(--amber-border);
  color: #7d5210; font-size: 11px; line-height: 1.7;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.guard-link-btn {
  border: 1px solid #e1be6d; background: #fff; color: #7a4e0b; border-radius: 8px;
  padding: 4px 10px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.guard-link-btn:hover { background: #fff3d2; }
.section-note { font-size: 11px; line-height: 1.8; color: #838fa1; margin-top: 10px; }

.price-section { margin-top: 28px; }
.table-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.table-toolbar h2 { font-size: 20px; }
.table-toolbar p:not(.eyebrow) { font-size: 11px; color: #8390a3; margin-top: 5px; }
.table-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; max-width: 100%; }
.tier-filters { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tier-pill {
  border: 1px solid #dde4ee; background: #fff; color: #5b6980; border-radius: 20px;
  padding: 5px 11px; font-size: 11px; font-weight: 550; white-space: nowrap;
}
.tier-pill:hover { background: #f3f7fd; border-color: #b7cdec; }
.tier-pill.active { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.toggle-filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.filter-label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6e7d94; white-space: nowrap; cursor: pointer; }
.filter-label input { accent-color: var(--blue); width: 13px; height: 13px; }
.search-field { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #dfe6ef; border-radius: 9px; padding: 7px 11px; }
.search-field > span { font-size: 18px; line-height: 1; color: #8c9cb4; }
.search-field input { border: 0; outline: none; background: transparent; color: var(--ink); font-size: 12px; width: 155px; min-width: 0; }
.search-field:focus-within { border-color: #80ace9; box-shadow: 0 0 0 2px #e4efff; }

.table-scroll {
  overflow-x: auto; overflow-y: visible; max-width: 100%;
  border: 1px solid var(--line); border-radius: 13px; background: #fff; scrollbar-width: thin;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; }
table.wide-chatgpt { min-width: 1360px; }
table.compact-ultra { min-width: 760px; }
table.filtered-narrow { min-width: 680px; }
th {
  text-align: left; font-weight: 600; font-size: 11px; color: #63748d;
  background: #f8fafd; border-bottom: 1px solid var(--line);
}
th, td { padding: 10px 10px; }
.rank-head { width: 38px; padding-left: 14px; padding-right: 4px; color: #a4aebc; }
.country-head { width: 150px; min-width: 138px; }
.proxy-head { width: 76px; min-width: 70px; }
.plan-head th[colspan] { text-align: center; padding: 12px 8px; border-left: 1px solid var(--line); white-space: nowrap; }
.plan-head th[rowspan] { vertical-align: middle; }
.single-channel-head { text-align: center; border-left: 1px solid var(--line); }

.tier-badge {
  display: inline-block; background: #e5efff; color: #4076bb; border: 1px solid #d9e7fb;
  border-radius: 5px; padding: 1px 6px; margin-right: 5px; font-size: 10px; font-weight: 650;
}
.tier-purple { background: #efe8fa; color: #7957af; border-color: #e4d8f7; }
.tier-team { background: #e8f6f2; color: #197458; border-color: #cdebe1; }

.channel-head { padding: 0; background: #fbfcfe; min-width: 96px; }
.channel-head button {
  display: flex; justify-content: center; gap: 5px; align-items: center; border: 0;
  background: transparent; width: 100%; height: 36px; font-size: 11px; color: #6d7f99; white-space: nowrap; padding: 0 6px;
}
.channel-head button:after { content: "↕"; font-size: 11px; color: #a3afc0; }
.channel-head.sorted { background: #e9f2ff; }
.channel-head.sorted button { color: #1c66c7; font-weight: 650; }
.channel-head.sorted button:after { content: "↑"; color: #1c66c7; }
.channel-head.group-start { border-left: 1px solid var(--line); }
.channel-head.sub-col { border-left: 1px solid #eef2f7; }

tbody td { border-bottom: 1px solid #edf1f6; min-height: 70px; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcff; }
td.rank-cell { font-size: 10px; font-variant-numeric: tabular-nums; color: #a3afbd; padding-left: 14px; padding-right: 4px; }
.country-cell .country-name { font-size: 12px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.country-cell .country-code { font-size: 10px; color: #9ba7b8; margin-top: 3px; letter-spacing: .4px; }
.country-flag { display: inline-block; margin-right: 5px; font-size: 15px; vertical-align: -1px; }

.proxy-cell { padding-left: 8px; padding-right: 8px; color: #8e9bad; font-size: 10px; white-space: nowrap; }
.proxy-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; }
.proxy-badge:before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #b3bdcb; flex: none; }
.proxy-badge[data-status=ok] { color: #36886d; }
.proxy-badge[data-status=ok]:before { background: #48a789; }
.proxy-badge[data-status=error], .proxy-badge[data-status=unreachable], .proxy-badge[data-status=mismatch] { color: #bf6f6f; }
.proxy-badge[data-status=error]:before { background: #cf8f8f; }

.price-cell { padding: 0 6px; text-align: center; }
.price-cell.group-start { border-left: 1px solid #e6ebf2; }
.price-cell.sub-col { border-left: 1px solid #f2f5f9; }
.price-cell.sorted { background: #f4f8ff; }
tbody tr:hover .price-cell.sorted { background: #edf4ff; }

.price-button {
  border: 0; background: none; width: 100%; padding: 9px 4px; min-height: 64px;
  color: inherit; border-radius: 8px;
}
.price-button:hover .local-price { text-decoration: underline; text-decoration-color: #bed3ee; text-underline-offset: 3px; }
.price-button.cell-suspect { background: var(--amber-bg); }
.price-button.cell-suspect:hover { background: #fff2cf; }
.price-button.cell-stale { opacity: .66; }

.local-price { font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.15px; }
.eur-price { font-size: 10px; color: #8191a8; margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-source { font-size: 9px; color: #95a1b3; margin-top: 3px; white-space: nowrap; }
.unverified-label { font-size: 11px; color: #9aa7b8; white-space: nowrap; }
.price-button[data-status=error] .unverified-label { color: #bd6a6a; }
.price-button[data-status=unavailable] .unverified-label { color: #b5bcc7; }

.cell-badge {
  display: inline-block; margin-top: 4px; padding: 1px 6px; border-radius: 10px; font-size: 9px; font-weight: 600; white-space: nowrap;
}
.badge-suspect { background: #ffefc7; color: var(--amber); border: 1px solid var(--amber-border); }
.badge-history { background: var(--indigo-bg); color: var(--indigo); border: 1px solid var(--indigo-border); }
.badge-stale { background: #eef1f5; color: #6d7787; border: 1px solid #d5dce6; }
.badge-override { background: var(--teal-bg); color: var(--teal); border: 1px solid var(--teal-border); }

.empty-table td { text-align: center; height: 140px; color: #9ba6b8; font-size: 12px; }
.table-footnote { font-size: 10px; line-height: 1.85; color: #8d99ab; margin-top: 12px; }
.excluded-panel { margin-top: 14px; }
summary { cursor: pointer; font-size: 11px; font-weight: 600; color: #68768c; line-height: 1.8; }
.excluded-panel > div { font-size: 11px; color: #8f9cb0; line-height: 2; padding: 10px 0; }

.page-footer {
  display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line);
  padding: 22px 0 30px; margin-top: 26px; color: #8491a5; font-size: 10px; line-height: 1.8; flex-wrap: wrap;
}
.page-footer strong { font-size: 11px; font-weight: 600; color: #667790; }
.page-footer p { margin-top: 4px; }
.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.price-dialog {
  border: 1px solid #dce4f0; border-radius: 18px; padding: 24px; color: var(--ink);
  width: min(680px, calc(100% - 28px)); max-height: 86vh; box-shadow: 0 24px 100px #11244524;
  overflow: auto;
}
.price-dialog::backdrop { background: #1d2c4260; backdrop-filter: blur(3px); }
.dialog-heading {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  border-bottom: 1px solid #edf1f6; padding-bottom: 16px; margin-bottom: 16px;
}
.dialog-heading h2 { font-size: 19px; }
.dialog-close { border: 0; background: #f2f5f9; color: #78879b; width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; flex: none; }
.detail-price { font-size: 26px; font-weight: 600; letter-spacing: -.6px; }
.detail-eur { margin-top: 6px; color: #7e8da4; font-size: 12px; }
.detail-reason { padding: 11px 13px; background: #f6f8fc; color: #687890; border-radius: 8px; font-size: 12px; line-height: 1.75; margin-top: 14px; }
.detail-reason.warning { background: var(--amber-bg); color: #7d5210; border: 1px solid var(--amber-border); }
.detail-grid { display: grid; grid-template-columns: 108px 1fr; gap: 9px 14px; font-size: 11px; line-height: 1.75; margin: 18px 0; }
.detail-grid dt { color: #8c98ab; }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; color: #54647c; }
.evidence-section { margin-top: 16px; border-top: 1px solid #edf1f6; padding-top: 14px; }
.evidence-section h3 { font-size: 12px; color: #596b85; margin: 0 0 10px; }
.candidate-list { list-style: none; margin: 0; padding: 0; }
.candidate-list li { padding: 9px 0; border-bottom: 1px solid #eff2f6; font-size: 11px; line-height: 1.7; color: #748299; overflow-wrap: anywhere; }
.candidate-list li:last-child { border-bottom: 0; }
.candidate-list strong { font-weight: 600; color: #4f617c; }

.other-apps-details { margin-top: 12px; border: 1px solid #edf1f6; border-radius: 10px; padding: 8px 12px; background: #fafbfd; }
.admin-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf1f6; }
.admin-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.admin-section h3 { font-size: 13px; color: #36455d; margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-field { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: #67768d; }
.form-field input, .form-field select {
  border: 1px solid #d8e1ee; border-radius: 8px; padding: 8px 10px; background: #fafbfd; color: var(--ink); font-size: 12px; width: 100%;
}
.button {
  border: 1px solid #d9e1ec; border-radius: 8px; padding: 8px 13px; background: #fff;
  color: #4d5c73; font-size: 12px; font-weight: 550; white-space: nowrap;
}
.button:hover:not(:disabled) { background: #f2f6fb; border-color: #b6c8e0; }
.button-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button-primary:hover:not(:disabled) { background: #1264cf; border-color: #1264cf; }
.button-danger { color: var(--red); border-color: #ecd0d0; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.secret-pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 4px 9px; border-radius: 10px;
  border: 1px solid #dde4ee; background: #f8fafd; color: #5f6f87; margin: 0 6px 6px 0;
}
.secret-pill.ok { background: #ecfaf4; border-color: #bbe7d5; color: #197455; }
.secret-pill.missing { background: #fff5f5; border-color: #f0cece; color: #a74242; }
.text-btn-del {
  border: 0; background: none; color: var(--red); font-size: 11px; margin-left: 8px; text-decoration: underline;
}

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #263954;
  color: #fff; border-radius: 10px; padding: 11px 16px; box-shadow: 0 8px 30px #0f244326;
  font-size: 12px; line-height: 1.5; max-width: min(560px, calc(100% - 28px)); z-index: 60;
}
.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; }
[hidden] { display: none !important; }

@media (max-width: 1150px) {
  .page-shell { width: calc(100% - 32px); }
  .minimum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-toolbar { align-items: stretch; }
  .table-controls { align-items: flex-start; width: 100%; }
  .tier-filters, .toggle-filters { justify-content: flex-start; }
  .coverage-strip p { margin-left: 0; text-align: left; }
}

@media (max-width: 760px) {
  .page-shell { width: calc(100% - 24px); }
  .brand .local-label { margin-left: 0; }
  .hero-row { flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 20px; }
  .header-status { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .coverage-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .coverage-strip p { display: none; }
  .minimum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .minimum-card { padding: 13px 12px; min-height: 124px; }
  .minimum-card .minimum-local { font-size: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 88px 1fr; }
  .footer-right { align-items: flex-start; }
}
