/* FEEDBACK-LUZ. Hebrew, RTL, Assistant. Light by default, dark when the device asks for it. */
:root {
  --bg: #f4f6f8; --card: #ffffff; --ink: #17212b; --muted: #5b6877; --line: #dde3ea; --field: #ffffff;
  --accent: #0f6b6b; --accent-ink: #ffffff; --accent-soft: #e2f1f0;
  --ok: #1b7a43; --ok-soft: #e4f4ea; --warn: #9a5b06; --warn-soft: #fdf1e0; --bad: #b3261e; --bad-soft: #fbe9e7;
  --shadow: 0 1px 2px rgba(23, 33, 43, .06), 0 2px 8px rgba(23, 33, 43, .05);
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151b; --card: #19212a; --ink: #e8edf2; --muted: #9aa7b5; --line: #2b3642; --field: #131a21;
    --accent: #56b9b3; --accent-ink: #06201f; --accent-soft: #173130;
    --ok: #6fce95; --ok-soft: #153021; --warn: #f0b35a; --warn-soft: #38290f; --bad: #f1857c; --bad-soft: #3a1b18;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 Assistant, "Segoe UI", Arial, sans-serif; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 64px 16px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.hint { color: var(--muted); font-size: 14px; }

/* ---------- shell ---------- */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; }
.brand small { color: var(--muted); font-size: 13px; }
.who { color: var(--muted); font-size: 14px; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 72px; }
main.narrow { max-width: 680px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.tabs { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- pieces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.card > h3 { margin-bottom: 4px; }
.card > h3 + .hint { margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 4px 6px; min-height: 0; }
.btn:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[type="text"], input[type="email"], input[type="date"], input[type="month"], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
label.f { display: grid; gap: 4px; font-weight: 600; }
label.f > .hint { font-weight: 400; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child > td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }
.toast { position: fixed; inset-inline: 0; bottom: 20px; margin: 0 auto; width: max-content; max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 20; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; }
dialog { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink); padding: 22px; width: min(440px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(10, 16, 22, .5); }
dialog h3 { margin-bottom: 8px; }
dialog .row { margin-top: 20px; justify-content: flex-end; }

/* ---------- my forms (phone first) ---------- */
.task { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.task:last-child { border-bottom: 0; }
.task b { display: block; font-size: 17px; }
.task .go { color: var(--muted); font-size: 22px; line-height: 1; }
.formbar { position: sticky; top: 0; z-index: 6; background: var(--card); border-bottom: 1px solid var(--line); }
.formbar-in { max-width: 680px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 10px; }
.formbar b { display: block; line-height: 1.2; }
.progress { height: 4px; background: var(--line); }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.item { scroll-margin-top: 80px; }
.item.miss { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-soft); }
.item .q { font-weight: 700; font-size: 17px; line-height: 1.35; }
.item .q .num { color: var(--muted); font-weight: 600; margin-inline-end: 6px; }
.item .hint { margin: 2px 0 12px; }
.scale-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.chip { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; min-height: 64px; padding: 8px 2px 6px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--field); cursor: pointer; text-align: center; }
.chip b { font-size: 20px; line-height: 1.1; }
.chip span { font-size: 12px; line-height: 1.15; color: var(--muted); }
.opts { display: grid; gap: 6px; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--field); cursor: pointer; text-align: start; line-height: 1.3; }
.opt b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 16px; }
.chip[aria-pressed="true"], .opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] span { color: var(--accent-ink); }
.opt[aria-pressed="true"] b { background: var(--accent-ink); color: var(--accent); }
.nosee { margin-top: 8px; width: 100%; min-height: 40px; border: 1.5px dashed var(--line); border-radius: 10px; background: none; cursor: pointer; color: var(--muted); font-size: 14px; }
.nosee[aria-pressed="true"] { border-style: solid; border-color: var(--muted); background: var(--bg); color: var(--ink); font-weight: 600; }
.chip:disabled, .opt:disabled, .nosee:disabled { cursor: default; opacity: .75; }
.pgrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pgrow:last-child { border-bottom: 0; }
.pgrow .seg button { padding: 6px 12px; font-size: 14px; }
.pgrow .seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
details > summary { cursor: pointer; font-weight: 700; font-size: 17px; }
details[open] > summary { margin-bottom: 12px; }
.submitbar { display: grid; gap: 10px; }
.submitbar .btn { min-height: 52px; font-size: 18px; }

