/* ===========================================================
   WEATHER PROTOCOL — page components
   =========================================================== */

/* ---------- empty / error states ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 220px;
  text-align: center;
  color: var(--fg-3);
}
.empty-state h2 {
  margin: 4px 0 0;
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.empty-state p { margin: 0; max-width: 42ch; font-size: var(--fs-sm); }
.empty-state svg { opacity: .35; }
.empty-state.allclear svg { color: var(--ok); opacity: .7; }

/* ===========================================================
   NOW page
   =========================================================== */

.now-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr);
  gap: var(--gap);
  align-items: start;
}
.now-col-main, .now-col-side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

@media (max-width: 1080px) {
  .now-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- hero ---------- */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
}
.hero-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.hero-icon { color: var(--a); filter: drop-shadow(0 0 14px var(--a-glow)); flex: none; }
.hero-read { min-width: 0; }
.hero-temp {
  font-size: var(--fs-3xl);
  font-weight: 300;
  line-height: .95;
  letter-spacing: -.03em;
  color: var(--fg-hi);
}
.hero-cond {
  font-size: var(--fs-md);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--a);
  margin-top: 4px;
}
.hero-feels { font-size: var(--fs-xs); color: var(--fg-3); margin-top: 2px; }

.hero-side { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.hero-hilo { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-sm); }
.hero-hilo span { display: flex; align-items: center; gap: 5px; color: var(--fg); }
.hero-hilo .lo { color: var(--fg-3); }
.hero-meta { text-align: right; font-size: var(--fs-xs); color: var(--fg-2); }

/* ---------- alert strip ---------- */
.alert-strip { display: flex; flex-direction: column; gap: 8px; }
.alert-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px 10px 0;
  background: var(--panel);
  border: 1px solid var(--ac, var(--danger));
  border-radius: var(--r);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background var(--speed);
}
.alert-card:hover { background: var(--panel-2); }
.alert-card-bar { width: 3px; align-self: stretch; background: var(--ac); flex: none; }
.alert-card b { color: var(--ac); font-size: var(--fs-sm); }

/* ---------- nowcast ---------- */
.nowcast { display: flex; flex-direction: column; gap: 10px; }
.nc-headline { display: flex; align-items: flex-start; gap: 14px; }
.nc-icon { color: var(--a); flex: none; filter: drop-shadow(0 0 8px var(--a-glow)); }
.nc-head {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--fg-hi);
  line-height: 1.2;
}
.nc-detail { font-size: var(--fs-xs); color: var(--fg-2); margin-top: 3px; }
.nc-peak { text-align: right; flex: none; }
.nc-peak-v { font-size: var(--fs-sm); color: var(--a); font-weight: 600; }
.nc-foot { border-top: 1px solid var(--line); padding-top: 8px; }

.nc-chart { position: relative; width: 100%; }
.nc-canvas { display: block; width: 100%; cursor: crosshair; }
.nc-tip {
  position: absolute;
  top: -4px;
  transform: translate(-50%, -100%);
  padding: 6px 9px;
  background: var(--raised);
  border: 1px solid var(--a-line);
  border-radius: var(--r);
  font-size: var(--fs-micro);
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 5;
  box-shadow: var(--shadow);
}
.nc-tip.show { opacity: 1; }
.nc-tip b { color: var(--a); }

/* ---------- tiles ---------- */
.tile-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}
.tile {
  padding: 10px 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  border-left: 2px solid var(--tc, var(--a-line));
}
.tile-head { display: flex; align-items: center; gap: 7px; color: var(--tc, var(--fg-3)); }
.tile-head svg { flex: none; }
.tile-val {
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--fg-hi);
  margin-top: 5px;
  line-height: 1.1;
}
.tile-sub { font-size: var(--fs-micro); color: var(--fg-3); margin-top: 2px; }

/* ---------- key/value lists ---------- */
.kv-list { display: flex; flex-direction: column; gap: 7px; }
.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--fs-sm);
}
.kv + .kv { border-top: 1px dotted var(--line); padding-top: 7px; }

