/* inputoutput.cloud News: iOS-style grouped layout. Warm off-whites, never pure white. */
:root {
  --bg: #f3eee5; --card: #fbf8f2; --fill: rgba(60, 48, 30, 0.07); --fill-2: rgba(60, 48, 30, 0.12);
  --ink: #1f2433; --ink-2: #4a4f5e; --ink-3: #77726a; --sep: rgba(31, 36, 51, 0.12);
  --accent: #b05a14; --accent-ink: #fbf6ee; --shadow: 0 1px 2px rgba(60, 48, 30, 0.06), 0 6px 18px rgba(60, 48, 30, 0.06);
  --ph-a: #e7dccb; --ph-b: #d9cbb5; --ph-ink: rgba(31, 36, 51, 0.45);
  --bar: rgba(243, 238, 229, 0.82);
  --chip-on: #fbf8f2; --accent-soft: rgba(176, 90, 20, 0.1); --live: #2f9e5b; --ini-ink: #2a2620;
  --r: 18px; --r-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121626; --card: #1d2338; --fill: rgba(245, 239, 228, 0.07); --fill-2: rgba(245, 239, 228, 0.13);
    --ink: #f5efe4; --ink-2: #d4cbbc; --ink-3: #a29a8c; --sep: rgba(245, 239, 228, 0.12);
    --accent: #ffb46b; --accent-ink: #1a1408; --shadow: none;
    --ph-a: #262d46; --ph-b: #1f2540; --ph-ink: rgba(245, 239, 228, 0.4);
    --bar: rgba(18, 22, 38, 0.82);
    --chip-on: #3a4263; --accent-soft: rgba(255, 180, 107, 0.14); --live: #5fd08a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
.wrap { width: min(1200px, 100% - 32px); margin: 0 auto; }
.dot { margin: 0 6px; color: var(--ink-3); }

.topbar { position: sticky; top: 0; z-index: 10; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 0.5px solid var(--sep); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.topbar-link { font-size: 15px; color: var(--accent); font-weight: 600; }

.chips-bar { padding-top: 14px; }
.chips { list-style: none; display: flex; gap: 2px; margin: 0; padding: 3px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--fill); border-radius: 12px; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: block; padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; line-height: 20px; }
.chip:hover { color: var(--ink); }
.chip[aria-current="page"] { background: var(--chip-on); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

.main { padding: 24px 0 56px; }
.page-head { margin-bottom: 24px; }
.page-head h1, .story h1 { font-size: clamp(32px, 5vw, 44px); line-height: 1.08; font-weight: 800; letter-spacing: -0.025em; }
.sub { margin: 8px 0 0; color: var(--ink-3); font-size: 15px; }
.eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.eyebrow a { color: var(--accent); }
.section { margin-top: 40px; }
.section:first-of-type { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 24px; font-weight: 750; }
.see-all { font-size: 15px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.empty { color: var(--ink-3); }

.meta { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); line-height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.meta .dot { margin: 0 5px; }
.meta .src, .meta .cat { font-weight: 600; color: var(--ink-2); }
.meta .trend { color: var(--accent); font-weight: 600; }

/* Media: placeholder behind, image on top; a failed image removes itself. */
.media { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--ph-a), var(--ph-b)); aspect-ratio: 16 / 9; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--ph-ink); font-weight: 700; font-size: 15px; letter-spacing: 0.01em; }
.thumb .ph { font-size: 10px; padding: 6px; }

