:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e0d8;
  --navy: #0b2545;
  --accent: #0d9488;
  --accent-ink: #ffffff;
  --accent-soft: #ccfbf1;
  --danger: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121a2b; --ink: #e8edf5; --ink-2: #c3cddc; --muted: #8b98ab;
    --line: #243049; --navy: #0b2545; --accent: #2dd4bf; --accent-ink: #042f2e; --accent-soft: #134e4a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #121a2b; --ink: #e8edf5; --ink-2: #c3cddc; --muted: #8b98ab;
  --line: #243049; --accent: #2dd4bf; --accent-ink: #042f2e; --accent-soft: #134e4a; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); }
a { color: inherit; }
img, svg { max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap, .wrap-narrow { padding: 0 28px; } }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.2rem/1 var(--serif); letter-spacing: -.01em; color: var(--ink); }
.brand svg { flex: none; }
@media (max-width: 480px) { .brand span { font-size: 1.05rem; } .main-nav a { padding: 8px 8px; } }
.main-nav { display: flex; gap: 4px; }
.main-nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: .95rem; color: var(--ink-2); }
.main-nav a:hover { background: var(--surface); color: var(--ink); }

/* Hero */
.hero { padding: 56px 16px 32px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.hero h1 { font: 700 clamp(2rem, 5vw, 3.6rem)/1.08 var(--serif); letter-spacing: -.02em; max-width: 18ch; margin: 0 0 16px; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; margin: 0; }

/* Cards */
.section { padding: 40px 0 16px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.section-head h2 { font: 700 1.6rem/1.2 var(--serif); margin: 0; }
.section-head a { color: var(--accent); font-weight: 600; text-decoration: none; }
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease; }
.card:hover { transform: translateY(-2px); }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.card-art { aspect-ratio: 16/9; overflow: hidden; }
.card-body { padding: 18px 20px 22px; }
.card h3 { font: 700 1.25rem/1.25 var(--serif); margin: 6px 0 8px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--ink-2); font-size: .97rem; }
.meta { font-size: .84rem; color: var(--muted); }
.meta .cat { color: var(--accent); font-weight: 600; }
.lead-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .lead-grid { grid-template-columns: 1.7fr 1fr; } }
.card-big h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.card-big .card-art { aspect-ratio: 2/1; }

