/* /history/ (build/site_history.py, static/history.js): every part you opened, as one data-ui table (Zach's pick of
   2026-11-24, docs/proposals.md). Loaded by /history/ only. Colours are site.css's tokens, so light, dark and a
   reader's Settings › Theme all follow. */

/* ---- the bar over the table: how far back, Clear history (the search is the table's own) ------------------- */
.ph-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 6px; }
.ph-range { display: inline-flex; flex: none; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--bg); }
.ph-range button { height: 30px; border: 0; border-left: 1px solid var(--rule); border-radius: 0; background: var(--bg); padding: 0 11px; white-space: nowrap; }
.ph-range button:first-child { border-left: 0; }
.ph-range button:hover:not([aria-pressed="true"]) { background: var(--hover); }
.ph-range button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.ph-range button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ph-clear { margin-left: auto; }
.ph-status { margin: 4px 0 2px; min-height: 1.45em; }
.ph-said { margin: 2px 0 6px; padding: 6px 10px; border-radius: 4px; background: var(--accent-bg); color: var(--ink); }
/* a button that reads as a link ("Show all") */
.ph-link { height: auto !important; border: 0 !important; background: none !important; padding: 0 !important; color: var(--accent); cursor: pointer; font: inherit; }
.ph-link:hover { text-decoration: underline; }

/* ---- empty and quiet states: one calm line, what to do next -------------------------------------------------- */
.ph-empty { margin: 18px 0; padding: 40px 16px 34px; text-align: center; border: 1px dashed var(--rule); border-radius: 8px; color: var(--ink2); }
.ph-empty-ic { display: inline-flex; width: 44px; height: 44px; color: var(--ink3); }
.ph-empty-ic svg { width: 100%; height: 100%; }
.ph-empty h2 { margin: 8px 0 4px; color: var(--ink); font-size: 17px; }
.ph-empty p { max-width: 34rem; margin: 0 auto; }
.ph-none { margin: 14px 0; color: var(--ink2); }

/* ---- the table: data-ui, one row per part --------------------------------------------------------------------- */
.ph-table data-views { margin-top: 6px; }
/* WHY a white plate under each photo, in dark mode too: site.css's rule for product photos (shot on white) */
#history-views img { background: var(--plate); border-radius: 3px; }

/* ---- dialogs: Add to list, Clear history ---------------------------------------------------------------------- */
.ph-dialog { width: min(440px, calc(100vw - 32px)); padding: 18px 20px 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); color: var(--ink); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28); }
.ph-dialog::backdrop { background: rgba(0, 0, 0, 0.38); }
.ph-dialog h2 { margin: 0 0 10px; font-size: 17px; }
.ph-lists { display: grid; gap: 2px; max-height: 40vh; overflow-y: auto; margin: 0 0 10px; }
.ph-opt { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 4px; cursor: pointer; }
.ph-opt:hover { background: var(--hover); }
.ph-opt-n { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.ph-new { display: grid; gap: 4px; color: var(--ink2); }
.ph-new input { height: 30px; border: 1px solid var(--rule); border-radius: 3px; background: var(--bg); color: var(--ink); padding: 0 8px; }
.ph-why { min-height: 1.45em; margin: 8px 0 0; color: var(--warn); }
.ph-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.ph-dialog button.ph-danger { background: var(--warn); border-color: var(--warn); color: var(--bg); font-weight: 600; }

/* ---- a phone: the range across the width ---------------------------------------------------------------------- */
@media (max-width: 600px) {
  .ph-range { flex: 1 1 auto; }
  .ph-range button { flex: 1 1 auto; padding: 0 6px; }
  .ph-clear { margin-left: 0; }
}
