*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #f5f4f0;
  --surface:  #ffffff;
  --surface2: #f1efe8;
  --border:   rgba(0,0,0,0.10);
  --border2:  rgba(0,0,0,0.18);
  --text:     #1a1a18;
  --text2:    #5f5e5a;
  --text3:    #888780;
  --green:    #3b6d11;
  --green-bg: #eaf3de;
  --green-t:  #27500a;
  --blue:     #185fa5;
  --blue-bg:  #e6f1fb;
  --blue-t:   #0c447c;
  --amber-bg: #faeeda;
  --amber-t:  #633806;
  --teal-bg:  #e1f5ee;
  --teal-t:   #085041;
  --coral-bg: #faece7;
  --coral-t:  #712b13;
  --purple-bg:#eeedfe;
  --purple-t: #3c3489;
  --radius:   8px;
  --radius-lg:12px;
}

body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

/* ── Layout ── */
#app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px; height: 52px; background: var(--surface);
  border-bottom: 0.5px solid var(--border); flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 14px; font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; }
.logo-img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.logo-text { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; font-weight: 700; color: #27500a; letter-spacing: 0.01em; }

.topnav { display: flex; gap: 2px; }
.topnav-right { display: flex; gap: 2px; align-items: center; margin-left: auto; }
.tnav {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius); font-size: 13px;
  cursor: pointer; color: var(--text2); border: none; background: transparent;
  font-family: inherit;
}
.tnav:hover { background: var(--surface2); color: var(--text); }
.tnav.tnav-primary { background: #5a8b2c; color: #fff; font-weight: 600; padding: 8px 16px; }
.tnav.tnav-primary:hover { background: #4a7424; color: #fff; }
.tnav.active { background: var(--surface2); color: var(--text); font-weight: 500; }
.tnav-icon { font-size: 15px; line-height: 1; }
.tnav-label { white-space: nowrap; }
.tnav-tools { display: inline-flex; align-items: center; gap: 4px; }
.tnav-tools .caret { font-size: 10px; opacity: .7; }

.tnav-dropdown { position: relative; }
.tnav-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
  min-width: 180px; background: var(--surface);
  border: 0.5px solid var(--border2); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  padding: 4px; display: flex; flex-direction: column;
}
.tnav-menu[hidden] { display: none; }
.tnav-menu-item {
  text-align: left; padding: 7px 12px; font-size: 13px; color: var(--text);
  background: transparent; border: none; border-radius: 6px; cursor: pointer;
  font-family: inherit;
}
.tnav-menu-item:hover { background: var(--surface2); }
.tnav-menu-divider { height: 1px; background: var(--border); margin: 4px 2px; }

/* ── Coming-soon placeholder screens (Weather / Markets / Contributors) ── */
.coming-soon {
  max-width: 560px; margin: 80px auto; padding: 40px 32px;
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); text-align: center;
}
.coming-soon-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--green-t);
  background: var(--green-bg); display: inline-block;
  padding: 4px 12px; border-radius: 99px; margin-bottom: 20px;
}
.coming-soon-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px; font-weight: 600; margin: 0 0 14px; color: var(--text);
}
.coming-soon-body { font-size: 15px; line-height: 1.55; color: var(--text2); margin: 0; }


.body { display: flex; flex: 1; overflow: hidden; }

.sidebar {
  width: 210px; flex-shrink: 0; background: var(--surface);
  border-right: 0.5px solid var(--border); padding: 14px 10px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 18px;
}
.sb-section-label { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; padding: 0 8px; margin-bottom: 4px; }
.sb-item {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 8px; border-radius: var(--radius); cursor: pointer; font-size: 13px; color: var(--text2);
}
.sb-item .sb-badge { margin-left: auto; }
.sb-item:hover { background: var(--surface2); color: var(--text); }
.sb-item.active { background: var(--blue-bg); color: var(--blue-t); font-weight: 500; }
.sb-badge { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--surface2); color: var(--text3); }
.sb-item.active .sb-badge { background: #b5d4f4; color: var(--blue-t); }

.main { flex: 1; overflow-y: auto; padding: 20px; }

/* ── Screens ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Stat cards ── */
.stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 20px; }
.stat { background: var(--surface2); border-radius: var(--radius); padding: 12px 14px; }
.stat-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.stat-val { font-size: 22px; font-weight: 500; }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── Section head ── */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 15px; font-weight: 500; }