/* ---------- manager ---------- */
.head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.tile b { display: block; font-size: 28px; line-height: 1.1; font-weight: 700; }
.tile > span { color: var(--muted); font-size: 14px; }
.raters { display: flex; flex-wrap: wrap; gap: 4px; }
.rater { font-size: 13px; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.rater.submitted { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.rater.draft { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.steps span { padding: 4px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; }
.steps span.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pick { border-bottom: 1px solid var(--line); padding: 10px 0; }
.pick:last-child { border-bottom: 0; }
.pick input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.pickgrid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tog { border: 1.5px solid var(--line); background: var(--field); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 14px; }
.tog[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cmp td, .cmp th { padding: 8px 10px; }
.cmp .n { text-align: center; white-space: nowrap; }
.cmp .big { font-size: 18px; font-weight: 700; }
.track { position: relative; width: 150px; height: 22px; direction: ltr; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--line); }
.track .tick { position: absolute; top: 7px; width: 2px; height: 8px; margin-left: -1px; background: var(--line); }
.track .range { position: absolute; top: 7px; height: 8px; border-radius: 4px; background: var(--accent-soft); border: 1px solid var(--accent); min-width: 8px; margin-left: -4px; }
.track .med { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); }
.track .self { position: absolute; top: 2px; width: 18px; height: 18px; margin-left: -9px; border-radius: 4px; border: 2.5px solid var(--ink); transform: rotate(45deg) scale(.72); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; vertical-align: middle; margin-inline-end: 6px; }
.legend .med { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.legend .self { width: 11px; height: 11px; border: 2.5px solid var(--ink); border-radius: 3px; transform: rotate(45deg); }
.legend .range { width: 26px; height: 8px; border-radius: 4px; background: var(--accent-soft); border: 1px solid var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.quote { padding: 8px 12px; border-inline-start: 3px solid var(--line); margin-bottom: 8px; white-space: pre-wrap; }
.quote small { display: block; color: var(--muted); font-size: 13px; }
.quote.keep { border-color: var(--ok); }
.quote.improve { border-color: var(--warn); }
.pre { white-space: pre-wrap; }
ul.plain { margin: 0; padding-inline-start: 20px; }
.bar3 { display: flex; height: 14px; width: 180px; border-radius: 4px; overflow: hidden; background: var(--line); direction: ltr; }
.bar3 i:nth-child(1) { background: var(--bad); } .bar3 i:nth-child(2) { background: var(--muted); } .bar3 i:nth-child(3) { background: var(--ok); }

@media (max-width: 720px) {
  .two { grid-template-columns: 1fr; }
  .head > .grow, .row > .grow { flex-basis: 100%; }
  .pick .row > .grow { flex-basis: 0; }
  h2 { font-size: 20px; }
  .card { padding: 14px; }
}

/* ---------- the meeting booklet ---------- */
.sheet { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 6px; padding: 28px 32px; margin: 0 auto 20px; max-width: 800px; font-size: 14px; line-height: 1.4;
  --ink: #111; --muted: #555; --line: #cfd5db; --accent: #0f6b6b; --accent-soft: #e2f1f0; --ok: #1b7a43; --warn: #9a5b06; --bad: #b3261e; --bg: #f4f6f8; --ok-soft: #e4f4ea; --warn-soft: #fdf1e0; --bad-soft: #fbe9e7; }
.sheet h2 { font-size: 22px; }
.sheet h4 { margin: 14px 0 4px; font-size: 14px; font-weight: 700; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.sheet .cmp td, .sheet .cmp th { padding: 3px 8px; font-size: 13px; }
.sheet .cmp .big { font-size: 14px; }
.sheet .quote { padding: 2px 10px; margin-bottom: 4px; }
.sheet .two { gap: 20px; }
.sheet .blank { min-height: 34px; border-bottom: 1px dotted var(--line); }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .top, .tabs, .noprint, .toast { display: none !important; }
  main { padding: 0; max-width: none; }
  .sheet { border: 0; border-radius: 0; padding: 0; margin: 0; max-width: none; break-after: page; }
  .sheet:last-child { break-after: auto; }
  .sheet h4, .sheet tr, .sheet .quote { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* rater picker (wizard) */
.picker { margin-top: 10px; display: grid; gap: 6px; }
.picker input { max-width: 320px; }
.picker .pickgrid { margin-top: 0; }
.picker .scale-title { margin: 8px 0 0; }
.tog:disabled { opacity: .45; cursor: default; }
.rater[data-kind="peer"] { border-style: dashed; }

/* summary editor: lines with a "hidden from the resident" switch; release preview; entrance */
.f > div.row > label { font-weight: 600; }
div.f { display: grid; gap: 4px; font-weight: 600; }
div.f > .hint { font-weight: 400; }
.lines { display: grid; gap: 6px; }
.line { display: flex; gap: 6px; align-items: center; }
.line input { flex: 1; min-width: 0; }
.lock { flex: none; border: 1px solid var(--line); background: var(--ok-soft); color: var(--ok); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lock[aria-pressed="true"] { background: var(--warn-soft); color: var(--warn); }
.row.tight { gap: 6px; flex-wrap: nowrap; }
.row.check { font-weight: 400; cursor: pointer; flex-wrap: nowrap; align-items: flex-start; }
.row.check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); margin-top: 2px; }
dialog.wide { width: min(720px, calc(100% - 32px)); }
.preview { border: 1px dashed var(--line); border-radius: var(--r); padding: 14px; background: var(--bg); max-height: 55vh; overflow: auto; }
#code { font-size: 24px; letter-spacing: 6px; text-align: center; max-width: 220px; }
#gate .btn { justify-self: start; }
@media (max-width: 720px) { .line { flex-wrap: wrap; } .line input { flex-basis: 100%; } .row.tight { flex-wrap: wrap; } }
/* the resident's own chart on a phone: the item names keep a readable width, the 1-5 line gets narrower */
.cmp td:first-child { min-width: 8.5em; }
@media (max-width: 480px) { .shared .cmp td, .shared .cmp th { padding: 8px 5px; } .shared .track { width: 96px; } }