/* ---------- sun arc ---------- */
.sun-arc { position: relative; height: 34px; margin-top: 4px; }
.sun-arc-track {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 30px;
  border-top: 1px dashed var(--a-line);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
}
.sun-arc-dot {
  position: absolute;
  bottom: 0;
  width: 9px; height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--a);
  box-shadow: 0 0 10px var(--a-glow);
  transition: left .6s ease, transform .6s ease;
}
.sun-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-micro);
  color: var(--fg-3);
}

/* ---------- horizontal hour strip ---------- */
.strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}
.strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 58px;
  padding: 8px 4px;
  border-radius: var(--r);
  scroll-snap-align: start;
  flex: none;
  transition: background var(--speed);
}
.strip-item:hover { background: var(--a-wash); }
.strip-item svg { color: var(--a); }
.strip-temp { font-size: var(--fs-sm); color: var(--fg-hi); }
.strip-pop { font-size: var(--fs-micro); color: var(--info); min-height: 12px; }

/* ---------- compact day list (Now page) ---------- */
.day-list { display: flex; flex-direction: column; }
.day-row {
  display: grid;
  grid-template-columns: 52px 22px 34px 38px 1fr 38px;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: var(--fs-sm);
}
.day-row + .day-row { border-top: 1px solid var(--line); }
.day-row svg { color: var(--a); }
.day-name { color: var(--fg-2); }
.day-pop { font-size: var(--fs-micro); color: var(--info); text-align: right; }
.day-lo { color: var(--fg-3); text-align: right; }
.day-hi { color: var(--fg-hi); text-align: right; }
.day-bar {
  position: relative;
  height: 4px;
  background: var(--panel-2);
  border-radius: 2px;
  overflow: hidden;
}
.day-bar-fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cold), var(--warn), var(--heat));
}

/* ---------- sources ---------- */
.src-list { display: flex; flex-direction: column; gap: 5px; }
.src-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  padding: 3px 0;
}
.src-note { color: var(--fg-3); flex: none; max-width: 40%; }
.src-age { color: var(--fg-3); flex: none; min-width: 62px; text-align: right; }
.src-attrib {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  line-height: 1.6;
  color: var(--fg-3);
}

/* ===========================================================
   HOURLY page
   =========================================================== */

.graph-wrap { width: 100%; overflow: hidden; }
.hourly-graph { width: 100%; height: 240px; display: block; }
.hourly-graph .g-grid   { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hourly-graph .g-day    { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.hourly-graph .g-line   { fill: none; stroke: var(--a); stroke-width: 2; vector-effect: non-scaling-stroke;
                          stroke-linejoin: round; stroke-linecap: round; }
.hourly-graph .g-ylabel,
.hourly-graph .g-xlabel,
.hourly-graph .g-daylabel {
  fill: var(--fg-3);
  font: 10px var(--mono);
}
.hourly-graph .g-daylabel { fill: var(--fg-2); font-weight: 600; }

.metric-select { width: auto !important; }

.table-wrap { max-height: 62vh; overflow: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-xs);
}
.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 7px 8px;
  background: var(--panel);
  border-bottom: 1px solid var(--a-line);
  color: var(--fg-3);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
}
.data-table th:first-child, .data-table th:nth-child(2) { text-align: left; }
.data-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td.num { text-align: right; }
.data-table td.dim { color: var(--fg-3); }
.data-table td svg { color: var(--a); display: block; }
.data-table tbody tr:hover { background: var(--a-wash); }
.data-table tr.wet { background: rgba(47, 182, 255, .05); }
.data-table tr.day-sep td {
  padding: 9px 8px 4px;
  color: var(--a);
  font-size: var(--fs-micro);
  letter-spacing: .16em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--a-line);
  background: var(--panel);
}

/* ===========================================================
   DAILY page
   =========================================================== */

.temp-legend {
  display: inline-block;
  width: 90px; height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cold), var(--warn), var(--heat));
}

.day-table { display: flex; flex-direction: column; }
.day-block + .day-block { border-top: 1px solid var(--line); }
.day-block.open { background: var(--panel-2); }

