:root{
  --navy: #0f4c6a;
  --navy-2:#0b3d56;
  --ink: #111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --bg:#ffffff;
  --card:#ffffff;
  --soft:#f7f7f7;
  --chip:#eef2f6;
  --chipText:#0f4c6a;
  --shadow: 0 10px 30px rgba(17, 24, 39, .08);
  --shadow2: 0 6px 18px rgba(17, 24, 39, .10);
  --radius: 4px;
  --radius2: 2px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: "Segoe UI", "Helvetica Neue", "Noto Sans", "Trebuchet MS", sans-serif;

  --callout-note: #e8f2fb;
  --callout-info: #e8f2fb;
  --callout-tip: #e9fbf1;
  --callout-warning: #fff7e6;
  --callout-danger: #ffecec;

  --callout-note-border: rgba(11,58,85,.25);
  --callout-info-border: rgba(11,58,85,.25);
  --callout-tip-border: rgba(16, 185, 129, .30);
  --callout-warning-border: rgba(245, 158, 11, .35);
  --callout-danger-border: rgba(239, 68, 68, .35);

  --topbar-h: 0px;         /* JS updates this */
  --panel-max-h: 422px;
  --shell-w: 1125px;        /* JS updates this */
  --target-w: 1125px;
  --target-h: 422px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  overflow:auto;
}

.skip-link{
  position: absolute;
  left: -999px;
  top: 0;
  background: #ffffff;
  color: var(--ink);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  z-index: 100;
}
.skip-link:focus{
  left: 12px;
  top: 12px;
}

*{
  scrollbar-width: thin;
  scrollbar-color: #c7cdd6 transparent;
}
*::-webkit-scrollbar{
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-thumb{
  background: #c7cdd6;
  border-radius: 999px;
}
*::-webkit-scrollbar-track{
  background: transparent;
}

.topbar{
  position: sticky;
  top:0;
  z-index: 10;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 100%);
  color:#fff;
}
.topbar__inner{
  max-width: 1300px;
  margin: 0 auto;
  padding: 14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{
  display:flex;
  gap:12px;
  align-items:center;
}
.brand__mark{
  width:40px;
  height:40px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(255,255,255,.15) 55%),
    radial-gradient(circle at 70% 70%, rgba(255,255,255,.35), rgba(255,255,255,0) 60%);
  border: 1px solid rgba(255,255,255,.25);
}
.brand__title{ font-weight: 750; letter-spacing: .2px; }
.brand__subtitle{ font-size: 12px; opacity: .85; margin-top:2px; }

.news-header{
  width: min(var(--target-w), 100vw);
  margin: 0 auto;
  padding: 7px 12px 5px;
}
.news-header__inner{
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
}
.news-header h1{
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 600;
  color: #5c6773;
  letter-spacing: 0;
  white-space: nowrap;
}
.news-header__sub{
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-align: right;
  max-width: 520px;
}

