:root {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #152030;
  background: #f9f8f2;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  --dusk: #152030;
  --ivory: #f9f8f2;
  --orange: #eb6d4e;
  --line: #d8d8d1;
  --muted: #64707a;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
[hidden] { display: none !important; }

.masthead { background: var(--ivory); border-bottom: 2px solid var(--dusk); }
.masthead-inner { max-width: 1520px; min-height: 90px; margin: auto; padding: 0 3vw; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 24px; white-space: nowrap; }
.brand strong { font-size: clamp(25px, 2.9vw, 38px); line-height: 1; letter-spacing: -.085em; font-weight: 800; }
.brand strong span { letter-spacing: -.085em; }
.brand-divider { height: 29px; width: 1px; background: var(--dusk); opacity: .5; }
.brand-section { font-size: 13px; text-transform: uppercase; letter-spacing: .17em; font-weight: 700; }
.masthead-status { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; }
.signal { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-right: 7px; }

main { max-width: 1520px; margin: auto; padding: 0 3vw 100px; }
nav { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 42px; scrollbar-width: thin; }
nav button { flex: 0 0 auto; padding: 20px 15px 17px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
nav button:hover { color: var(--dusk); background: #f0eee6; }
nav button.active { color: var(--dusk); border-bottom-color: var(--orange); background: transparent; }

h1, h2 { letter-spacing: -.035em; color: var(--dusk); }
h1 { margin: 0; font-size: clamp(30px, 3.3vw, 46px); line-height: 1.1; }
h2 { margin: 0 0 23px; font-size: 17px; }
p { color: var(--muted); line-height: 1.55; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 23px; margin-bottom: 23px; border-bottom: 1px solid var(--dusk); }
.heading h1::before { content: 'NEG.NEWS / OPERATIONS'; display: block; color: var(--orange); font-size: 10px; line-height: 1.5; font-weight: 800; letter-spacing: .14em; margin-bottom: 9px; }
.reader .heading h1::before { content: 'NEG.NEWS / INTELLIGENCE'; }
.heading button { margin-bottom: 1px; }

button { font: inherit; cursor: pointer; border: 1px solid var(--dusk); border-radius: 2px; background: var(--dusk); color: var(--ivory); padding: 10px 15px; font-size: 12px; font-weight: 700; }
button:hover { background: #2a3d53; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
button.secondary { color: var(--dusk); background: transparent; }
button.secondary:hover { background: #e9e8df; }
button:disabled { opacity: .45; cursor: default; }

.card { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--dusk); padding: 22px 24px; margin-bottom: 18px; overflow-x: auto; }
.card h2 { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; margin-bottom: 18px; }
.metric { min-height: 104px; padding: 17px 19px; background: var(--dusk); color: var(--ivory); border-top: 3px solid var(--orange); }
.metric strong { display: block; font-size: 32px; line-height: 1.15; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.metric span { display: block; margin-top: 8px; color: #d5d9da; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }

.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: end; gap: 16px; }
.form label, .login label { display: flex; flex-direction: column; gap: 7px; color: var(--dusk); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.form .wide { grid-column: 1 / -1; }
.form .check { flex-direction: row; align-items: center; gap: 9px; min-height: 38px; }
.check input { width: auto; accent-color: var(--orange); }
input, textarea, select { display: block; min-width: 0; width: 100%; padding: 10px 11px; border: 1px solid #b9bec0; border-radius: 2px; background: var(--ivory); color: var(--dusk); font: inherit; font-size: 13px; text-transform: none; letter-spacing: 0; }
textarea { min-height: 76px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--orange); outline-offset: 1px; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); text-align: left; text-transform: uppercase; letter-spacing: .09em; font-size: 10px; }
td, th { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td { max-width: 400px; overflow-wrap: anywhere; }
tbody tr:hover { background: #f9f8f2; }
td button { padding: 5px 8px; font-size: 11px; margin: 2px; }
a { color: #b94e34; text-underline-offset: 3px; }
.pill { display: inline-block; padding: 4px 7px; background: #efeee8; border-left: 2px solid var(--orange); font-size: 11px; font-weight: 700; }
.bad { color: #b43d35; }
.good { color: #33664e; }
#notice { min-height: 22px; margin: -22px 0 14px; color: #9f432d; font-weight: 700; }
.error { color: #b43d35; }
.bar { height: 7px; background: #e3e3dd; overflow: hidden; margin-top: 5px; }
.bar span { display: block; height: 100%; background: var(--orange); }
.chartrow { display: grid; grid-template-columns: 130px 1fr 45px; gap: 10px; align-items: center; margin: 12px 0; color: var(--muted); font-size: 11px; }

.login { max-width: 500px; margin: 12vh auto 0; padding: 32px; }
.login h1 { font-size: 36px; }
.login button { margin-top: 18px; }
.login-inline { max-width: none; margin: 0 0 24px; display: grid; grid-template-columns: minmax(230px, 1fr) minmax(280px, 1fr); align-items: end; gap: 16px 28px; }
.login-inline h2 { margin-bottom: 8px; border: 0; padding: 0; }
.login-inline p { margin: 0; }
.login-controls { display: flex; align-items: end; gap: 8px; }
.login-controls label { flex: 1; }
.login-controls button { margin: 0; min-height: 39px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 0 18px; background: var(--orange); color: white; text-decoration: none; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.account-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin: 0 0 12px; }
.login-inline .error { grid-column: 1 / -1; }
.public-heading { margin-top: 32px; }

.search-form { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px) auto; align-items: end; gap: 12px; margin: 30px 0 22px; }
.search-form label { display: flex; flex-direction: column; gap: 8px; color: var(--dusk); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.search-form input, .search-form select { min-height: 42px; background: #fff; }
.search-form button { min-height: 42px; }
.eyebrow { color: var(--orange); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; }
.result-list { display: grid; gap: 14px; }
.feed-intro { margin: 10px 0 0; }
.feed-status { display: flex; align-items: center; gap: 9px; margin: -4px 0 18px; color: var(--muted); font-size: 12px; font-weight: 700; }
.feed-status #feedUpdated, .feed-status #publicFeedUpdated { margin-left: auto; font-weight: 400; }
.feed-pulse { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px #eb6d4e22; }
.feed-offline .feed-pulse { background: #9d9c98; box-shadow: none; }
.story { padding: 22px 25px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--orange); }
.story-new { background: #fff9f3; }
.fresh-label { color: #b94e34; }
.story-top, .article-heading { display: flex; gap: 18px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.story h2 { margin: 12px 0; font-size: 23px; line-height: 1.2; }
.story p { margin: 0 0 17px; max-width: 90ch; }
.story-actions { display: flex; align-items: center; gap: 18px; }
.story-actions a { font-size: 12px; font-weight: 700; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 24px 0; }
.periods { display: flex; flex-wrap: wrap; gap: 6px; }
.periods .selected-period { background: var(--orange); border-color: var(--orange); color: var(--dusk); }
.article-dialog { width: min(900px, 94vw); max-height: 90vh; border: 1px solid var(--dusk); border-top: 5px solid var(--orange); padding: 34px; background: var(--ivory); color: var(--dusk); }
.article-dialog::backdrop { background: rgba(21, 32, 48, .7); }
.dialog-close { float: right; margin: -14px -14px 10px 10px; }
.article-dialog h1 { clear: both; margin: 14px 0 20px; }
.article-dialog h2 { margin-top: 28px; }
.article-body { white-space: pre-wrap; color: var(--dusk); line-height: 1.7; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.history-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); padding: 12px 0; }

@media (max-width: 800px) {
  .masthead-inner { min-height: 76px; }
  .brand { gap: 13px; }
  .brand-section { font-size: 10px; }
  .brand-divider { height: 20px; }
  .masthead-status { display: none; }
  nav { margin-bottom: 28px; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .form { grid-template-columns: 1fr; }
  .search-form { grid-template-columns: 1fr; }
  .login-inline { grid-template-columns: 1fr; }
  .heading { align-items: center; }
  .heading h1 { font-size: 29px; }
  .card { padding: 17px; }
  td { min-width: 100px; }
}

@media (max-width: 430px) {
  .brand-section, .brand-divider { display: none; }
  .heading { gap: 10px; }
  .heading button { padding: 8px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
