/* Visual adaptation of shir-man.com/homepage: dark surfaces, compact tabs,
   centered feed and blue numbered cards. No third-party code or assets. */
:root {
  color-scheme: dark;
  --paper: #05070d;
  --card: #090d16;
  --ink: #f7f9fc;
  --muted: #9aa6b6;
  --line: rgba(148, 163, 184, .18);
  --blue: #2f81f7;
  --teal: #6ee7b7;
  --red: #fca5a5;
}
html { scroll-padding-top: 100px; }
body { background: var(--paper); color: var(--ink); font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; }
a { color: #a9cbff; text-decoration: none; }
a:hover { color: white; }
button, .button { border: 1px solid rgba(148, 163, 184, .22); border-radius: 8px; background: var(--blue); padding: 9px 14px; font-size: 12px; font-weight: 600; gap: 12px; }
button:hover, .button:hover { background: #1f6feb; }
button.secondary { background: #152239; color: #a9cbff; }
button.quiet { background: transparent; border: 0; color: var(--muted); }
:focus-visible { outline: 2px solid #71aaff; outline-offset: 4px; }
.masthead { position: sticky; top: 0; z-index: 10; background: rgba(5, 7, 13, .96); backdrop-filter: blur(16px); padding: 24px 32px 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand-group { min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; width: fit-content; }
.brand-mark, .overview-icon { display: grid; place-items: center; color: white; background: linear-gradient(135deg, #8ab5ff, #2f81f7); border-radius: 8px; box-shadow: 0 0 18px #2f81f72b; }
.brand-mark { width: 28px; height: 28px; font-size: 23px; transform: rotate(-6deg); }
.masthead h1 { font-size: 13px; letter-spacing: .2em; font-weight: 700; }
.masthead .brand-status { margin: 7px 0 0; font-size: 9px; color: var(--muted); letter-spacing: .16em; }
.top-tabs { display: flex; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.top-tabs a { display: block; padding: 8px 13px; border-radius: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.top-tabs a[aria-current] { background: var(--blue); color: white; box-shadow: 0 0 14px #2f81f730; }
.top-tabs a:hover:not([aria-current]) { background: #182234; color: white; }
.status-card { justify-self: end; align-self: center; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 5px 12px; font-size: 11px; gap: 9px; }
.session-dot, .feed-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #6ee7b7; }
.status-card strong { font-weight: 500; }
main { max-width: none; margin: 0 auto; padding: 0 32px; }
.feed-search-wrap { max-width: 800px; margin: 6px auto 28px; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid rgba(255,255,255,.06); padding: 10px 16px; border-radius: 12px; color: var(--muted); }
.feed-search-wrap > span:first-child { font-size: 22px; line-height: 1; }
.feed-search-wrap input { width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; }
.feed-search-wrap input::placeholder { color: var(--muted); }
.search-hint { border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eyebrow { font-size: 10px; color: var(--muted); font-weight: 500; letter-spacing: .17em; }
.overview > .eyebrow { margin: 0 4px 12px; }
.overview-surface { min-height: 184px; border: 1px solid rgba(255,255,255,.06); border-radius: 16px; background: var(--card); display: flex; justify-content: center; align-items: center; gap: clamp(40px, 7vw, 120px); padding: 32px; }
.overview-copy { display: flex; align-items: flex-start; gap: 16px; }
.overview-icon { width: 38px; height: 38px; font-size: 29px; flex-shrink: 0; margin-top: 3px; }
.overview-copy h2 { font-size: 19px; line-height: 1.35; letter-spacing: -.02em; margin: 0; font-weight: 650; }
.overview-copy h2 span { color: #c2cede; }
.overview-copy p { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.overview-stats { display: grid; grid-template-columns: auto auto; gap: 16px 30px; }
.overview-stats > div { display: grid; gap: 3px; }
.overview-stats strong { font-size: 26px; font-weight: 600; line-height: 1; }
.overview-stats > div span { color: var(--muted); font-size: 10px; }
.overview-stats .button { grid-column: 1 / -1; background: #203f75; }
.overview-stats .button:hover { background: var(--blue); }
.material-feed { width: min(800px, 100%); margin: 64px auto 0; background: var(--card); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; overflow: hidden; box-shadow: 0 14px 30px rgba(2,8,23,.22); }
.feed-heading { background: #112440; border-bottom: 1px solid #2f81f7; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feed-heading > span:last-child { color: #a7b4c7; letter-spacing: .16em; font-size: 10px; }
.feed-dot { margin-left: 10px; background: var(--blue); box-shadow: 0 0 10px #2f81f7; }
.feed-chip { background: rgba(47,129,247,.2); color: #a9cbff; border: 1px solid rgba(148,163,184,.25); border-radius: 99px; padding: 4px 12px; letter-spacing: .12em; font-size: 10px; }
.feed-subheading { padding: 14px 18px 6px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; }
.source-chip { border: 1px solid rgba(249,115,22,.25); border-radius: 5px; background: rgba(251,146,60,.12); color: #fed7aa; padding: 5px 8px; }
.feed-cards { padding: 8px 16px; display: grid; gap: 10px; }
.feed-card { display: flex; gap: 14px; border: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.02); border-radius: 14px; padding: 17px 15px; transition: background .15s, border-color .15s; }
.feed-card:hover { background: rgba(255,255,255,.045); border-color: rgba(148,163,184,.3); }
.rank-chip { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; background: var(--blue); color: white; font-size: 11px; font-weight: 600; border-radius: 50%; }
.feed-card-body { flex: 1; min-width: 0; }
.feed-card h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.5; }
.feed-card h3 a { color: var(--ink); }
.feed-card h3 a:hover { color: #a9cbff; }
.feed-description { margin: 7px 0 12px; color: #aebaca; font-size: 12px; }
.feed-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); font-size: 10px; }
.publisher-chip { font-size: 9px; letter-spacing: .1em; padding: 3px 6px; border-radius: 4px; background: rgba(99,115,129,.18); color: #cad6e5; overflow-wrap: anywhere; }
.evidence-link { margin-left: auto; color: #8cb9ff; }
.feed-pagination { padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.feed-pagination > div { display: flex; gap: 16px; }
.feed-empty { padding: 28px; color: var(--muted); }
main > footer { max-width: 800px; margin: 24px auto; font-size: 10px; color: #8996a9; line-height: 1.7; }
.workspace { max-width: 1380px; margin: 20px auto; }
.flow-nav { top: 83px; background: rgba(5,7,13,.96); border-bottom: 1px solid var(--line); }
.flow-nav a { background: var(--card); color: #a9cbff; font-size: 12px; font-weight: 500; }
.panel, .login-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; }
.panel h2 { font-size: 20px; font-weight: 600; }
.panel h3 { font-size: 15px; }
.notice, .compare-box { background: #101e33; color: #bbcde6; border-color: #273c59; border-radius: 10px; }
.error { background: #2a151d; color: var(--red); border-color: #69353e; }
.form-card, .edit-form, .trace-card, .digest-card, .compare-card, .job-row { background: #0e1521; border-color: var(--line); border-radius: 10px; }
.form-card label, .edit-form label { color: #c2cede; font-size: 12px; font-weight: 500; }
.form-card input, .form-card select, .edit-form input, .edit-form textarea, .search-label input { background: #050a13; color: var(--ink); border: 1px solid #2c3a50; border-radius: 7px; padding: 10px; font: inherit; }
.search-label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
input[type='checkbox'] { accent-color: var(--blue); }
.badge { background: #182234; color: #b1c2d8; border-radius: 5px; white-space: normal; }
.source-select { min-width: 0; }
.source-row { font-size: 12px; }
.source-row small { color: var(--muted); }
.small { color: var(--muted); font-size: 12px; }
.table-scroll { border-radius: 8px; }
table { background: #0a101a; font-size: 12px; }
th { background: #142139; color: #becbe0; font-size: 11px; font-weight: 500; }
td { color: #c2cede; }
blockquote { background: #101e33; border-color: #2f81f7; }
blockquote footer { color: #a8b9d2; }
summary { color: #a9cbff; font-size: 12px; }
pre { background: #050a13; color: #bfcee2; border: 1px solid var(--line); }
.decision.selected { background: #133a30; color: #91edc3; }
.decision.rejected { background: #232936; color: #b4bfce; }
.article-page { max-width: 960px; margin: 40px auto; }
.article-page > .eyebrow { margin-top: 30px; }
.article-page h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 600; letter-spacing: -.03em; }
.article-text { background: #050a13; color: #d3dce9; border-color: var(--line); }
.login-page main.login-card { width: min(480px, calc(100% - 32px)); margin: 32px auto; padding: 32px; }
.login-card h1 { font-size: 26px; letter-spacing: -.03em; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 1000px) {
  .masthead { grid-template-columns: 1fr auto; padding: 18px 20px 12px; gap: 15px; }
  .top-tabs { grid-row: 2; grid-column: 1 / -1; justify-self: center; }
  main { padding: 0 20px; }
  .overview-surface { gap: 32px; }
  .flow-nav { top: 125px; }
  html { scroll-padding-top: 140px; }
}
@media (max-width: 600px) {
  .masthead { padding: 14px 12px 10px; gap: 12px; }
  .masthead h1 { font-size: 11px; letter-spacing: .12em; }
  .brand { gap: 8px; }
  .brand-mark { width: 24px; height: 24px; }
  .masthead .brand-status { font-size: 8px; }
  .status-card { padding: 4px 8px; gap: 5px; max-width: 170px; font-size: 10px; }
  .status-card .quiet { padding: 3px; font-size: 10px; }
  .top-tabs { width: 100%; justify-content: space-between; gap: 1px; }
  .top-tabs a { padding: 8px 6px; font-size: 10px; }
  main { padding: 0 12px; }
  .feed-search-wrap { margin: 12px auto 24px; }
  .feed-search-wrap input { font-size: 12px; }
  .search-hint { display: none; }
  .overview-surface { flex-direction: column; align-items: stretch; padding: 24px; gap: 24px; }
  .overview-copy h2 { font-size: 17px; }
  .overview-stats { grid-template-columns: 1fr 1fr; }
  .overview-stats strong { font-size: 24px; }
  .material-feed { margin-top: 28px; }
  .feed-heading { padding: 14px 12px; }
  .feed-heading > span:last-child { font-size: 9px; letter-spacing: .08em; }
  .feed-subheading { align-items: flex-start; padding: 12px 10px 4px; }
  .feed-cards { padding: 8px; }
  .feed-card { padding: 14px 10px; gap: 10px; }
  .rank-chip { width: 26px; height: 26px; font-size: 10px; }
  .feed-card h3 { font-size: 14px; }
  .feed-card-meta { gap: 8px; }
  .evidence-link { margin-left: 0; width: 100%; }
  .feed-pagination { align-items: flex-start; flex-direction: column; font-size: 10px; }
  .workspace .grid.two { grid-template-columns: 1fr; }
  .workspace .panel { padding: 16px; }
  .flow-nav { position: static; }
}

/* Reader-first controls stay compact above the feed; admin targets are role gated. */
.top-tabs .feed-mode-form { display: flex; gap: 3px; margin: 0; }
.top-tabs .feed-mode-form button { border: 0; background: transparent; color: var(--muted); padding: 8px 13px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.top-tabs .feed-mode-form button[aria-current="page"] { background: var(--blue); color: white; box-shadow: 0 0 14px #2f81f730; }
.top-tabs .feed-mode-form button:hover:not([aria-current="page"]) { background: #182234; color: white; }
.role-switch { display: flex; gap: 2px; font-size: 10px; color: var(--muted); }
.role-switch button { padding: 2px 0; text-align: left; font-size: 10px; }
.role-label { color: var(--muted); font-size: 10px; }
.status-card { display: flex; align-items: center; flex-wrap: nowrap; }
.reader-preferences { width: min(800px, 100%); margin: 0 auto; }
.reader-preferences[hidden], .material-feed[hidden], .workspace[hidden] { display: none !important; }
.reader-preferences-details { border: 1px solid var(--line); border-radius: 12px; background: #0a101a; }
.reader-preferences-details > summary { cursor: pointer; list-style: none; padding: 10px 14px; color: #becbe0; font-size: 11px; }
.reader-preferences-details > summary::-webkit-details-marker { display: none; }
.reader-preferences-details > summary::after { content: "+"; float: right; color: var(--blue); font-size: 15px; line-height: 12px; }
.reader-preferences-details[open] > summary::after { content: "−"; }
.reader-preferences-details form { padding: 0 14px 14px; }
.preferences-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.preferences-heading h2 { margin: 2px 0; font-size: 15px; }
.preferences-heading label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.preferences-heading select { max-width: 200px; border: 1px solid var(--line); background: #050a13; color: var(--ink); border-radius: 6px; padding: 6px 8px; }
.reader-preferences .small { margin: 8px 0; font-size: 10px; }
.interest-options { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 10px 0; }
.interest-options legend { width: 100%; padding: 0; margin-bottom: 4px; color: #becbe0; font-size: 10px; }
.interest-options[hidden] { display: none; }
.interest-chip { position: relative; cursor: pointer; }
.interest-chip input { position: absolute; opacity: 0; }
.interest-chip span { display: block; border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); font-size: 10px; }
.interest-chip input:checked + span { border-color: #367ee6; background: #112c50; color: #c7ddff; }
.interest-chip input:focus-visible + span { outline: 2px solid #71aaff; outline-offset: 2px; }
.reader-preferences button[type="submit"] { padding: 7px 11px; font-size: 10px; }
.preference-status { margin-left: 10px; color: var(--muted); font-size: 10px; }
.feed-search-wrap { margin-bottom: 12px; }
.search-submit { padding: 6px 10px; font-size: 10px; }
.reader-status { width: min(800px, 100%); margin: -5px auto 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: #7f8da2; font-size: 9px; }
.material-feed { margin-top: 20px; }
.article-title-link { display: block; color: var(--ink); }
.article-title-link h3 { color: inherit; }
.category-labels { display: flex; flex-wrap: wrap; gap: 5px; margin: -4px 0 10px; }
.category-chip { border: 1px solid rgba(148,163,184,.22); border-radius: 999px; padding: 3px 7px; color: #aab7c8; font-size: 9px; }
.reaction-controls { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.reaction-controls form { margin: 0; }
.reaction-controls button { border: 1px solid transparent; background: transparent; color: #99a7ba; padding: 5px 7px; font-size: 10px; }
.reaction-controls button:hover, .reaction-controls button.is-active { background: #14243a; border-color: #29486d; color: #acd0ff; }
.reaction-controls button:disabled { opacity: .55; cursor: wait; }
.reaction-status { color: var(--muted); font-size: 9px; }
.new-items-notice { margin: 0 16px; text-align: center; }
.new-items-notice button { background: #153566; }
.feed-pagination a { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 1000px) {
  .top-tabs .feed-mode-form { justify-content: center; }
  .role-switch { max-width: 100%; font-size: 9px; }
  .reader-status { padding: 0 2px; }
}
@media (max-width: 600px) {
  .top-tabs .feed-mode-form { width: 100%; justify-content: space-between; }
  .top-tabs .feed-mode-form button { padding: 8px 7px; font-size: 10px; }
  .preferences-heading { align-items: flex-start; flex-direction: column; }
  .preferences-heading label { width: 100%; justify-content: space-between; }
  .preferences-heading select { max-width: 65%; }
  .reader-status { font-size: 8px; }
  .reaction-controls { flex-wrap: wrap; }
  .reaction-status { width: 100%; }
}