/* ── Buttons ── */
button, .btn {
  padding: 6px 14px; border-radius: var(--radius); font-size: 13px; cursor: pointer;
  border: 0.5px solid var(--border2); background: transparent; color: var(--text); font-family: inherit;
}
button:hover, .btn:hover { background: var(--surface2); }
.btn-primary { background: var(--green); color: white; border-color: var(--green); }
.btn-primary:hover { background: var(--green-t); }
.btn-danger { color: #a32d2d; border-color: #f09595; }
.btn-danger:hover { background: #fcebeb; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Form elements ── */
input[type=text], input[type=email], input[type=time], input[type=url], select, textarea {
  font-size: 13px; padding: 7px 10px; border: 0.5px solid var(--border2);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
  font-family: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-bg); }
label { font-size: 12px; color: var(--text2); display: block; margin-bottom: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-group { margin-bottom: 12px; }

/* ── Search row ── */
.search-row { display: flex; gap: 8px; margin-bottom: 14px; }
.search-row input { flex: 1; }
.search-row select { width: auto; }

/* ── Report list ── */
.report-list { display: flex; flex-direction: column; gap: 8px; }
.report-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.report-card:hover { border-color: var(--border2); background: var(--surface2); box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.report-card.selected { border-color: #378add; border-width: 1.5px; }

.rc-badge {
  font-size: 12px; line-height: 1; font-weight: 600;
  padding: 8px 12px; border-radius: 99px; white-space: nowrap;
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  min-width: 92px;
}
.rc-badge.open  { background: var(--green-bg); color: var(--green-t); }
.rc-badge.close { background: #d6e8f5;  color: var(--blue-t); }
/* Blog timeline cards reuse .rc-badge but render an icon-only glyph,
 * so opt them out of the wide Morning/Evening pill sizing. */
.rc-badge.blog  { min-width: 0; padding: 6px 8px; }
.rc-badge-glyph { font-size: 14px; line-height: 1; }
.sb-icon { font-size: 14px; line-height: 1; vertical-align: -1px; margin-right: 4px; }

.rc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rc-date { font-size: 15px; font-weight: 600; color: var(--text); }
.rc-time { font-weight: 400; color: var(--text3); }
.rc-meta { font-size: 12px; color: var(--text3); }

.rc-cats { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.rc-cat-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 6px; border-radius: 99px;
  font-size: 11px; font-weight: 500; color: var(--text2);
  background: var(--surface2); border: 0.5px solid var(--border);
}
.cat-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cat-mini { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 0; }
.cat-mini .cat-icon { display: block; }

.rc-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .15s; flex-shrink: 0; }
.report-card:hover .rc-actions, .report-card:focus-within .rc-actions { opacity: 1; }

@media (max-width: 560px) {
  .report-card { padding: 12px 14px; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
  .rc-badge { min-width: 0; padding: 5px 10px; font-size: 11px; }
  .rc-badge-label { display: none; }
  .rc-badge-glyph { font-size: 16px; }
  .rc-info { gap: 3px; }
  .rc-date { font-size: 14px; }
  .rc-cat-chip-label { display: none; }
  .rc-cat-chip { padding: 4px; }
  .rc-actions { opacity: 1; margin-left: auto; }
}

/* ── Report viewer ── */
.viewer-wrap { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.viewer-header { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 14px; border-bottom: 0.5px solid var(--border); margin-bottom: 14px; }
.viewer-title { font-size: 16px; font-weight: 500; }
.viewer-sub { font-size: 12px; color: var(--text2); margin-top: 3px; }
.next-run { text-align: right; }
.next-run .label { font-size: 11px; color: var(--text3); }
.next-run .val { font-size: 13px; font-weight: 500; }

.page-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.page-tab { font-size: 12px; padding: 4px 14px; border-radius: 99px; cursor: pointer; border: 0.5px solid var(--border2); background: transparent; color: var(--text2); }
.page-tab.active { background: var(--surface2); color: var(--text); font-weight: 500; border-color: var(--border2); }

.cat-section { margin-bottom: 14px; }
.cat-pill { font-size: 11px; font-weight: 500; padding: 3px 10px 3px 8px; border-radius: 99px; display: inline-flex; align-items: center; gap: 5px; margin-bottom: 7px; line-height: 1; }
.cat-pill .cat-icon { display: block; flex-shrink: 0; }
.cat-pill.general    { background: var(--green-bg);  color: var(--green-t); }
.cat-pill.weather    { background: var(--blue-bg);   color: var(--blue-t); }
.cat-pill.markets    { background: var(--amber-bg);  color: var(--amber-t); }
.cat-pill.agronomy   { background: var(--teal-bg);   color: var(--teal-t); }
.cat-pill.livestock  { background: var(--coral-bg);  color: var(--coral-t); }
.cat-pill.government { background: var(--purple-bg); color: var(--purple-t); }

.bullet-list { list-style: none; }
.bullet-list li { font-size: 13px; padding: 5px 0 5px 16px; position: relative; border-bottom: 0.5px solid var(--border); line-height: 1.5; }
.bullet-list li:last-child { border-bottom: none; }
.bullet-list li::before { content: ''; position: absolute; left: 0; top: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--border2); }

.form-hint { font-size: 11px; color: var(--text2, #888); margin-top: 4px; line-height: 1.4; }
.form-hint code { background: var(--surface2, #f1efe8); padding: 1px 4px; border-radius: 3px; font-size: 10.5px; }

.hero-banner { position: relative; width: 100%; height: 220px; border-radius: 10px; overflow: hidden; margin-bottom: 14px; background: var(--surface2, #f1efe8); border: 0.5px solid var(--border); }
.hero-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; image-rendering: auto; transform: translateZ(0); }
.hero-banner .hero-credit { position: absolute; bottom: 8px; right: 10px; padding: 3px 8px; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; letter-spacing: .02em; backdrop-filter: blur(4px); }
.hero-banner-empty { background: repeating-linear-gradient(45deg, #f1efe8 0 10px, #e8e6e0 10px 20px); }
.hero-banner-empty .hero-empty-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text3, #888); font-size: 13px; }
.hero-edit-btn { position: absolute; top: 10px; right: 10px; padding: 6px 12px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 500; border: 0; cursor: pointer; backdrop-filter: blur(4px); z-index: 2; }
.hero-edit-btn:hover { background: rgba(0,0,0,.8); }

/* ── Hero photo chooser modal ── */
.hero-chooser-status { margin-bottom: 4px; }
.hero-chooser-pill { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--surface2, #f1efe8); color: var(--text2, #555); font-size: 11px; font-weight: 500; }
.hero-chooser-pill-override { background: #fff3cd; color: #7a5b00; }
.hero-chooser-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; max-height: 320px; overflow-y: auto; padding: 6px; border: 0.5px solid var(--border); border-radius: 8px; background: var(--surface2, #f9f8f3); }
.hero-candidate { display: block; position: relative; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; background: #fff; }
.hero-candidate input[type="radio"] { position: absolute; top: 6px; left: 6px; z-index: 2; }
.hero-candidate img { width: 100%; height: 90px; object-fit: cover; display: block; background: #eee; }
.hero-candidate-name { font-size: 11px; padding: 4px 6px; color: var(--text2, #555); border-top: 0.5px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-candidate.is-current { border-color: var(--blue, #2563eb); }
.hero-candidate-broken { display: none; }

.source-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 0.5px solid var(--border); }
.source-item:last-child { border-bottom: none; }
.src-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 4px; flex-shrink: 0; background: var(--surface2, #f1efe8); border: 0.5px solid var(--border); }
.src-thumb-empty { background: repeating-linear-gradient(45deg, #f1efe8 0 6px, #e8e6e0 6px 12px); }
.src-info { flex: 1; min-width: 0; }
.src-name { font-size: 13px; font-weight: 500; }
.src-url { font-size: 11px; color: var(--blue); margin-top: 1px; word-break: break-all; }
.src-cats { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface2); color: var(--text2); white-space: nowrap; }

/* ── Config ── */
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.config-card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.config-card-title { font-size: 13px; font-weight: 500; margin-bottom: 14px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 0.5px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; }
.cat-toggle-label { display: inline-flex; align-items: center; gap: 8px; }

.lookup-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lookup-pill {
  font: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text2); cursor: pointer;
  transition: background-color .12s, color .12s, border-color .12s;
}
.lookup-pill:hover { border-color: var(--text3); color: var(--text1); }
.lookup-pill.active {
  background: var(--accent, #2f6e2f); border-color: var(--accent, #2f6e2f);
  color: #fff;
}
.lookup-pill.custom { border-style: dashed; }
.lookup-pill.custom.active { background: #6b7280; border-color: #6b7280; }

/* ── Category-focused archive view ── */
.cat-view-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; padding-bottom: 12px; border-bottom: 0.5px solid var(--border); }
.cat-view-title { display: inline-flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 600; }
.cat-view-sub { font-size: 12px; color: var(--text3); }
.cat-day { margin-bottom: 22px; }
.cat-day-header { font-size: 13px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; padding: 6px 0; border-bottom: 0.5px solid var(--border); margin-bottom: 10px; }
.cat-session { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; margin-bottom: 10px; }
.cat-session-head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; padding: 0 0 8px 0; cursor: pointer; text-align: left; font: inherit; color: inherit; border-bottom: 0.5px solid var(--border); margin-bottom: 8px; }
.cat-session-head:hover { color: var(--accent); }
.cat-session-time { font-size: 12px; color: var(--text3); }
.cat-session-count { font-size: 11px; color: var(--text3); margin-left: auto; }
.cat-bullets { margin: 0; padding-left: 20px; }
.cat-bullets li { font-size: 13px; line-height: 1.55; padding: 3px 0; }
.toggle-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }
.toggle { width: 32px; height: 18px; border-radius: 9px; background: var(--green); position: relative; cursor: pointer; flex-shrink: 0; border: none; padding: 0; }
.toggle.off { background: var(--border2); }
.toggle::after { content: ''; position: absolute; width: 13px; height: 13px; border-radius: 50%; background: white; top: 2.5px; left: 16px; transition: left .12s; }
.toggle.off::after { left: 3px; }
.day-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.day-pill { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg2, #f4f5f7); color: var(--text2, #666); font-size: 12px; font-weight: 600; cursor: pointer; user-select: none; }
.day-pill.on { background: var(--green); border-color: var(--green); color: #fff; }

/* ── Sources table ── */
.sources-table { width: 100%; border-collapse: collapse; }
.sources-table th { text-align: left; font-size: 11px; font-weight: 500; color: var(--text3); padding: 7px 10px; border-bottom: 0.5px solid var(--border); white-space: nowrap; }
.sources-table td { padding: 8px 10px; border-bottom: 0.5px solid var(--border); font-size: 13px; vertical-align: middle; }
.sources-table tr:last-child td { border-bottom: none; }
.sources-table tr:hover td { background: var(--surface2); }
.sources-table .paused td { color: var(--text3); }

/* ── Modal ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--surface); border-radius: var(--radius-lg); border: 0.5px solid var(--border); padding: 22px; width: 460px; max-width: 95vw; max-height: 92vh; overflow-y: auto; }
.modal.modal-wide  { width: 1100px; max-width: 95vw; padding: 28px 32px; }
.modal.modal-wide #bp-body { font-size: 15px; line-height: 1.55; min-height: 400px; }
.modal.modal-wide .form-group label { font-size: 13px; font-weight: 500; color: var(--text2); }
.bp-drop-zone {
  border: 1.5px dashed var(--border2); border-radius: var(--radius-lg);
  padding: 22px 18px; background: var(--surface2); text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.bp-drop-zone:hover, .bp-drop-zone.drag-over { border-color: var(--green); background: rgba(45, 122, 60, 0.05); }
.bp-drop-zone .bp-drop-icon { font-size: 28px; line-height: 1; opacity: 0.6; }
.bp-drop-zone .bp-drop-main { font-size: 14px; color: var(--text); font-weight: 500; }
.bp-drop-zone .bp-drop-hint { font-size: 12px; color: var(--text3); }
.bp-hero-preview-wrap { position: relative; display: inline-block; }
.bp-hero-preview-wrap img { max-width: 100%; max-height: 220px; border-radius: var(--radius); border: 0.5px solid var(--border); display: block; }
.bp-hero-preview-wrap .bp-hero-clear {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px;
  border-radius: 50%; border: none; background: rgba(0,0,0,0.6); color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer;
}
.modal-title { font-size: 15px; font-weight: 500; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 0.5px solid var(--border); }

/* ── Empty state ── */
.empty { text-align: center; padding: 48px 20px; color: var(--text3); font-size: 13px; }
.empty p { margin-top: 6px; }

/* ── Toast ── */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: var(--text); color: white; font-size: 13px; padding: 9px 16px; border-radius: var(--radius); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }
.toast.success { background: var(--green); }
.toast.error   { background: #a32d2d; }

/* ── Misc ── */
.divider { border: none; border-top: 0.5px solid var(--border); margin: 14px 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Markets page ── */
#screen-markets { max-width: 1200px; margin: 0 auto; }
.mkt-strips { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.mkt-strip { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; }
.mkt-strip-head { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mkt-strip-sub { font-size: 10px; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--text3); opacity: .85; }
.mkt-strip-rows { display: flex; flex-direction: column; gap: 8px; }
.mkt-mini { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 0.5px solid var(--border); }
.mkt-mini:last-child { border-bottom: none; }
.mkt-mini-name { flex: 1; min-width: 0; }
.mkt-mini-name .nm { font-size: 13px; font-weight: 500; color: var(--text); }
.mkt-mini-name .sym { font-size: 11px; color: var(--text3); }
.mkt-mini-spark { flex-shrink: 0; width: 80px; height: 28px; }
.mkt-mini-px { text-align: right; flex-shrink: 0; min-width: 110px; }
.mkt-mini-px .px { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.mkt-mini-px .ch { font-size: 11px; font-variant-numeric: tabular-nums; }
.mkt-up   { color: #1c6e3a; }
.mkt-down { color: #a32d2d; }
.mkt-flat { color: var(--text3); }

.mkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.mkt-card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.mkt-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mkt-card-name { font-size: 14px; font-weight: 600; color: var(--text); }
.mkt-card-sub { font-size: 11px; color: var(--text3); }
.mkt-card-px { display: flex; align-items: baseline; gap: 10px; }
.mkt-card-px .px { font-size: 22px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.mkt-card-px .ch { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mkt-card-chart { width: 100%; height: 80px; }
.mkt-card-foot { font-size: 10.5px; color: var(--text3); display: flex; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 0.5px solid var(--border); }
.mkt-card.unavail { opacity: 0.75; }
.mkt-card.unavail .mkt-card-px .px { color: var(--text3); font-size: 14px; font-weight: 500; }
.mkt-card-error { font-size: 11.5px; color: #a32d2d; padding: 8px 0; }

.mkt-skeleton { height: 200px; background: var(--surface2); border-radius: var(--radius-lg); animation: mktPulse 1.4s ease-in-out infinite; }
@keyframes mktPulse { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }
.mkt-error-banner { background: #fbe9e9; border: 0.5px solid #f0a8a8; color: #7a1f1f; padding: 12px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }
.mkt-attribution { margin-top: 22px; padding: 14px 0 8px; border-top: 0.5px solid var(--border); font-size: 11.5px; color: var(--text3); text-align: center; }

.mkt-cash-section { margin-top: 28px; }
.mkt-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mkt-section-head h2 { font-size: 15px; font-weight: 600; margin: 0; color: var(--text); }
.mkt-section-meta { font-size: 12px; color: var(--text3); }
.mkt-cash-table { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.mkt-cash-head, .mkt-cash-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr; align-items: center; gap: 10px; padding: 10px 14px; }
.mkt-cash-head { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text3); background: var(--surface2); }
.mkt-cash-row { border-top: 0.5px solid var(--border); font-size: 13px; }
.mkt-cash-row .cash-name { font-weight: 500; color: var(--text); display: flex; align-items: baseline; gap: 8px; }
.mkt-cash-row .cash-cat { font-size: 10.5px; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; }
.mkt-cash-row .cash-px { font-variant-numeric: tabular-nums; }
.mkt-cash-row .cash-px .px { font-size: 14px; font-weight: 600; color: var(--text); }
.mkt-cash-row .cash-scope { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 8px; background: var(--surface2, #f0f0f0); color: var(--text3); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
.mkt-cash-row .cash-px .unit { font-size: 11px; color: var(--text3); }
.mkt-cash-row .cash-period { font-size: 12px; color: var(--text3); }
.mkt-cash-row.unavail .cash-px .px { color: var(--text3); font-weight: 500; }
.mkt-cash-row.unavail .cash-period { color: #a32d2d; }
.mkt-cash-setup { background: #fff7e0; border: 0.5px solid #e9c977; color: #5a4310; padding: 12px 14px; border-radius: var(--radius); font-size: 13px; line-height: 1.5; }

@media (max-width: 760px) {
  .mkt-strips { grid-template-columns: 1fr; }
  .mkt-grid { grid-template-columns: 1fr; }
  .mkt-mini-spark { width: 60px; }
  .mkt-mini-px { min-width: 90px; }
  .mkt-cash-head, .mkt-cash-row { grid-template-columns: 1.4fr 1fr; }
  .mkt-cash-head > div:last-child, .mkt-cash-row .cash-period { display: none; }
}

/* ── Source test result rows on Sources screen ── */
.src-test-result-row td { background: var(--surface2); padding: 10px 14px !important; border-bottom: 0.5px solid var(--border) !important; }
.src-test-ok    { color: var(--green); font-size: 12px; }
.src-test-fail  { color: #a32d2d; font-size: 12px; }
.src-test-skip  { color: var(--text3); font-size: 12px; }
.src-test-loading { color: var(--text3); font-size: 12px; font-style: italic; }
.src-test-samples { margin: 6px 0 0 18px; padding: 0; color: var(--text2); font-size: 12px; }
.src-test-samples li { margin: 2px 0; }
.src-note-row td { background: var(--surface2); padding: 4px 14px !important; border-bottom: 0.5px solid var(--border) !important; }
.src-note { font-size: 11px; color: var(--text3); font-style: italic; }
.sources-table tr.paused td:first-child { color: var(--text3); }

/* ── Per-source breakdown banner on report viewer ── */
.src-stats-banner { background: var(--surface2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 18px 0; }
.src-stats-summary { font-size: 12px; color: var(--text2); margin-bottom: 8px; }
.src-stats-fail-count { color: #a32d2d; }
.src-stat-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.src-stat-pill { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 99px; cursor: help; }
.src-stat-ok   { background: #e8f6ed; color: #1c6e3a; }
.src-stat-fail { background: #fbe9e9; color: #a32d2d; }
.src-stat-skip { background: var(--surface); color: var(--text3); border: 0.5px solid var(--border); }
.rc-fail { color: #a32d2d; }

/* ── Home (news magazine) ─────────────────────────────────────────── */
/* Cap the magazine layout to a comfortable reading width so images
 * don't balloon on wide displays now that the sidebar is hidden. */
#screen-home { padding: 0 4px 40px; max-width: 1100px; margin: 0 auto; }
.home-eyebrow {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 0 0 10px; margin: 0 0 12px;
  border-bottom: 1px solid var(--border);
}
.home-eyebrow-pill {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: #1c4870;
  background: #eaf2fa; padding: 4px 10px; border-radius: 99px;
}
.home-eyebrow-date {
  font-size: 13px; color: var(--text3); letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px; align-items: center; margin-bottom: 36px;
}
.home-hero-img {
  position: relative; aspect-ratio: 16 / 10; border-radius: 14px;
  overflow: hidden; background: linear-gradient(135deg,#3a6e4b,#1f4733);
  box-shadow: 0 6px 28px rgba(0,0,0,0.10);
  max-height: 320px;
}
.home-hero-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.home-hero-img.home-hero-noimg img { display: none; }
.home-hero-credit {
  position: absolute; bottom: 10px; left: 12px; color: #fff;
  font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  background: rgba(0,0,0,0.45); padding: 3px 9px; border-radius: 4px;
  backdrop-filter: blur(4px);
}
.home-hero-text { display: flex; flex-direction: column; justify-content: center; }
.home-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 38px; line-height: 1.12; letter-spacing: -0.01em;
  margin: 0 0 14px; color: var(--text);
}
.home-lede {
  font-size: 16px; line-height: 1.55; color: var(--text2);
  margin: 0 0 22px;
}
.home-cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.home-hero-stats { margin: 0 0 18px; }
.home-hero-stats .src-stats-banner { margin: 0; }

.home-section-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text2);
  border-top: 1px solid var(--border);
  padding-top: 10px; margin: 0 0 18px;
}

.home-briefing {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 32px;
}
.home-takeaways { display: flex; flex-direction: column; gap: 22px; }
.home-take-section {
  border-left: 3px solid var(--border); padding: 2px 0 2px 16px;
}
.home-take-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 8px;
}
.home-take-list { margin: 0; padding-left: 18px; }
.home-take-list li {
  font-size: 14.5px; line-height: 1.55; color: var(--text);
  margin-bottom: 6px;
}

.home-headlines {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 6px 8px;
  align-self: start;
}
.home-headlines-head {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text3);
  padding: 12px 14px 10px; border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.home-head-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px; border-radius: 8px;
  text-decoration: none; color: inherit;
  transition: background 0.15s;
}
.home-head-row + .home-head-row { border-top: 1px solid var(--border); }
.home-head-row:hover:not(.home-head-row--noLink) { background: var(--surface); }
.home-head-icon { flex: 0 0 14px; padding-top: 2px; }
.home-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-head-title { font-size: 14px; line-height: 1.35; color: var(--text); }
.home-head-source {
  font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text3);
}
.home-head-arrow {
  flex: 0 0 auto; color: var(--text3); font-size: 14px;
  align-self: center; opacity: 0; transition: opacity 0.15s, transform 0.15s;
}
.home-head-row:hover .home-head-arrow {
  opacity: 1; transform: translateX(2px); color: var(--accent);
}
.home-head-row--noLink { opacity: 0.7; cursor: default; }

@media (max-width: 980px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-title { font-size: 30px; }
  .home-briefing { grid-template-columns: 1fr; }
}

/* Home screen takes the full width — the sidebar's filters apply only
 * to the archive/category views, so hiding it gives the magazine
 * layout more room. The flag is toggled in showScreen(). */
body.home-active .sidebar { display: none; }

/* ── Blog cards (home strip + Blogs page) ── */
.home-blogs-strip { margin: 12px 0 40px; padding-bottom: 36px; border-bottom: 1px solid var(--border); }

/* Public email signup card on the home page (anonymous visitors only). */
.home-signup {
  margin: 32px 0 40px; padding: 28px 28px;
  background: linear-gradient(135deg, #f4f9ec 0%, #e9f4d8 100%);
  border: 1px solid #cfe2a8; border-radius: 12px;
}
.home-signup-body { max-width: 640px; margin: 0 auto; text-align: center; }
.home-signup-title { font-family: Georgia, 'Times New Roman', serif; font-size: 24px; margin: 0 0 8px; color: #27500a; }
.home-signup-lead { font-size: 14px; line-height: 1.55; color: #2c3e1b; margin: 0 0 18px; }
.home-signup-form { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.home-signup-form input { flex: 1 1 200px; min-width: 180px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; }
.home-signup-form button { white-space: nowrap; }
.home-signup-status { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.home-signup-status.is-ok    { background: #e1f5d8; color: #27500a; border: 1px solid #b6dd8a; }
.home-signup-status.is-error { background: #fde7e7; color: #8a1f1f; border: 1px solid #f4b3b3; }
.home-signup-fine { font-size: 11px; color: var(--text3); margin: 14px 0 0; }
.home-signup-cta { display: flex; justify-content: center; }
.btn.btn-lg { padding: 12px 22px; font-size: 15px; font-weight: 600; }

/* Recipient signup modal */
.signup-form .form-group { margin-bottom: 14px; }
.signup-form .form-group > label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text2); margin-bottom: 6px; }
.signup-form input[type=text], .signup-form input[type=email], .signup-form input[type=tel], .signup-form textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; box-sizing: border-box;
}
.signup-form textarea { resize: vertical; min-height: 70px; }
.signup-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .signup-row-2 { grid-template-columns: 1fr; } }
.signup-optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text3); font-size: 11px; }
.signup-chip-row { display: flex; flex-wrap: nowrap; gap: 5px; overflow-x: auto; padding: 2px 1px 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.signup-chip-row::-webkit-scrollbar { height: 6px; }
.signup-chip-row::-webkit-scrollbar-thumb { background: #c8d3b6; border-radius: 999px; }
.signup-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; user-select: none; font-size: 12px; line-height: 1.2; background: #fff; transition: background .15s, border-color .15s; white-space: nowrap; }
.signup-chip:hover { border-color: #9ab47a; }
.signup-chip input { margin: 0; accent-color: #5a8b2c; }
.signup-chip:has(input:checked) { background: #e1f5d8; border-color: #5a8b2c; color: #27500a; font-weight: 600; }
.signup-fine { font-size: 11px; color: var(--text3); margin: 8px 0 14px; text-align: center; }
.signup-optin { background: #f7f6f1; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.signup-checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.4; color: var(--text2); cursor: pointer; }
.signup-checkbox input { margin-top: 2px; accent-color: #5a8b2c; flex: 0 0 auto; }
.signup-checkbox span { flex: 1 1 auto; }

/* Recipients admin table — extra columns */
.sub-name { font-weight: 600; color: var(--text1); }
.sub-email { font-size: 12px; color: var(--text2); }
.sub-tags { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.sub-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #eef4e3; color: #2c4d10; font-size: 11px; border: 1px solid #cbe0aa; }
.sub-empty { color: var(--text3); }
.sub-interests { font-size: 12px; color: var(--text2); max-width: 240px; white-space: pre-wrap; }
.subs-table th, .subs-table td { vertical-align: top; }

/* Admin Recipients table */
.subs-table-wrap { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.subs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.subs-table thead th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--text2); background: #f7f6f1; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.04em; }
.subs-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.subs-table tbody tr:last-child td { border-bottom: 0; }
.subs-table tbody td:last-child { text-align: right; }
.sub-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.sub-summary { display: inline-flex; gap: 4px; font-size: 13px; color: var(--text2); white-space: nowrap; }
.subs-table a { color: var(--green, #3b6d11); text-decoration: none; }
.subs-table a:hover { text-decoration: underline; }
.home-blogs-head  { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.home-blogs-title { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; font-weight: 600; margin: 0; color: var(--text); }
.blog-card-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.blog-card {
  background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s;
  display: flex; flex-direction: column;
}
.blog-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.blog-card-thumb { width: 100%; aspect-ratio: 16/10; background-size: cover; background-position: center; background-color: var(--surface2); }
.blog-card-thumb-placeholder { display: flex; align-items: center; justify-content: center; }
.blog-card-body  { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.blog-card-title { font-family: Georgia, 'Times New Roman', serif; font-size: 16px; font-weight: 600; line-height: 1.3; margin: 4px 0 0; color: var(--text); }
.blog-card-meta  { font-size: 11px; color: var(--text3); }

/* ── Blogs full list ── */
.blog-list { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.blog-list-card {
  display: flex; gap: 18px; padding: 16px;
  background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg);
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.blog-list-card:hover { border-color: var(--border2); box-shadow: 0 2px 8px rgba(0,0,0,0.05); transform: translateY(-1px); }
.blog-list-thumb { width: 180px; flex-shrink: 0; aspect-ratio: 16/10; background-size: cover; background-position: center; background-color: var(--surface2); border-radius: var(--radius); }
.blog-list-thumb-placeholder { display: flex; align-items: center; justify-content: center; }
.blog-list-body  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.blog-list-title { font-family: Georgia, 'Times New Roman', serif; font-size: 20px; font-weight: 600; margin: 2px 0 0; color: var(--text); line-height: 1.25; }
.blog-list-meta  { font-size: 12px; color: var(--text3); }
.blog-list-excerpt { font-size: 14px; color: var(--text2); line-height: 1.55; margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 640px) {
  .blog-list-card { flex-direction: column; gap: 12px; padding: 14px; }
  .blog-list-thumb { width: 100%; aspect-ratio: 16/8; }
  .blog-list-title { font-size: 18px; }
  .blog-list-excerpt { font-size: 13px; -webkit-line-clamp: 2; }
}

/* ── Blog viewer ── */
.blog-article { max-width: 760px; margin: 0 auto; padding: 8px 0; }
.blog-hero { width: 100%; aspect-ratio: 16/7; background-size: cover; background-position: center; background-color: var(--surface2); border-radius: var(--radius-lg); margin-bottom: 18px; }
.blog-article-title { font-family: Georgia, 'Times New Roman', serif; font-size: 32px; font-weight: 600; line-height: 1.2; margin: 10px 0 6px; color: var(--text); }
.blog-article-meta  { font-size: 13px; color: var(--text3); margin-bottom: 20px; }
.blog-article-body  { font-size: 16px; line-height: 1.65; color: var(--text); }
.blog-article-body p { margin: 0 0 16px; }

/* ── Users admin table ── */
.users-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.users-table th, .users-table td { text-align: left; padding: 10px 14px; border-bottom: 0.5px solid var(--border); font-size: 13px; }
.users-table th { background: var(--surface2); font-weight: 500; color: var(--text2); font-size: 12px; }
.users-table tr:last-child td { border-bottom: none; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-avatar-placeholder { background: var(--surface2); color: var(--text2); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }

/* ── Contributors directory ── */
.contributor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.contributor-card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 18px; text-align: center; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.contributor-card:hover, .contributor-card:focus-visible { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.06); border-color: var(--accent, #5e8a3a); outline: none; }
.contributor-cta { margin-top: 10px; font-size: 12px; color: var(--accent, #5e8a3a); font-weight: 600; opacity: 0; transition: opacity .12s ease; }
.contributor-card:hover .contributor-cta, .contributor-card:focus-visible .contributor-cta { opacity: 1; }
.contributor-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; display: block; }
.contributor-photo-placeholder { background: var(--surface2); color: var(--text2); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 600; }
.contributor-name { font-family: Georgia, 'Times New Roman', serif; font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.contributor-bio  { font-size: 13px; color: var(--text2); line-height: 1.5; margin: 0; }
/* "📍 Iowa, USA" — shown between name and bio on the public Contributors
 * card. Kept small + muted so it's a glanceable detail rather than a
 * dominant element. */
.contributor-geo  { font-size: 12px; color: var(--text3); margin: 2px 0 8px; }

/* ── Weather alert strips on Home (gated by include_weather_banner) ──
 * Same visual rhythm as .alert-strip, but tinted by NWS severity. */
.weather-strip-stack { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 14px; }
.weather-strip {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid; text-decoration: none;
  font-size: 13px; line-height: 1.2; transition: background 0.15s;
}
.weather-strip-severe   { background: #fff5f5; border-color: #ffc9c9; color: #c92a2a; }
.weather-strip-moderate { background: #fff9db; border-color: #ffe066; color: #a86600; }
.weather-strip-minor    { background: #e7f5ff; border-color: #a5d8ff; color: #1864ab; }
.weather-strip:hover, .weather-strip:focus-visible { filter: brightness(0.97); }
.weather-strip-glyph { font-size: 16px; line-height: 1; }
.weather-strip-label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.6); }
.weather-strip-title { flex: 1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather-strip-cta { font-weight: 600; }
@media (max-width: 720px) {
  .weather-strip-cta { display: none; }
  .weather-strip-title { white-space: normal; }
}

/* ── Weather page (full active-alerts list) ── */
.weather-group-head { font-family: Georgia, 'Times New Roman', serif; font-size: 18px; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.weather-group-count { font-size: 12px; color: var(--text3); font-weight: 400; background: var(--surface2); padding: 2px 8px; border-radius: 999px; }
.weather-card {
  border: 1px solid var(--border); border-left-width: 4px;
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; background: var(--surface);
}
.weather-card-severe   { border-left-color: #c92a2a; }
.weather-card-moderate { border-left-color: #f59f00; }
.weather-card-minor    { border-left-color: #1c7ed6; }
.weather-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.weather-card-event { font-family: Georgia, 'Times New Roman', serif; font-size: 17px; font-weight: 700; }
.weather-card-area  { font-size: 13px; color: var(--text2); margin-top: 2px; }
.weather-card-tags  { display: flex; gap: 6px; flex-shrink: 0; }
.weather-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface2); color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; }
.weather-tag-severe   { background: #ffe3e3; color: #c92a2a; }
.weather-tag-moderate { background: #fff3bf; color: #a86600; }
.weather-tag-minor    { background: #d0ebff; color: #1864ab; }
.weather-card-headline { font-size: 14px; line-height: 1.5; margin: 6px 0 8px; color: var(--text); }
.weather-card-details { margin: 6px 0; font-size: 13px; }
.weather-card-details summary { cursor: pointer; color: var(--text2); font-weight: 500; padding: 4px 0; }
.weather-card-details pre { white-space: pre-wrap; word-wrap: break-word; font-family: inherit; font-size: 13px; line-height: 1.5; color: var(--text); margin: 6px 0 0; padding: 10px; background: var(--surface2); border-radius: 6px; }
.weather-card-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text3); margin-top: 8px; flex-wrap: wrap; }
.weather-card-link { margin-left: auto; color: var(--green); text-decoration: none; font-weight: 500; }
.weather-card-link:hover { text-decoration: underline; }

/* ── Weather forecast page (geolocated) ── */
.weather-locate {
  text-align: center; padding: 48px 24px; max-width: 480px; margin: 32px auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.weather-locate-icon { font-size: 48px; margin-bottom: 12px; }
.weather-locate-title { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; margin: 0 0 8px; }
.weather-locate-body { color: var(--text2); line-height: 1.55; margin: 0 0 20px; font-size: 14px; }
.weather-locate-fine { color: var(--text3); font-size: 12px; margin: 14px 0 0; }

/* ──────────────────────────────────────────────────────────────────
 * Forecast widget — header → stats+compass → 24-hour strip → 7-day list.
 * Styled to mirror the radar.agnewsline.com companion widget so users
 * see a familiar, consolidated forecast card. */
.wx-card { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); overflow: hidden; }
.wx-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.wx-head-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wx-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.18); }
.wx-place { font-family: Georgia, 'Times New Roman', serif; font-size: 18px; font-weight: 700; margin: 0; }
.wx-cond { display: inline-flex; align-items: center; gap: 6px; color: var(--text2); font-size: 14px; }
.wx-cond-icon { font-size: 18px; line-height: 1; }
.wx-when { color: var(--text3); font-size: 13px; }

.wx-summary { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: 18px; align-items: center; border-bottom: 1px solid var(--border); }
.wx-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 18px; }
.wx-stat { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.wx-stat-icon { font-size: 18px; line-height: 1.2; flex: 0 0 auto; }
.wx-stat-body { min-width: 0; }
.wx-stat-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; }
.wx-stat-val { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 1px; }
.wx-stat-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }

.wx-compass { flex: 0 0 auto; }
.wx-compass-ring { position: relative; width: 110px; height: 110px; border-radius: 50%; border: 2px solid var(--border); background: radial-gradient(circle at center, #f8fafc 0%, #eef2f7 100%); }
.wx-compass-ring > span { position: absolute; font-size: 10px; color: var(--text3); font-weight: 600; }
.wx-compass-n { top: 4px;  left: 50%; transform: translateX(-50%); }
.wx-compass-s { bottom: 4px; left: 50%; transform: translateX(-50%); }
.wx-compass-e { right: 4px; top: 50%; transform: translateY(-50%); }
.wx-compass-w { left: 4px;  top: 50%; transform: translateY(-50%); }
.wx-compass-needle { position: absolute; left: 50%; top: 50%; width: 2px; height: 42px; margin-left: -1px; margin-top: -42px; background: linear-gradient(to top, transparent 0%, transparent 50%, #16a34a 50%, #16a34a 100%); transform-origin: bottom center; }
.wx-compass-needle::before { content: ''; position: absolute; top: -2px; left: -4px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid #16a34a; }
.wx-compass-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; background: #fff; padding: 8px 10px; border-radius: 50%; min-width: 50px; }
.wx-compass-speed { font-family: Georgia, 'Times New Roman', serif; font-size: 18px; font-weight: 700; line-height: 1; }
.wx-compass-unit { font-size: 9px; color: var(--text3); letter-spacing: 0.08em; margin-top: 1px; }

.wx-section { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.wx-section:last-child { border-bottom: 0; }
.wx-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.wx-section-head h3 { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text2); }
.wx-section-note { font-size: 11px; color: var(--text3); }

.wx-hourly { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.wx-hour { flex: 0 0 78px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border: 1px solid var(--border); border-radius: 10px; background: #fafbfc; }
.wx-hour.is-now { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,0.15); background: #fff; }
.wx-hour-time { font-size: 11px; font-weight: 600; color: var(--text2); }
.wx-hour-icon { font-size: 22px; line-height: 1; }
.wx-hour-temp { font-family: Georgia, 'Times New Roman', serif; font-size: 16px; font-weight: 700; }
.wx-hour-wind { font-size: 10px; color: var(--text3); }
.wx-hour-pop { font-size: 11px; font-weight: 600; color: #1864ab; }

.wx-narrative { display: flex; flex-direction: column; gap: 10px; }
.wx-narrative-row { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fafbfc; }
.wx-narrative-row.is-night { background: #f4f6fb; }
.wx-narrative-icon { width: 56px; height: 56px; flex-shrink: 0; border-radius: 8px; background: rgba(255,255,255,0.6); object-fit: cover; }
.wx-narrative-icon.placeholder { background: repeating-linear-gradient(45deg, #e5e7eb, #e5e7eb 6px, #f3f4f6 6px, #f3f4f6 12px); }
.wx-narrative-body { flex: 1; min-width: 0; }
.wx-narrative-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.wx-narrative-name { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text2); }
.wx-narrative-temp { font-family: Georgia, 'Times New Roman', serif; font-size: 18px; font-weight: 700; }
.wx-narrative-short { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.wx-narrative-meta { font-size: 12px; color: var(--text3); margin-bottom: 6px; }
.wx-narrative-pop { color: #1864ab; font-weight: 600; }
.wx-narrative-detail { font-size: 13px; line-height: 1.55; color: var(--text); margin: 0; }

.wx-daily { list-style: none; margin: 0; padding: 0; }
.wx-day { display: grid; grid-template-columns: 14px 80px 24px 1fr 70px 90px 44px 44px; gap: 10px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--border); font-size: 13px; }
.wx-day:first-child { border-top: 0; }
.wx-day-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.wx-day-name { font-weight: 600; }
.wx-day-icon { font-size: 18px; text-align: center; }
.wx-day-cond { color: var(--text2); }
.wx-day-pop { color: #1864ab; font-weight: 600; }
.wx-day-wind { color: var(--text3); font-size: 12px; }
.wx-day-hi { font-weight: 700; text-align: right; }
.wx-day-lo { color: var(--text3); text-align: right; }

@media (max-width: 720px) {
  .wx-summary { grid-template-columns: 1fr; }
  .wx-stats { grid-template-columns: repeat(2, 1fr); }
  .wx-compass { margin: 0 auto; }
  .wx-day { grid-template-columns: 10px 56px 20px 1fr 36px 36px; gap: 6px; font-size: 12px; }
  .wx-day-cond, .wx-day-wind { display: none; }
}

.weather-strip-more { display: inline-block; font-size: 12px; color: var(--text2); padding: 4px 12px; text-decoration: none; }
.weather-strip-more:hover { text-decoration: underline; }

/* Location prompt — search box + chooser */
.weather-locate-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--text3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.weather-locate-divider::before, .weather-locate-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.weather-search { display: flex; gap: 8px; }
.weather-search input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text); }
.weather-search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
.weather-search-results { margin-top: 12px; text-align: left; }
.weather-search-list { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px; background: var(--surface); }
.weather-search-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 6px; font: inherit; color: var(--text); }
.weather-search-item:hover, .weather-search-item:focus-visible { background: var(--surface2); outline: none; }
.weather-search-place { font-weight: 600; font-size: 14px; }
.weather-search-detail { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Blog entries woven into the Archive timeline / category view */
.rc-badge.blog { background: #f1ede1; color: #8a6d2c; }
.blog-timeline-card { border-left: 3px solid #d6c887; }
.cat-session-blog { background: #fcfaf2; border: 0.5px solid var(--border); border-radius: var(--radius); padding: 6px 4px; }
.cat-session-blog-wrap { padding: 0; background: transparent; border: 0; }

/* Thumbnail tile for blog rows in the Archive timeline */
.blog-timeline-thumb { width: 56px; height: 42px; flex-shrink: 0; border-radius: 6px; background-size: cover; background-position: center; background-repeat: no-repeat; border: 0.5px solid var(--border); }
.blog-timeline-thumb-placeholder { display: flex; align-items: center; justify-content: center; }

/* ── Home highlights (urgency hierarchy) ──
 * Three different treatments based on highlight_type:
 *   alert    → slim full-width red strip(s) at the very top (.alert-strip)
 *   featured → big banner card below the alerts (.featured-banner)
 *   new_post → not rendered up here — only as a green ribbon on the
 *              matching "From the blog" strip card.
 */

/* Slim, single-line alert strip. Stacks vertically if more than one. */
.alert-strip-stack { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 14px; }
.alert-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  background: linear-gradient(90deg, #fff1f1 0%, #ffe2e2 100%);
  border: 1px solid #e88c8c; border-left: 4px solid #c92a2a;
  color: #6e1f1f; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.alert-strip:hover, .alert-strip:focus-visible {
  transform: translateY(-1px); outline: none;
  box-shadow: 0 4px 12px rgba(201, 42, 42, 0.18);
}
.alert-strip-glyph { color: #c92a2a; font-size: 16px; line-height: 1; }
.alert-strip-label {
  font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: #c92a2a; padding: 2px 7px; border: 1px solid #e88c8c; border-radius: 99px;
  background: #fff;
}
.alert-strip-title {
  font-weight: 600; color: #4a1717; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.alert-strip-timer {
  font-size: 11px; color: #8a2222; padding: 2px 7px;
  background: #fff; border: 1px solid #e88c8c; border-radius: 99px;
  white-space: nowrap;
}
.alert-strip-cta {
  font-size: 12px; font-weight: 600; color: #c92a2a; white-space: nowrap;
}
@media (max-width: 720px) {
  .alert-strip-cta { display: none; }
  .alert-strip-title { white-space: normal; }
}

/* Responsive grid for up to 2 side-by-side Featured banner cards. Each
 * card already handles its own internal image+text layout; this wrapper
 * just lays them out 1- or 2-up and collapses on narrow viewports. */
.featured-grid { display: grid; gap: 14px; margin: 8px 0 22px; grid-template-columns: 1fr; }
.featured-grid[data-count="2"] { grid-template-columns: 1fr 1fr; }
@media (max-width: 980px) {
  .featured-grid[data-count="2"] { grid-template-columns: 1fr; }
}
/* When a Featured banner is inside the grid, the wrapper provides the
 * outer margin so individual cards don't double-space. */
.featured-grid .featured-banner { margin: 0; }

.featured-banner {
  margin: 8px 0 22px;
  /* Color tokens — overridden per highlight type below. */
  --hi-bg-from: #fffbe6;
  --hi-bg-to:   #fff7d1;
  --hi-border:  #e7d177;
  --hi-accent:  #d4a017;
  --hi-text:    #8a6d2c;
  --hi-glow:    rgba(212, 175, 55, 0.18);
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--hi-bg-from) 0%, var(--hi-bg-to) 100%);
  border: 1px solid var(--hi-border); border-radius: var(--radius-lg);
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
  position: relative; overflow: hidden;
}
.featured-banner[data-htype="alert"] {
  --hi-bg-from: #fff1f1; --hi-bg-to: #ffd9d9;
  --hi-border:  #e88c8c; --hi-accent: #c92a2a;
  --hi-text:    #8a2222; --hi-glow:   rgba(201, 42, 42, 0.20);
}
.featured-banner[data-htype="new_post"] {
  --hi-bg-from: #ecfdf3; --hi-bg-to: #d4f5e0;
  --hi-border:  #8ad1a3; --hi-accent: #2f9e57;
  --hi-text:    #1f6b3b; --hi-glow:   rgba(47, 158, 87, 0.20);
}
.featured-banner:hover, .featured-banner:focus-visible {
  transform: translateY(-1px); outline: none;
  box-shadow: 0 6px 20px var(--hi-glow);
}
.featured-banner-eyebrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--hi-text); margin-bottom: 12px;
}
.featured-banner-star { color: var(--hi-accent); font-size: 14px; }
.featured-banner-countdown {
  margin-left: auto; padding: 3px 9px; background: #fff;
  border: 1px solid var(--hi-border); border-radius: 99px;
  font-size: 11px; color: var(--hi-text); letter-spacing: 0.04em;
}
.featured-banner-grid {
  display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center;
}
.featured-banner-img {
  width: 100%; aspect-ratio: 16/10; border-radius: 10px;
  background-size: cover; background-position: center;
  background-color: var(--surface2);
}
.featured-banner-img-placeholder { display: flex; align-items: center; justify-content: center; }
.featured-banner-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.featured-banner-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px; font-weight: 600; line-height: 1.25; margin: 4px 0 0; color: var(--text);
}
.featured-banner-excerpt { font-size: 14px; color: var(--text2); line-height: 1.55; margin: 4px 0 0; }
.featured-banner-meta { font-size: 12px; color: var(--text3); margin-top: 4px; }
@media (max-width: 720px) {
  .featured-banner-grid { grid-template-columns: 1fr; }
  .featured-banner-img { max-height: 180px; }
}

/* Ribbon + pulse glow on a highlighted card inside the home blog strip.
 * Color tokens are driven by `data-htype` (defaults to yellow/featured). */
.blog-card.is-featured {
  --hi-border: #e7d177; --hi-accent: #d4a017; --hi-glow-rgb: 212,160,23;
  border-color: var(--hi-border);
  box-shadow: 0 0 0 0 rgba(var(--hi-glow-rgb), 0.45);
  animation: featuredPulse 2.4s ease-in-out infinite;
  position: relative;
}
.blog-card.is-featured[data-htype="alert"]    { --hi-border:#e88c8c; --hi-accent:#c92a2a; --hi-glow-rgb:201,42,42; }
.blog-card.is-featured[data-htype="new_post"] { --hi-border:#8ad1a3; --hi-accent:#2f9e57; --hi-glow-rgb:47,158,87; }
.blog-card-ribbon {
  position: absolute; top: 10px; left: -34px;
  transform: rotate(-35deg);
  background: linear-gradient(90deg, var(--hi-accent, #d4a017), color-mix(in srgb, var(--hi-accent, #d4a017) 65%, white));
  color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 38px; z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
@keyframes featuredPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--hi-glow-rgb), 0.0); border-color: var(--hi-border); }
  50%      { box-shadow: 0 0 0 6px rgba(var(--hi-glow-rgb), 0.22); border-color: var(--hi-accent); }
}

/* Small "★ Featured" / "⚠ Alert" / "✦ New" pill used on the Blogs list
 * and Archive timeline rows. Defaults to yellow; data-htype overrides. */
.featured-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 99px;
  background: #fff7d1; color: #8a6d2c;
  border: 1px solid #e7d177;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  vertical-align: middle;
}
.featured-pill[data-htype="alert"]    { background:#ffe2e2; color:#8a2222; border-color:#e88c8c; }
.featured-pill[data-htype="new_post"] { background:#dcf5e6; color:#1f6b3b; border-color:#8ad1a3; }
.blog-list-card.is-featured { border-color: #e7d177; }
.blog-list-card.is-featured[data-htype="alert"]    { border-color:#e88c8c; }
.blog-list-card.is-featured[data-htype="new_post"] { border-color:#8ad1a3; }
.blog-timeline-card.is-featured { border-left-color: #d4a017; }
.blog-timeline-card.is-featured[data-htype="alert"]    { border-left-color:#c92a2a; }
.blog-timeline-card.is-featured[data-htype="new_post"] { border-left-color:#2f9e57; }

/* Highlight-type radio chips inside the composer */
.bp-htype-opt { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text2); cursor: pointer; }
.bp-htype-opt input[type="radio"] { margin: 0; }
.bp-htype-opt input[type="radio"]:disabled + span { opacity: 0.5; cursor: not-allowed; }

/* Composer "Highlight on home" controls */
.bp-highlight-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bp-highlight-row input[type="number"] { width: 80px; }
.bp-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text2); cursor: pointer; }

/* Inline images inside blog post bodies */
.blog-inline-figure { margin: 18px 0; text-align: center; }
.blog-inline-figure img { max-width: 100%; height: auto; border-radius: 8px; border: 0.5px solid var(--border); display: inline-block; }
.blog-inline-figure figcaption { font-size: 12px; color: var(--text3); margin-top: 6px; font-style: italic; }
.blog-inline-img { max-width: 100%; height: auto; border-radius: 6px; border: 0.5px solid var(--border); margin: 6px 0; vertical-align: middle; }
.bp-body-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }

/* Per-card chart label on the Markets cards — clarifies that the
 * sparkline covers the most recent 30 daily closes. */
.mkt-card-chart-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 4px; }
.mkt-card-hilo { display: inline-flex; gap: 8px; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.mkt-card-hilo .hi { color: #1b6e2a; font-weight: 600; }
.mkt-card-hilo .lo { color: #a13629; font-weight: 600; }

/* Admin Lists screen — tabs along the top, generic table below. */
.lists-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; border-bottom: 0.5px solid var(--border); padding-bottom: 8px; }
.lists-tab { padding: 6px 14px; background: transparent; border: 0.5px solid var(--border); border-radius: 999px; font-size: 13px; font-family: inherit; color: var(--text2); cursor: pointer; }
.lists-tab:hover { background: #f5f4f0; color: var(--text); }
.lists-tab.active { background: #27500a; color: #fff; border-color: #27500a; }
.lists-tab-count { display: inline-block; margin-left: 4px; font-size: 11px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.lists-table td code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--text3); }

/* ── Blog post share row ───────────────────────────────────────────── */
.blog-share {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 32px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.blog-share-label { font-size: 13px; color: var(--text2); margin-right: 4px; font-weight: 500; }
.blog-share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 500; font-family: inherit;
  color: var(--text2); background: #f5f4f0;
  border: 0.5px solid var(--border); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.blog-share-btn:hover { background: #eaf3de; color: #27500a; border-color: #cfe2a8; text-decoration: none; }
.blog-share-btn svg { display: block; }

/* ── Live radar embed on the Weather screen ─────────────────────────
 * Renders the radar.agnewsline.com site inside an iframe so users
 * can pan/zoom without leaving Ag Newsline. The header shows the
 * title and a fallback "Open in new tab" link in case the embed
 * is blocked by the browser. */
.radar-embed {
  margin: 0 0 16px;
  border: 0.5px solid var(--border);
  border-left: 3px solid #378add;
  border-radius: var(--radius);
  background: #eaf2fa;
  overflow: hidden;
}
.radar-embed-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 0.5px solid #b5d4f4;
}
.radar-embed-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%; background: #ffffff;
  display: inline-flex; align-items: center; justify-content: center;
  color: #378add; border: 0.5px solid #b5d4f4;
}
.radar-embed-title { flex: 1; font-size: 14px; font-weight: 600; color: #0c447c; }
.radar-embed-cta {
  font-size: 12px; font-weight: 600; color: #0c447c;
  text-decoration: none; letter-spacing: 0.02em;
}
.radar-embed-cta:hover { text-decoration: underline; }
.radar-embed-frame {
  display: block;
  width: 100%;
  height: 480px;
  border: 0;
  background: #fff;
}
@media (max-width: 760px) {
  .radar-embed-frame { height: 360px; }
}

/* ── Local elevator bids (Markets page + admin screen) ── */
.elev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; margin-top: 6px; }
.elev-card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.elev-card-head { padding: 12px 14px; border-bottom: 0.5px solid var(--border); background: var(--surface2); }
.elev-name { font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.elev-loc { font-size: 12px; color: var(--text3); font-weight: 400; }
.elev-meta { font-size: 12px; color: var(--text3); margin-top: 2px; }
.elev-meta a { color: var(--blue-t); text-decoration: none; }
.elev-meta a:hover { text-decoration: underline; }
.elev-bid-head, .elev-bid-row {
  display: grid; grid-template-columns: 1.4fr 1fr 0.8fr 0.9fr;
  align-items: baseline; gap: 8px; padding: 9px 14px;
}
.elev-bid-head { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); background: var(--surface2); }
.elev-bid-row { border-top: 0.5px solid var(--border); font-size: 13px; }
.elev-bid-row .elev-bid-cmd { font-weight: 500; }
.elev-bid-period { font-size: 10.5px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-left: 6px; }
.elev-bid-px .px { font-variant-numeric: tabular-nums; font-weight: 600; }
.elev-bid-px .unit { font-size: 11px; color: var(--text3); margin-left: 4px; }
.elev-bid-when { font-size: 11px; color: var(--text3); text-align: right; }
.elev-basis { font-variant-numeric: tabular-nums; font-weight: 600; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.elev-basis.mkt-up   { color: #1c6e3a; background: rgba(28,110,58,0.10); }
.elev-basis.mkt-down { color: #a32d2d; background: rgba(163,45,45,0.10); }
.elev-basis.mkt-flat { color: var(--text3); background: var(--surface2); }

/* Admin screen */
.elev-admin-card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 14px; }
.elev-admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.elev-bids-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.elev-bids-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); padding: 6px 8px; background: var(--surface2); border-bottom: 0.5px solid var(--border); }
.elev-bids-table td { padding: 8px; border-bottom: 0.5px solid var(--border); vertical-align: middle; }
.elev-bids-table td.num { text-align: right; }
.elev-bids-table .unit { font-size: 11px; color: var(--text3); }

@media (max-width: 700px) {
  .elev-bid-head, .elev-bid-row { grid-template-columns: 1.4fr 1fr 0.9fr; }
  .elev-bid-head > div:last-child, .elev-bid-row .elev-bid-when { display: none; }
}

/* ── AI voice "Listen" card ── */
.listen-card {
  background: linear-gradient(135deg, #f7f3ff 0%, #eef4ff 100%);
  border: 0.5px solid #d8d3f0;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 14px 0 18px;
}
.listen-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.listen-icon { font-size: 28px; line-height: 1; }
.listen-text { flex: 1 1 220px; min-width: 0; }
.listen-title { font-size: 15px; font-weight: 700; color: var(--text); }
.listen-sub   { font-size: 12.5px; color: var(--text2); margin-top: 2px; }
.listen-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.listen-weather-toggle {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2);
  cursor: pointer; user-select: none;
}
.listen-weather-toggle--off { opacity: 0.55; cursor: not-allowed; }
.listen-weather-toggle input { margin: 0; }
.listen-status {
  margin-top: 12px; padding: 8px 10px; border-radius: 6px; font-size: 12.5px;
}
.listen-status-info { background: #eef2ff; color: #3730a3; border: 0.5px solid #c7d2fe; }
.listen-status-err  { background: #fef2f2; color: #991b1b; border: 0.5px solid #fecaca; }
.listen-player { margin-top: 12px; }
.listen-player audio { width: 100%; }
.listen-meta { font-size: 11.5px; color: var(--text3); margin-top: 6px; }
.listen-transcript-toggle { margin-top: 8px; }
.listen-transcript {
  margin-top: 8px; padding: 10px 12px; max-height: 280px; overflow-y: auto;
  background: rgba(255,255,255,0.6); border: 0.5px solid var(--border);
  border-radius: 6px; font-size: 13px; line-height: 1.55; color: var(--text);
}
.listen-transcript p { margin: 0 0 8px; }
.listen-transcript p:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .listen-actions { width: 100%; justify-content: space-between; }
}

/* ── Inline shared mini-player rendered inside the Listen card.
     Replaces the old native <audio controls> so the card and the
     persistent header player share one underlying <audio> element. ── */
.listen-mini-player {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius);
  background: rgba(255,255,255,0.7); border: 0.5px solid #c5d8c2;
}
.listen-mini-btn {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #1f4e8c 0%, #6b9b3f 100%);
  color: #fff; border: none; cursor: pointer;
  font-size: 14px; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center;
}
.listen-mini-btn:hover:not(:disabled) { filter: brightness(1.05); }
.listen-mini-btn:disabled { opacity: 0.7; cursor: progress; }
.listen-mini-meta { flex: 1; min-width: 0; }
.listen-mini-time {
  font-size: 12px; color: var(--text3); font-variant-numeric: tabular-nums;
}
.listen-mini-progress {
  height: 4px; border-radius: 999px; background: #dde7d6;
  margin-top: 4px; overflow: hidden;
}
.listen-mini-bar {
  height: 100%; width: 0%; background: linear-gradient(90deg, #1f4e8c, #6b9b3f);
  transition: width 0.25s linear;
}
.listen-mini-status { font-size: 12px; color: var(--text2); margin-top: 2px; }
.listen-mini-status.err { color: #991b1b; }

/* ── Persistent header audio player ──
   Lives in the topbar between the nav and auth controls. Picks up the
   logo's blue→green palette (deep ocean blue + leaf green, dark-green
   outline) so it reads as a first-class part of the brand. */
.header-audio-stack {
  display: flex; align-items: center; gap: 6px;
  margin-left: auto; min-width: 0;
}
.header-audio {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 10px 2px 2px; border-radius: 999px;
  background: linear-gradient(135deg, #eef3fa 0%, #eef5e4 100%);
  border: 0.5px solid #c5d8c2;
  max-width: 180px; min-width: 0;
}
.header-audio[hidden] { display: none; }
/* Local-forecast variant — sky/rain palette so it reads as distinct
   from the green-leaf briefing pill at a glance. */
.header-audio-wx {
  background: linear-gradient(135deg, #e0f0ff 0%, #cfe6f7 100%);
  border-color: #9fc7e6;
}
.header-audio-wx .ha-btn {
  background: linear-gradient(135deg, #1f4e8c 0%, #4aa3df 100%);
}
.header-audio-wx .ha-title { color: #14416a; }
.ha-btn {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  border: none; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #1f4e8c 0%, #6b9b3f 100%);
  font-size: 11px; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center;
  font-family: inherit;
}
.ha-btn:hover:not(:disabled) { filter: brightness(1.05); }
.ha-btn:disabled { opacity: 0.7; cursor: progress; }
.ha-btn.err { background: #991b1b; }
.ha-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.ha-title {
  font-size: 11px; font-weight: 600; color: #1f4d23;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 140px;
}
.ha-time {
  font-size: 10px; color: var(--text3); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 140px;
}
.ha-spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: ha-spin 0.8s linear infinite;
}
@keyframes ha-spin { to { transform: rotate(360deg); } }

/* On narrow viewports the header player collapses to icon + truncated
   title, and gives up its right-side margin so the auth nav still fits. */
@media (max-width: 720px) {
  .header-audio { max-width: 140px; padding: 2px 8px 2px 2px; gap: 6px; }
  .ha-title { max-width: 90px; font-size: 11px; }
  .ha-time { display: none; }
}
@media (max-width: 480px) {
  .header-audio .ha-meta { display: none; }
  .header-audio { max-width: 40px; }
}

/* ── Mobile layout (≤720px) ─────────────────────────────────────────
 * Three changes to make the app usable on phones:
 *   1. Hamburger button reveals the sidebar as a slide-in drawer.
 *   2. Top nav scrolls horizontally instead of wrapping.
 *   3. Persistent audio player docks to the bottom of the viewport
 *      (full width) so it doesn't compete for topbar space. */
.topbar-menu-btn {
  display: none;
  width: 36px; height: 36px; flex-shrink: 0;
  border: none; background: transparent; border-radius: 8px;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--text);
  align-items: center; justify-content: center;
  font-family: inherit;
}
.topbar-menu-btn:hover { background: var(--surface2); }
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}
.sidebar-backdrop:not([hidden]) { display: block; }

@media (max-width: 720px) {
  /* Topbar — shrink logo, expose hamburger, show nav as evenly-spaced
     icons so all 6 fit without horizontal scrolling. */
  .topbar { gap: 6px; padding: 0 8px; }
  .topbar-menu-btn { display: inline-flex; }
  .logo { gap: 0; }
  .logo-img { width: 36px; height: 36px; }
  .topnav {
    flex: 1; min-width: 0;
    display: flex; flex-wrap: nowrap;
    justify-content: space-around; align-items: center;
    gap: 0;
  }
  .tnav {
    flex: 1 1 0; min-width: 0;
    padding: 8px 4px; min-height: 40px;
    justify-content: center;
  }
  .tnav-icon { font-size: 18px; }
  .tnav-label { display: none; }

  /* Sidebar drawer — hidden off-screen, slides in when .open */
  .sidebar {
    position: fixed; top: 52px; left: 0; bottom: 0;
    width: 280px; max-width: 85vw;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 100;
    box-shadow: 2px 0 16px rgba(0,0,0,0.18);
    border-right: 0.5px solid var(--border);
    padding: 16px 12px;
  }
  .sidebar.open { transform: translateX(0); }
  /* Override the desktop "hide sidebar on Home" rule — on mobile the
     drawer is always reachable via the hamburger, even from Home. */
  body.home-active .sidebar { display: flex; }
  .sb-item { padding: 10px 10px; font-size: 14px; }

  /* Persistent audio players → bottom dock (full width, stacked). The
     stack wrapper is fixed; each visible pill is a row inside it. */
  .header-audio-stack {
    position: fixed; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: none; min-width: 0;
    margin: 0; gap: 0;
    flex-direction: column;
    z-index: 80;
  }
  .header-audio:not([hidden]) {
    width: 100%; max-width: none; min-width: 0;
    margin: 0; border-radius: 0;
    border: 0; border-top: 0.5px solid #c5d8c2;
    padding: 10px 14px; gap: 12px;
  }
  .header-audio-wx:not([hidden]) { border-top-color: #9fc7e6; }
  .header-audio .ha-meta { display: flex; flex: 1; min-width: 0; }
  .header-audio .ha-title { max-width: none; font-size: 13px; }
  .header-audio .ha-time { display: block; font-size: 11px; }
  .ha-btn { width: 40px; height: 40px; font-size: 14px; }
  /* Reserve room above the bottom dock(s) so the last bit of content
     isn't trapped behind them. Each visible pill ≈ 60px tall. */
  body.has-audio-bar .main         { padding-bottom: 80px; }
  body.has-weather-audio-bar .main { padding-bottom: 80px; }
  body.has-audio-bar.has-weather-audio-bar .main { padding-bottom: 144px; }
}

/* ── Ads & monetization ── */
.ad-slot {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafaf7;
  overflow: hidden;
}
.ad-slot-label {
  padding: 4px 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  background: #f1efe8;
  border-bottom: 1px solid var(--border);
}
.ad-slot-link { display: block; line-height: 0; text-decoration: none; }
.ad-slot-link img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
}

/* Admin Ads screen */
.ads-slot-section { margin-bottom: 24px; }
.ads-slot-heading {
  font-size: 14px; font-weight: 600; margin: 8px 0 10px;
  color: var(--text1); text-transform: none; letter-spacing: 0;
}
.ads-slot-count { color: var(--text3); font-weight: 400; font-size: 12px; }
.ads-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}
.ad-card {
  display: grid; grid-template-columns: 120px 1fr; gap: 12px;
  padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff;
}
.ad-card-inactive { opacity: 0.6; }
.ad-card-thumb { width: 120px; height: 90px; border-radius: 6px; overflow: hidden; background: #f1efe8; }
.ad-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-card-noimg {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text3);
}
.ad-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ad-card-name { font-weight: 600; font-size: 14px; color: var(--text1); }
.ad-card-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.ad-card-link {
  color: var(--text2); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.ad-card-link:hover { text-decoration: underline; }
.ads-window { font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; }
.ad-card-stats { font-size: 11px; color: var(--text2); display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.ad-card-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge-on  { background: #d1fae5; color: #065f46; }
.badge-off { background: #fee2e2; color: #991b1b; }

/* Ad editor modal — minimal styling so it works without depending on
   pre-existing modal classes elsewhere in the app. */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 1000; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex; flex-direction: column;
  /* Allow tall forms (e.g. the recipient signup with chips + textarea)
   * to scroll inside the modal so the Save / Sign-up button is always
   * reachable. Pairs with the first .modal rule's max-height: 92vh. */
  max-height: calc(100vh - 80px);
  overflow-y: auto; overflow-x: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal .form { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.modal .form label {
  display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  color: var(--text2); font-weight: 600;
}
.modal .form input, .modal .form select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit;
}
.modal .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal .form-check { flex-direction: row !important; align-items: center; gap: 8px; }
.modal .form-check input { width: auto; }
.modal .form-hint { font-size: 11px; color: var(--text3); }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 8px; border-top: 1px solid var(--border); margin-top: 8px;
  padding: 12px 0 0;
}

/* ── Approval gating (v9) ───────────────────────────────────────────── */
.approval-banner {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 12px;
  align-items: center; padding: 12px 14px; border-radius: 10px;
  margin: 12px 0; background: #fff7e6; border: 1px solid #f5c97a;
}
.approval-banner.approval-pending { background:#fff7e6; border-color:#f5c97a; }
.approval-banner .ab-icon { font-size: 22px; text-align: center; }
.approval-banner .ab-title { font-weight: 600; color: #8a5a00; }
.approval-banner .ab-sub   { font-size: 12px; color: #7a5500; margin-top: 2px; }
.approval-banner .ab-actions { display: flex; gap: 6px; }
@media (max-width: 600px) {
  .approval-banner { grid-template-columns: 1fr; }
  .approval-banner .ab-actions { justify-content: stretch; }
  .approval-banner .ab-actions .btn { flex: 1; }
}
.approval-status {
  display:inline-block; padding:4px 10px; border-radius:999px;
  font-size:11px; font-weight:600; margin:8px 0;
}
.approval-status-ok   { background:#e6f6ea; color:#1f7a3a; border:1px solid #b5e0c2; }
.approval-status-auto { background:#eef2ff; color:#3a44a8; border:1px solid #c2c9f0; }
.approval-status-bad  { background:#fdecec; color:#a8302a; border:1px solid #f0c2c2; }

.rc-approval {
  display:inline-block; padding:2px 8px; border-radius:999px;
  font-size:10px; font-weight:600; margin-left:6px;
}
.rc-approval-pend { background:#fff7e6; color:#8a5a00; border:1px solid #f5c97a; }
.rc-approval-ok   { background:#e6f6ea; color:#1f7a3a; border:1px solid #b5e0c2; }
.rc-approval-auto { background:#eef2ff; color:#3a44a8; border:1px solid #c2c9f0; }
.rc-approval-bad  { background:#fdecec; color:#a8302a; border:1px solid #f0c2c2; }

.home-approvals {
  background:#fff7e6; border:1px solid #f5c97a; border-radius:10px;
  padding:10px 12px; margin: 10px 0 14px;
}
.home-approvals .ha-head { font-weight:600; color:#8a5a00; margin-bottom:6px; }
.home-approvals .ha-row {
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  width:100%; padding:8px 10px; margin-top:6px;
  background:#fff; border:1px solid #f0d8a8; border-radius:8px;
  cursor:pointer; font-family:inherit; font-size:13px; text-align:left;
}
.home-approvals .ha-row:hover { background:#fffaf0; }
.home-approvals .ha-kind { font-weight:600; min-width:90px; }
.home-approvals .ha-when { color:#666; }
.home-approvals .ha-deadline { color:#8a5a00; font-size:12px; }
.home-approvals .ha-cta { margin-left:auto; color:#1f6feb; font-weight:600; }
