/* "A procurement file on the manager's desk": paper, ink, hairline rules, one stamp-red accent. */
:root {
  --paper: #f5f1e8;
  --paper-2: #ece6d8;
  --ink: #1c1a17;
  --ink-2: #4a453d;
  --muted: #7a7265;
  --rule: #d6cdbb;
  --rule-strong: #1c1a17;
  --stamp: #b8322a;
  --approve: #1f6a46;
  --amber: #9a6a12;
  --field: #fbf9f4;
  --serif: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --sans: 'Heebo', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', 'Heebo', ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1a17;
    --paper-2: #24221e;
    --ink: #ece6da;
    --ink-2: #c9c1b2;
    --muted: #958c7c;
    --rule: #3a362f;
    --rule-strong: #ece6da;
    --stamp: #e0685d;
    --approve: #6cc79a;
    --amber: #e2b158;
    --field: #22201c;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.defs { position: absolute; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
}
.sheet {
  max-width: 980px;
  margin: 0 auto;
  background: var(--paper);
  min-height: 100vh;
  padding: 0 44px;
  border-inline: 1px solid var(--rule);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.muted { color: var(--muted); }
b, strong { font-weight: 700; }

/* ---------- masthead ---------- */
.masthead { padding: 26px 0 0; }
.mast-top { display: flex; align-items: center; gap: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); font-size: .88rem; line-height: 1.45; }
.tau-logo { height: 52px; width: auto; }
@media (prefers-color-scheme: dark) { .tau-logo { filter: invert(1); } }
.mast-course { border-inline-start: 1px solid var(--rule); padding-inline-start: 18px; }

.title-row { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 30px 0 26px; }
.kicker { font-size: .82rem; font-weight: 700; color: var(--muted); }
h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(3.4rem, 9vw, 6rem); line-height: .95; margin: 6px 0 14px; letter-spacing: -.02em; }
.lede { font-family: var(--serif); font-size: 1.22rem; line-height: 1.55; max-width: 34em; margin: 0; color: var(--ink-2); }
.hero-stamp { width: 190px; height: 190px; color: var(--stamp); transform: rotate(-11deg); opacity: .9; animation: press .6s cubic-bezier(.2, 1.5, .4, 1) both .2s; }
.st-big { font-family: var(--serif); font-weight: 900; font-size: 46px; fill: currentColor; }
.st-small { font-family: var(--sans); font-weight: 700; font-size: 15px; letter-spacing: 1px; fill: currentColor; }
@keyframes press { from { transform: scale(1.8) rotate(-24deg); opacity: 0; } to { transform: scale(1) rotate(-11deg); opacity: .9; } }

.method { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--rule-strong); border-bottom: 1px solid var(--rule); }
.method li { display: flex; gap: 12px; padding: 14px 0; font-size: .93rem; line-height: 1.5; color: var(--ink-2); }
.method li + li { border-inline-start: 1px solid var(--rule); padding-inline-start: 16px; }
.method li:not(:last-child) { padding-inline-end: 16px; }
.mn { font-family: var(--mono); font-size: .8rem; color: var(--stamp); padding-top: 2px; }
.method b { color: var(--ink); }

/* ---------- stepper ---------- */
.stepper-bar { position: sticky; top: 0; z-index: 5; background: var(--paper); margin: 0 -44px; padding: 0 44px; border-bottom: 1px solid var(--rule); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 13px 0 11px; color: var(--muted); border-bottom: 2px solid transparent; font-size: .95rem; }
.steps .sn { font-family: var(--mono); font-size: .8rem; }
.steps li.active { color: var(--ink); border-bottom-color: var(--stamp); font-weight: 700; }
.steps li.done { color: var(--ink-2); }
.steps li.done .sn::after { content: ' ✓'; color: var(--approve); }

