/* INSIGHTS design system v2 — red, white and black.
   Idea: "A thousand dots. One red." The logo's red dot is the only memorable mark; everything else stays quiet.
   Black carries structure (header, hero, sidebar, footer). White carries content. Red is a signal: actions, the dot, attention.
   Positive status is black, never red, so red keeps meaning "act" or "look here". */
:root {
  --red: #E10600;
  --red-ink: #C20500;         /* red for TEXT on white (6.3:1) */
  --red-hot: #FF4D42;         /* red for text on black (6.0:1) */
  --red-soft: #FFECEA;
  --red-line: #FFC9C4;
  --black: #0A0A0B;
  --night: #141416;           /* raised surface on black */
  --night-line: #2A2A2F;
  --ink: #0E0E10;
  --ink-2: #2B2B31;
  --mid: #5C5C66;
  --soft: #A1A1AA;            /* secondary text on black (7.4:1) */
  --line: #E4E4E7;
  --grey: #F3F3F4;
  --paper: #FFFFFF;
  --green: #0F7B3F;           /* only for money in/out in finance tables */
  /* legacy names kept so older inline styles keep working */
  --orange: var(--red); --orange-ink: var(--red-ink); --orange-soft: var(--red-soft);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 16px 36px rgba(10,10,11,.10);
  --glow: 0 12px 28px rgba(225,6,0,.32);
  --pop: 6px 6px 0 var(--red);
  --display: "Inter", ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --font: "Inter", ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --surface: #FFFFFF;          /* cards, inputs, tables */
  --surface-2: #FAFAFA;
  --emph: #0A0A0B;             /* filled "dark" controls */
  --ui-scale: 1; --read-scale: 1;
  --maxw: 1220px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; font-size: calc(100% * var(--ui-scale, 1)); }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.6; font-size: 1rem; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { max-width: 100%; }