.day-main {
  display: grid;
  grid-template-columns: 16px 110px 28px minmax(90px, 1fr) 40px 56px 40px minmax(60px, 120px) 40px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 4px;
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
}
.day-main:hover { background: var(--a-wash); }
.day-caret { color: var(--fg-3); display: flex; transition: transform var(--speed); }
.day-caret.open { transform: rotate(90deg); color: var(--a); }
.day-when b { display: block; }
.day-icon { color: var(--a); display: flex; }
.day-cond { color: var(--fg-2); font-size: var(--fs-xs); }
.day-amt { text-align: right; }

.day-detail {
  padding: 4px 4px 16px 26px;
  animation: pageIn .2s ease;
}
.day-detail-stats {
  display: grid;
  gap: 6px 22px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 12px;
}
.day-detail-stats .kv + .kv { border: 0; padding-top: 0; }
.day-hours { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; }

@media (max-width: 860px) {
  .day-main {
    /* number columns size to their text, so the Text size setting can't push them off-screen */
    grid-template-columns: 14px minmax(0, 1fr) 24px auto auto minmax(40px, 80px) auto;
  }
  .day-cond, .day-amt { display: none; }
}

/* ===========================================================
   ALERTS page
   =========================================================== */

.alert-list { display: flex; flex-direction: column; gap: 10px; }

.alert-full {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--ac, var(--danger));
  border-radius: var(--r);
  overflow: hidden;
}
.alert-full-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.alert-full-head:hover { background: var(--panel-2); }
.alert-event { color: var(--ac); font-size: var(--fs-md); }
.alert-area { font-size: var(--fs-xs); color: var(--fg-2); margin-top: 3px; }
.alert-caret { color: var(--fg-3); transition: transform var(--speed); flex: none; margin-top: 3px; }
.alert-caret.open { transform: rotate(90deg); }
.alert-full-bar { display: none; }

.alert-body {
  padding: 0 14px 14px 14px;
  border-top: 1px solid var(--line);
  animation: pageIn .2s ease;
}
.alert-tags { margin: 12px 0; }
.alert-headline {
  margin: 12px 0 8px;
  font-size: var(--fs-sm);
  color: var(--fg-hi);
  font-weight: 600;
}
.alert-text {
  white-space: pre-wrap;
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--fg-2);
  max-height: 460px;
  overflow-y: auto;
}
.alert-instruction {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--a-wash);
  border-left: 2px solid var(--a);
  border-radius: 0 var(--r) var(--r) 0;
}
.alert-instruction .alert-text { color: var(--fg); }
.alert-meta {
  display: grid;
  gap: 4px 20px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
}
.alert-meta .kv + .kv { border: 0; padding-top: 0; }

/* ===========================================================
   SETTINGS page
   =========================================================== */

.settings-filter { width: 220px !important; }

.settings-wrap {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}
@media (max-width: 860px) {
  .settings-wrap { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { display: none; }
}

.settings-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--fg-3);
  font: inherit;
  font-size: var(--fs-xs);
  text-align: left;
  cursor: pointer;
  transition: color var(--speed), background var(--speed), border-color var(--speed);
}
.settings-nav-btn:hover {
  color: var(--a);
  background: var(--a-wash);
  border-left-color: var(--a);
}
.settings-nav-btn.dim { opacity: .35; }
.settings-nav-sep { height: 1px; background: var(--line); margin: 8px 0; }

.settings-body { display: flex; flex-direction: column; gap: var(--gap); }
.settings-group-hint {
  margin: -4px 0 10px;
  font-size: var(--fs-xs);
  color: var(--fg-3);
  max-width: 62ch;
}
.settings-items { display: flex; flex-direction: column; }

.setting {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
}
.setting + .setting { border-top: 1px solid var(--line); }
.setting-text { flex: 1; min-width: 0; }
.setting-label { font-size: var(--fs-sm); color: var(--fg); display: block; cursor: default; }
.setting-hint {
  font-size: var(--fs-micro);
  color: var(--fg-3);
  margin-top: 3px;
  max-width: 58ch;
  line-height: 1.55;
}
.setting-control { flex: none; width: auto; min-width: calc(230px * var(--fs-scale, 1)); max-width: 65%;  /* grows with Text size / Easiest and long option names */ display: flex; justify-content: flex-end; }
.setting-control > * { max-width: 100%; }

