@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  --bg: #fbfbf9; --card: #ffffff; --ink: #13343b; --ink-2: #47595e; --ink-3: #7b898d;
  --line: #e7e8e3; --chip: #f1f2ee; --accent: #1f7f8c; --accent-soft: #e2f0f1; --danger: #b3402f;
  --shadow: 0 1px 2px rgb(19 52 59 / .05);
  --serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --scale: 1;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161818; --card: #1f2121; --ink: #e9ecea; --ink-2: #b4bcba; --ink-3: #828b89;
    --line: #2e3131; --chip: #2a2d2d; --accent: #33b1bf; --accent-soft: #17393d; --danger: #ef8a78;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161818; --card: #1f2121; --ink: #e9ecea; --ink-2: #b4bcba; --ink-3: #828b89;
  --line: #2e3131; --chip: #2a2d2d; --accent: #33b1bf; --accent-soft: #17393d; --danger: #ef8a78;
  --shadow: none; color-scheme: dark;
}
:root[data-size="s"] { --scale: .93; }
:root[data-size="l"] { --scale: 1.12; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.i { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.bar { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 9px; font: 500 21px/1 var(--serif); letter-spacing: -.01em; }
.logo { width: 26px; height: 26px; display: block; }
.top-actions { display: flex; gap: 2px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--chip); }
.spin .i { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.desk { display: none; }

.tabs { max-width: 1240px; margin: 0 auto; display: flex; gap: 22px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; flex: none; padding: 7px 0 11px; font-size: 15px; font-weight: 500; color: var(--ink-3); }
.tabs a.on { color: var(--ink); }
.tabs a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px; }

.page { max-width: 1240px; margin: 0 auto; padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.page.single { max-width: 820px; }
.main { min-width: 0; }
.rail { display: none; }
.page-title { font: 500 32px/1.15 var(--serif); letter-spacing: -.015em; margin: 8px 0 18px; }

.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.grid > .sentinel { grid-column: 1 / -1; height: 1px; }
.hero { margin-bottom: 14px; display: flex; flex-direction: column-reverse; }
.pic { position: relative; aspect-ratio: 3 / 2; background: var(--chip); border-radius: 13px 13px 0 0; overflow: hidden; }
.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; display: block; }
@media (max-width: 679px) { .card > .no-photo { display: none; } }
.tile { position: absolute; inset: 0; display: grid; place-items: center; }
.tile .fav { width: 34px; height: 34px; border-radius: 9px; opacity: .92; }
.c-ai { background: linear-gradient(135deg, #d9eef0, #a9d4da); }
.c-tech { background: linear-gradient(135deg, #e0e6f3, #b4c2de); }
.c-singapore { background: linear-gradient(135deg, #f6e1dd, #e4b5ac); }
.c-business { background: linear-gradient(135deg, #e7ecd9, #c2cea2); }
.c-world { background: linear-gradient(135deg, #e6e3ee, #beb7d2); }
.c-science { background: linear-gradient(135deg, #dcf0e6, #a8d6bf); }
.c-sport { background: linear-gradient(135deg, #f7ecd1, #e6cd8e); }
.c-culture { background: linear-gradient(135deg, #f4dfe9, #dfb0c6); }

.card-copy, .hero-copy { padding: 13px 16px 10px; }
.card h3 { font: 450 calc(21px * var(--scale))/1.27 var(--serif); letter-spacing: -.005em; }
.hero h2 { font: 450 calc(27px * var(--scale))/1.17 var(--serif); letter-spacing: -.012em; }
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: 14px; z-index: 2; }
.dek { margin-top: 6px; color: var(--ink-2); font: calc(16px * var(--scale))/1.42 var(--serif); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.read h3, .card.read h2 { color: var(--ink-3); }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; min-height: 36px; }
.meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.500px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.src { overflow: hidden; text-overflow: ellipsis; }
.meta time { flex: none; }
.dot { flex: none; }
.stack { display: inline-flex; flex: none; }
.fav { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 1.500px solid var(--card); display: inline-block; }
.stack .fav + .fav { margin-left: -6px; }
.acts { position: relative; z-index: 3; display: flex; align-items: center; flex: none; margin-right: -7px; }
.act { width: 34px; height: 36px; display: grid; place-items: center; color: var(--ink-3); border-radius: 8px; list-style: none; cursor: pointer; }
.act::-webkit-details-marker { display: none; }
.act .i { width: 18px; height: 18px; }
.act:hover { color: var(--ink); }
.act.on { color: var(--accent); }
.act.on .i { fill: currentColor; }
.more { position: relative; }
.menu { position: absolute; right: 0; bottom: 40px; width: 220px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / .18); z-index: 20; }
.menu a, .menu button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; font-size: 14.500px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu a:hover, .menu button:hover { background: var(--chip); }
.menu .i { width: 17px; height: 17px; color: var(--ink-3); }

.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; font-weight: 500; color: var(--ink-3); }
.bottom a.on { color: var(--accent); }

.brief, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; box-shadow: var(--shadow); }
.brief-inline { margin-bottom: 14px; }
.brief { background: var(--accent-soft); border-color: transparent; }
.brief-head { display: flex; flex-direction: column; gap: 1px; margin-bottom: 9px; }
.brief-head strong { font: 500 21px/1.2 var(--serif); }
.brief-head span { font-size: 13px; color: var(--ink-2); }
.brief li { position: relative; padding-left: 14px; font: calc(16.500px * var(--scale))/1.4 var(--serif); }
.brief li + li { margin-top: 7px; }
.brief li::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.panel h4 { font-size: 14px; font-weight: 600; margin-bottom: 9px; }
.panel p { font-size: 14.500px; color: var(--ink-2); }
.connect .btn { margin-top: 11px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--chip); border-radius: 999px; font-size: 14px; }
.chip button { font-size: 17px; line-height: 1; color: var(--ink-3); padding: 0 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 18px; border-radius: 11px; background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 550; }
.btn:disabled { opacity: .55; }
.btn .i { width: 17px; height: 17px; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.link { color: var(--ink-3); font-size: 14.500px; text-decoration: underline; padding: 12px 0; }
.empty { text-align: center; padding: 56px 20px; color: var(--ink-2); }
.empty h2 { font: 500 24px/1.2 var(--serif); color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; color: var(--ink-3); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font-size: 16px; }

.story-wrap { max-width: 720px; margin: 0 auto; padding: 18px 16px calc(106px + env(safe-area-inset-bottom)); }
.story h1 { font: 450 calc(35px * var(--scale))/1.13 var(--serif); letter-spacing: -.016em; }
.story-meta { display: flex; align-items: center; gap: 7px; margin: 13px 0; font-size: 14px; color: var(--ink-2); }
.when { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); }
.when .i { width: 15px; height: 15px; }
.story-pic { position: relative; margin-bottom: 16px; }
.story-pic .pic { border-radius: 12px; aspect-ratio: 16 / 10; }
.credit { position: absolute; z-index: 2; right: 10px; bottom: 9px; color: #fff; font-size: 12.500px; font-weight: 500; text-shadow: 0 1px 4px rgb(0 0 0 / .7); }
.byline { font-size: 13.500px; color: var(--ink-3); margin-bottom: 6px; }
.lede { font: calc(20px * var(--scale))/1.42 var(--serif); }
.why { margin-top: 16px; padding: 13px 15px; background: var(--accent-soft); border-radius: 12px; }
.why strong { font-size: 13.500px; font-weight: 600; color: var(--accent); }
.why p { margin-top: 3px; font: calc(17.500px * var(--scale))/1.42 var(--serif); }
.sec { font-size: 17px; font-weight: 600; margin: 27px 0 11px; }
.points { padding-left: 21px; list-style: disc; }
.points li, .prose p { font: calc(19px * var(--scale))/1.5 var(--serif); }
.points li + li, .prose p + p { margin-top: 11px; }
.points li::marker { color: var(--ink-3); }
.prose { margin-top: 18px; }
.cite { display: inline-block; vertical-align: 1px; margin-left: 2px; padding: 0 6px; background: var(--chip); border-radius: 5px; font: 500 11.500px/1.65 ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink-2); }
.read-row { display: flex; align-items: center; gap: 4px; margin-top: 24px; }
.read-row .btn { margin-right: auto; }
.read-row .act { width: 44px; height: 44px; }
.asks { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sources li { border-top: 1px solid var(--line); }
.sources li:last-child { border-bottom: 1px solid var(--line); }
.sources a { display: flex; align-items: center; gap: 11px; padding: 11px 0; }
.sources .fav { flex: none; width: 22px; height: 22px; }
.sources span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sources b { font-size: 14.500px; font-weight: 600; }
.sources em { font-style: normal; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sources .i { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.scroller { display: flex; gap: 11px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; scroll-snap-type: x proximity; }
.scroller::-webkit-scrollbar { display: none; }
.mini { flex: none; width: 188px; scroll-snap-align: start; scroll-margin-left: 16px; }
.mini .pic { border-radius: 11px; aspect-ratio: 3 / 2; margin-bottom: 7px; }
.mini strong { font: 500 15.500px/1.28 var(--serif); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.askbar { position: fixed; z-index: 30; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(720px, calc(100vw - 20px)); display: flex; align-items: center; gap: 1px; padding: 5px 7px 5px 3px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 28px rgb(0 0 0 / .14); }
.askbar input[type="text"] { flex: 1; min-width: 0; height: 40px; background: none; border: 0; outline: 0; font-size: 16px; padding: 0 4px; }
.send { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; margin-left: 3px; }

.settings .panel { margin-bottom: 14px; padding: 17px 16px; scroll-margin-top: 70px; }
.settings h2 { font: 500 22px/1.2 var(--serif); margin-bottom: 7px; }
.settings h3 { font-size: 14px; font-weight: 600; margin: 19px 0 8px; }
.status { font-weight: 600; color: var(--ink) !important; margin-bottom: 4px; }
.hint { font-size: 13.500px !important; color: var(--ink-3) !important; margin-top: 8px; }
.field { display: block; font-size: 14px; font-weight: 500; margin: 13px 0; }
select, input:not([type]), input[type="text"], input[type="password"], textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: 16px; }
.field select { display: block; width: 100%; height: 44px; margin-top: 5px; padding: 0 10px; }
.add { display: flex; gap: 7px; margin-top: 10px; }
.add input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; }
.add select { width: 94px; height: 40px; padding: 0 6px; flex: none; }
[data-notes] textarea { display: block; width: 100%; padding: 10px 12px; resize: vertical; margin-bottom: 8px; }
.form-error { color: var(--danger) !important; font-size: 14px !important; margin-top: 8px; }
.outlets { margin-top: 13px; }
.outlets li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.outlets li.muted b { color: var(--ink-3); }
.outlets .fav { flex: none; width: 22px; height: 22px; }
.s-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s-name b { font-size: 15px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-name small { font-size: 12.500px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-name small.bad { color: var(--danger); }
.x { width: 24px; height: 32px; color: var(--ink-3); font-size: 19px; flex: none; }
.seg { display: inline-flex; padding: 3px; background: var(--chip); border-radius: 10px; }
.seg button { padding: 6px 13px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.seg.tiny { flex: none; }
.seg.tiny button { padding: 0; width: 34px; height: 30px; display: inline-grid; place-items: center; font-size: 12.500px; }
.seg.tiny .i { width: 15px; height: 15px; }
.seg.tiny button.on:first-child { color: var(--accent); }
.seg.tiny button.on:first-child .i { fill: currentColor; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 15px; }

.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login .logo { width: 44px; height: 44px; }
.login h1 { font: 500 30px/1.2 var(--serif); margin: 14px 0 20px; }
.login form { width: min(320px, 100%); display: flex; flex-direction: column; gap: 10px; }
.login input[type="password"] { height: 48px; padding: 0 14px; }

@media (min-width: 680px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom { display: none; }
  .page { padding-bottom: 40px; }
  .desk { display: grid; }
  .story-wrap { padding-top: 30px; }
  .story h1 { font-size: calc(44px * var(--scale)); }
  .asks { flex-direction: row; flex-wrap: wrap; }
  .hero { flex-direction: row; align-items: stretch; background: none; border: 0; box-shadow: none; gap: 24px; margin-bottom: 24px; }
  .hero-copy { flex: 1; min-width: 0; padding: 0; display: flex; flex-direction: column; }
  .hero h2 { font-size: calc(38px * var(--scale)); line-height: 1.12; }
  .hero .dek { font-size: calc(18px * var(--scale)); margin-top: 11px; }
  .hero .foot { margin-top: auto; padding-top: 12px; }
  .hero-pic { flex: 1; min-width: 0; border-radius: 13px; aspect-ratio: 16 / 10; }
}
@media (min-width: 1040px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1180px) {
  .page:not(.single) { grid-template-columns: minmax(0, 1fr) 300px; }
  .rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 118px; align-self: start; }
  .brief-inline { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1400px) {
  .page:not(.single) { max-width: 1380px; }
  .bar, .tabs { max-width: 1380px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (hover: none) { .icon-btn:hover { background: none; } }
@media (prefers-reduced-motion: reduce) { .spin .i { animation: none; } }
