/* Tzedukeh user guide: standalone static site. No external fonts, scripts or network requests. */
:root {
  --bg: #f7f7f5; --panel: #ffffff; --ink: #1d2433; --muted: #5b6475; --line: #e3e5ea;
  --accent: #1f5f8b; --accent-ink: #ffffff; --accent-soft: #e6f0f7; --warn-soft: #fff6e0; --warn-line: #e8c46a;
  --ok-soft: #e8f5ec; --ok-line: #8cc7a0; --mark: #d9480f; --mark-ink: #fff; --code: #f0f1f4;
  --radius: 10px; --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 16px rgba(20, 30, 50, .06);
  --sidebar: 288px; --toc: 232px; --header: 60px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Hebrew", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12161d; --panel: #1a1f29; --ink: #e8ebf1; --muted: #a2abbb; --line: #2b3240; --accent: #7cb7e3;
    --accent-ink: #0d1520; --accent-soft: #1d2d3c; --warn-soft: #2e2716; --warn-line: #8a6d23; --ok-soft: #17291e;
    --ok-line: #3d7a52; --code: #232a36; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); }
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 16px; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--panel); padding: 8px 12px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }

/* Header */
.top { position: sticky; top: 0; z-index: 30; height: var(--header); display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 15px; }
.brand small { font-weight: 500; color: var(--muted); }
.menu-btn { display: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }
.search { position: relative; flex: 1; max-width: 520px; margin-inline-start: auto; }
.search input { width: 100%; font: inherit; padding: 8px 12px 8px 36px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; background: var(--panel); }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 70vh; overflow: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: none; }
.results.open { display: block; }
.results a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.results a:hover, .results a[aria-selected="true"] { background: var(--accent-soft); }
.results .r-path { font-size: 12px; color: var(--muted); }
.results .r-snip { font-size: 13px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results mark { background: #ffe58a; color: #222; border-radius: 2px; }
.results .empty { padding: 12px; color: var(--muted); }

/* Layout */
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc); min-height: calc(100vh - var(--header)); }
.sidebar { position: sticky; top: var(--header); height: calc(100vh - var(--header)); overflow: auto; padding: 16px 12px 40px;
  border-inline-end: 1px solid var(--line); background: var(--panel); }
