/* Shared masthead: the controls form one right-aligned group, away from the brand. */
.topbar { gap: 12px; }
.toolbar-controls { display: contents; }
.topbar .time-window { margin-left: auto; flex: none; }
.topbar .filters { flex: none; justify-content: flex-end; gap: 8px; }
.topbar .filters label { gap: 4px; }
.topbar .method { margin-left: 0; white-space: nowrap; }
.layout-picker { position: relative; flex: none; }
.layout-picker label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.layout-picker select { width: 124px; height: 40px; background: var(--soft); font-size: 14px; padding: 0 6px; }
.masthead-picker { border-left: 1px solid var(--line); padding-left: 12px; }
.panel-layout-picker { display: none; margin-left: auto; }
.layout-hint { position: absolute; z-index: 40; top: calc(100% + 9px); right: 0; width: 265px; padding: 14px 38px 14px 14px; background: white; color: var(--ink); border: 1px solid #8a98ae; font-size: 14px; line-height: 1.4; }
.layout-hint[hidden] { display: none; }
.layout-hint::before { content: ''; position: absolute; right: 24px; top: -6px; width: 10px; height: 10px; background: white; border-top: 1px solid #8a98ae; border-left: 1px solid #8a98ae; transform: rotate(45deg); }
.layout-hint p { margin: 5px 0 0; }
.layout-hint button { position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; }
.layout-hint svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; }
@media (prefers-reduced-motion: no-preference) {
  .layout-cue select { animation: layout-cue 900ms ease-out 3; }
  @keyframes layout-cue { 0%, 50% { background: #e3eaf5; outline: 2px solid #21447b; outline-offset: 2px; } 100% { background: var(--soft); outline: 2px solid transparent; outline-offset: 2px; } }
}
.workspace[hidden], .news-workspace[hidden], .news-aside[hidden] { display: none; }
html:has([data-home-layout='news'][data-map-ready='true']) { height: auto; overflow: auto; overscroll-behavior: auto; }
body:has([data-home-layout='news'][data-map-ready='true']) { height: auto; overflow: visible; overscroll-behavior: auto; }
.layout-b[data-home-layout='news'] .screen { height: auto; min-height: 100dvh; overflow: visible; grid-template-rows: auto auto 1fr auto; }
.layout-b[data-home-layout='news'] .topbar { position: sticky; top: 0; z-index: 20; }
.layout-b[data-home-layout='news'] .bottom-bar { min-height: 28px; }
.news-workspace { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 38px 40px; }
.news-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.news-heading h1 { font-size: 22px; line-height: 1.2; }
.news-heading p { color: var(--muted); font-size: 14px; }
.news-overview { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 44px; align-items: stretch; }
.news-column, .news-aside { min-width: 0; }
.news-aside { display: flex; flex-direction: column; }
.news-map-track { flex: 1; }
.news-map-track .news-map { position: sticky; top: 72px; background: white; }
.news-lead { scroll-margin-top: 140px; }
/* Wpis z adresu, którego nie ma wśród wiadomości (selection.js): komunikat nad czołówką, czołówka zostaje sobą. */
.news-notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; padding: 12px 14px; border: 1px solid #9fb4c5; border-radius: 10px; background: var(--soft); }
.news-notice[hidden] { display: none; }
.news-notice-body { flex: 1; min-width: 0; }
.news-notice p { font-size: 15px; line-height: 1.5; margin: 0 0 4px; }
.news-notice .news-notice-heading { font-size: 17px; }
.news-notice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.news-notice-actions .full-link { font-weight: 700; }
.news-notice-actions button { border: 0; background: transparent; padding: 8px 0; min-height: 44px; font-size: 14px; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.news-notice-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; flex: none; }
.news-lead-heading h2 { font-size: clamp(28px, 3.1vw, 38px); line-height: 1.14; letter-spacing: -0.012em; text-wrap: balance; margin: 0 0 14px; }
.news-lead-heading h2 a, .news-workspace h3 a { color: var(--ink); text-decoration: none; }
.news-lead-heading h2 a:hover, .news-workspace h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.news-lead-heading .row-meta { margin-bottom: 6px; }
.news-place, .news-note, .news-sources { color: var(--muted); font-size: 14px; line-height: 1.5; }
/* Teza, status i źródła jednym blokiem dowodu z cienką osią (jak ClaimStatus na stronie wpisu). */
.news-evidence { margin-top: 18px; padding-left: 14px; border-left: 1px solid #8a98ae; max-width: 65ch; }
.news-claim { font-size: 19px; line-height: 1.5; margin: 0 0 8px; color: var(--ink); }
.news-status { font-size: 14px; line-height: 1.6; color: var(--muted); }
.news-status a { color: var(--blue); text-underline-offset: 3px; }
.news-status .claim-status { font-weight: 700; color: var(--ink); background: var(--soft); padding: 1px 6px; }
.news-lead-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 24px; margin-top: 14px; }
.news-lead-actions .full-link { margin: 0; font-weight: 700; }
.news-select { border: 0; background: transparent; padding: 8px 0; min-height: 44px; font-size: 14px; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.news-sources { margin-top: 4px; font-size: 13px; }
.news-other { margin-top: 30px; }
.news-other h2, .news-stream > h2, .news-map > h2 { font-size: 21px; line-height: 1.25; margin: 0 0 4px; }
.news-workspace ul, .news-workspace ol { padding: 0; list-style: none; }
/* Wiersz relacji: numer zgodny z kółkiem na mapie w lewym marginesie, treść obok. */
.news-other li, .news-day ol > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 14px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.news-workspace h3 { font-size: 21px; line-height: 1.25; margin: 0 0 6px; }
.news-row-body > p { font-size: 16px; line-height: 1.5; color: var(--muted); max-width: 70ch; }
.news-row-body .row-meta { margin: 10px 0 0; }
.news-pin { position: relative; display: grid; place-items: center; width: 28px; height: 28px; margin-top: 1px; padding: 0; border: 1px solid var(--blue); border-radius: 50%; background: white; color: var(--blue); font-size: 12px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; cursor: pointer; }
.news-pin::after { content: ''; position: absolute; inset: -8px; }
.news-pin:hover { background: var(--blue); color: white; }
.row-meta .news-pin { width: 24px; height: 24px; margin: 0; font-size: 11px; }
.row-status { display: inline-block; margin-right: 2px; padding: 0 5px; background: var(--soft); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.5; vertical-align: 1px; }
.news-stream { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--ink); scroll-margin-top: 140px; }
.news-day > h3 { margin: 22px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--ink); color: var(--ink); font-size: 15px; font-weight: 700; }
.news-map { border-block: 1px solid var(--line); padding-block: 12px; }
.news-map .map-zone { position: relative; inset: auto; height: 350px; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.news-map .map-heading { position: relative; inset: auto; max-width: none; padding: 0 10px; background: white; border-bottom: 1px solid var(--line); }
.news-map .map-heading h1, .news-map .map-heading > p { display: none; }
.news-map .map-legend { margin: 0; }
.news-map .map-legend summary { min-height: 44px; line-height: 44px; }
.news-map .map-canvas { height: auto; }
.news-map #map-viewport { overflow: hidden; touch-action: pan-y; overscroll-behavior: auto; }
.news-map { scroll-margin-top: 120px; }
.news-map .map-credit { top: auto; bottom: 5px; font-size: 10px; }
.news-map .map-tools { top: 10px; right: 10px; }
.news-map .legend-content { max-height: 140px; }
.legend-panel-head { display: none; }
/* Desktop legend floats above the map; it never takes a row from its canvas. */
.legend-content[popover] {
  position: fixed;
  inset: auto;
  left: var(--legend-left, 12px);
  top: var(--legend-top, 72px);
  width: min(600px, calc(100vw - 24px));
  max-width: none;
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--rail, #8a98ae);
  background: white;
  color: var(--ink);
  box-shadow: 0 8px 24px #14244626;
  font-size: 14px;
  line-height: 1.4;
}
.legend-content[popover]:not(:popover-open) { display: none; }
.legend-content[popover] .legend-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.legend-content[popover] .legend-panel-head h2 { margin: 0; font-size: 18px; line-height: 1.2; }
.legend-panel-close { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; flex: none; border: 0; background: transparent; }
.legend-panel-close:hover { background: var(--soft); }
.legend-panel-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.legend-content[popover] > p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.legend-content[popover] ol { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, auto); grid-auto-flow: column; gap: 8px 24px; margin: 14px 0 10px; }
.legend-content[popover] li { grid-template-columns: 40px minmax(0, 1fr); gap: 8px; font-size: 14px; line-height: 1.4; }
.legend-content[popover] > a { display: inline-flex; align-items: center; min-height: 32px; font-size: 13px; }
@media (max-height: 480px) {
  .legend-content[popover] { padding: 12px; }
  .legend-content[popover] ol { gap: 4px 24px; margin-block: 8px; }
}
@media (max-height: 360px) {
  .legend-content[popover] { width: min(800px, calc(100vw - 24px)); }
}
@media (prefers-reduced-motion: no-preference) {
  .legend-content:popover-open { animation: legend-panel-in 150ms ease-out; }
  @keyframes legend-panel-in { from { opacity: 0; translate: 0 -6px; } to { opacity: 1; translate: 0 0; } }
}
.news-shortcuts { display: grid; gap: 4px; margin: 18px 0; }
.news-shortcuts a { display: flex; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); font-size: 15px; }
.news-footer { margin-top: 40px; }
.news-workspace .news-footer .site-footer { margin: 0; }
@media (min-width: 1051px) and (max-width: 1300px) {
  .topbar .filters label > span, .masthead-picker label > span { display: none; }
  .topbar .filters select { max-width: 145px; }
  .topbar .logo { font-size: 26px; }
  .layout-picker select { width: 120px; }
}
@media (min-width: 901px) and (max-width: 1050px) {
  .topbar { padding-inline: 12px; gap: 8px; }
  .topbar .logo { font-size: 22px; }
  .topbar .filters { gap: 4px; }
  .topbar .filters select { max-width: 115px; font-size: 13px; }
  .topbar .time-window button { min-width: 40px; padding-inline: 4px; }
  .topbar .filters label > span, .masthead-picker label > span { display: none; }
  .topbar #unknown { font-size: 11px; padding-inline: 6px; }
  .layout-picker select { width: 110px; font-size: 13px; }
  .masthead-picker { padding-left: 8px; }
  .topbar .method { font-size: 12px; }
}
@media (max-width: 900px) {
  .topbar { display: flex; flex-wrap: wrap; gap: 0 6px; padding: 4px 12px; }
  .topbar .logo { order: 1; flex: 1; font-size: 22px; }
  .topbar .time-window { order: 2; margin-left: 0; }
  .topbar .masthead-picker { order: 3; border: 0; padding: 0; }
  .masthead-picker label > span { display: none; }
  .masthead-picker select { width: 110px; height: 44px; font-size: 13px; }
  .topbar .filters { order: 4; display: flex; flex: 1 0 100%; flex-wrap: nowrap; gap: 6px; padding: 0; overflow: visible; }
  .topbar .filters .kind-filters { display: contents; }
  .topbar .filters label { flex: 1; min-width: 0; }
  .topbar .filters select { width: 100%; min-width: 0; max-width: none; }
  .topbar .list-toggle { min-width: 50px; }
  .topbar .method { display: none; }
  .panel-layout-picker { display: block; }
  .panel-layout-picker select { width: 112px; height: 44px; font-size: 13px; }
  .panel-tabs { gap: 4px; }
  .panel-tabs > button { padding-inline: 10px; }
  .news-workspace { padding: 12px 18px 32px; }
  .news-heading { margin-bottom: 10px; }
  .news-heading p { font-size: 12px; }
  .news-overview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .news-column { display: contents; }
  .news-notice { order: -1; margin-bottom: 0; }
  .news-lead { order: 0; }
  .news-aside { order: 1; width: 100%; }
  .news-map-track .news-map { position: static; }
  .news-other { order: 2; margin-top: 0; }
  .news-stream { order: 3; margin-top: 0; }
  .news-shortcuts, .news-aside > .news-note { display: none; }
  .news-map { padding-top: 0; }
  .news-lead > .news-map { margin-block: 12px; }
  .news-map > h2 { font-size: 18px; margin-bottom: 6px; }
  .news-map .map-zone { height: 250px; }
  .news-lead-heading h2 { font-size: clamp(24px, 6.67vw, 28px); line-height: 1.12; margin-bottom: 10px; }
  .news-claim { font-size: 17px; margin-top: 10px; }
  .news-lead-actions { margin-top: 8px; }
  .news-sources { margin-top: 6px; }
}

/* Keep the document's original header space when the mobile bar condenses. */
@media (max-width: 900px) {
  .layout-b { --news-toolbar-full: 97px; }
  .layout-b[data-toolbar-compact='true'] .source-status::before { content: ''; display: block; height: calc(var(--news-toolbar-full) - 56px); }
  .layout-b[data-toolbar-compact='true'] .topbar { min-height: 56px; height: 56px; flex-wrap: nowrap; gap: 6px; }
  .layout-b[data-toolbar-compact='true'] .topbar .logo { font-size: 18px; flex: 1; }
  .layout-b[data-toolbar-compact='true'] .topbar .masthead-picker { order: 2; }
  .news-filters-toggle { min-width: 70px; min-height: 44px; padding: 0 8px; font-size: 13px; order: 3; }
  #news-active-filters { font-weight: 700; margin-left: 3px; }
  .layout-b[data-toolbar-compact='true'] .toolbar-controls { display: flex; flex-wrap: wrap; gap: 8px; position: absolute; top: 100%; left: 0; right: 0; padding: 12px; background: white; border-bottom: 1px solid var(--rail, #8a98ae); max-height: calc(100dvh - 64px); overflow: auto; }
  .layout-b[data-toolbar-compact='true'] .toolbar-controls .time-window { order: 1; margin: 0; }
  .layout-b[data-toolbar-compact='true'] .toolbar-controls .filters { order: 2; flex: 1 0 100%; }
}
@media (min-width: 780px) and (max-width: 900px) {
  .layout-b { --news-toolbar-full: 56px; }
}
@media (max-width: 359px) {
  .layout-b[data-toolbar-compact='true'] .topbar { column-gap: 4px; }
  .layout-b[data-toolbar-compact='true'] .topbar .logo { font-size: 16px; }
}
@media (min-width: 901px) and (max-height: 620px) {
  .news-map .map-zone { height: max(160px, calc(100dvh - 170px)); }
}
@media (min-width: 780px) and (max-width: 900px) {
  .topbar { flex-wrap: nowrap; min-height: 56px; padding-block: 0; }
  .topbar .logo { flex: none; font-size: 20px; }
  .topbar .filters { flex: 1; flex-basis: auto; order: 3; }
  .topbar .filters label { min-width: 0; }
  .topbar .masthead-picker { order: 4; }
  .masthead-picker select { width: 100px; }
  .topbar #unknown { font-size: 11px; padding-inline: 4px; }
  .topbar .list-toggle { font-size: 12px; padding-inline: 6px; }
}
@media (max-width: 420px) {
  .topbar .logo { font-size: 20px; }
  .topbar .time-window { gap: 0; }
  .topbar .time-window button { min-width: 40px; padding-inline: 3px; }
  .masthead-picker select { width: 100px; }
}
@media (max-width: 359px) {
  .topbar { padding-inline: 8px; column-gap: 4px; }
  .topbar .logo { font-size: 16px; }
  .topbar .time-window button { min-width: 36px; }
  .masthead-picker select { width: 94px; font-size: 12px; }
  .news-workspace { padding-inline: 14px; }
  .news-lead-heading h2 { font-size: 24px; }
  .panel-layout-picker select { width: 104px; font-size: 12px; }
}

/* In a short landscape viewport, keep the complete headline above a visible map. */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .news-workspace { padding-top: 8px; }
  .news-heading { margin-bottom: 6px; }
  .news-heading h1 { font-size: 18px; }
  .news-lead-heading { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; align-items: center; }
  .news-lead-heading h2 { grid-column: 1 / -1; font-size: 22px; line-height: 1.12; margin-bottom: 0; }
  .news-lead-heading .row-meta { margin-bottom: 0; }
  .news-lead-heading .news-place { font-size: 13px; line-height: 1.35; }
  .news-lead > .news-map { margin-block: 6px; }
  .news-map > h2 { font-size: 16px; margin-bottom: 2px; }
}