@media (max-width: 620px) {
  .setting { flex-direction: column; align-items: stretch; gap: 8px; }
  .setting-control { width: 100%; min-width: 0; max-width: none; }
}

/* --- switch --- */
.switch {
  position: relative;
  width: 40px; height: 22px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--bg-2);
  cursor: pointer;
  transition: background var(--speed), border-color var(--speed);
  flex: none;
}
.switch[aria-checked="true"] { background: var(--a-wash); border-color: var(--a); }
.switch-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--fg-3);
  transition: transform var(--speed), background var(--speed);
}
.switch[aria-checked="true"] .switch-knob {
  transform: translateX(18px);
  background: var(--a);
  box-shadow: 0 0 8px var(--a-glow);
}
.switch:focus-visible { outline: 1px solid var(--a); outline-offset: 2px; }

/* --- segmented control --- */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;          /* large text on a phone: wrap, don't overflow */
  max-width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
}
.segmented-btn {
  padding: 6px 11px;
  background: var(--panel-2);
  border: 0;
  color: var(--fg-3);
  font: inherit;
  font-size: var(--fs-micro);
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  flex: 1 1 auto;           /* if it ever wraps, rows fill evenly instead of leaving a gap */
  transition: color var(--speed), background var(--speed);
}
.segmented-btn + .segmented-btn { border-left: 1px solid var(--line-2); }
.segmented-btn:hover { color: var(--a); }
.segmented-btn[aria-checked="true"] { background: var(--a); color: #000; font-weight: 600; }

/* --- range --- */
.range-wrap { display: flex; align-items: center; gap: 10px; width: 100%; }
.range {
  flex: 1;
  min-width: 0;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: var(--line-2);
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--a);
  box-shadow: 0 0 7px var(--a-glow);
  cursor: pointer;
}
.range::-moz-range-thumb {
  width: 13px; height: 13px;
  border: 0;
  border-radius: 50%;
  background: var(--a);
  cursor: pointer;
}
.range:focus-visible { outline: 1px solid var(--a); outline-offset: 4px; }
.range-out {
  font-size: var(--fs-xs);
  color: var(--a);
  min-width: 52px;
  text-align: right;
  flex: none;
}

.number-wrap { display: flex; align-items: center; gap: 8px; }
.number-wrap .input { width: 110px; }

.settings-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
}
.settings-meta .kv { gap: 8px; }
.settings-meta .kv + .kv { border: 0; padding-top: 0; }

/* ===========================================================
   live widget updates
   Each panel repaints on its own when its data slice changes;
   the pulse is the only signal that it happened.
   =========================================================== */

.widget { display: contents; }

@keyframes widgetPulse {
  0%   { box-shadow: inset 0 0 0 1px var(--a), 0 0 16px -4px var(--a-glow); }
  100% { box-shadow: inset 0 0 0 1px transparent, 0 0 0 0 transparent; }
}
.widget-pulse > .panel,
.widget-pulse > .alert-strip > .alert-card {
  animation: widgetPulse 1.15s ease-out;
  border-radius: var(--r);
}

@keyframes headFlash {
  0%   { color: var(--a); text-shadow: 0 0 14px var(--a-glow); }
  100% { color: var(--fg-hi); text-shadow: none; }
}
.nc-head.flash { animation: headFlash 1.3s ease-out; }

/* value-level tick — used by the header readouts */
@keyframes valueTick {
  0%   { color: var(--a); }
  100% { color: inherit; }
}
.tick { animation: valueTick .9s ease-out; }

/* live badge in the status bar */
.head-live {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  white-space: nowrap;
  transition: color var(--speed), border-color var(--speed);
}
.head-live.hot { color: var(--a); border-color: var(--a-line); }
.head-live .dot { transition: background var(--speed); }

/* ===========================================================
   ACCOUNT page
   =========================================================== */

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }

.auth-msg { min-height: 18px; font-size: var(--fs-xs); }
.auth-msg .err { color: var(--danger); }
.auth-msg .ok  { color: var(--ok); }

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.avatar {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--a-line);
  border-radius: 50%;
  color: var(--a);
  background: var(--a-wash);
  flex: none;
}