::selection { background: var(--red); color: #fff; }
a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--red-ink); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.06; letter-spacing: -.035em; margin: 0 0 .5em; font-weight: 800; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.2rem; letter-spacing: -.02em; font-weight: 700; }
h4 { font-size: 1rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--mid); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--red); color: #fff; padding: 10px 14px; z-index: 100; border-radius: 0 0 10px 0; }
.skip:focus { left: 0; top: 0; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.site-header :focus-visible, .site-footer :focus-visible, .ink :focus-visible, .hero :focus-visible, .card.dark :focus-visible, .card.accent :focus-visible, .side :focus-visible, .banner :focus-visible { outline-color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Banner and flash messages */
.banner { background: var(--red); color: #fff; font-size: .86rem; padding: 8px 20px; text-align: center; font-weight: 500; }
.banner b { background: var(--black); color: #fff; font-weight: 700; padding: 2px 12px; border-radius: 999px; margin-right: 10px; font-size: .8rem; }
.flash { max-width: var(--maxw); margin: 18px auto 0; padding: 0 24px; }
.flash > div { border-radius: var(--radius-sm); padding: 14px 18px; background: var(--black); color: #fff; font-weight: 600; border-left: 6px solid var(--red); }
.flash .error { background: var(--red-soft); border-color: var(--red); color: #7d0300; border-left-width: 6px; }

/* Header: black, glassy, sticky */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(10,10,11,.97); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px); border-bottom: 1px solid #1E1E22; color: #fff; }
.nav { display: flex; align-items: center; gap: 18px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.wordmark { display: inline-flex; align-items: baseline; font-family: var(--display); font-weight: 800; letter-spacing: -.055em; line-height: 1; color: #fff; white-space: nowrap; }
.wordmark::after { content: ""; width: .2em; height: .2em; border-radius: 50%; background: var(--red); margin-left: .1em; flex: none; }
.nav-links { display: flex; gap: 2px; margin-left: 18px; flex: 1; }
.nav-links a { position: relative; padding: 9px 15px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .95rem; color: #E4E4E7; transition: background .15s, color .15s; }
.nav-links a:hover { background: var(--night); color: #fff; }
.nav-links a[aria-current="page"] { background: var(--night); color: #fff; padding-left: 30px; }
.nav-links a[aria-current="page"]::before { content: ""; position: absolute; left: 14px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--red-hot); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-actions > a:not(.btn) { color: #E4E4E7; font-weight: 600; text-decoration: none; padding: 8px 10px; }
.nav-actions > a:not(.btn):hover { color: #fff; }
.nav .menu-btn { display: none; }
.site-header .btn { border-color: #fff; color: #fff; background: transparent; }
.site-header .btn:hover { background: #fff; color: var(--black); }
.site-header .btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.site-header .btn.primary:hover { background: #fff; border-color: #fff; color: var(--red-ink); box-shadow: none; }
.dot { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 800; text-align: center; vertical-align: middle; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 24px; border-radius: 999px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .18s var(--ease), background .15s, color .15s, box-shadow .2s, border-color .15s; }
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #B80500; border-color: #B80500; color: #fff; box-shadow: var(--glow); }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn.dark:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn.on-dark { background: transparent; color: #fff; border-color: #fff; }
.btn.on-dark:hover { background: #fff; color: var(--black); }
.btn.danger { border-color: var(--red); color: var(--red-ink); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.sm { min-height: 40px; padding: 6px 18px; font-size: .9rem; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--grey); color: var(--black); transform: none; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--mid); font-size: .84rem; display: block; margin-top: 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=tel], input[type=date], input[type=time], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; min-height: 48px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 128px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #C4C4CB; }
input:focus, select:focus, textarea:focus { border-color: var(--black); outline: none; box-shadow: 0 0 0 4px var(--red-soft); }
.field { margin-bottom: 18px; }
.field.err input, .field.err textarea, .field.err select { border-color: var(--red); }
.err-msg { color: var(--red-ink); font-size: .85rem; font-weight: 700; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--red); flex: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-2 > .card .grid-2, .grid-3 > .card .grid-2, .grid-3 > .card .grid-3 { grid-template-columns: 1fr; } /* nested grids inside half-width cards stack, so fields stay readable */
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }

/* Hero: black, a thousand dots, one red. app.js draws the live dot field; without JS a static grid shows. */
.hero { --cell: 38px; position: relative; overflow: hidden; isolation: isolate; background: var(--black); color: #fff; }
.hero .field { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle at center, #2E2E34 0 2.3px, transparent 2.8px); background-size: var(--cell) var(--cell); }
.hero .field canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero.live .field { background-image: none; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(10,10,11,.78) 0, rgba(10,10,11,.35) 48%, rgba(10,10,11,0) 75%); }
.hero .the-dot { position: absolute; left: calc(var(--cell) * 26); top: calc(var(--cell) * 4); width: var(--cell); height: var(--cell); }
.hero.live .the-dot { display: none; }
.the-dot::before, .the-dot::after { content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 50%; background: var(--red); }
.the-dot::after { background: transparent; border: 2px solid var(--red); opacity: 0; animation: ping 2.8s var(--ease) .8s 3 both; }
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(4.6); opacity: 0; } }
.hero .wrap { position: relative; padding-top: 104px; padding-bottom: 116px; }
.hero-note { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--soft); margin: 0 0 26px; }
.dotmark { width: 10px; height: 10px; border-radius: 50%; background: var(--red); display: inline-block; box-shadow: 0 0 0 5px rgba(225,6,0,.22); }
.hero h1 { font-size: clamp(3.3rem, 9.4vw, 8.4rem); line-height: .9; letter-spacing: -.055em; margin: 0 0 .3em; max-width: 11ch; color: #fff; font-weight: 800; text-wrap: initial; }
.hero h1 .stop { color: var(--red); font-style: normal; }
.hero p.lead { font-size: 1.28rem; max-width: 40ch; color: #D4D4DB; line-height: 1.5; }
.searchbar { display: flex; gap: 8px; background: #fff; border: 0; border-radius: 999px; padding: 7px; max-width: 680px; margin-top: 34px; box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 24px 60px rgba(0,0,0,.55); transition: box-shadow .2s, transform .2s var(--ease); }
.searchbar:focus-within { box-shadow: 0 0 0 4px var(--red), 0 24px 60px rgba(0,0,0,.55); transform: translateY(-2px); }
.searchbar input { border: none; background: transparent; box-shadow: none !important; flex: 1; min-width: 0; padding-left: 22px; color: var(--ink); }
.searchbar .btn { min-height: 48px; }
.quick-links { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.quick-links a { color: #E4E4E7; border: 1.5px solid #34343A; background: transparent; border-radius: 999px; padding: 7px 16px; font-size: .92rem; font-weight: 600; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.quick-links a:hover { background: #fff; border-color: #fff; color: var(--black); }
.hero .btn:not(.primary) { border-color: #fff; color: #fff; background: transparent; }
.hero .btn:not(.primary):hover { background: #fff; color: var(--black); }
/* One orchestrated entrance, once */
.hero .hero-note, .hero h1, .hero p.lead, .hero .searchbar, .hero .quick-links, .hero .wrap > .row { animation: rise .9s var(--ease) both; }
.hero h1 { animation-delay: .08s; } .hero p.lead { animation-delay: .22s; } .hero .searchbar { animation-delay: .32s; } .hero .quick-links { animation-delay: .42s; } .hero .wrap > .row { animation-delay: .5s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* Sections and cards */
section.block { padding: 92px 0; }
section.block.tint { background: var(--grey); }
section.block.ink { background: var(--black); color: #fff; background-image: radial-gradient(circle at center, #232327 0 1.6px, transparent 2.1px); background-size: 36px 36px; }
.ink h2, .ink h3 { color: #fff; }
.ink .muted { color: var(--soft); }
.ink a { color: #fff; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 34px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head > a { font-weight: 700; text-decoration-thickness: 2px; }
.section-head h2 + p { margin-top: 10px !important; }
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px; }
.tint .card { border-color: transparent; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card.flat { box-shadow: none; }
.card.accent { background: var(--black); color: #fff; border-color: var(--black); box-shadow: none; position: relative; overflow: hidden; }
.card.accent::before { content: ""; position: absolute; right: -60px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(225,6,0,.55), transparent 68%); pointer-events: none; }
.card.accent > * { position: relative; }
.card.accent h2, .card.accent h3 { color: #fff; }
.card.accent .muted, .card.accent p { color: #C9C9D1; }
.card.accent a:not(.btn) { color: #fff; }
.card.accent .btn:not(.primary) { border-color: #fff; color: #fff; background: transparent; }
.card.accent .btn:not(.primary):hover { background: #fff; color: var(--black); }
.card.dark { background: radial-gradient(70% 140% at 100% 0%, rgba(225,6,0,.42), transparent 62%), var(--black); color: #fff; border-color: var(--black); border-radius: 32px; }
.card.dark h2 { color: #fff; font-size: clamp(2rem, 4.8vw, 3.6rem); max-width: 16ch; margin-inline: auto; }
.card.dark p { color: #D4D4DB; }
.card.dark a:not(.btn) { color: #fff; }
.idea-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; height: 100%; padding-bottom: 28px; transition: border-color .15s, box-shadow .25s, transform .25s var(--ease); position: relative; }
.idea-card:hover { border-color: var(--black); box-shadow: var(--shadow); transform: translateY(-4px); color: var(--ink); }
.idea-card:hover h3 { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.idea-card h3 { margin: 0; font-size: 1.28rem; line-height: 1.15; }
.idea-card p { margin: 0; color: var(--ink-2); font-size: .96rem; }
.idea-card .meta { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: .84rem; color: var(--mid); padding: 4px 52px 0 0; }
.idea-card .go { position: absolute; right: 18px; bottom: 18px; width: 40px; height: 40px; border-radius: 50%; background: var(--grey); display: grid; place-items: center; transition: background .2s, transform .3s var(--ease); }
.idea-card .go::before { content: ""; width: 9px; height: 9px; border-top: 2.5px solid var(--black); border-right: 2.5px solid var(--black); transform: rotate(45deg) translate(-1px, 1px); transition: border-color .2s; }
.idea-card:hover .go { background: var(--red); transform: rotate(-45deg); }
.idea-card:hover .go::before { border-color: #fff; }
.cap { font-weight: 700; color: var(--red-ink); background: var(--red-soft); border-radius: 8px; padding: 2px 10px; }
.loc::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--red); }
.pill { display: inline-flex; align-items: center; font-size: .78rem; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: var(--grey); color: var(--ink-2); border: 1px solid var(--line); line-height: 1.4; }
.pill.ok { background: var(--emph); border-color: var(--emph); color: #fff; }
.pill.ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 7px; }
a.pill { text-decoration: none; }
a.pill:hover { background: var(--black); border-color: var(--black); color: #fff; }
.pill.dark { background: var(--emph); color: #fff; border-color: var(--emph); }
.pill.red { background: var(--red-soft); color: var(--red-ink); border-color: var(--red-line); }
.pill.soft { background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink); }
.sample { position: absolute; top: 16px; right: 16px; }
.sample + .row { padding-right: 78px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cat { position: relative; display: block; text-decoration: none; padding: 22px 22px 20px; border: 1.5px solid var(--line); border-radius: 18px; font-family: var(--display); font-size: 1.1rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; background: #fff; transition: background .2s, color .2s, border-color .2s, transform .25s var(--ease); }
.cat::after { content: ""; position: absolute; right: 18px; top: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--line); transition: background .2s, transform .25s var(--ease); }
.cat small { display: block; margin-top: 8px; font-family: var(--font); font-weight: 500; letter-spacing: 0; color: var(--mid); font-size: .84rem; transition: color .2s; }
.cat:hover { background: var(--black); border-color: var(--black); color: #fff; transform: translateY(-3px); }
.cat:hover::after { background: var(--red); transform: scale(1.6); }
.cat:hover small { color: var(--red-hot); }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.steps > div { background: var(--night); border: 1px solid var(--night-line); border-radius: var(--radius); padding: 28px 24px; color: #fff; transition: border-color .2s, transform .25s var(--ease); }
.steps > div:hover { border-color: var(--red); transform: translateY(-3px); }
.steps > div::before { counter-increment: s; content: counter(s, decimal-leading-zero); display: block; font-family: var(--display); font-weight: 800; font-size: 3rem; letter-spacing: -.05em; line-height: 1; color: var(--red-hot); margin-bottom: 20px; }
.steps p { color: #C0C0C9; margin: 0; font-size: .96rem; }
.steps h3 { color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 7px 15px; border-radius: 999px; border: 1.5px solid var(--line); text-decoration: none; font-weight: 600; font-size: .9rem; background: var(--surface); transition: border-color .15s, background .15s, color .15s; }
.chip:hover { border-color: var(--black); color: var(--black); }
.chip.on { background: var(--emph); border-color: var(--emph); color: #fff; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--emph); color: #fff; display: inline-grid; place-items: center; font-family: var(--display); font-weight: 800; flex: none; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--red); }
.avatar.lg { width: 88px; height: 88px; font-size: 2rem; }
.badge-verified { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; background: var(--emph); color: #fff; border-radius: 999px; padding: 2px 10px 2px 8px; }
.badge-verified::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red-hot); }

/* Discover layout */
.discover { display: grid; grid-template-columns: 290px 1fr; gap: 32px; align-items: start; padding: 40px 0 72px; }
.filters { position: sticky; top: 94px; }
.filters details { border-top: 1px solid var(--line); padding: 11px 0; }
.filters summary { font-weight: 700; cursor: pointer; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 44px; text-align: center; padding: 9px 13px; border: 1.5px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 700; }
.pager a:hover { border-color: var(--black); }
.pager .cur { background: var(--red); color: #fff; border-color: var(--red); }

/* Empty, loading */
.empty { text-align: center; padding: 56px 24px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.empty .glyph { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--grey); display: grid; place-items: center; font-size: 0; }
.empty .glyph::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--red); }
.empty h3 { margin-bottom: .3em; }
.skeleton { background: linear-gradient(90deg, #f1f1f2 25%, #e6e6e8 37%, #f1f1f2 63%); background-size: 400% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; min-height: 16px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } .the-dot::after { display: none; } }

/* Idea page */
.idea-head { padding-block: 48px 18px; }
.idea-head h1 { letter-spacing: -.05em; font-size: clamp(2.5rem, 6vw, 4.8rem); line-height: .98; max-width: 18ch; }
.idea-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; padding-bottom: 72px; align-items: start; }
.idea-body > aside { position: sticky; top: 94px; }
.prose { font-size: calc(1.08rem * var(--read-scale, 1) / var(--ui-scale, 1)); max-width: 68ch; line-height: 1.75; }
.prose h2 { margin-top: 1.6em; font-size: 1.6rem; }
.prose ul { padding-left: 1.2em; }
.facts { display: grid; gap: 10px; }
.fact { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; font-size: .95rem; }
.fact b { text-align: right; }
.idea-body aside .card:first-child { background: var(--black); color: #fff; border-color: var(--black); }
.idea-body aside .card:first-child h3 { color: #fff; }
.idea-body aside .card:first-child .fact { border-bottom-color: var(--night-line); color: #C9C9D1; }
.idea-body aside .card:first-child .fact b { color: #fff; }
.idea-body aside .card:first-child .muted, .idea-body aside .card:first-child p, .idea-body aside .card:first-child small { color: var(--soft); }
.idea-body aside .card:first-child a:not(.btn) { color: #fff; }
.notice { position: relative; border: 1.5px solid var(--ink); background: var(--surface); padding: 14px 18px 14px 44px; border-radius: var(--radius-sm); font-size: .93rem; }
.notice::before { content: ""; position: absolute; left: 18px; top: 21px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.notice.red { border-color: var(--red); background: var(--red-soft); }
.ink .notice { background: var(--night); border-color: #3A3A41; color: #E4E4E7; }
.lock { position: relative; }
.lock .fade { height: 130px; margin-top: -130px; position: relative; background: linear-gradient(to bottom, rgba(255,255,255,0), var(--paper)); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery img { width: 100%; height: 170px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; }
.media-frame { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: var(--radius-sm); background: var(--black); }
.visual { border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
dialog { border: none; border-radius: 16px; padding: 0; max-width: min(960px, 94vw); }
dialog::backdrop { background: rgba(0,0,0,.84); }
dialog img { display: block; max-height: 86vh; }

/* Dashboards: black rail, red marker */
.dash { display: grid; grid-template-columns: 262px 1fr; gap: 36px; padding: 36px 0 80px; align-items: start; }
.side { position: sticky; top: 94px; display: grid; gap: 3px; background: var(--black); border-radius: 24px; padding: 14px 12px 18px; max-height: calc(100vh - 112px); overflow-y: auto; }
.side h4 { font-family: var(--font); font-size: .8rem; font-weight: 600; letter-spacing: .01em; color: #8A8A94; margin: 18px 12px 4px; }
.side a { padding: 10px 14px; border-radius: 12px; text-decoration: none; font-weight: 600; color: #E4E4E7; display: flex; justify-content: space-between; align-items: center; transition: background .15s, color .15s; }
.side a:hover { background: var(--night); color: #fff; }
.side a[aria-current="page"] { background: var(--red); color: #fff; position: relative; padding-left: 32px; }
.side a[aria-current="page"]::before { content: ""; position: absolute; left: 15px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #fff; }
.side .dot { background: #fff; color: var(--red-ink); }
.dash h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.045em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 22px 28px; margin-bottom: 30px; }
.tile { border: 0; border-top: 2px solid var(--ink); border-radius: 0; padding: 14px 2px 6px; background: transparent; }
.tile .k { font-size: .86rem; font-weight: 600; color: var(--mid); }
.tile .v { font-family: var(--display); font-size: 2.5rem; font-weight: 800; letter-spacing: -.05em; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .s { font-size: .84rem; color: var(--mid); margin-top: 4px; }
.tile.hl { border-top-color: var(--red); }
.tile.hl .v { color: var(--red-ink); }
.tile.warn { border-top-color: var(--red); background: var(--red-soft); padding-inline: 14px; border-radius: 0 0 12px 12px; }
.table-wrap { overflow-x: auto; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; font-weight: 600; color: #E4E4E7; background: var(--black); white-space: nowrap; }
tbody tr:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.pos { color: var(--green); font-weight: 700; }
td.neg { color: var(--red-ink); font-weight: 700; }
.inline-form { display: inline; }
.inline-form .btn { margin: 2px 0; }
.bar { height: 10px; background: var(--grey); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--red); border-radius: 6px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 22px; padding-bottom: 4px; }
.tabs a { white-space: nowrap; padding: 8px 17px; border-radius: 999px; border: 1.5px solid var(--line); text-decoration: none; font-weight: 600; font-size: .9rem; }
.tabs a:hover { border-color: var(--black); color: var(--black); }
.tabs a[aria-current="page"] { background: var(--emph); color: #fff; border-color: var(--emph); }
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan .price { font-family: var(--display); font-size: 2.6rem; font-weight: 800; letter-spacing: -.05em; line-height: 1.1; }
.plan ul { padding-left: 1.1em; margin: 0; }
.plan.pop { background: var(--black); color: #fff; border-color: var(--black); box-shadow: var(--pop); transform: translateY(-6px); }
.plan.pop h3, .plan.pop .price { color: #fff; }
.plan.pop .muted, .plan.pop p, .plan.pop li { color: #C9C9D1; }
.plan.pop .btn:not(.primary) { border-color: #fff; color: #fff; background: transparent; }
.plan.pop .btn:not(.primary):hover { background: #fff; color: var(--black); }
.suggest { position: absolute; z-index: 20; background: var(--surface); border: 2px solid var(--black); border-radius: var(--radius-sm); width: 100%; max-height: 260px; overflow: auto; box-shadow: var(--shadow); }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: var(--surface); color: var(--ink); padding: 11px 15px; font: inherit; cursor: pointer; }
.suggest button:hover, .suggest button[aria-selected=true] { background: var(--red-soft); }
.rel { position: relative; }
.autosave { font-size: .82rem; color: var(--mid); }

/* Footer */
.site-footer { background: var(--black); color: #C9C9D1; padding: 68px 0 34px; border-top: 6px solid var(--red); }
.site-footer a { color: #fff; text-decoration-color: var(--red-hot); }
.site-footer a:hover { color: var(--red-hot); }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: .8em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.fgrid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; }
.fine { border-top: 1px solid var(--night-line); margin-top: 40px; padding-top: 24px; font-size: .82rem; color: #9A9AA4; }

/* Responsive */
.dash > *, .idea-body > *, .discover > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .cards > * { min-width: 0; }
@media (max-width: 960px) {
  .discover, .idea-body, .dash { grid-template-columns: 1fr; }
  .filters, .side, .idea-body > aside { position: static; }
  .side { display: flex; overflow-x: auto; overflow-y: hidden; gap: 6px; padding: 8px; border-radius: 18px; max-height: none; }
  .side h4 { display: none; }
  .side a { white-space: nowrap; }
  .steps, .grid-4, .fgrid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .plan.pop { transform: none; }
}
@media (max-width: 960px) {
  .nav .menu-btn { display: inline-flex; margin-left: auto; }
  .nav-links, .nav-actions { display: none; }
  .nav.open { flex-wrap: wrap; padding-bottom: 14px; }
  .nav.open .nav-links, .nav.open .nav-actions { display: flex; flex-direction: column; width: 100%; align-items: stretch; margin: 0; }
  .nav.open .nav-actions .btn { width: 100%; }
}
@media (max-width: 720px) {
  .grid-2, .steps, .grid-4, .fgrid { grid-template-columns: 1fr; }
  .hero { --cell: 32px; }
  .hero::after { background: linear-gradient(180deg, rgba(10,10,11,.55), rgba(10,10,11,.2)); }
  .hero .the-dot { left: calc(var(--cell) * 9); top: calc(var(--cell) * 2); }
  .hero .wrap { padding-top: 60px; padding-bottom: 68px; }
  section.block { padding: 60px 0; }
  .searchbar { flex-direction: column; border-radius: 24px; }
  .searchbar input { padding: 12px 14px; }
  th, td { padding: 10px 12px; }
  .wrap, .narrow { padding: 0 18px; }
}
@media print { .site-header, .site-footer, .side, .btn { display: none !important; } }

/* ===== PWA additions: app chrome, offline bar, audio, uploads, toasts ===== */
#netbar { position: sticky; top: 0; z-index: 60; background: var(--red); color: #fff; text-align: center; font-size: .86rem; font-weight: 600; padding: 7px 16px; }
#netbar[hidden] { display: none; }
#toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 721px) { #toasts { bottom: 28px; } }
.toast { background: var(--black); color: #fff; border-left: 5px solid var(--red); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; font-size: .94rem; animation: tin .25s var(--ease); pointer-events: auto; }
.toast.error { background: #3a0a08; border-left-color: var(--red-hot); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .4s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }
.tabbar { display: none; }
@media (max-width: 720px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: rgba(10,10,11,.98); border-top: 1px solid #222; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; text-decoration: none; color: #A1A1AA; font-size: .68rem; font-weight: 600; padding: 4px 0; border-radius: 10px; }
  .tabbar a[aria-current="page"] { color: #fff; }
  .tabbar a[aria-current="page"] .ico { background: var(--red); }
  .tabbar .ico { width: 44px; height: 28px; border-radius: 14px; display: grid; place-items: center; transition: background .2s; }
  .tabbar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
}
.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; cursor: pointer; }
.idea-cover { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius); margin: 0 0 22px; background: var(--grey); }
.listen-card { background: var(--black); color: #fff; border-radius: var(--radius); padding: 22px; margin: 0 0 24px; }
.listen-card h2 { color: #fff; font-size: 1.5rem; margin-bottom: 4px; }
.listen-card .muted { color: #A1A1AA; }
.audio { width: 100%; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 18px; background: var(--grey); }
.dropzone:hover { border-color: var(--red); }
.progress { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }
.cover-preview img, .listen-card img { max-width: 100%; border-radius: var(--radius-sm); }
.listen-card-cover { display: flex; gap: 16px; align-items: center; }

/* Google button, divider, spinner popup, print */
.btn.google { width: 100%; justify-content: center; background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); gap: 12px; min-height: 52px; font-weight: 700; }
.btn.google:hover { border-color: var(--ink); background: var(--surface); color: var(--ink); }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--mid); font-size: .86rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.busy-pop { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(10,10,11,.62); padding: 24px; }
.busy-pop > div { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 28px 26px; max-width: 380px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.spinner { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--red); animation: spin .9s linear infinite; position: relative; }
.spinner::after { content: ""; position: absolute; top: -5px; left: 50%; width: 11px; height: 11px; margin-left: -5.5px; background: var(--red); border-radius: 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy-pop h3 { margin-bottom: 6px; }
.busy-pop .msg { min-height: 1.5em; color: var(--mid); margin: 0; }
.sec-badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--emph); color: #fff; }
.sec-badge.off { background: var(--red-soft); color: var(--red-ink); }
.keybox { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--grey); border-radius: 10px; padding: 12px; word-break: break-all; letter-spacing: .08em; user-select: all; }

/* Long words and links must never be cut off or push the screen sideways */
.card, .tile, .notice, td, th, li, p, h1, h2, h3, .pill, .chip, .fact, .empty { overflow-wrap: anywhere; }
.row { flex-wrap: wrap; }
@media (max-width: 720px) {
  .pill { white-space: normal; max-width: 100%; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap tr { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; padding: 6px 4px; }
  .table-wrap td { border: 0; padding: 6px 12px; text-align: left !important; }
  .table-wrap td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mid); }
  .dash .side { position: static; }
  .inline-form { flex-wrap: wrap; }
  .inline-form > * { flex: 1 1 100%; }
}
@media print {
  .tabbar, #netbar, #toasts, .busy-pop, .no-print, .skip { display: none !important; }
  body { padding: 0 !important; background: #fff; }
  .dash { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}

.illus { margin: 22px 0; } .illus img { width: 100%; height: auto; border-radius: var(--radius-sm); background: var(--grey); border: 1px solid var(--line); } .illus figcaption { color: var(--mid); font-size: .88rem; margin-top: 6px; }

/* money / control centre */
.pill { white-space: nowrap; }


/* ================= v3: themes, display controls, polish ================= */
html { color-scheme: light; }
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111114; --surface: #1A1A1F; --surface-2: #202026; --emph: #34343C;
  --ink: #F2F2F4; --ink-2: #D4D4DA; --mid: #A6A6B0; --soft: #A6A6B0; --line: #2E2E35; --grey: #1F1F24;
  --red-ink: #FF6B61; --red-soft: #2A1412; --red-line: #5B221E;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 16px 36px rgba(0,0,0,.55); --green: #4FD18B;
}
[data-theme="dark"] body { background: var(--paper); }
[data-theme="dark"] .site-header { border-bottom-color: #26262C; }
[data-theme="dark"] .pill.soft { color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .searchbar input { color: #0A0A0B; }
[data-theme="dark"] .btn.primary { color: #fff; }
[data-theme="dark"] .idea-card:hover { border-color: var(--red-hot); }
[data-theme="dark"] .notice { border-color: var(--line); }
[data-theme="dark"] .notice.red { border-color: var(--red-line); background: var(--red-soft); }
[data-theme="dark"] img.thumb, [data-theme="dark"] .illus img { background: #fff; }
[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #202026 25%, #2A2A31 37%, #202026 63%); background-size: 400% 100%; }
[data-theme="dark"] .cat:hover { background: var(--emph); border-color: var(--emph); }
[data-theme="dark"] .tile { border-top-color: var(--line); }
[data-theme="dark"] .card.flat { background: var(--surface-2); }
[data-theme="dark"] .lock .fade { background: linear-gradient(to bottom, rgba(17,17,20,0), var(--paper)); }
[data-theme="dark"] .banner b { background: #000; }
[data-theme="dark"] code, [data-theme="dark"] pre { background: var(--surface-2); color: var(--ink); }
[data-theme="dark"] .btn.google { color: var(--ink); }
[data-theme="dark"] hr { border-color: var(--line); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid #34343A; background: transparent; color: #fff; cursor: pointer; font: inherit; transition: background .15s, border-color .15s, transform .15s; }
.icon-btn:hover { background: #26262B; border-color: #fff; transform: translateY(-1px); }
.nav-tools { display: flex; gap: 8px; align-items: center; margin-left: auto; margin-right: 10px; }
.i-moon { display: none; } [data-theme="dark"] .i-sun { display: none; } [data-theme="dark"] .i-moon { display: block; }
.display-pop { border: 1px solid var(--line); border-radius: 22px; padding: 22px; width: min(94vw, 440px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.display-pop::backdrop { background: rgba(0,0,0,.5); }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-weight: 600; }
.pref-row select { max-width: 62%; min-height: 44px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; gap: 3px; background: var(--surface-2); }
.seg button { border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 999px; cursor: pointer; min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pref-preview { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 1.05rem; }
.tr-banner { position: sticky; top: 0; z-index: 70; background: var(--surface); color: var(--ink); border-bottom: 1.5px solid var(--red); padding: 8px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: .9rem; }
.up-bar { width: 100%; height: 10px; border-radius: 99px; accent-color: var(--red); }
/* reading */
.prose { margin-inline: auto; }
.prose p { margin-bottom: 1.15em; }
.prose h2 { margin-top: 1.9em; }
figure.illus { margin: 1.6em 0; } figure.illus img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
figure.illus figcaption { color: var(--mid); font-size: .9rem; margin-top: 8px; text-align: center; }
/* cards: gentle lift */
.idea-card { transition: transform .22s var(--ease), box-shadow .22s, border-color .2s; }
.idea-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.related { margin-top: 56px; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#view > * { animation: rise .28s var(--ease) both; }
/* Control / dashboard side navigation: modern SaaS look */
.side { background: var(--surface); border: 1.5px solid var(--line); box-shadow: none; padding: 12px 10px 16px; border-radius: 20px; }
.side h4 { color: var(--mid); text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; font-weight: 700; margin: 18px 12px 6px; }
.side a { color: var(--ink-2); font-weight: 600; font-size: .95rem; gap: 10px; justify-content: flex-start; padding: 9px 12px; }
.side a .ni { width: 20px; height: 20px; flex: none; opacity: .75; }
.side a:hover { background: var(--grey); color: var(--ink); }
.side a[aria-current="page"] { background: var(--red-soft); color: var(--red-ink); padding-left: 12px; box-shadow: inset 3px 0 0 var(--red); }
.side a[aria-current="page"]::before { display: none; }
.side a[aria-current="page"] .ni { opacity: 1; }
.side .dot { margin-left: auto; background: var(--red); color: #fff; }
.side :focus-visible { outline-color: var(--red); }
.dash h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.03em; }
.pill.on, .pill.off { font-weight: 700; }
@media (max-width: 960px) { .side { border-radius: 16px; } .side a { padding: 9px 14px; } .side a .ni { display: none; } }
@media (max-width: 720px) {
  .nav-tools { margin-right: 6px; } .icon-btn { width: 44px; height: 44px; }
  .pref-row { flex-direction: column; align-items: stretch; gap: 6px; } .pref-row select { max-width: 100%; }
}


/* ================= v4: light mode is genuinely light (header, hero, footer), inputs without a type are styled ================= */
html:not([data-theme="dark"]) .site-header { background: rgba(255,255,255,.94); color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(10,10,11,.02); }
html:not([data-theme="dark"]) .wordmark { color: var(--ink); }
html:not([data-theme="dark"]) .nav-links a, html:not([data-theme="dark"]) .nav-actions > a:not(.btn) { color: var(--ink-2); }
html:not([data-theme="dark"]) .nav-links a:hover, html:not([data-theme="dark"]) .nav-actions > a:not(.btn):hover { background: var(--grey); color: var(--ink); }
html:not([data-theme="dark"]) .nav-links a[aria-current="page"] { background: var(--red-soft); color: var(--red-ink); }
html:not([data-theme="dark"]) .nav-links a[aria-current="page"]::before { background: var(--red); }
html:not([data-theme="dark"]) .site-header .btn { border-color: var(--ink); color: var(--ink); background: transparent; }
html:not([data-theme="dark"]) .site-header .btn:hover { background: var(--ink); color: #fff; }
html:not([data-theme="dark"]) .site-header .btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
html:not([data-theme="dark"]) .site-header .btn.primary:hover { background: #B80500; border-color: #B80500; color: #fff; }
html:not([data-theme="dark"]) .site-header .icon-btn { border-color: var(--line); color: var(--ink); background: var(--surface); }
html:not([data-theme="dark"]) .site-header .icon-btn:hover { background: var(--grey); }
html:not([data-theme="dark"]) .nav .menu-btn { color: var(--ink); border-color: var(--ink); }
/* hero */
html:not([data-theme="dark"]) .hero { background: linear-gradient(180deg, #FFFFFF 0%, #FFF6F5 100%); color: var(--ink); }
html:not([data-theme="dark"]) .hero .field { background-image: radial-gradient(circle at center, #DCDCE2 0 2.3px, transparent 2.8px); }
html:not([data-theme="dark"]) .hero::after { background: linear-gradient(90deg, rgba(255,255,255,.85) 0, rgba(255,255,255,.4) 48%, rgba(255,255,255,0) 75%); }
html:not([data-theme="dark"]) .hero h1 { color: var(--ink); }
html:not([data-theme="dark"]) .hero p.lead { color: var(--ink-2); }
html:not([data-theme="dark"]) .hero-note { color: var(--mid); }
html:not([data-theme="dark"]) .hero .btn:not(.primary) { border-color: var(--ink); color: var(--ink); }
html:not([data-theme="dark"]) .hero .btn:not(.primary):hover { background: var(--ink); color: #fff; }
html:not([data-theme="dark"]) .searchbar { background: #fff; box-shadow: 0 0 0 1.5px var(--line), 0 18px 44px rgba(10,10,11,.10); }
html:not([data-theme="dark"]) .searchbar:focus-within { box-shadow: 0 0 0 3px var(--red), 0 18px 44px rgba(10,10,11,.12); }
html:not([data-theme="dark"]) .quick-links a { color: var(--ink-2); border-color: var(--line); background: var(--surface); }
html:not([data-theme="dark"]) .quick-links a:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
/* footer: calm light surface, red rule kept */
html:not([data-theme="dark"]) .site-footer { background: var(--grey); color: var(--mid); border-top: 4px solid var(--red); }
html:not([data-theme="dark"]) .site-footer a { color: var(--ink); text-decoration-color: var(--red); }
html:not([data-theme="dark"]) .site-footer a:hover { color: var(--red-ink); }
html:not([data-theme="dark"]) .site-footer .wordmark { color: var(--ink); }
html:not([data-theme="dark"]) .site-footer h4 { color: var(--ink); }
@media (max-width:860px){ html:not([data-theme="dark"]) .tabbar { background: rgba(255,255,255,.97); border-top: 1px solid var(--line); } html:not([data-theme="dark"]) .tabbar a { color: var(--mid); } html:not([data-theme="dark"]) .tabbar a[aria-current="page"] { color: var(--red-ink); } }

/* Package manager: one card per package (a table with 10 columns cannot fit on any screen) */
.pkg-list table, .pkg-list tbody { display: block; width: 100%; }
.pkg-list thead { display: none; }
.pkg-list tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 16px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.pkg-list td { display: block; border: 0 !important; padding: 0 !important; min-width: 0; }
.pkg-list td::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 700; color: var(--mid); margin-bottom: 4px; }
.pkg-list td[data-label=""]::before { display: none; }
.pkg-list td[data-label="Status"] .pill, .pkg-list td[data-label="Worth per read"] { font-weight: 800; }
.pkg-list td:first-child { grid-column: 1 / -1; }
.pkg-list td:last-child { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
.pkg-list td:last-child .btn { white-space: nowrap; }
.pkg-list input { min-height: 44px; }

/* Narrow phones with large text: keep the header on one line */
@media (max-width: 420px) {
  .nav { gap: 8px; }
  .nav .nav-tools { gap: 6px; }
  .site-header .icon-btn { width: 42px; min-width: 42px; height: 42px; padding: 0; font-size: .95rem; }
  .nav .menu-btn { padding: 6px 14px; min-height: 42px; font-size: .95rem; }
  .nav .brand .wordmark { font-size: 1.45rem !important; }
}

/* Header language menu */
.lang-btn { width: auto !important; min-width: 40px; padding: 0 10px !important; gap: 6px; font-weight: 700; font-size: .8rem; letter-spacing: .04em; }
.lang-menu { position: fixed; z-index: 95; max-height: min(70vh, 540px); overflow-y: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 8px; }
.lang-menu .lang-head { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mid); padding: 8px 12px 6px; }
.lang-menu button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; text-align: left; min-height: 44px; padding: 8px 12px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; border-radius: 12px; cursor: pointer; }
.lang-menu button:hover:not(:disabled) { background: var(--grey); }
.lang-menu button[aria-checked="true"] { background: var(--red-soft); color: var(--red-ink); }
.lang-menu button:disabled { opacity: .55; cursor: not-allowed; }
.lang-menu small { font-weight: 500; font-size: .72rem; color: var(--mid); }
.lang-menu .lang-note { margin: 6px 12px 8px; line-height: 1.4; }
@media (max-width: 420px) { .lang-btn { padding: 0 8px !important; min-width: 42px; } .lang-btn svg { width: 16px; height: 16px; } }

/* Phones: a compact header that still fits at the largest text size (brand, theme, language, display, menu) */
@media (max-width: 520px) {
  .nav { gap: 6px; }
  .nav .nav-tools { gap: 4px; margin-right: 0; }
  .site-header .icon-btn { width: 38px; min-width: 38px; height: 38px; border-radius: 11px; }
  .site-header .lang-btn { width: auto; min-width: 38px; padding: 0 7px !important; font-size: .72rem; gap: 4px; }
  .nav .menu-btn { padding: 6px 11px; min-height: 38px; font-size: .85rem; }
  .nav .brand .wordmark { font-size: 1.3rem !important; }
}
@media (max-width: 340px) {
  .nav .brand .wordmark { font-size: 1.05rem !important; }
  .site-header .icon-btn { width: 34px; min-width: 34px; height: 34px; }
  .site-header .lang-btn { min-width: 34px; padding: 0 5px !important; }
  .nav .menu-btn { padding: 6px 8px; min-height: 34px; font-size: .8rem; }
  .wrap { padding-left: 12px; padding-right: 12px; }
}

/* No word is ever cut off by the screen edge: long words wrap, big headlines scale with the screen, strips wrap instead of hiding chips */
body { overflow-wrap: break-word; }
h1, h2, h3, h4, .lead, .idea-card h3, .card h3 { overflow-wrap: anywhere; }
.visual { overflow: auto; }
.visual svg, .visual img, .illus svg, .illus img, .prose img, .prose svg { max-width: 100%; height: auto; }
@media (max-width: 960px) { .side { flex-wrap: wrap; overflow: visible; } .side a { white-space: normal; padding: 8px 12px; } }
@media (max-width: 560px) {
  .hero h1 { font-size: clamp(2.3rem, 12vw, 3.6rem); line-height: .95; max-width: 100%; }
  .hero p.lead { font-size: 1.08rem; }
  .hero .wrap { padding-top: 64px; padding-bottom: 72px; }
  h1 { font-size: clamp(1.7rem, 7.6vw, 2.4rem); }
}
.pill { white-space: normal; max-width: 100%; }
td .pill, th .pill, .tile .pill, .side .pill { white-space: nowrap; }
.discover > *, .dash > *, .idea-body > *, .grid-2 > *, .cards > * { min-width: 0; }

/* v5: Visual studio palette picker */
.pal-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pal-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line, #d4d4d8); cursor: pointer; padding: 0; }
.pal-dot.on { outline: 3px solid var(--red, #E10600); outline-offset: 2px; }

/* v5: capital tiers, rush chips, disclaimer */
.tier-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.tier-lead { font-size: .85rem; font-weight: 700; flex-basis: 100%; }
.chip.tier { display: inline-flex; flex-direction: column; line-height: 1.15; padding: 8px 14px; border-radius: 14px; }
.chip.tier small { font-size: .7rem; font-weight: 500; opacity: .75; }
.chip.tier.rush { justify-content: center; background: var(--red, #E10600); color: #fff; border-color: transparent; }
.tier-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 18px; }
.tier-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line, #E4E4E7); border-radius: 16px; text-decoration: none; color: inherit; background: var(--surface, #fff); transition: transform .15s, border-color .15s; overflow-wrap: anywhere; }
.tier-card:hover { transform: translateY(-2px); border-color: var(--red, #E10600); }
.tier-card b { font-size: 1.15rem; }
.tier-card small { opacity: .8; }
.tier-n { width: 28px; height: 28px; border-radius: 50%; background: var(--ink, #0A0A0B); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.tier-card.t4 { background: var(--ink, #0A0A0B); color: #fff; } .tier-card.t4 .tier-n { background: var(--red, #E10600); }
.disc-back { position: fixed; inset: 0; background: rgba(10,10,11,.6); display: grid; place-items: center; z-index: 200; padding: 16px; }
.disc-box { max-width: 460px; width: 100%; background: var(--surface, #fff); color: var(--text, #0A0A0B); border-radius: 18px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.35); max-height: 90vh; overflow: auto; }
.disc-box h2 { margin: 0 0 8px; font-size: 1.3rem; }

/* v6: logo (bulb-as-i mark + stacked name) */
.logo { display: inline-flex; align-items: center; gap: .5em; height: var(--lh, 30px); color: #fff; white-space: nowrap; line-height: 1; }
.logo-mark { height: 100%; width: auto; flex: none; }
.logo-words { display: inline-flex; flex-direction: column; justify-content: center; gap: .12em; font-family: var(--display); }
.logo-words b { font-size: calc(var(--lh, 30px) * .56); font-weight: 800; letter-spacing: -.02em; }
.logo-words i { font-style: normal; font-size: calc(var(--lh, 30px) * .3); font-weight: 700; letter-spacing: .26em; color: var(--red, #E10600); }
html:not([data-theme="dark"]) .logo { color: var(--ink, #0A0A0B); }
@media (max-width: 520px) { .nav .brand .logo { --lh: 32px !important; gap: .4em; } .logo-words i { letter-spacing: .18em; } }
@media (max-width: 400px) { .nav .brand .logo { --lh: 28px !important; } .logo-words i { letter-spacing: .1em; } }
@media (max-width: 340px) { .nav .brand .logo { --lh: 24px !important; } .logo-words i { letter-spacing: .06em; } }
