/* CoinIvy site styles. Mobile first; tablet from 700px, desktop from 1024px. Light and dark themes. */
:root {
  --bg: #F5F7F4; --surface: #FFFFFF; --ink: #13201A; --ink2: #4A5A52; --ink3: #66756D;
  --line: #DDE3DE; --line2: #C9D3CC; --chip: #EEF2EF; --ivy: #2F6B4F; --ivy-ink: #FFFFFF; --ivy-dark: #1F4A36;
  --weather-green: #2F8F5B; --weather-red: #B42318; --chart: #1768A6;
  --radius: 18px; --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1512; --surface: #17201B; --ink: #E6EEE9; --ink2: #B4C2BA; --ink3: #95A59C;
    --line: #2A3630; --line2: #3A4842; --chip: #22302A; --ivy: #6FBF95; --ivy-ink: #0F1512; --ivy-dark: #8FD3AE; --chart: #3E9BDB;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; }
a { color: var(--ivy); }
a:hover { color: var(--ivy-dark); }
img, svg { max-width: 100%; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 3px solid var(--ivy); outline-offset: 2px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand b { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.brand b span { color: var(--ivy); }
.header-search { flex: 1 1 100%; order: 3; }
.weather { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink2); margin-left: auto; }
.weather i { width: 10px; height: 10px; border-radius: 99px; background: var(--weather-green); display: inline-block; }
.weather.red i { background: var(--weather-red); }
.weather .long { display: none; }

/* Search */
.search { position: relative; }
.search form { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line2); border-radius: 16px; padding: 4px 4px 4px 14px; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 17px; height: 44px; }
.search input::placeholder { color: var(--ink3); }
.search button { flex: none; height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--ivy); color: var(--ivy-ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.search .suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; list-style: none; margin: 0; padding: 6px; z-index: 5; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 60vh; overflow-y: auto; }
.search .suggest[hidden] { display: none; }
.search .suggest li a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); min-height: 44px; align-items: center; }
.search .suggest li a[aria-selected="true"], .search .suggest li a:hover { background: var(--chip); }
.search .suggest .t { font-family: var(--mono); color: var(--ink2); font-size: 14px; }
.search .none { padding: 10px 12px; color: var(--ink2); font-size: 14px; }

/* Home */
body.home { min-height: 100vh; display: flex; flex-direction: column; }
.home-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 40px 16px 18vh; }
.home-logo { display: flex; align-items: center; gap: 12px; }
.home-logo h1 { margin: 0; font-size: 44px; font-weight: 800; letter-spacing: -1px; }
.home-logo h1 span { color: var(--ivy); }
.slogan { margin: 0; font-size: 19px; color: var(--ink2); font-weight: 500; }
.home-search { width: 100%; max-width: 680px; text-align: left; }
.home-search form { border-radius: 999px; padding-left: 20px; }
.home-search button { border-radius: 999px; padding: 0 22px; }
.try { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center; font-size: 14px; color: var(--ink2); }
.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.tiles { display: grid; grid-template-columns: 1fr; gap: 14px; width: 100%; max-width: 980px; margin-top: 18px; text-align: left; }
.weather-home { justify-content: center; margin: 0; }