.note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--fg-3);
  border-radius: var(--r);
  font-size: var(--fs-xs);
  color: var(--fg-2);
  line-height: 1.55;
}
.note svg { flex: none; margin-top: 1px; }
.note.warn { border-left-color: var(--warn); color: var(--warn); }

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--danger);
}
.danger-zone .mono-label { color: var(--danger); }

/* ---------- voice briefing ---------- */
.briefing .brief-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.brief-play { display: inline-flex; align-items: center; gap: 6px; min-width: 84px; justify-content: center; }
.brief-play.on { color: var(--a); border-color: var(--a-line); background: var(--a-wash); }
.segmented-btn.brief-emergency[aria-checked="true"] { background: var(--danger); color: #fff; }
.segmented-btn.brief-emergency:hover { color: var(--danger); }
.brief-progress {
  height: 2px; margin: 12px 0 8px; background: var(--line-2); overflow: hidden;
}
.brief-progress-fill { height: 100%; width: 0; background: var(--a); transition: width .4s ease; }
.brief-caption {
  min-height: 3.2em; line-height: 1.5; color: var(--fg-2);
  text-transform: none; letter-spacing: 0; font-size: var(--fs-small, 12px);
}
.brief-foot { margin-top: 6px; opacity: .6; }

/* ===========================================================
   almanac
   =========================================================== */
.alm-full { grid-column: 1 / -1; }
.alm-note { margin: 8px 0 0; font-size: var(--fs-xs); color: var(--fg-3); line-height: 1.5; }
.alm-hi { color: var(--a); }
.alm-glyph { display: inline-grid; flex: none; }
.alm-glyph svg { display: block; }

.alm-moon { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.alm-big { font-size: var(--fs-lg); color: var(--fg-hi); font-weight: 500; }
.alm-phases {
  display: grid; gap: 8px; margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.alm-phase {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 8px 10px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--r);
  font-size: var(--fs-sm);
}
.alm-phase .mono-label { letter-spacing: .06em; }

.alm-cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.alm-cal-head b { flex: 1; text-align: center; color: var(--fg-hi); font-weight: 500; }
.alm-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.alm-dow { text-align: center; padding-bottom: 2px; }
.alm-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0 5px; border-radius: var(--r); min-height: 54px;
  border: 1px solid transparent;
}
.alm-cell.empty { visibility: hidden; }
.alm-cell.event { background: var(--a-wash); }
.alm-cell.today { border-color: var(--a); }
.alm-day { font-size: var(--fs-micro); color: var(--fg-3); }
.alm-ev { font-size: 9px; color: var(--a); text-transform: uppercase; letter-spacing: .04em; text-align: center; line-height: 1.1; }

.alm-trend { margin-top: 12px; }
.alm-trend-key { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.alm-trend-key i { display: inline-block; width: 12px; height: 2px; vertical-align: middle; }
.alm-trend-key .k1 { background: var(--a); }
.alm-trend-key .k2 { background: var(--fg-3); }
.alm-chart { width: 100%; height: 120px; display: block; overflow: visible; }
.alm-chart path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.alm-chart .l1 { stroke: var(--a); }
.alm-chart .l2 { stroke: var(--fg-3); stroke-dasharray: 4 3; }
.alm-chart .ax { stroke: var(--line); vector-effect: non-scaling-stroke; }
.alm-chart .now { stroke: var(--a-line); stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.alm-chart .fut { fill: var(--a-wash); opacity: .5; }
.alm-chart text { fill: var(--fg-3); font-size: 9px; font-family: inherit; }

.alm-moist { display: flex; flex-direction: column; gap: 6px; }
.alm-moist-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.alm-moist-val { font-size: var(--fs-xs); color: var(--fg-2); white-space: nowrap; }
.alm-bar { height: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.alm-bar span { display: block; height: 100%; background: var(--a); }
.alm-bar .dry { background: var(--warn, #d9a441); }
.alm-bar .wet { background: var(--info); }

.alm-crops { display: flex; flex-direction: column; margin-top: 10px; }
.alm-crop {
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
  font-size: var(--fs-sm); color: var(--fg-3);
}
.alm-crop + .alm-crop { border-top: 1px dotted var(--line); }
.alm-crop b { font-weight: 500; min-width: 64px; text-align: right; }
.alm-crop.ok { color: var(--fg); }
.alm-crop.ok b { color: var(--a); }
.alm-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: none; }
.alm-crop.ok .alm-dot { background: var(--a); box-shadow: 0 0 6px var(--a-glow); }

.alm-lore { display: flex; flex-direction: column; margin-top: 10px; }
.alm-lore-row {
  display: grid; grid-template-columns: 74px 26px 96px minmax(0, 1fr);
  align-items: center; gap: 10px; padding: 7px 4px;
}
.alm-lore-row + .alm-lore-row { border-top: 1px dotted var(--line); }
.alm-lore-row.today { background: var(--a-wash); border-radius: var(--r); }
.alm-lore-date, .alm-lore-sign { display: flex; flex-direction: column; gap: 1px; font-size: var(--fs-sm); }
.alm-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.alm-chips .chip.muted { opacity: .5; }
@media (max-width: 560px) {
  .alm-lore-row { grid-template-columns: 64px 24px minmax(0, 1fr); }
  .alm-chips { grid-column: 1 / -1; }
}

/* ===========================================================
   settings — account card
   =========================================================== */
.acct-row { display: flex; align-items: center; gap: 12px; color: var(--a); }
.acct-summary { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acct-summary b { color: var(--fg-hi); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-summary .mono-label { letter-spacing: .06em; }
.acct-body { margin-top: 14px; }
.acct-body > .grid { margin: 0; }

/* ===========================================================
   constellations
   =========================================================== */
.sky-control { margin-bottom: var(--gap); }
.sky-control-row { display: flex; align-items: center; gap: 12px; }
.sky-time { font-size: var(--fs-xl); color: var(--fg-hi); line-height: 1.1; }
.sky-slider { width: 100%; margin: 12px 0 4px; accent-color: var(--a); height: 28px; cursor: pointer; }
.sky-ends { display: flex; justify-content: space-between; }
.sky-grid {
  display: grid; gap: var(--gap); margin-bottom: var(--gap);
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}
@media (max-width: 980px) { .sky-grid { grid-template-columns: minmax(0, 1fr); } }
.sky-side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.sky-canvas-wrap { width: 100%; display: flex; justify-content: center; }
.sky-canvas { display: block; cursor: pointer; touch-action: manipulation; }

.sky-score { display: flex; align-items: baseline; gap: 10px; }
.sky-score b { font-size: var(--fs-xl); font-weight: 600; color: var(--fg-hi); }
.sky-score[data-label="Great"] b { color: var(--a); }
.sky-score[data-label="OK"] b { color: var(--warn); }
.sky-score[data-label="Poor"] b { color: var(--danger); }
.sky-reasons { margin: 8px 0 0; padding-left: 18px; color: var(--fg-2); font-size: var(--fs-sm); line-height: 1.6; }

.sky-info-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sky-info-head b { font-size: var(--fs-lg); color: var(--fg-hi); font-weight: 600; }
.sky-lore { margin: 8px 0 12px; color: var(--fg-2); font-size: var(--fs-sm); line-height: 1.55; }
.sky-down { opacity: .5; }

.sky-up { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.sky-up-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 8px 10px; background: var(--panel-2); color: var(--fg-2);
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
  font: inherit; font-size: var(--fs-sm);
}
.sky-up-row b { color: var(--fg-hi); font-weight: 500; }
.sky-up-row:hover, .sky-up-row.on { border-color: var(--a); }
.sky-up-row .mono-label { letter-spacing: .06em; }

/* ---------- practical tips under readings (ui/tips.js) ---------- */
.tip-line {
  display: flex; gap: 8px; align-items: baseline;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px dotted var(--line);
  font-size: var(--fs-sm); color: var(--fg-2); line-height: 1.45;
}
.hero > .tip-line { flex-basis: 100%; margin-top: 0; order: 99; }  /* always the bottom row */
.tip-mark { color: var(--a); font-weight: 700; flex: none; }
.tile-tip {
  margin-top: 6px; padding-top: 6px;
  border-top: 1px dotted var(--line);
  font-size: var(--fs-micro); color: var(--fg-2); line-height: 1.4;
}