/* Art */
.art { display: block; width: 100%; height: 100%; color: #e2f3f1; }
.card-art, .article-art { background: radial-gradient(120% 120% at 20% 0%, #134e6f 0%, var(--navy) 55%, #06152b 100%); }
.cat-mri { background: radial-gradient(120% 120% at 80% 0%, #3b2a6b 0%, #1a1740 60%, #0b0b24 100%); }
.cat-ai-software, .cat-autonomous-imaging { background: radial-gradient(120% 120% at 50% 100%, #0f5c55 0%, #0b2f3a 55%, #061a22 100%); }
.cat-research { background: radial-gradient(120% 120% at 100% 100%, #1e4d7a 0%, #10284a 55%, #08142a 100%); }
.cat-industry-events { background: radial-gradient(120% 120% at 0% 100%, #6b3a12 0%, #3a1f0b 60%, #1f1006 100%); }

/* Magazine teaser */
.mag-teaser a { display: flex; gap: 18px; align-items: stretch; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); height: 100%; }
.mag-mini { flex: 0 0 150px; aspect-ratio: 210/297; border-radius: 6px; background: linear-gradient(160deg, #0b2545 0%, #134e6f 55%, #0d9488 100%); color: #fff; padding: 12px; display: flex; flex-direction: column; box-shadow: 0 10px 24px rgba(11,37,69,.35); }
.mag-mini-label { font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; opacity: .85; }
.mag-mini-title { font: 700 1.45rem/1 var(--serif); margin-top: 8px; }
.mag-mini-line { margin-top: auto; font-size: .7rem; line-height: 1.3; opacity: .92; }
.mag-teaser-text { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.mag-teaser-text h3 { font: 700 1.3rem/1.25 var(--serif); margin: 0 0 10px; }
.mag-mini { align-self: flex-start; }
.lead-grid .mag-teaser a { flex-direction: column; align-items: center; justify-content: center; padding: 28px; background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent-soft) 45%, var(--surface))); }
.lead-grid .mag-mini { flex: none; width: min(62%, 230px); align-self: center; padding: 16px; }
.lead-grid .mag-mini-title { font-size: 2.1rem; }
.lead-grid .mag-mini-line { font-size: .78rem; }
.lead-grid .mag-teaser-text { align-items: center; text-align: center; }
.mag-shelf { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }

/* Buttons & chips */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 10px 18px; font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none; width: fit-content; }
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-small { padding: 6px 12px; font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.chip { text-decoration: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: .88rem; color: var(--ink-2); background: var(--surface); text-transform: capitalize; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Pages */
.page-head { padding: 48px 16px 8px; }
.page-head h1 { font: 700 clamp(2rem, 4vw, 2.8rem)/1.1 var(--serif); margin: 0 0 10px; letter-spacing: -.02em; }
.empty { color: var(--muted); padding: 40px 0; }

/* Article */
.article-head { padding-top: 48px; }
.cat-link { color: var(--accent); font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; }
.article-head h1 { font: 700 clamp(2rem, 4.4vw, 3rem)/1.1 var(--serif); letter-spacing: -.02em; margin: 10px 0 14px; }
.article-head .meta { margin: 16px 0 6px; }
.article-art { border-radius: var(--radius); overflow: hidden; aspect-ratio: 21/9; margin: 22px auto 8px; padding: 0 !important; max-width: 712px; }
@media (min-width: 720px) { .article-art { max-width: 704px; } }
.prose { padding-top: 16px; padding-bottom: 8px; }
.prose h2 { font: 700 1.55rem/1.25 var(--serif); margin: 2em 0 .5em; letter-spacing: -.01em; }
.prose h3 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
.prose p, .prose li { color: var(--ink-2); }
.prose a { color: var(--accent); }
.prose blockquote { margin: 1.5em 0; padding: 4px 20px; border-left: 4px solid var(--accent); font: 500 1.2rem/1.5 var(--serif); color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; font-size: .93rem; margin: 1.4em 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 700; color: var(--ink); background: var(--surface); }
.prose .keypoints, .prose .callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 20px; margin: 1.6em 0; }
.prose .keypoints ul { margin: 6px 0; padding-left: 20px; }
.sources { margin-top: 24px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .9rem; }
.sources h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.sources a { color: var(--ink-2); word-break: break-word; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px auto; }
.tag { background: var(--accent-soft); color: var(--ink); padding: 3px 10px; border-radius: 999px; font-size: .8rem; }

/* Share */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.share-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-right: 4px; }
.share-btn { font: 500 .85rem var(--sans); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; cursor: pointer; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Forms */
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
.form small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: 400 1rem var(--sans); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.mono { font: 400 .9rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .span2 { grid-column: span 2; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { flex-direction: row !important; align-items: flex-start; font-weight: 400 !important; }
.consent input { width: auto; margin-top: 4px; }
.form-msg { font-weight: 600; min-height: 1.4em; }
.form-msg.ok { color: var(--accent); }
.form-msg.err, .error { color: var(--danger); }

.correction { margin: 32px 0 48px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 22px; }
.correction summary { cursor: pointer; list-style: none; padding: 16px 0; }
.correction summary::-webkit-details-marker { display: none; }
.correction summary h2 { font: 700 1.2rem var(--serif); margin: 0; display: inline; }
.correction summary h2::after { content: " ＋"; color: var(--accent); }
.correction details[open] summary h2::after { content: " －"; }
.correction summary span { display: block; color: var(--muted); font-size: .92rem; }
.correction form { padding-bottom: 20px; }

/* Footer */
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0 24px; font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.footer-inner p { margin: 4px 0 0; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.fineprint { margin-top: 20px; color: var(--muted); font-size: .8rem; }

/* Magazine toolbar */
.mag-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; padding-top: 40px; }
.mag-toolbar h1 { font: 700 clamp(1.7rem, 3.5vw, 2.4rem)/1.1 var(--serif); margin: 0; }
.preview-banner { background: #f59e0b; color: #1c1917; text-align: center; font-weight: 700; padding: 6px; }

/* ---------- Admin ---------- */
body.admin { font-size: 15px; }
.admin-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 20px; background: var(--navy); color: #fff; }
.admin-bar .brand { color: #fff; font-family: var(--sans); font-size: 1rem; }
.admin-bar .brand span { opacity: .65; font-weight: 500; margin-left: 4px; }
.admin-bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.admin-bar nav a, .linklike { color: #dbe7f5; text-decoration: none; padding: 6px 10px; border-radius: 8px; font: 500 .9rem var(--sans); background: none; border: 0; cursor: pointer; }
.admin-bar nav a:hover, .linklike:hover { background: rgba(255,255,255,.1); color: #fff; }
.admin-bar form { margin: 0; }
.admin-main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.admin-head h1 { margin: 0; font-size: 1.6rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; color: var(--muted); font-size: .88rem; }
.stat span { display: block; font-size: 1.9rem; font-weight: 700; color: var(--ink); }
.stat-alert span { color: var(--danger); }
.two-col { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: 2fr 1fr; } }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table td a { color: var(--ink); font-weight: 500; }
.right { text-align: right; }
.badge { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; background: var(--line); color: var(--ink-2); }
.badge-published, .badge-resolved { background: #dcfce7; color: #166534; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-new { background: #fee2e2; color: #991b1b; }
.badge-reviewed { background: #dbeafe; color: #1e40af; }
.muted { color: var(--muted); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.flash { background: var(--accent-soft); border: 1px solid var(--accent); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.editor { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .editor { grid-template-columns: 1fr 300px; align-items: start; } .editor-side { position: sticky; top: 16px; } }
.danger-zone { margin-top: 24px; }
.corr-head { display: flex; justify-content: space-between; gap: 12px; }
.corr blockquote { margin: 10px 0; padding: 10px 14px; background: var(--bg); border-radius: 8px; border-left: 3px solid var(--accent); }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select { width: auto; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(100%, 380px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; font-size: 1.4rem; }
.login-card p { margin: 0; color: var(--muted); }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }

/* ---------- Editor ---------- */
.editor-hero { background: radial-gradient(80% 120% at 85% 0%, #134e6f 0%, var(--navy) 55%, #06152b 100%); color: #fff; padding: 56px 0 48px; }
.editor-hero-inner { display: grid; gap: 32px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 760px) { .editor-hero-inner { grid-template-columns: 260px 1fr; gap: 48px; } }
.editor-photo-wrap { width: min(220px, 60vw); aspect-ratio: 1; border-radius: 50%; padding: 6px; background: conic-gradient(from 200deg, #2dd4bf, #0d9488, #134e6f, #2dd4bf); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
@media (min-width: 760px) { .editor-photo-wrap { width: 260px; } }
.editor-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; background: #0b2545; }
.editor-hero .eyebrow { color: #5eead4; }
.editor-hero h1 { font: 700 clamp(2.2rem, 5vw, 3.6rem)/1.05 var(--serif); letter-spacing: -.02em; margin: 0 0 8px; }
.editor-title { margin: 0 0 16px; color: #a7f3d0; font-weight: 600; letter-spacing: .02em; }
.editor-hero .lede { color: #dbe7f5; max-width: 62ch; }
.editor-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.editor-badges span { border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 5px 14px; font-size: .82rem; font-weight: 600; color: #fff; background: rgba(255,255,255,.06); }
.editor-bio { padding-top: 40px; }
.editor-bio p { font-size: 1.06rem; }
.editor-bio strong { color: var(--ink); }
.cred-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.cred { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.cred b { font: 700 1.05rem/1.3 var(--serif); }
.cred span { color: var(--muted); font-size: .92rem; }
.small-head { font: 700 1.2rem var(--serif); margin: 0 0 8px; }

.book { display: grid; grid-template-columns: 110px 1fr; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.book-cover { display: block; }
.book-cover img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; box-shadow: 0 8px 22px rgba(15,23,42,.25); background: var(--line); display: block; }
.book h3 { font: 700 1.15rem/1.3 var(--serif); margin: 0 0 4px; }
.book h3 a { text-decoration: none; }
.book-pub { color: var(--accent); font-weight: 600; font-size: .88rem; margin: 0 0 8px; }
.book p { color: var(--ink-2); font-size: .94rem; margin: 0 0 12px; }
.book-featured { grid-template-columns: 1fr; margin-bottom: 22px; background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--accent-soft) 55%, var(--surface)) 100%); padding: 28px; }
@media (min-width: 720px) { .book-featured { grid-template-columns: 220px 1fr; gap: 36px; align-items: center; } }
.book-featured .book-cover { max-width: 220px; }
.book-featured h3 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
.book-featured p { font-size: 1.02rem; }
.book-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); }

.editor-strip { display: grid; gap: 22px; grid-template-columns: 1fr; align-items: center; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
@media (min-width: 860px) { .editor-strip { grid-template-columns: 120px 1fr 300px; } }
.editor-strip-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid var(--accent-soft); }
.editor-strip h2 { font: 700 1.6rem/1.2 var(--serif); margin: 4px 0 6px; }
.editor-strip p { margin: 0 0 8px; color: var(--ink-2); }
.link-arrow { color: var(--accent); font-weight: 600; }
.editor-strip-books { display: flex; gap: 10px; justify-content: flex-start; }
.editor-strip-books img { width: 30%; max-width: 90px; aspect-ratio: 2/3; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 16px rgba(15,23,42,.25); }
.monogram { display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, #1f6f8b 0%, #0b2545 70%); color: #fff; }
.monogram span { font: 700 clamp(2rem, 9vw, 5.2rem)/1 var(--serif); letter-spacing: .02em; background: linear-gradient(180deg, #fff 0%, #99f6e4 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.editor-strip-photo.monogram span { font-size: 2.6rem; }
.editor-strip-photo.monogram { border-color: var(--accent-soft); }
@media (max-width: 520px) { .header-inner { gap: 8px; } .main-nav { gap: 0; } .main-nav a { padding: 6px 7px; font-size: .86rem; } }
@media (max-width: 420px) { .brand span { display: none; } }

/* Research digest */
.section-sub { color: var(--muted); margin: -.4rem 0 1.2rem; max-width: 60ch; }
.paper-box { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 1rem 1.2rem; margin: 1.4rem 0; background: var(--surface, transparent); }
.paper-box p { margin: .3rem 0; }
