/* Log activity side screen (public/js/logSide.js, M3 round 2 item 37, Sami 2026-11-05).
   Look M4a (Sami 2026-11-08, docs/prototypes/log-panel/m4a.html): Interests (blue), Offers (amber) and Timeline (pink) are three white
   panels floating on a grey ground; each header folds its panel. The timeline sits on a pale ground (cards white on it). */
:root { --md-side: 420px; }

/* Wide: the drawer grows a column on its left; the log keeps its own width and scroll. */
@media (min-width: 1100px) {
  .md-dw.has-side { width: calc(var(--md-dw) + var(--md-side)); display: grid; grid-template-columns: var(--md-side) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .md-dw.has-side > .ls { grid-column: 1; grid-row: 1 / 3; min-height: 0; overflow: auto; overscroll-behavior: contain; border-inline-end: 1px solid var(--c-line); }
  .md-dw.has-side > .md-dw-head { grid-column: 2; grid-row: 1; }
  .md-dw.has-side > .md-dw-body { grid-column: 2; grid-row: 2; }
}
/* Narrow: under the log, in the same scroll. */
.md-dw-body > .ls { margin: 0 -24px; border-top: 1px solid var(--c-line); }

.ls { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 12px; overflow-x: hidden; background: var(--c-select); }
.ls-sec, .ls-b { min-width: 0; }
.ls-sec { --k: var(--c-muted); --ks: var(--c-select); --kl: var(--c-line); flex: none; overflow: clip; border-radius: var(--r-lg); background: var(--c-card); box-shadow: 0 0 0 1px var(--c-line); }
.ls-int { --k: var(--tint-blue); --ks: var(--tint-blue-soft); --kl: var(--tint-blue-line); }
.ls-off { --k: color-mix(in srgb, var(--tint-amber) 88%, #000); --ks: var(--tint-amber-soft); --kl: var(--tint-amber-line); }
.ls-tl { --k: var(--tint-pink); --ks: var(--tint-pink-soft); --kl: var(--tint-pink-line); }
.ls-sec[hidden] { display: none; }
/* the header: one button that folds the panel; icon and count in the panel's colour */
/* the head (quiet look B, Sami 2026-11-13, DECISIONS #238): the same quiet head as every section box (ui.css .sbox) */
.ls-h { position: sticky; top: 0; z-index: 2; margin: 0; background: var(--c-card); border-bottom: 1px solid var(--c-line); }
.ls-sec.shut .ls-h { border-bottom-color: transparent; }
.ls-hb { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px 12px 16px; border: 0; background: transparent; font: inherit; text-align: start; color: var(--c-ink); cursor: pointer; }
.ls-hb:hover { background: var(--c-page); }
.ls-hb:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.ls-ht { font-size: var(--fs-body); font-weight: var(--fw-semibold); }
.ls-ic { width: 20px; height: 20px; flex: none; display: grid; place-items: center; color: var(--c-muted); }
.ls-ic svg { width: 18px; height: 18px; }
.ls-hb em { padding: 1px 9px; border-radius: var(--r-pill); font-style: normal; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-muted); background: var(--c-page); }
.ls-hb em:empty { display: none; }
.ls-fold { display: grid; place-items: center; width: 30px; height: 30px; flex: none; margin-inline-start: auto; border: 1px solid var(--c-line-strong); border-radius: 9px; background: var(--c-card); color: var(--c-text); transition: transform .2s; }
.ls-sec.shut .ls-fold { transform: rotate(-90deg); }
.ls-sec.shut > .ls-b { display: none; }
/* the timeline panel: small filters on white, the logs on a pale ground */
.ls-tl > .ls-b { padding: 0; }
/* the head now has a coloured band with a line under it: the filters need room below that line */
.ls-tl .ls-filters { margin: 0; padding: 12px 16px; }
.ls-tl .ls-list { padding: 12px 12px 14px; background: var(--c-tile); border-top: 1px solid var(--c-line); }
.ls-tl .ls-more { margin: 0 auto 14px; }
.ls-tl .ls-empty { padding: 0 16px 16px; }
.ls-tl .ls-wait { margin: 0 16px 16px; }
/* offers: soft cards like the needs, read only */
.ls-offer { padding: 12px 14px; border-radius: var(--r-lg); background: var(--c-tile); display: grid; gap: 6px; min-width: 0; }
.ls-offer + .ls-offer { margin-top: 10px; }
.ls-offer-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.ls-offer-h b { font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); }
.ls-offer-h .badge { margin-inline-start: auto; }
.ls-offer-p { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-hint); color: var(--c-muted); }
.ls-offer-m { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: var(--fs-hint); color: var(--c-muted); }
.ls-offer-m span:first-child { font-weight: var(--fw-semibold); color: var(--c-ink); font-variant-numeric: tabular-nums; }
.ls-offer-v { font-size: var(--fs-hint); color: var(--c-muted); }
.ls-offer-v.late { color: var(--c-danger); font-weight: var(--fw-semibold); }
.ls-b { padding: 14px 18px 18px; }
.ls-empty { margin: 0; font-size: var(--fs-table); color: var(--c-muted); }
.ls-wait { height: 64px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--c-select) 0, var(--c-tile) 40%, var(--c-select) 80%); background-size: 200% 100%; animation: ls-shine 1.2s linear infinite; }
@keyframes ls-shine { to { background-position: -200% 0; } }

/* ---- needs: soft cards, the Main one with a thin blue edge; a card with changes not saved yet turns purple ---- */
.ls-need { background: var(--c-tile); border-radius: var(--r-lg); padding: 12px 14px; transition: box-shadow .2s; }
.ls-need + .ls-need { margin-top: 10px; }
.ls-need.main { background: var(--c-accent-soft); }
.ls-need.pending { box-shadow: 0 0 0 2px var(--c-select); }
.ls-need-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ls-tag { font-size: var(--fs-hint); font-weight: var(--fw-semibold); letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--r-pill); background: #eaf1fd; color: var(--ic-a, var(--c-info)); }
.ls-tag.g { background: var(--c-line); color: var(--c-muted); }
.ls-cat { display: inline-flex; align-items: center; gap: 6px; color: var(--c-muted); }
.ls-cat b { font-size: var(--fs-table); color: var(--c-ink); }
.ls-will { margin-inline-start: auto; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-text); background: var(--c-select); border: 1px solid var(--c-select-line); border-radius: var(--r-pill); padding: 2px 9px; }
.ls-kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-family: var(--md-font-ar, var(--font)); font-size: var(--fs-table); }
.ls-kv dt { color: var(--c-muted); }
.ls-kv dd { margin: 0; color: var(--c-ink); font-weight: var(--fw-semibold); }
.ls-kv dd.chg { color: var(--c-text); }
.ls-kv dd s { display: block; margin-top: 1px; font-size: var(--fs-hint); font-weight: 400; color: var(--c-faint); }

/* The Add / Update interests button in the log: a hint line and the change count. */
.ic-add-t small { font-size: var(--fs-hint); font-weight: var(--fw-medium); color: var(--c-muted); }
.ic-add > em { flex: none; font-style: normal; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-card); background: var(--c-ink); border-radius: var(--r-pill); padding: 2px 10px; }
.ic-add.chg { border-color: var(--c-ink); box-shadow: var(--focus-ring); }

/* 720px = where the drawer body padding drops to 16px (home.css) */
@media (max-width: 720px) {
  .md-dw-body > .ls { margin: 0 -16px; }
  .ls-b { padding: 12px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) { .ls-wait { animation: none; } .ls-fold { transition: none; } }