.shell{
  width: min(var(--target-w), 100vw);
  height: calc(var(--target-h) - 50px);
  margin: 0 auto;
  padding: 0 12px 10px;
  display:grid;
  grid-template-columns: 245px minmax(330px, 390px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas:
    "filters list sidebar";
  gap: 12px;
  align-items: stretch;
  position: relative;
}

.panel{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  display:flex;
  flex-direction: column;
  min-height: 0;
}

.panel--left,
.panel--mid{ padding: 10px; }

.panel--left{ grid-area: filters; }
.panel--mid{ grid-area: list; }
.panel--right{
  grid-area: sidebar;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  height: 100%;
}

.panel__scroll{
  flex: 1;
  min-height: 0;
}
.panel__scroll--col{
  display:flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.panel__section{
  padding: 0 0 0 0;
  border-bottom: none;
}
.panel__section--tight{ padding: 0 0 8px 0; }
.panel__section--footer{ border-bottom: none; }

.panel--right .panel__section{
  padding: 12px 0;
}

.panel__section--grow{
  flex: 1;
  min-height: 0;
  display:flex;
  flex-direction: column;
}

.panel--left .panel__scroll--col{ gap: 12px; }
.panel--left{ padding-bottom: 10px; }

.shell--news .panel--mid .panel__section--tight{
  display: none;
}

.panel__section--tags.is-collapsed .tagsScroll{
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
}

.panel__section--tags.is-collapsed .tags{
  opacity: 0;
  pointer-events: none;
}

.panel__section--pushBottom{ margin-top: auto; }

.label{
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  text-transform: uppercase;
}

.row{ display:flex; align-items:center; gap: 10px; }
.row--space{ justify-content: space-between; align-items: center; }
.row--tight{ gap: 8px; }

.btn{
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 3px;
  padding: 7px 10px;
  font-weight: 600;
  font-size: 12px;
  cursor:pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
  user-select:none;
}
.btn:active{ transform: translateY(1px); }

.btn--ghost{
  background: var(--soft);
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover{ background: #fff; }

.btn--ghostDark{
  background: var(--soft);
  border-color: var(--line);
  color: var(--navy);
}
.btn--ghostDark:hover{ background: #fff; }

.btn--primary{
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.btn--primary:hover{ background: #0d415a; }

.btn--tiny{ padding: 5px 8px; font-size: 11px; }
.btn--small{ padding: 6px 10px; font-size: 11px; }
.btn--toggle{
  padding: 4px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .35px;
}
.icon{ margin-right: 8px; opacity: .9; }

.search{
  margin-top: 6px;
  display:flex;
  align-items:center;
  gap:6px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.search__icon{ opacity: .55; }
.input{ width: 100%; border: none; outline: none; background: transparent; font-size: 12px; }
.hint{ margin-top: 10px; font-size: 12px; color: var(--muted); }

.segmented{
  display:flex;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px;
  margin-top: 6px;
}
.segmented__btn{
  flex:1;
  border: none;
  background: transparent;
  border-radius: 3px;
  padding: 5px 8px;
  cursor:pointer;
  font-weight: 600;
  color: var(--muted);
}
.segmented__btn.is-active{
  background: #fff;
  color: var(--navy);
}

.tags{
  margin-top: 6px;
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
  transition: opacity .2s ease;
}

.tagsScroll{
  margin-top: 6px;
  flex: 1;
  min-height: 0;
  max-height: 158px;
  overflow: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
  transition: max-height .2s ease, margin .2s ease;
}

.tag{
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--chipText);
  border-radius: 999px;
  padding: 5px 8px;
  font-weight: 600;
  font-size: 11px;
  cursor:pointer;
  user-select:none;
  transition: background .2s ease, transform .06s ease, border-color .2s ease;
}
.tag:active{ filter: brightness(.98); }
.tag.is-active{
  background: var(--navy);
  color: #fff;
  border-color: rgba(11,58,85,.3);
}

.pill{
  min-width: 28px;
  height: 22px;
  border-radius: 999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: var(--soft);
  border: 1px solid var(--line);
  font-weight: 700;
  color: var(--navy);
  padding: 0 10px;
  font-size: 11px;
}

.status{ display:none; font-size: 13px; color: var(--muted); }
.mini{ font-size: 12px; color: var(--muted); margin-top: 8px; }
.mini code{ font-family: var(--mono); font-size: 11px; }

.list{ padding: 0; display:flex; flex-direction: column; gap: 0; }

.midListScroll{
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 0;
  max-height: none;
}

.card{
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  cursor:pointer;
  background: transparent;
  transition: color .2s ease;
  border-radius: 3px;
}

.card:hover{
  background: #f7f7f7;
}

.card:nth-child(even){
  background: #fafafa;
}

.card:nth-child(even):hover{
  background: #f4f5f6;
}

.card:first-child{ padding-top: 8px; }
.card:hover .card__title{ color: var(--navy); }
.card.is-active .card__title{ color: var(--navy); }
.card__title{
  margin: 0 0 5px 0;
  font-size: 15px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta{
  display:flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}
.card__byline{
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}
.card__posted{
  color: var(--muted);
  font-size: 11px;
}
.card__summary{
  margin: 0;
  color: #374151;
  font-size: 12px;
  line-height: 1.35;
  max-width: 80ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__actions{ display:none; }

.empty{ padding: 20px 16px; text-align:center; color: var(--muted); }
.empty__title{ font-weight: 850; color: var(--ink); margin-bottom: 6px; }
.empty__subtitle{ font-size: 13px; }

.is-hidden{ display:none !important; }

/* Reader */
.reader{ flex: 1; min-height: 0; display:flex; flex-direction: column; }

.reader__empty{
  padding: 0;
  flex: 1;
  min-height: 0;
  display:flex;
  align-items: center;
  justify-content: center;
}
.reader__watermark{
  color: #c2c8cf;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  user-select: none;
}

.reader__content{
  padding: 0;
  flex: 1;
  min-height: 0;
  display:flex;
  flex-direction: column;
}

.reader__kicker{
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0;
  font-size: 10px;
  text-transform: uppercase;
}
.reader__title{ margin: 4px 0 5px; font-size: 17px; line-height: 1.16; letter-spacing: 0; }
.reader__content > .reader__meta .reader__title{ display: none; }
.fullview__meta .reader__title{ display: none; }
.reader__byline{
  color: var(--muted);
  font-size: 11px;
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
  align-items:center;
  margin-bottom: 7px;
}
.reader__tagRow{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  max-height: 58px;
  overflow: auto;
}

.reader__tagRow .tag{
  padding: 4px 7px;
  font-size: 10px;
  line-height: 1.15;
}

.reader__body--preview{
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  position: relative;
  padding-bottom: 6px;
  padding-right: 6px;
}

.reader__footer{
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  display:flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.reader__footer .btn{
  flex: 1 1 auto;
  white-space: nowrap;
}

.fullview{
  position: fixed;
  top: 0;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--target-w), 100vw);
  height: min(var(--target-h), 100vh);
  z-index: 50;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.fullview__inner{ height: 100%; display:flex; flex-direction: column; }
.fullview__top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, var(--soft) 100%);
}
.fullview__meta{ padding: 10px 14px 0; }
.fullview__body{ padding: 0 14px 14px; overflow: auto; }
.fullview,
.fullview__body{ overscroll-behavior: contain; }

.prose{ line-height: 1.45; color:#111827; font-size: 12px; }
.prose::after{
  content: "";
  display: block;
  clear: both;
}
.prose h1, .prose h2, .prose h3, .prose h4{ margin: 12px 0 7px; line-height: 1.22; }
.prose h1{ font-size: 18px; }
.prose h2{ font-size: 16px; }
.prose h3{ font-size: 14px; }
.prose h4{ font-size: 13px; }
.prose p{ margin: 7px 0; }

.prose a{
  color: var(--navy);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.prose code{
  font-family: var(--mono);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
}

.prose pre{
  background: #0b1220;
  color: #e5e7eb;
  border-radius: 6px;
  padding: 10px;
  overflow:auto;
  border: 1px solid rgba(255,255,255,.08);
}
.prose pre code{ background: transparent; border: none; padding: 0; color: inherit; }

.prose blockquote{
  margin: 8px 0;
  padding: 8px 10px;
  border-left: 4px solid rgba(11,58,85,.35);
  background: var(--soft);
  border-radius: 4px;
  color:#334155;
}

.prose ul, .prose ol{ margin: 8px 0 8px 18px; }
.prose li{ margin: 4px 0; }

.prose hr{ border: none; border-top: 1px solid var(--line); margin: 12px 0; }

.prose img{
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.prose .md-media{
  margin: 10px 0;
  display: block;
  max-width: 100%;
}
.prose .md-media--align-left{ margin-left: 0; margin-right: auto; }
.prose .md-media--align-right{ margin-left: auto; margin-right: 0; }
.prose .md-media--align-center{ margin-left: auto; margin-right: auto; }
.prose .md-media--float-left{
  float: left;
  margin: 6px 12px 8px 0;
}
.prose .md-media--float-right{
  float: right;
  margin: 6px 0 8px 12px;
}
.prose .md-media__img{
  margin: 0;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow2);
}
.prose .md-media--image figcaption,
.prose .md-media--video figcaption{
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}
.prose .md-media__frame{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b1220;
  box-shadow: var(--shadow2);
}
.prose .md-media__frame iframe,
.prose .md-media__frame video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 820px) {
  .prose .md-media--float-left,
  .prose .md-media--float-right{
    float: none;
    margin: 12px 0;
    width: 100% !important;
    max-width: 100% !important;
  }
}

.prose table{
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.prose th, .prose td{
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 12px;
}
.prose th{
  background: var(--soft);
  text-align: left;
  font-weight: 850;
  color: var(--navy);
}
.prose tr:last-child td{ border-bottom: none; }

.prose mark{
  background: #fff3bf;
  padding: 0 .18em;
  border-radius: .35em;
  box-decoration-break: clone;
}
.prose ins{
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
.prose del{ opacity: .85; }

.prose .callout{
  margin: 9px 0;
  padding: 8px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.prose .callout__title{
  font-weight: 900;
  margin: 0 0 4px 0;
  letter-spacing: 0;
}
.prose .callout--note{ background: var(--callout-note); border-color: var(--callout-note-border); }
.prose .callout--info{ background: var(--callout-info); border-color: var(--callout-info-border); }
.prose .callout--tip{ background: var(--callout-tip); border-color: var(--callout-tip-border); }
.prose .callout--warning{ background: var(--callout-warning); border-color: var(--callout-warning-border); }
.prose .callout--danger{ background: var(--callout-danger); border-color: var(--callout-danger-border); }

/*.bottombar{ margin-top: 10px; padding: 10px 0 18px; }*/

.bottombar__inner{
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 18px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 900px){
  .shell{
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "filters"
      "list"
      "sidebar";
  }
  .panel--right{ margin-top: 8px; }
  .panel--left .panel__scroll--col{
    grid-template-columns: 1fr;
  }
}
