/* KER-5: Kerestir on Today, its sheets and its chat cards — docs/kerestir/reference/kerestir-mockup.html, Quiet Desk tokens
   only (docs/design/QUIET_DESIGN.md): one accent, no new colors, no gradients, --need stays for "צריך אותך". */
.num { font-variant-numeric: tabular-nums; }

#kerestir-today { margin: .25rem 0 .5rem; }
.ker { padding: 14px 14px 4px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); }
.ker-state { padding: 14px; }
.ker-head { display: flex; align-items: center; gap: 8px; }
.ker-title { flex: 1; margin: 0; font-size: var(--text-section); font-weight: 600; }
.ker-seg { display: inline-flex; padding: 2px; border-radius: var(--r-control); background: var(--sunk); }
.ker-seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: var(--text-small); font-weight: 500; cursor: pointer; }
.ker-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
/* A 44px touch target around the 32px segment buttons. */
.ker-seg button { position: relative; }
.ker-seg button::after { content: ""; position: absolute; inset: -6px 0; }
.ker-fresh { margin: 2px 0 12px; color: var(--muted); font-size: var(--text-meta); }
.ker-sub { margin: 6px 0 0; color: var(--muted); font-size: var(--text-small); }
.ker-empty { margin: 0 0 12px; color: var(--ink); font-size: var(--text-card); }
.ker-warn { margin: 8px 0 4px; color: var(--muted); font-size: var(--text-small); }
.ker-bad { margin: 6px 0 0; color: var(--bad); font-size: var(--text-small); }
.ker-action { margin-top: 10px; }
.ker-state .ker-action { margin-bottom: 0; }
.ker .ker-action { margin-bottom: 10px; }

/* KER-14 (Yitzhak, 2.10): meals first. One tile per meal, divided by hairlines, the coming meal today in the accent. */
.ker-meals { display: grid; grid-template-columns: repeat(var(--ker-meal-count, 3), minmax(0, 1fr)); margin: 0 0 6px; }
.ker-meal-tile { display: grid; align-content: start; gap: 1px; min-width: 0; min-height: 44px; padding: 4px 12px 8px; border: 0;
  border-inline-start: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.ker-meal-tile:first-child { padding-inline-start: 0; border-inline-start: 0; }
.ker-ml { color: var(--muted); font-size: var(--text-small); }
.ker-mv { font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: 0; }
.ker-ms { color: var(--muted); font-size: var(--text-meta); overflow-wrap: anywhere; }
.ker-meal-tile.is-next .ker-ml { color: var(--accent); font-weight: 500; }
.ker-meal-tile.is-next .ker-ml::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.ker-meal-tile.is-next .ker-mv { color: var(--accent); }
.ker-meal-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* Rooms are a row now: a slim meter at its end. */
.ker-rows li > .ker-mini { flex: 0 0 72px; align-self: center; height: 6px; border-radius: 3px; }
.ker-rows li > .ker-mini i { border-radius: 3px; }
.ker-g-count { font-weight: 600; }

.ker-rows { margin: 12px 0 0; padding: 0; list-style: none; }
.ker-rows li { display: flex; align-items: baseline; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--text-card); }
.ker-k { flex: 0 0 auto; min-width: 56px; color: var(--muted); font-size: var(--text-small); }
.ker-t { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; overflow-wrap: anywhere; }
.ker-meal b { font-weight: 600; }
.ker-more { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 12px 0; border: 0;
  border-top: 1px solid var(--line); background: none; color: var(--accent); font: inherit; font-size: var(--text-small); font-weight: 500; text-align: start; cursor: pointer; }