main { padding: 30px 0 10px; }
.step { animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- blocks ---------- */
.block { margin-bottom: 34px; }
.block-head { margin-bottom: 14px; }
h2 { font-family: var(--serif); font-weight: 700; font-size: 1.55rem; line-height: 1.2; margin: 0 0 4px; }
.block-head p { margin: 0; max-width: 46em; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }

/* case files */
.cases { border-top: 2px solid var(--rule-strong); }
.case {
  width: 100%; display: grid; grid-template-columns: 70px 1fr auto; gap: 18px; align-items: baseline;
  text-align: right; background: none; border: none; border-bottom: 1px solid var(--rule);
  padding: 16px 4px; cursor: pointer; color: var(--ink); font: inherit; border-radius: 0;
  transition: background .15s;
}
.case:hover { background: var(--field); }
.case:hover .case-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.case.selected { background: var(--field); box-shadow: inset -3px 0 0 var(--stamp); }
.case-id { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.case-body { display: flex; flex-direction: column; gap: 2px; }
.case-title { font-weight: 700; }
.case-desc { color: var(--ink-2); font-size: .94rem; }
.case-kind { font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* fields */
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--rule-strong); padding-bottom: 6px; margin-bottom: 14px; }
.field-head h2 { font-size: 1.3rem; margin: 0; }
.tabs { display: flex; gap: 14px; }
.tabs button { background: none; border: none; padding: 2px 0; font: inherit; font-size: .88rem; color: var(--muted); cursor: pointer; border-bottom: 1px solid transparent; border-radius: 0; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 170px; border: 1px dashed var(--muted); background: var(--field); cursor: pointer; padding: 18px; text-align: center; color: var(--ink-2); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--ink); border-style: solid; }
.file-name { font-size: .92rem; font-weight: 500; color: var(--approve); }

textarea, input[type=number], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--field);
  border: 1px solid var(--rule); border-radius: 0; padding: 10px 12px;
}
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input[type=number] { width: 96px; font-family: var(--mono); }
textarea { resize: vertical; line-height: 1.55; }
.hint { color: var(--muted); font-size: .88rem; margin: 8px 0 0; }
.err { color: var(--stamp); border-inline-start: 3px solid var(--stamp); padding: 6px 12px; margin: 12px 0 0; background: var(--field); }

.q { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.q:first-of-type { border-top: 2px solid var(--rule-strong); }
.q > label { display: flex; gap: 12px; font-weight: 700; margin-bottom: 10px; line-height: 1.45; }
.qn { font-family: var(--mono); font-weight: 400; color: var(--stamp); min-width: 1.2em; }
.inline { display: inline-flex; gap: 10px; align-items: center; font-size: .95rem; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; }
.opt { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; font-size: .95rem; }
.opt input { accent-color: var(--ink); width: 16px; height: 16px; }
.count { font-family: var(--mono); color: var(--muted); font-size: .75rem; text-align: left; margin-top: 3px; }

/* buttons */
button { font: inherit; cursor: pointer; color: var(--ink); background: transparent; border: 1px solid var(--ink); padding: 10px 22px; border-radius: 0; transition: background .15s, color .15s; }
button:hover { background: var(--field); }
button:disabled { opacity: .45; cursor: wait; }
button.primary { background: var(--ink); color: var(--paper); font-weight: 700; padding: 12px 30px; }
button.primary:hover { background: var(--stamp); border-color: var(--stamp); }
.nav { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 40px; }

/* loading */
.loading { border-top: 2px solid var(--rule-strong); padding-top: 14px; }
.stages { list-style: none; padding: 0; margin: 14px 0 0; counter-reset: s; }
.stages li { counter-increment: s; display: flex; gap: 14px; padding: 7px 0; border-bottom: 1px dotted var(--rule); color: var(--muted); }
.stages li::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: .8rem; padding-top: 3px; }
.stages li::after { content: ''; margin-inline-start: auto; font-family: var(--mono); font-size: .8rem; }
.stages li.active { color: var(--ink); }
.stages li.active::after { content: 'בעבודה'; color: var(--stamp); animation: blink 1.1s steps(2) infinite; }
.stages li.done { color: var(--ink-2); }
.stages li.done::after { content: 'הושלם'; color: var(--approve); }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- report (memo) ---------- */
.memo-head { border-top: 2px solid var(--rule-strong); border-bottom: 1px solid var(--rule); padding: 12px 0; display: flex; flex-wrap: wrap; gap: 6px 28px; font-size: .88rem; color: var(--ink-2); }
.memo-head .kicker { width: 100%; }
.memo-head .mv { font-weight: 600; font-size: .9rem; color: var(--ink); }

