:root {
  --ink: #142321;
  --muted: #70817d;
  --subtle: #9aa8a5;
  --line: #dbe4e1;
  --surface: #ffffff;
  --canvas: #f4f7f6;
  --mint: #b7e6d4;
  --mint-strong: #2b8b6b;
  --coral: #e6785e;
  --coral-pale: #fff0eb;
  --shadow: 0 12px 35px rgba(20, 35, 33, 0.06);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.page-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 800; letter-spacing: 0; }
.brand-mark { width: 25px; height: 25px; display: inline-flex; align-items: end; gap: 3px; padding: 5px; background: var(--ink); border-radius: 6px; }
.brand-mark span { display: block; width: 4px; background: var(--mint); border-radius: 2px 2px 0 0; }
.brand-mark span:nth-child(1) { height: 7px; }
.brand-mark span:nth-child(2) { height: 11px; background: #f2c173; }
.brand-mark span:nth-child(3) { height: 15px; background: var(--coral); }
.topbar-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 500 10px/1 "DM Mono", monospace; letter-spacing: .08em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint-strong); box-shadow: 0 0 0 4px rgba(43, 139, 107, .12); }
.icon-button { width: 30px; height: 30px; margin-left: 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 18px; line-height: 1; }
.icon-button:hover, .icon-button:focus-visible { border-color: var(--ink); outline: none; }

.intro { padding: 82px 0 54px; max-width: 800px; }
.eyebrow, .section-kicker { color: var(--coral); font: 500 11px/1.2 "DM Mono", monospace; letter-spacing: .12em; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: "Bricolage Grotesque", "Manrope", sans-serif; }
h1 { margin-top: 17px; font-size: clamp(42px, 7vw, 78px); line-height: 1.03; letter-spacing: -.04em; font-weight: 800; }
h1 em { color: var(--coral); font-style: normal; }
.intro-copy { max-width: 560px; margin-top: 22px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.sync-status { display: inline-flex; align-items: center; margin-top: 24px; color: var(--subtle); font: 400 11px/1.4 "DM Mono", monospace; }
.sync-status.is-ready::before { content: ""; width: 6px; height: 6px; margin-right: 8px; background: var(--mint-strong); border-radius: 50%; }
.sync-status.is-error { color: var(--coral); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-item { min-height: 116px; display: flex; flex-direction: column; justify-content: center; padding: 18px 22px 18px 0; border-right: 1px solid var(--line); }
.stat-item:not(:first-child) { padding-left: 22px; }
.stat-item:last-child { border-right: 0; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-item strong { margin-top: 8px; font: 700 31px/1 "DM Mono", monospace; letter-spacing: -.04em; }

.catalog { padding: 70px 0 36px; }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
h2 { margin-top: 10px; font-size: 31px; line-height: 1.1; letter-spacing: -.03em; }
.result-count { color: var(--muted); font: 400 11px/1 "DM Mono", monospace; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 165px; gap: 10px; margin-top: 28px; }
.search-box, .select-box { min-width: 0; height: 48px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.search-box:focus-within, .select-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20, 35, 33, .06); }
.search-icon { padding-left: 15px; color: var(--muted); font-size: 23px; line-height: 1; transform: translateY(-1px); }
.search-box input { width: 100%; height: 100%; padding: 0 12px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: var(--subtle); }
kbd { margin-right: 12px; padding: 3px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; color: var(--subtle); font: 400 10px "DM Mono", monospace; }
.select-box select { width: 100%; height: 100%; padding: 0 12px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }

.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.proxy-card { min-width: 0; display: flex; flex-direction: column; min-height: 220px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.proxy-card:hover { transform: translateY(-3px); border-color: #b6c8c2; box-shadow: 0 16px 40px rgba(20, 35, 33, .1); }
.card-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.domain { overflow: hidden; color: var(--ink); font-size: 17px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.protocol { flex: 0 0 auto; padding: 5px 7px; border-radius: 4px; color: var(--mint-strong); background: #eaf8f2; font: 500 9px/1 "DM Mono", monospace; letter-spacing: .05em; }
.protocol.http { color: #a56320; background: #fff4df; }
.target-label { margin-top: 27px; color: var(--subtle); font: 400 10px/1 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.target { margin-top: 7px; overflow: hidden; color: var(--muted); font: 500 12px/1.5 "DM Mono", monospace; text-overflow: ellipsis; white-space: nowrap; }
.card-bottom { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 26px; }
.card-meta { min-width: 0; color: var(--subtle); font-size: 11px; line-height: 1.55; }
.card-meta strong { display: block; overflow: hidden; color: var(--muted); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.open-link { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 8px 10px; border-radius: 5px; color: var(--ink); background: var(--mint); font-size: 11px; font-weight: 800; }
.open-link:hover, .open-link:focus-visible { background: #98d9bf; outline: none; }
.route-line { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.route { max-width: 100%; overflow: hidden; padding: 4px 6px; border-radius: 3px; color: var(--muted); background: #f0f4f3; font: 400 9px/1.2 "DM Mono", monospace; text-overflow: ellipsis; white-space: nowrap; }
.more-routes { padding: 4px 2px; color: var(--subtle); font: 400 9px/1.2 "DM Mono", monospace; }

.empty-state, .error-state { padding: 80px 20px; text-align: center; }
.empty-mark { display: block; color: var(--subtle); font-size: 36px; }
.empty-state h3, .error-state h3 { margin-top: 16px; font-size: 16px; }
.empty-state p, .error-state p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.text-button { margin-top: 20px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); font-size: 12px; }
.text-button:hover, .text-button:focus-visible { border-color: var(--ink); outline: none; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px 0 34px; color: var(--subtle); font: 400 10px/1.4 "DM Mono", monospace; letter-spacing: .05em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .page-shell { width: min(100% - 30px, 520px); }
  .topbar { height: 68px; }
  .topbar-meta { font-size: 9px; }
  .intro { padding: 56px 0 42px; }
  h1 { font-size: 44px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat-item, .stat-item:not(:first-child) { min-height: 95px; padding: 16px 14px; }
  .stat-item:nth-child(2) { border-right: 0; }
  .stat-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stat-item strong { font-size: 25px; }
  .catalog { padding-top: 52px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .catalog-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; gap: 8px; }
}