.ker-chev { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[dir="ltr"] .ker-chev { transform: scaleX(-1); }

.ker-bone { height: 12px; margin: 8px 0; border-radius: 6px; background: var(--sunk); }
@media (prefers-reduced-motion: no-preference) { .ker-bone { animation: skeleton-breath 1.4s ease-in-out infinite; } }

/* Sheets (day, booking, connection) */
.kerestir-sheet .ker-fresh { margin-top: 0; }
.ker-h4 { margin: 20px 0 4px; font-size: var(--text-section); font-weight: 600; scroll-margin-top: 12px; }
.ker-g-rows { margin: 0; padding: 0; list-style: none; }
.ker-g-rows > li { padding: 11px 0; border-top: 1px solid var(--line); }
.ker-g-rows > li:first-child { border-top: 0; }
.ker-g-open { display: grid; gap: 2px; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.ker-g-top { display: flex; justify-content: space-between; gap: 8px; font-size: var(--text-card); }
.ker-g-top b { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.ker-g-top span { flex: 0 0 auto; color: var(--ink); }
.ker-g-sub { display: block; color: var(--muted); font-size: var(--text-small); overflow-wrap: anywhere; }
.ker-flat { margin: 0; }
.ker-check { font-size: var(--text-card); }
.ker-tag { display: inline-block; margin-inline-start: 6px; padding: 1px 7px; border-radius: 7px; background: var(--sunk); color: var(--muted); font-size: var(--text-meta); }
.ker-link { min-height: 44px; }

.ker-week-wrap { margin-top: 10px; }
.ker-week { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 132px; }
.ker-week button { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; padding: 0;
  border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: pointer; }
.ker-b { width: 70%; max-width: 24px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent); }
.ker-b-none { background: var(--line); }
.ker-cap { position: absolute; inset-inline: 0; top: 16px; border-top: 1px dashed var(--line); pointer-events: none; }
.ker-d { color: var(--muted); font-size: var(--text-meta); }
.ker-val { color: var(--ink); font-size: var(--text-meta); }
.ker-week button[aria-pressed="true"] .ker-d { color: var(--ink); font-weight: 500; }
.ker-tip { min-height: 22px; margin: 8px 0 0; color: var(--ink); font-size: var(--text-small); }

.ker-status { margin: 0 0 10px; font-size: var(--text-card); font-weight: 500; }
.ker-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: var(--text-card); }
.ker-kv dt { color: var(--muted); font-size: var(--text-small); }
.ker-kv dd { margin: 0; overflow-wrap: anywhere; }
.ker-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ker-btns:empty { display: none; }
.ker-btns .button { text-decoration: none; }
.ker-calm { margin: 8px 0 0; color: var(--muted); font-size: var(--text-meta); }
.ker-src { margin-top: 6px; color: var(--muted); font-size: var(--text-meta); }
.ker-draft { width: 100%; min-height: 6rem; padding: .6rem .75rem; border: 1px solid var(--field-line); border-radius: var(--r-control); background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
.ker-key { display: grid; gap: .5rem; margin: 1rem 0; }
.ker-key input { width: 100%; min-height: var(--tap); padding: .55rem .75rem; border: 1px solid var(--field-line); border-radius: var(--r-control); background: var(--surface); color: var(--ink); font: inherit; text-align: left; }
.ker-key .field-hint { margin: 0; }
.ker-key .button { justify-self: start; }

/* Chat cards */
.ker-acard { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.ker-acard-bare { padding-top: 2px; border-top: 0; }
.ker-acard .ker-g-rows > li { padding: 8px 0; }

:focus-visible.ker-g-open, .ker-week button:focus-visible, .ker-seg button:focus-visible, .ker-more:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }

/* The occupancy meter: in the chat's card, and slim at the end of the rooms row (track --accent-soft, fill --accent). */
.ker-meter { height: 10px; overflow: hidden; border-radius: 5px; background: var(--accent-soft); }
.ker-meter i { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.ker-acard-bare .ker-meter { margin-top: 2px; }
@media (forced-colors: active) { .ker-meter i, .ker-b { background: CanvasText; } .ker-meter { border: 1px solid CanvasText; } }
/* KER-15: the "חריג" row — the same quiet row, its label in ink (it is the line to read first, not a "needs you"). */
.ker-rows li.ker-unusual .ker-k { color: var(--ink); font-weight: 500; }
.ker-unusual-text { display: block; min-width: 0; font-size: var(--text-card); overflow-wrap: anywhere; }