.verdict { display: grid; grid-template-columns: 1fr auto; gap: 26px; align-items: center; padding: 26px 0 28px; border-bottom: 2px solid var(--rule-strong); }
.verdict-title { font-family: var(--serif); font-weight: 900; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1; margin: 4px 0 12px; }
.verdict.ok .verdict-title { color: var(--approve); }
.verdict.warn .verdict-title { color: var(--amber); }
.verdict.bad .verdict-title { color: var(--stamp); }
.verdict p { margin: 4px 0; max-width: 36em; }
.ready { font-weight: 700; }
.stamp-svg { width: 200px; height: 200px; transform: rotate(-12deg); animation: press2 .5s cubic-bezier(.2, 1.7, .4, 1) both .25s; }
.verdict.ok .stamp-svg { color: var(--approve); }
.verdict.warn .stamp-svg { color: var(--amber); }
.verdict.bad .stamp-svg { color: var(--stamp); }
@keyframes press2 { from { transform: scale(2.2) rotate(-28deg); opacity: 0; } to { transform: scale(1) rotate(-12deg); opacity: .92; } }

.scoreline { margin-top: 18px; max-width: 420px; }
.scoreline .num { font-family: var(--serif); font-weight: 900; font-size: 2.6rem; line-height: 1; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.scoreline .of { font-family: var(--mono); font-size: .85rem; color: var(--muted); margin-inline-start: 6px; }
.track { position: relative; height: 6px; background: var(--rule); margin-top: 10px; direction: ltr; }
.track .fill { position: absolute; inset-block: 0; left: 0; width: 0; background: var(--ink); transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }
.track .mark { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--stamp); }
.track-legend { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-top: 4px; direction: ltr; }

.sec { padding: 26px 0; border-bottom: 1px solid var(--rule); }
.sec-head { display: flex; gap: 14px; align-items: baseline; margin-bottom: 12px; }
.sec-letter { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; color: var(--stamp); min-width: 1.6em; }
.sec-head h2 { font-size: 1.35rem; margin: 0; }
.sec-head .sec-note { font-size: .85rem; color: var(--muted); margin-inline-start: auto; }
.sec > p, .sec .lead { margin: 0 0 12px; color: var(--ink-2); max-width: 46em; }

.items { list-style: none; padding: 0; margin: 0; counter-reset: it; }
.items > li { counter-increment: it; display: grid; grid-template-columns: 2.2em 1fr; padding: 12px 0; border-top: 1px dotted var(--rule); }
.items > li:first-child { border-top: none; }
.items > li::before { content: counter(it) '.'; font-family: var(--mono); font-size: .85rem; color: var(--muted); padding-top: 3px; }
.items .it-main { font-weight: 700; }
.items .it-row { color: var(--ink-2); font-size: .95rem; }
.items .it-row .k { font-size: .8rem; font-weight: 700; color: var(--muted); margin-inline-end: 6px; }
.sub { font-family: var(--sans); font-weight: 700; font-size: .95rem; margin: 18px 0 4px; }
.sub.bad { color: var(--stamp); }
.code-tag { font-size: .74rem; font-weight: 500; color: var(--stamp); border: 1px solid currentColor; padding: 0 5px; margin-inline-start: 8px; white-space: nowrap; vertical-align: 2px; }

/* ledger (scores) */
.ledger { width: 100%; border-collapse: collapse; }
.ledger td, .ledger th { padding: 10px 0; border-bottom: 1px dotted var(--rule); vertical-align: top; text-align: right; }
.ledger th { font-family: var(--mono); font-weight: 400; font-size: .75rem; color: var(--muted); border-bottom: 1px solid var(--rule); }
.ledger .cat { font-weight: 700; width: 34%; padding-inline-end: 16px; }
.ledger .pts { font-family: var(--mono); white-space: nowrap; direction: ltr; unicode-bidi: isolate; text-align: left; width: 70px; }
.ledger .why { color: var(--ink-2); font-size: .93rem; padding-inline-end: 16px; }
.ledger .ded { color: var(--stamp); display: block; margin-top: 4px; }
.ledger tfoot td { border-bottom: none; border-top: 2px solid var(--rule-strong); font-weight: 700; }
.ledger tfoot .pts { font-family: var(--serif); font-size: 1.3rem; }

