:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f3;
  color: #17211c;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(13,122,95,.14), transparent 34rem),
    radial-gradient(circle at 92% 8%, rgba(255,106,0,.13), transparent 30rem),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(246,247,243,.78) 34rem),
    #f6f7f3;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.page { width: min(1180px, calc(100vw - 32px)); margin: 0 auto; padding: 28px 0 56px; }
.hero { padding: 10px 0 24px; }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: #66746d; font-size: 13px; margin-bottom: 24px; }
.backlink:hover { color: #0d7a5f; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 480px); gap: 32px; align-items: end; }
.eyebrow { color: #0d7a5f; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(34px, 5vw, 66px); line-height: 1; letter-spacing: 0; }
.hero p, .sub-header p { margin-top: 12px; color: #66746d; font-size: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero-actions a, .placeholder-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid #dbe3de; border-radius: 8px; background: #ffffffcc; color: #213029; font-size: 14px; font-weight: 700; }
.hero-actions a:first-child { color: #064f77; }

.home-page { padding-top: 42px; }
.landing-hero { position: relative; overflow: hidden; max-width: none; min-height: 360px; border: 1px solid rgba(13,122,95,.18); border-radius: 8px; padding: 44px; background: linear-gradient(135deg, #06281f 0%, #0d604d 58%, #24627e 100%); color: #fff; box-shadow: 0 28px 70px rgba(12,54,45,.18); }
.landing-hero::after { content: ""; position: absolute; inset: auto -18% -42% 44%; height: 250px; background: radial-gradient(circle, rgba(255,178,92,.34), transparent 68%); pointer-events: none; }
.landing-hero .eyebrow { color: #9be7cf; }
.landing-hero h1 { position: relative; z-index: 1; max-width: 760px; font-size: clamp(46px, 7vw, 86px); line-height: .95; }
.landing-hero p { position: relative; z-index: 1; max-width: 820px; margin-top: 20px; color: rgba(255,255,255,.82); font-size: 18px; line-height: 1.75; }
.home-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 4px 0 28px; }
.home-stat { position: relative; overflow: hidden; min-height: 116px; border: 1px solid #dfe6e1; border-radius: 8px; background: rgba(255,255,255,.92); padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 14px 36px rgba(23,33,28,.05); }
.home-stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: #0d7a5f; }
.home-stat:nth-child(2)::before { background: #ff6a00; }
.home-stat:nth-child(3)::before { background: #24627e; }
.home-stat:nth-child(4)::before { background: #6d5bd0; }
.home-stat::after { content: ""; position: absolute; right: -28px; top: -30px; width: 92px; height: 92px; border-radius: 999px; background: rgba(13,122,95,.07); }
.home-stat:nth-child(2)::after { background: rgba(255,106,0,.09); }
.home-stat:nth-child(3)::after { background: rgba(36,98,126,.09); }
.home-stat:nth-child(4)::after { background: rgba(109,91,208,.08); }
.home-stat span { color: #718078; font-size: 12px; font-weight: 900; }
.home-stat strong { margin-top: 8px; color: #ff6a00; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.08; overflow-wrap: anywhere; }
.home-stat:nth-child(1) strong { color: #0d7a5f; }
.home-stat:nth-child(3) strong { color: #24627e; }
.home-stat:nth-child(4) strong { color: #6d5bd0; }
.home-stat small { margin-top: 7px; color: #17211c; font-weight: 900; }
.module-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.module-card { position: relative; overflow: hidden; min-height: 360px; border: 1px solid #dfe6e1; border-radius: 8px; background: rgba(255,255,255,.94); padding: 24px; display: flex; flex-direction: column; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.module-card::before { content: ""; position: absolute; inset: 0; height: 7px; background: #0d7a5f; }
.module-card::after { content: ""; position: absolute; right: -60px; top: -70px; width: 190px; height: 190px; border-radius: 999px; background: rgba(13,122,95,.09); pointer-events: none; }
.module-card.buyback::before { background: #ff6a00; }
.module-card.buyback::after { background: rgba(255,106,0,.1); }
.module-card.southbound::before { background: #24627e; }
.module-card.southbound::after { background: rgba(36,98,126,.12); }
.module-card:hover { transform: translateY(-3px); border-color: #ff6a00; box-shadow: 0 20px 50px rgba(23,33,28,.1); }
.module-icon { display: flex; justify-content: space-between; align-items: center; color: #0d7a5f; margin-bottom: 18px; }
.module-icon span { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 8px; background: #eef8f3; font-size: 30px; }
.module-card.buyback .module-icon { color: #ff6a00; }
.module-card.buyback .module-icon span { background: #fff1e7; }
.module-card.southbound .module-icon { color: #24627e; }
.module-card.southbound .module-icon span { background: #eaf4fa; }
.module-icon b { color: #ff6a00; font-size: 28px; }
.module-body { display: flex; flex-direction: column; flex: 1; }
.module-body > span { color: #66746d; font-size: 13px; font-weight: 900; }
.module-body h2 { margin-top: 10px; font-size: clamp(27px, 3vw, 40px); line-height: 1.1; }
.module-body p { margin-top: 13px; color: #596861; line-height: 1.75; }
.module-body em { margin-top: 15px; color: #0d7a5f; font-style: normal; font-weight: 900; line-height: 1.5; }
.module-card.buyback .module-body em { color: #c75300; }
.module-card.southbound .module-body em { color: #24627e; }
.module-body ul { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; color: #223029; font-weight: 800; }
.module-body li { display: flex; gap: 9px; align-items: center; line-height: 1.4; }
.module-body li::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: #ff6a00; flex: 0 0 auto; }
.module-body > strong { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 8px; background: #0d7a5f; color: #fff; font-size: 14px; }
.module-card.buyback .module-body > strong { background: #ff6a00; }
.module-card.southbound .module-body > strong { background: #24627e; }

.search-box { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 72px; padding: 10px 10px 10px 18px; border: 1px solid #dbe3de; border-radius: 8px; background: #fff; box-shadow: 0 24px 60px rgba(23,33,28,.08); }
.search-box svg { color: #0d7a5f; }
.search-box input { min-width: 0; border: 0; outline: 0; color: #17211c; }
.search-box button { height: 52px; border: 0; border-radius: 8px; padding: 0 26px; background: #ff6a00; color: #fff; font-weight: 800; cursor: pointer; }
.suggestions { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; right: 0; max-height: 320px; overflow-y: auto; border: 1px solid #dbe3de; border-radius: 8px; background: #fff; box-shadow: 0 24px 60px rgba(23,33,28,.12); }
.suggestions.hidden { display: none; }
.suggestions a { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #edf1ee; }
.suggestions a:hover { background: #f6faf8; }
.suggestions span, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #64746d; font-size: .92em; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 28px 0 30px; }
.stats.compact { margin-top: 26px; }
.stat { min-height: 150px; border: 1px solid #dfe6e1; border-radius: 8px; background: #ffffffb8; padding: 24px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.stat-icon { color: #0d7a5f; margin-bottom: 12px; }
.stat strong { font-size: clamp(26px, 4vw, 42px); line-height: 1; color: #ff6a00; }
.stat span { margin-top: 10px; color: #425049; font-weight: 700; }
.stat small { margin-top: 4px; color: #87928d; }

.panel, .focus, .ranking, .table-panel { border: 1px solid #dfe6e1; border-radius: 8px; background: rgba(255,255,255,.78); }
.panel, .focus { padding: 24px; margin-bottom: 24px; }
.section-head, .ranking-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2, .ranking-head h2 { font-size: 22px; line-height: 1.2; }
.section-head span, .ranking-head p { color: #708078; font-size: 13px; margin-top: 5px; }
.pill { display: inline-flex; width: fit-content; margin-bottom: 10px; padding: 5px 10px; border-radius: 999px; background: #fff1e7; color: #a14700; font-weight: 800; }

.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; min-height: 220px; }
.bar-card { min-height: 220px; border: 1px solid #edf1ee; border-radius: 8px; padding: 14px; display: grid; grid-template-rows: 1fr auto auto auto; justify-items: center; gap: 8px; background: #fff; transition: transform .15s ease, border-color .15s ease; }
.bar-card.compact { min-width: 96px; min-height: 190px; }
.bar-card:hover { border-color: #ff6a00; transform: translateY(-2px); }
.bar-card.active { border-color: #ff6a00; background: #fff7ef; box-shadow: inset 0 0 0 1px rgba(255, 106, 0, .12); }
.bar-track { width: 54px; height: 130px; display: flex; align-items: end; border-radius: 8px; background: #f1f4f1; overflow: hidden; }
.bar-fill { width: 100%; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #ff9c46, #ff6a00); }
.bar-card strong { font-size: 26px; }
.bar-card span { color: #66746d; font-weight: 800; }
.bar-card small { color: #87928d; }

.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.focus-item { min-height: 128px; border: 1px solid #edf1ee; border-radius: 8px; padding: 16px; background: #fff; }
.focus-item:hover { border-color: #0d7a5f; }
.focus-item div { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.focus-item b { color: #0d7a5f; font-size: 12px; }
.focus-item strong { display: block; line-height: 1.3; }
.focus-item span { display: block; margin-top: 10px; color: #708078; font-size: 13px; }

.rank-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.ranking { min-width: 0; overflow: hidden; }
.ranking-head { padding: 20px 22px 0; }
.ranking-head svg { color: #0d7a5f; }
.rank-list { padding-bottom: 8px; }
.rank-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 18px; border-top: 1px solid #edf1ee; }
.rank-row:hover { background: #f8fbf9; }
.rank-no { color: #89948f; text-align: right; font-weight: 800; }
.rank-main { min-width: 0; }
.rank-main div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.rank-main strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank-main small { display: block; margin-top: 3px; color: #7d8b84; }
.rank-main i { display: block; height: 3px; margin-top: 8px; border-radius: 999px; background: #ff6a00; }
.rank-value { text-align: right; font-weight: 900; font-size: 15px; white-space: nowrap; }
.rank-value small { display: block; color: #8b9691; font-size: 12px; font-weight: 600; margin-top: 3px; }
.up, .pos { color: #0d7a5f; }
.down, .neg { color: #d83b3b; }

footer { margin-top: 34px; padding-top: 26px; border-top: 1px solid #dfe6e1; text-align: center; color: #7f8b85; font-size: 13px; line-height: 1.8; }
.loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 10px; color: #66746d; }
.loading svg { color: #0d7a5f; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: #b42318; }

.sub-header { padding: 14px 0 22px; }
.sub-header h1 { font-size: clamp(30px, 5vw, 52px); }
.table-panel { overflow: hidden; margin-top: 18px; }
.section-head.inside { padding: 18px 20px 0; margin-bottom: 14px; }
.buyback-bars { grid-template-columns: repeat(10, minmax(96px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
.buyback-filter { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: end; }
.buyback-filter label { display: grid; gap: 8px; }
.buyback-filter label span { color: #66746d; font-size: 13px; font-weight: 800; }
.buyback-filter input { min-height: 44px; border: 1px solid #dbe3de; border-radius: 8px; padding: 0 12px; outline: 0; color: #17211c; background: #fff; }
.buyback-filter button, .buyback-filter a { min-height: 44px; border-radius: 8px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.buyback-filter button { border: 0; background: #ff6a00; color: #fff; cursor: pointer; }
.buyback-filter a { border: 1px solid #dbe3de; background: #fff; color: #66746d; }
.buyback-results { display: grid; gap: 12px; margin-top: 18px; }
.buyback-result { border: 1px solid #edf1ee; border-radius: 8px; padding: 14px; background: #fff; }
.buyback-result > a { display: flex; gap: 10px; align-items: baseline; }
.buyback-result > span { display: block; margin-top: 8px; color: #66746d; font-size: 13px; }
.southbound-stats .stat:nth-child(1) strong { color: #24627e; }
.southbound-stats .stat:nth-child(2) strong { color: #0d7a5f; }
.southbound-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.southbound-chart { margin-bottom: 0; }
.flow-bars { min-height: 220px; display: flex; align-items: end; gap: 4px; overflow-x: auto; padding: 12px 4px 26px; border-radius: 8px; background: linear-gradient(180deg, rgba(36,98,126,.05), rgba(255,255,255,.4)); }
.flow-bar { position: relative; min-width: 12px; height: 180px; display: flex; align-items: end; justify-content: center; }
.flow-bar i { width: 9px; min-height: 4px; border-radius: 6px 6px 0 0; background: #24627e; display: block; }
.flow-bar.out i { background: #d83b3b; }
.flow-bar.in i { background: #0d7a5f; }
.cum-flow .flow-bar i { background: #24627e; }
.flow-bar span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%) rotate(-45deg); transform-origin: center; color: #7d8b84; font-size: 10px; white-space: nowrap; }
.southbound-ranking .ranking-head svg { color: #24627e; }
.southbound-ranking .rank-main i { background: #24627e; }
.mini-records { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.mini-records a { border-radius: 8px; background: #f6faf8; padding: 10px; }
.mini-records b, .mini-records span { display: block; }
.mini-records span { margin-top: 4px; color: #66746d; font-size: 12px; }
.record-filters { display: grid; gap: 10px; margin: 20px 0 -2px; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-group span { min-width: 64px; color: #66746d; font-size: 13px; font-weight: 800; }
.record-filters button { min-height: 34px; border: 1px solid #dbe3de; border-radius: 8px; background: #fff; color: #425049; padding: 0 12px; font-weight: 800; cursor: pointer; }
.record-filters button.active { border-color: #0d7a5f; background: #e7f6ef; color: #0d7a5f; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 960px; border-collapse: collapse; background: #fff; }
th, td { padding: 13px 14px; border-bottom: 1px solid #edf1ee; text-align: left; vertical-align: top; }
th { color: #66746d; font-size: 12px; text-transform: uppercase; background: #f6faf8; }
td { font-size: 14px; }
td a { display: grid; gap: 4px; }
td small { display: block; margin-top: 4px; color: #7d8b84; }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #eef4f1; color: #425049; }
.tag.buy { background: #e7f6ef; color: #0d7a5f; }
.tag.sell { background: #fdecec; color: #c92f2f; }
.empty { padding: 20px; text-align: center; color: #7d8b84; }
.empty.large { padding: 46px; }
.placeholder-links { margin-top: 24px; }

@media (max-width: 860px) {
  .page { width: min(100vw - 24px, 680px); }
  .hero-grid, .stats, .rank-grid, .focus-grid, .home-stats, .module-list { grid-template-columns: 1fr; }
  .module-icon span { width: 62px; height: 62px; font-size: 30px; }
  .search-box { grid-template-columns: auto 1fr; }
  .search-box button { grid-column: 1 / -1; width: 100%; }
  .buyback-filter, .mini-records, .southbound-grid { grid-template-columns: 1fr; }
  .bars { grid-template-columns: repeat(5, minmax(96px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
  .section-head { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .page { width: min(100vw - 20px, 520px); padding-top: 18px; }
  .hero p, .sub-header p { font-size: 14px; }
  .landing-hero p { font-size: 15px; }
  .home-stat { min-height: 104px; }
  .stat { min-height: 126px; padding: 18px; }
  .module-card { min-height: auto; padding: 18px; }
  .rank-row { grid-template-columns: 24px minmax(0, 1fr); }
  .rank-value { grid-column: 2; text-align: left; }
}