/* Cards (shared) */
.card { background: var(--surface); border: 1px solid var(--c-line, var(--line)); border-radius: var(--radius); overflow: hidden; }
.card-head { background: var(--c-tint, var(--chip)); border-bottom: 1px solid var(--c-line, var(--line)); padding: 10px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head .ic { width: 28px; height: 28px; border-radius: 99px; background: var(--c-strong, var(--ink2)); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.card-head .ic svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card-head h2, .card-head h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--c-strong, var(--ink)); flex: 1; min-width: 0; }
.badge { font-size: 12px; font-weight: 700; color: var(--c-strong, var(--ink2)); background: var(--surface); border: 1px solid var(--c-line, var(--line)); border-radius: 999px; padding: 4px 10px; }
.card-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.card-body p { margin: 0; }
.rows { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.rows > div { display: grid; grid-template-columns: 1fr; gap: 2px; }
.rows dt { color: var(--ink2); font-size: 13px; }
.rows dd { margin: 0; font-weight: 700; font-size: 15px; }
.note { font-size: 12.5px; color: var(--ink3); }
sup.src { font-size: 11px; font-weight: 600; margin-left: 2px; }
sup.src a { text-decoration: none; }
.list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.cat-facts   { --c-strong: #1E5A8A; --c-tint: #E8F0F8; --c-line: #C5D8EA; }
.cat-price   { --c-strong: #1768A6; --c-tint: #E8F1FA; --c-line: #C5DCF0; }
.cat-checks  { --c-strong: #33449C; --c-tint: #ECEEFA; --c-line: #CDD3F0; }
.cat-control { --c-strong: #5B3F99; --c-tint: #F0EBF8; --c-line: #D9CCEE; }
.cat-supply  { --c-strong: #0B6E6B; --c-tint: #E3F3F2; --c-line: #BFE0DD; }
.cat-use     { --c-strong: #2F6B4F; --c-tint: #E8F2EC; --c-line: #C6DECF; }
.cat-trading { --c-strong: #A3305F; --c-tint: #F8E8EF; --c-line: #EBC6D6; }
.cat-history { --c-strong: #3E4C5E; --c-tint: #ECEFF3; --c-line: #D3D9E1; }
.cat-watch   { --c-strong: #8A5300; --c-tint: #FFF4E0; --c-line: #EBCB92; }
.cat-sources { --c-strong: #4A5A52; --c-tint: #EEF2EF; --c-line: #D5DDD7; }
@media (prefers-color-scheme: dark) {
  .card[class*="cat-"] { --c-tint: color-mix(in srgb, var(--c-strong) 22%, var(--surface)); --c-line: color-mix(in srgb, var(--c-strong) 45%, var(--surface)); }
  .card-head h2, .card-head h3, .badge { color: color-mix(in srgb, var(--c-strong) 45%, #ffffff); }
}

/* Coin page */
.coin-main { padding: 16px 0 40px; display: flex; flex-direction: column; gap: 16px; }
.crumbs { font-size: 13px; color: var(--ink2); }
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.hero h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.hero .tick { font-family: var(--mono); font-size: 16px; color: var(--ink2); margin-left: 8px; font-weight: 400; }
.hero .one { margin: 0; color: var(--ink2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; font-weight: 600; }
.tags span { background: var(--chip); border-radius: 999px; padding: 5px 11px; }
.price .when { font-size: 13px; color: var(--ink2); display: block; }
.price .big { font-family: var(--mono); font-size: 30px; font-weight: 500; letter-spacing: -0.5px; display: block; }
.price .chg { font-size: 14px; color: var(--ink2); display: block; }
.price-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.cur-toggle { display: inline-flex; border: 1px solid var(--line2); border-radius: 999px; padding: 2px; background: var(--surface); }
.cur-toggle button { min-height: 36px; min-width: 52px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink2);
  font: inherit; font-family: var(--mono); font-size: 13px; font-weight: 500; cursor: pointer; }
.cur-toggle button[aria-pressed="true"] { background: var(--ivy); color: var(--ivy-ink); }
.cur-toggle button:focus-visible { outline: 2px solid var(--ivy); outline-offset: 2px; }
.short { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.short h2 { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.short p { margin: 0 0 10px; font-size: 16.5px; line-height: 1.6; }
.short .note { margin: 0; }
.choose h2 { margin: 0; font-size: 15px; font-weight: 800; }
.choose-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.choose-top .act { display: flex; gap: 8px; }
.btn-ghost { min-height: 44px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  background: var(--surface); color: var(--ink2); border: 1.5px solid var(--line2); white-space: nowrap; }
.chip i { width: 10px; height: 10px; border-radius: 99px; background: var(--line2); }
.chip[aria-pressed="true"] { background: var(--c-tint); color: var(--c-strong); border-color: var(--c-strong); }
.chip[aria-pressed="true"] i { background: var(--c-strong); }
@media (prefers-color-scheme: dark) {
  .chip[aria-pressed="true"] { background: color-mix(in srgb, var(--c-strong) 25%, var(--surface)); color: color-mix(in srgb, var(--c-strong) 45%, #fff); border-color: color-mix(in srgb, var(--c-strong) 60%, #fff); }
}
.cards { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.cards .card[hidden], .card[hidden] { display: none; }
.checks { display: grid; grid-template-columns: 1fr; column-gap: 32px; }
.check { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.check .q { font-weight: 600; font-size: 15px; }
.check .a { font-family: var(--mono); font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line2); align-self: start; white-space: nowrap; color: var(--ink); }
.check .a.unk { border-style: dashed; }
.check .why { grid-column: 1 / -1; font-size: 13px; color: var(--ink2); }
.bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.bar span { height: 16px; border-radius: 4px; background: var(--line2); }
.bar span.on { background: var(--c-strong); }
.flag { color: var(--ink); }
.flag strong { color: var(--c-strong); }
.sources ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sources a { word-break: break-word; }

/* Lists of coins */
.page-main { padding: 20px 0 40px; }
.page-main h1 { font-size: 28px; margin: 0 0 8px; }
.coin-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
.coin-grid a { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; text-decoration: none; color: var(--ink); min-height: 52px; }
.coin-grid .t { font-family: var(--mono); font-size: 13px; color: var(--ink2); }
.coin-grid .k { font-size: 12px; color: var(--ink3); }
.filter { width: 100%; max-width: 420px; height: 46px; border: 1px solid var(--line2); border-radius: 12px; padding: 0 14px; font: inherit; background: var(--surface); color: var(--ink); }
.prose { max-width: 760px; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose p, .prose li { font-size: 16px; }
.def { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 10px 0; }
.def h3 { margin: 0 0 6px; font-size: 16px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wrap { padding-top: 16px; padding-bottom: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--ink2); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer nav a { color: var(--ink2); min-height: 32px; display: inline-flex; align-items: center; }

/* Tablet */
/* Price chart (one series; validated: #1768A6 on white, #3E9BDB on the dark surface) */
.chart-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.ranges { display: inline-flex; border: 1px solid var(--line2); border-radius: 999px; padding: 2px; }
.ranges button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ranges button[aria-pressed="true"] { background: var(--chip); color: var(--ink); }
.ranges button:focus-visible { outline: 2px solid var(--chart); outline-offset: 2px; }
.chart-sum { margin: 0; font-size: 13.5px; color: var(--ink2); }
.chart-plot { position: relative; touch-action: pan-y; }
.chart-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-plot svg:focus-visible { outline: 2px solid var(--chart); outline-offset: 4px; border-radius: 6px; }
.chart-plot .grid { stroke: var(--line); stroke-width: 1; }
.chart-plot .axis { fill: var(--ink3); font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-plot .line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-plot .area { fill: var(--chart); opacity: .1; }
.chart-plot .dot { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.chart-plot .hair { stroke: var(--ink3); stroke-width: 1; }
.chart-tip { position: absolute; transform: translateX(-50%); pointer-events: none; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px;
  padding: 6px 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); display: flex; flex-direction: column; align-items: center; white-space: nowrap; z-index: 2; }
.chart-tip[hidden] { display: none; }
.chart-tip b { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--ink); }
.chart-tip span { font-size: 12px; color: var(--ink3); }
.chart-table { margin-top: 10px; font-size: 13.5px; }
.chart-table summary { cursor: pointer; color: var(--ink2); min-height: 32px; display: flex; align-items: center; }
.chart-table table { border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { text-align: right; padding: 4px 14px 4px 0; border-bottom: 1px solid var(--line); }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.price.is-live .when::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 99px; background: var(--weather-green); margin-right: 6px; vertical-align: 1px; }

@media (min-width: 700px) {
  .wrap { padding: 0 24px; }
  .header-search { flex: 1 1 300px; order: 0; }
  .weather { margin-left: 0; }
  .weather .long { display: inline; }
  .home-main { padding-top: 72px; gap: 22px; }
  .home-logo h1 { font-size: 60px; }
  .slogan { font-size: 22px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { flex-direction: row; justify-content: space-between; align-items: flex-start; padding: 24px 26px; }
  .hero h1 { font-size: 38px; }
  .price { text-align: right; flex: none; }
  .price-top { justify-content: flex-end; }
  .price-top .when { order: -1; }
  .price .big { font-size: 36px; }
  .short { padding: 22px 26px; }
  .chips { flex-wrap: wrap; overflow: visible; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards .wide { grid-column: 1 / -1; }
  .rows > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 16px; }
  .rows dt { font-size: 15px; }
  .coin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .wrap { flex-direction: row; justify-content: space-between; flex-wrap: wrap; }
}
/* Desktop */
@media (min-width: 1024px) {
  .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-facts .rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 36px; }
  .coin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .coin-main { padding-top: 24px; gap: 20px; }
}
@media (min-width: 1280px) { .coin-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media print { .site-header, .choose, .site-footer nav { display: none; } .cards .card[hidden], .card[hidden] { display: block; } }