/* checks */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 2.4em 1fr; padding: 9px 0; border-top: 1px dotted var(--rule); }
.checklist li:first-child { border-top: none; }
.checklist .mk { font-family: var(--mono); font-weight: 500; }
.checklist .pass .mk { color: var(--approve); }
.checklist .fail { color: var(--stamp); }
.checklist .warn .mk { color: var(--amber); }
.checklist .na { color: var(--muted); }

/* brief table */
.grid { width: 100%; border-collapse: collapse; font-size: .95rem; }
.grid th { font-family: var(--mono); font-weight: 400; font-size: .75rem; color: var(--muted); text-align: right; padding: 0 0 6px; border-bottom: 1px solid var(--rule); }
.grid td { padding: 10px 0; border-bottom: 1px dotted var(--rule); vertical-align: top; padding-inline-end: 14px; }
.status { font-weight: 700; white-space: nowrap; }
.status.ok { color: var(--approve); }
.status.bad { color: var(--stamp); }
.status.warn { color: var(--amber); }

/* 4D */
.fourd { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule-strong); }
.fourd .d { padding: 16px 0 16px; border-bottom: 1px solid var(--rule); }
.fourd .d:nth-child(odd) { padding-inline-end: 22px; border-inline-end: 1px solid var(--rule); }
.fourd .d:nth-child(even) { padding-inline-start: 22px; }
.fourd h3 { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 2px; }
.fourd .dq { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.fourd p { margin: 8px 0; }
.fourd .meta { font-size: .88rem; color: var(--ink-2); }
.fourd .meta .k { font-size: .8rem; font-weight: 700; color: var(--muted); margin-inline-end: 6px; }

.questions { margin: 0; padding: 0; list-style: none; counter-reset: q; }
.questions li { counter-increment: q; font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; padding: 12px 0 12px; border-top: 1px dotted var(--rule); display: grid; grid-template-columns: 2em 1fr; }
.questions li:first-child { border-top: none; }
.questions li::before { content: counter(q) '.'; font-family: var(--mono); font-size: .85rem; color: var(--stamp); padding-top: 5px; }

.plain { margin: 0; padding-inline-start: 20px; color: var(--ink-2); }
.plain li { margin: 4px 0; }
.model-line { font-family: var(--mono); font-size: .75rem; color: var(--muted); padding: 14px 0 0; }

.alert { border: 1px solid var(--stamp); color: var(--stamp); padding: 10px 14px; margin: 0 0 18px; background: var(--field); }
.alert.warn { border-color: var(--amber); color: var(--amber); }

.foot { border-top: 1px solid var(--rule); padding: 18px 0 40px; font-size: .8rem; color: var(--muted); line-height: 1.7; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .sheet { padding: 0 16px; border: none; }
  .stepper-bar { margin: 0 -16px; padding: 0 16px; }
  .steps { gap: 16px; font-size: .88rem; }
  .title-row { grid-template-columns: 1fr; }
  .hero-stamp { position: absolute; left: 4px; top: 205px; width: 100px; height: 100px; }
  .masthead { position: relative; }
  .method { grid-template-columns: 1fr; }
  .method li + li { border-inline-start: none; border-top: 1px solid var(--rule); padding-inline-start: 0; }
  .cols { grid-template-columns: 1fr; gap: 0; }
  .case { grid-template-columns: 56px 1fr; }
  .case-kind { grid-column: 2; }
  .verdict { grid-template-columns: 1fr; }
  .stamp-svg { width: 140px; height: 140px; justify-self: start; }
  .fourd { grid-template-columns: 1fr; }
  .fourd .d:nth-child(odd), .fourd .d:nth-child(even) { padding-inline: 0; border-inline-end: none; }
  .ledger .cat { width: auto; }
  .ledger .why { display: block; }
}

@media print {
  body { background: #fff; }
  .sheet { border: none; padding: 0; max-width: none; }
  .method, .stepper-bar, .nav, .foot, #step1, #step2, .hero-stamp { display: none !important; }
  .sec { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