/* Lead story */
.lead { margin-bottom: 16px; }
.lead-link { display: grid; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.lead-body { padding: 14px 16px 16px; }
.lead h3 { font-size: clamp(22px, 3vw, 30px); line-height: 1.15; font-weight: 750; }
.lead-sum { margin: 8px 0 0; color: var(--ink-2); font-size: 16px; line-height: 1.45; }
@media (min-width: 820px) {
  .lead-link { grid-template-columns: 3fr 2fr; }
  .lead-media { aspect-ratio: auto; min-height: 340px; }
  .lead-body { padding: 28px; align-self: center; }
}

/* Cards: image on top (wide screens), compact rows on phones */
.cards, .tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.card a, .tile a { display: flex; height: 100%; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.card h3, .tile h3 { font-size: 16px; line-height: 1.3; font-weight: 650; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card a:hover h3, .tile a:hover h3, .lead-link:hover h3 { color: var(--accent); }
.card a { flex-direction: row-reverse; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; }
.card-media { flex: 0 0 88px; width: 88px; aspect-ratio: 1; border-radius: var(--r-sm); }
.card-body { flex: 1; min-width: 0; }
.tile a { align-items: center; gap: 12px; padding: 12px 12px 12px 16px; }
.tile-body { flex: 1; min-width: 0; }
.thumb { flex: 0 0 88px; width: 88px; aspect-ratio: 1; border-radius: var(--r-sm); }
@media (min-width: 700px) {
  .cards, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { gap: 16px; }
  .card a { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
  .card-media { flex: none; width: 100%; aspect-ratio: 16 / 9; border-radius: 0; }
  .card-body { padding: 14px 16px 16px; }
  .card h3 { font-size: 17px; }
}
@media (min-width: 1100px) {
  .cards, .tiles:not(.two) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; background: var(--fill); color: var(--ink-2); }
.badge.cov { background: var(--accent-soft); color: var(--accent); }
.badge.buzz::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); margin-right: 6px; }

/* Story page */
.story, .narrow { max-width: 760px; }
.story .byline { margin: 12px 0 0; color: var(--ink-3); font-size: 15px; }
.story .byline a { color: var(--ink-2); font-weight: 600; }
.story .badges { margin-top: 12px; }
.story .badge { height: 26px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.hero { margin-top: 20px; border-radius: var(--r); }
.group { margin-top: 28px; }
.group-title { margin: 0 0 8px 16px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.inset { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.points { list-style: none; margin: 0; padding: 0 0 0 16px; }
.points li { position: relative; padding: 14px 16px 14px 18px; }
.points li + li { border-top: 0.5px solid var(--sep); }
.points li::before { content: ""; position: absolute; left: 0; top: 23px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.points p { margin: 0; font-size: 17px; line-height: 1.5; }
.credit { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.why { margin-top: 12px; padding: 14px 16px; }
.why h3 { font-size: 15px; font-weight: 700; }
.why p { margin: 4px 0 0; color: var(--ink-2); }
.note { margin: 8px 16px 0; font-size: 13px; color: var(--ink-3); }
.quote { margin: 0; padding: 16px; }
.quote figcaption { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.quote blockquote { margin: 8px 0 0; padding-left: 14px; border-left: 3px solid var(--accent); }
.quote p { margin: 0; color: var(--ink-2); font-style: italic; }
.rows { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.rows a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.rows a:hover { background: var(--fill); }
.rows a { position: relative; }
.rows li + li a::before { content: ""; position: absolute; top: 0; left: 84px; right: 0; height: 0.5px; background: var(--sep); }
.ini { position: relative; flex: 0 0 56px; width: 56px; height: 56px; border-radius: var(--r-sm); display: grid; place-items: center; overflow: hidden; font-size: 17px; font-weight: 750; letter-spacing: 0.02em; color: var(--ini-ink); align-self: flex-start; }
.ini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.h0 { background: #e9c9a4; } .h1 { background: #cfd9c2; } .h2 { background: #c9d3e3; }
.h3 { background: #e6c6c6; } .h4 { background: #dccfe4; } .h5 { background: #e4dbb8; }
.row-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-src { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.row-title { font-size: 16px; line-height: 1.3; font-weight: 600; }
.row-sum { font-size: 14px; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chev { color: var(--ink-3); font-size: 22px; line-height: 1; }
.cta-wrap { margin: 20px 0 0; }
.cta { display: flex; justify-content: center; align-items: center; min-height: 52px; padding: 14px 20px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 650; font-size: 17px; text-align: center; }
.cta:hover { filter: brightness(1.06); }
.related { margin-top: 48px; }

.foot { border-top: 0.5px solid var(--sep); padding: 24px 0 40px; color: var(--ink-3); font-size: 13px; }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) { .card a, .tile a, .lead-link { transition: transform 0.15s; } .card a:active, .tile a:active, .lead-link:active { transform: scale(0.985); } }
