/* Trends tab. Light mode only — the app has no dark theme.
   Marks are thin, grid is a recessive hairline, and the data is the only loud thing. */

/* Full width, matching .feed-wrap and the Shopping List — the charts read better with
   the room. (The page wrapper already supplies the 20px side gutter.) */
.trend-wrap{position:relative;z-index:1;width:100%;margin:0 auto;padding:16px 0}

/* Two columns on a wide screen so the charts don't stretch into letterboxes. */
@media(min-width:1000px){
  .trend-charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px;align-items:start}
  .tcard .tsub,.tcard .tnote{max-width:64ch}
}

/* ---------- filter row: one row above everything it scopes ---------- */
.trange{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.trange-l{font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-soft);font-weight:600}
.trange-n{margin-left:auto;font-size:.8rem;color:var(--ink-soft)}
.tpill{
  min-height:44px;padding:0 18px;cursor:pointer;font-family:inherit;font-size:.9rem;font-weight:600;
  color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:22px;
}
.tpill:hover{border-color:var(--sage)}
.tpill.on{background:var(--sage-deep);color:#fff;border-color:transparent}

/* ---------- card ---------- */
.tcard{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:22px 24px;margin-bottom:18px;
}
.tcard h3{font-family:'Fraunces',serif;font-weight:600;font-size:1.3rem;letter-spacing:-.01em}
.tsub{margin-top:4px;font-size:.88rem;color:var(--ink-soft);line-height:1.5}
.tnote{margin-top:12px;font-size:.8rem;color:var(--ink-soft);line-height:1.55}

.tintro .tsub{font-size:.95rem;margin-top:10px}

/* ---------- locked (progressive disclosure) ---------- */
.tlocked{
  display:flex;align-items:center;gap:14px;margin-top:16px;padding:20px;
  background:var(--surface-2);border:1px solid var(--line-soft);border-radius:var(--radius-sm);
}
.tlock-i{font-size:1.5rem;opacity:.45}
.tlocked p{font-size:.88rem;color:var(--ink-soft);line-height:1.6}
.tlocked b{color:var(--ink)}

/* ---------- plot ---------- */
.plotwrap{margin-top:16px;overflow-x:auto}
.plot{display:block;width:100%;height:auto;min-width:420px;overflow:visible}

.plot .grid{stroke:var(--line-soft);stroke-width:1;shape-rendering:crispEdges}
.plot .tick{fill:var(--ink-soft);font-size:10px;font-family:inherit;font-variant-numeric:tabular-nums}
.plot .line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.plot .dot{stroke:var(--surface);stroke-width:2}          /* surface ring, not a border */
.plot .wash{opacity:.10}                                   /* band as a wash, never a block */
.plot .dlabel{fill:var(--ink);font-size:11px;font-weight:600;font-family:inherit}
.plot .ref{stroke:var(--ink-soft);stroke-width:1;opacity:.5;shape-rendering:crispEdges}
.plot .reflabel{fill:var(--ink-soft);font-size:9.5px;font-family:inherit}
.plot .nightband{fill:var(--ink);opacity:.045}
.plot .hot{fill:transparent}
.plot .hot:hover{fill:var(--ink);fill-opacity:.035}

/* ---------- legend (mandatory for >= 2 series) ---------- */
.legend{display:flex;gap:16px;margin-top:12px}
.legend span{display:inline-flex;align-items:center;gap:7px;font-size:.82rem;color:var(--ink-soft)}
.legend i{width:11px;height:11px;border-radius:3px;display:inline-block}
.legend i.ref-key{width:16px;height:0;border-top:1px solid var(--ink-soft);opacity:.6;border-radius:0}

/* ---------- observations ---------- */
.tobs ul{list-style:none;margin:16px 0 0;padding:0}
.ob{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-top:1px solid var(--line-soft);
    font-size:.95rem;line-height:1.55}
.ob:first-child{border-top:0;padding-top:6px}
.obi{
  flex:0 0 22px;height:22px;border-radius:50%;display:grid;place-items:center;
  font-size:.72rem;font-weight:700;margin-top:2px;
}
.ob-good  .obi{background:var(--sage-soft);color:var(--sage-deep)}
.ob-info  .obi{background:var(--line-soft);color:var(--ink-soft)}
/* Even "watch" stays warm — a nudge, never an alarm. */
.ob-watch .obi{background:var(--butter-soft);color:#8a6a1f}

/* ---------- table twin (every chart has one) ---------- */
.tnumbers{margin-top:14px}
.tnumbers summary{
  cursor:pointer;font-size:.8rem;font-weight:600;color:var(--ink-soft);
  padding:6px 0;list-style:none;
}
.tnumbers summary::-webkit-details-marker{display:none}
.tnumbers summary::before{content:'▸ ';font-size:.7rem}
.tnumbers[open] summary::before{content:'▾ '}
.tscroll{overflow-x:auto;max-height:280px;overflow-y:auto}
.ttable{width:100%;border-collapse:collapse;font-size:.85rem}
.ttable th{
  position:sticky;top:0;background:var(--surface);text-align:left;
  font-size:.68rem;letter-spacing:.06em;text-transform:uppercase;
  color:var(--ink-soft);font-weight:600;padding:6px 8px;
}
.ttable td{padding:7px 8px;border-top:1px solid var(--line-soft);font-variant-numeric:tabular-nums}

/* ---------- tooltip ---------- */
.ttip{
  position:fixed;z-index:80;pointer-events:none;
  background:var(--ink);color:#FFFDF8;
  padding:7px 10px;border-radius:8px;font-size:.8rem;font-weight:500;
  box-shadow:var(--shadow-lg);white-space:nowrap;
}

@media(max-width:620px){
  .tcard{padding:18px 16px}          /* matches .feed-card at this width */
  .trange-n{width:100%;margin-left:0}
  .tpill{flex:1 1 auto}
}