.sidebar h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 10px 6px; }
.sidebar details { margin: 2px 0; }
.sidebar summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 8px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary::before { content: "▸"; font-size: 11px; color: var(--muted); transition: transform .15s; }
.sidebar details[open] > summary::before { transform: rotate(90deg); }
.sidebar summary:hover { background: var(--bg); }
.sidebar ul { list-style: none; margin: 0; padding: 0 0 4px 0; }
.sidebar li a { display: block; padding: 5px 10px 5px 30px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.sidebar li a:hover { background: var(--bg); }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar .solo { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.sidebar .solo:hover { background: var(--bg); }
.role-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

main { padding: 32px clamp(16px, 4vw, 56px) 80px; min-width: 0; }
.content { max-width: 920px; }
.toc { position: sticky; top: var(--header); height: calc(100vh - var(--header)); overflow: auto; padding: 32px 16px; font-size: 14px; }
.toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.toc a { display: block; padding: 3px 8px; color: var(--muted); text-decoration: none; border-inline-start: 2px solid var(--line); }
.toc a.l3 { padding-inline-start: 20px; font-size: 13px; }
.toc a.on { color: var(--accent); border-color: var(--accent); }

/* Content */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 24px; margin: 40px 0 12px; padding-top: 8px; border-top: 1px solid var(--line); }
h3 { font-size: 19px; margin: 28px 0 10px; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 20px; }
.route { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--code); padding: 2px 6px; border-radius: 4px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-inline-end: 4px; }
.pill.muted { background: var(--code); color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 16px 0; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.card:hover { border-color: var(--accent); }
.card h3 { margin: 6px 0 4px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.card p { margin: 0; font-size: 14.5px; color: var(--muted); }
.card .count { font-size: 12px; color: var(--muted); margin-top: 8px; display: block; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 12px 0; }
.steps li { counter-increment: step; position: relative; padding: 10px 12px 10px 52px; margin: 6px 0; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before { content: counter(step); position: absolute; left: 12px; top: 10px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.result { border-inline-start: 4px solid var(--ok-line); background: var(--ok-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 10px 0 18px; }
.note { border-inline-start: 4px solid var(--warn-line); background: var(--warn-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 10px 0; }
.notes { padding-inline-start: 20px; }
table { width: 100%; border-collapse: collapse; margin: 12px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 15px; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

/* Figures with numbered callouts */
.figs { display: grid; gap: 22px; margin: 16px 0 8px; }
.figs.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
figure.shot { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.frame { position: relative; margin: 0 auto; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #fff; cursor: zoom-in; }
.frame.mobile { max-width: 360px; }
.frame.mobile .clip { max-height: 760px; }
.frame .clip { position: relative; overflow: hidden; max-height: 900px; }
.frame.expanded .clip { max-height: none; }
.frame img { display: block; width: 100%; height: auto; }
.callout { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; background: var(--mark);
  color: var(--mark-ink); font: 700 13px/26px system-ui, sans-serif; text-align: center; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.45); cursor: pointer; padding: 0; }
.callout:hover, .callout.hl { transform: translate(-50%, -50%) scale(1.25); z-index: 2; }
.fade { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(transparent, rgba(255,255,255,.95));
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; }
.fade button, .tool { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
figcaption { margin-top: 10px; font-size: 14.5px; }
figcaption .cap-title { font-weight: 700; }
figcaption .meta { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
ol.legend { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
ol.legend li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
ol.legend .n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--mark); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; margin-top: 1px; }
ol.legend li:hover { color: var(--accent); cursor: default; }
.provenance { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Gallery */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.filters label { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.filters select { font: inherit; font-size: 14px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.thumb { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-align: start; padding: 0; cursor: pointer; font: inherit; color: var(--ink); }
.thumb:hover { border-color: var(--accent); }
.thumb .ti { height: 160px; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line); }
.thumb img { width: 100%; display: block; }
.thumb .tt { padding: 8px 10px; font-size: 13.5px; }
.thumb .tt b { display: block; font-size: 14px; }

/* Lightbox */
dialog.lb { border: 0; padding: 0; max-width: min(1400px, 96vw); width: 96vw; max-height: 94vh; background: var(--panel); color: var(--ink); border-radius: 12px; }
dialog.lb::backdrop { background: rgba(10, 14, 20, .78); }
.lb-head { position: sticky; top: 0; display: flex; gap: 12px; align-items: center; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 3; }
.lb-head h2 { margin: 0; padding: 0; border: 0; font-size: 17px; flex: 1; }
.lb-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 14px; }
.lb-body .frame { cursor: default; }
.lb-body .frame .clip { max-height: none; }
.lb-side { font-size: 14.5px; }

/* Status table on the home page */
.status-ok { color: #1c7c3c; font-weight: 600; }
.status-off { color: #a15c00; font-weight: 600; }
@media (prefers-color-scheme: dark) { .status-ok { color: #79d29a; } .status-off { color: #f0b660; } .fade { background: linear-gradient(transparent, rgba(26,31,41,.95)); } }

/* Responsive */
@media (max-width: 1180px) { .layout { grid-template-columns: var(--sidebar) minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .menu-btn { display: inline-block; }
  .sidebar { position: fixed; inset: var(--header) auto 0 0; width: min(320px, 88vw); transform: translateX(-105%); transition: transform .2s; z-index: 25; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .brand small, .search kbd { display: none; }
  .lb-body { grid-template-columns: 1fr; }
  main { padding-top: 20px; }
}
@media print {
  .top, .sidebar, .toc, .fade, .tool { display: none !important; }
  .layout { display: block; } main { padding: 0; }
  .frame .clip { max-height: none !important; }
  figure.shot, .steps li { break-inside: avoid; box-shadow: none; }
}
main:focus { outline: none; }
