/* SHINI AI · שפת עיצוב אחת: Material 3 Expressive בצבעי המותג (דבש #E8B84C, גרפיט #282722, נייר שמנת #FAF7F0).
   הפלטה נגזרת משלושת צבעי המקור לתפקידי M3 (primary / secondary / tertiary / surface / container). אין צבע מחוץ לתפקידים.
   גופן Heebo מקומי (public/fonts, רישיון OFL). מרווחים 4/8/16/24, גוף 16, יעד מגע 48. הכל מקומי, בלי רשת. */
@font-face { font-family: Heebo; src: url("./fonts/Heebo.ttf") format("truetype"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  /* תפקידי צבע */
  --primary: #6F5100; --on-primary: #FFFDF8;
  --primary-container: #E8B84C; --on-primary-container: #282722; --primary-container-hover: #D4A033; --primary-subtle: #F7E9C2;
  --secondary: #5C5849; --secondary-container: #E9E3CF; --on-secondary-container: #282722;
  --tertiary: #4F6430; --tertiary-container: #DCE8B9; --on-tertiary-container: #1E2B08;
  --error: #A3321F; --error-container: #F6DCD6; --on-error-container: #4A1109;
  --warning: #7A4A00; --warning-container: #F8E7C4; --on-warning-container: #3D2500;
  --surface: #FAF7F0; --surface-lowest: #FFFDF8; --surface-low: #F6F2E7; --surface-container: #F1ECDE; --surface-high: #EBE5D4; --surface-highest: #E5DFCC;
  --on-surface: #282722; --on-surface-variant: #55534A; --outline: #7D786A; --outline-variant: #D8D0BC;
  --inverse-surface: #282722; --inverse-on-surface: #FAF7F0; --scrim: rgb(40 39 34 / .5);
  /* מרווחים */
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px;
  /* צורות: עגולות ומגוונות */
  --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --r-xl: 28px; --r-full: 999px;
  /* הגבהות */
  --e1: 0 1px 2px rgb(40 39 34 / .14), 0 1px 3px 1px rgb(40 39 34 / .08);
  --e3: 0 4px 8px 3px rgb(40 39 34 / .1), 0 1px 3px rgb(40 39 34 / .18);
  /* תנועה: קפיצית עדינה, ומבוטלת ב-prefers-reduced-motion */
  --spring: cubic-bezier(.34, 1.4, .64, 1); --standard: cubic-bezier(.2, 0, 0, 1); --t-fast: 160ms; --t-med: 300ms;
  /* מבנה */
  --scale: 1; --row-pad: 12px; --nav-h: 76px; --rail-w: 96px; --content-w: 80rem;
  --font: Heebo, "Segoe UI", "Noto Sans Hebrew", Arial, sans-serif;
  /* סקאלת טיפוגרפיה (rem). אף טקסט לא קטן מ-1rem. */
  --fs-body: 1rem; --fs-title: 1.1875rem; --fs-headline: 1.375rem; --fs-display: 1.875rem;
  color-scheme: light;
}
html { font-size: calc(16px * var(--scale)); }
html[data-density="comfortable"] { --row-pad: 16px; }
html[data-density="compact"] { --row-pad: 4px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--surface); color: var(--on-surface); font: var(--fs-body)/1.5 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: var(--fs-display); line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: var(--fs-headline); line-height: 1.3; font-weight: 700; }
h3 { font-size: var(--fs-title); line-height: 1.35; font-weight: 700; }
h4 { font-size: var(--fs-body); font-weight: 700; }
.muted { color: var(--on-surface-variant); }
.small, small { font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: var(--s3); top: -5rem; background: var(--inverse-surface); color: var(--inverse-on-surface); padding: var(--s2) var(--s3); border-radius: var(--r-full); z-index: 60; }
.skip:focus { top: var(--s2); }
:focus-visible { outline: 3px solid var(--on-surface); outline-offset: 2px; box-shadow: 0 0 0 6px var(--primary-container); }
.icon { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip .icon, .banner > .icon, .sc-reason .icon, .hl-note .icon { width: 1.25rem; height: 1.25rem; }

/* איורים וסימן המותג */
.art { display: grid; place-items: center; }
.art-svg { width: min(100%, 10rem); height: auto; }
.art-img { width: min(100%, 14rem); height: auto; }
.a-blob { fill: var(--primary-subtle); }
.a-ink { stroke: var(--on-surface); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.a-thick { stroke-width: 5; }
.a-fill { fill: var(--surface-lowest); }
.a-acc { fill: var(--primary-container); }
.a-dot { fill: var(--primary-container); } .a-dot2 { fill: var(--tertiary-container); }
.a-s1, .a-s2 { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.a-s1 { stroke: var(--on-surface); stroke-width: 128; }
.a-s2 { stroke: var(--primary-container); stroke-width: 118; }
.brand-mark { width: 2.5rem; height: 2.5rem; flex: none; }

/* כותרת ומעטפת */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s2) max(var(--s3), calc((100% - var(--content-w)) / 2)); background: var(--surface); }
.brand { min-height: 48px; min-width: 48px; display: flex; align-items: center; gap: var(--s2); text-decoration: none; font-weight: 800; }
.date-block { flex: 1 1 12rem; min-width: 0; }
.hebrew-date { font-size: var(--fs-title); font-weight: 800; line-height: 1.2; }
.gregorian { color: var(--on-surface-variant); }
.status-zone { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.badge { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 6px; border-radius: var(--r-full); background: var(--primary-container); color: var(--on-primary-container); font-size: 1rem; font-weight: 700; line-height: 1; }
.bell { position: relative; }
.bell .badge, .bottom-nav .badge { position: absolute; top: 2px; inset-inline-start: calc(50% + 10px); min-width: 1.25rem; height: 1.25rem; padding: 0 4px; border: 2px solid var(--surface); }
.bell .badge { inset-inline-start: auto; inset-inline-end: 0; top: 0; }
.bar .bell + .icon-btn { margin-inline-start: 0; }

/* ניווט: סרגל תחתון בנייד, פס צד (rail) במחשב */
.bottom-nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; gap: var(--s1); padding: var(--s2) var(--s2) calc(var(--s2) + env(safe-area-inset-bottom)); background: var(--surface-container); }
.bottom-nav a { position: relative; flex: 1 1 0; max-width: 8rem; min-width: 56px; min-height: 48px; display: grid; justify-items: center; align-content: start; gap: 2px; text-decoration: none; font-weight: 600; line-height: 1.2; color: var(--on-surface-variant); }
.bottom-nav a .icon { box-sizing: content-box; width: 1.5rem; height: 1.5rem; padding: 4px 20px; border-radius: var(--r-full); transition: background-color var(--t-med) var(--standard), border-radius var(--t-med) var(--spring); }
.bottom-nav a:hover .icon { background: color-mix(in srgb, var(--on-surface) 8%, transparent); }
.bottom-nav a[aria-current="page"] { color: var(--on-surface); font-weight: 800; }
.bottom-nav a[aria-current="page"] .icon { background: var(--primary-container); color: var(--on-primary-container); }
.bottom-nav a:active .icon { border-radius: var(--r-sm); }
.bottom-nav .rail-brand { display: none; }
body.has-bottom-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
body.has-bottom-nav .hl-rest { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
body.has-bottom-nav .composer { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }

/* כפתור פעולה צף מורחב */
.fab { position: fixed; inset-inline-end: var(--s3); bottom: calc(var(--nav-h) + var(--s3) + env(safe-area-inset-bottom)); z-index: 25; display: inline-flex; align-items: center; gap: var(--s2); min-height: 56px; padding: 0 var(--s4) 0 20px; border: 0; border-radius: var(--r-md); background: var(--primary-container); color: var(--on-primary-container); font-weight: 800; box-shadow: var(--e3); transition: border-radius var(--t-med) var(--spring), transform var(--t-med) var(--spring), box-shadow var(--t-fast); }
.fab:hover { box-shadow: var(--e3), inset 0 0 0 999px color-mix(in srgb, currentColor 8%, transparent); }
.fab:active { border-radius: var(--r-full); transform: scale(.96); }

/* בנייד, כפתור הפעולה הראשית של המסך הופך ל-FAB; במחשב הוא כפתור רגיל */
@media (max-width: 1023px) {
  .fab-narrow { position: fixed; inset-inline-end: var(--s3); bottom: calc(var(--nav-h) + var(--s3) + env(safe-area-inset-bottom)); z-index: 25; min-height: 56px; padding: 0 var(--s4) 0 20px; border-radius: var(--r-md); font-weight: 800; box-shadow: var(--e3); }
}
@media (min-width: 1024px) { .fab-only-narrow { display: none; } }
@media (max-width: 1023px) { body.has-bottom-nav:has(.fab) { padding-bottom: calc(var(--nav-h) + 88px + env(safe-area-inset-bottom)); } }

/* כפתורים: מלא (דבש), טונאלי, קווי, טקסט. צורת כדור שמתעגלת אחרת בלחיצה */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; min-width: 48px; padding: 0 20px; border-radius: var(--r-full); border: 1px solid var(--outline); background: transparent; color: var(--on-surface); font-weight: 600; text-decoration: none; text-align: center; transition: border-radius var(--t-med) var(--spring), box-shadow var(--t-fast), background-color var(--t-fast), transform var(--t-med) var(--spring); }
.btn:hover { box-shadow: inset 0 0 0 999px color-mix(in srgb, currentColor 8%, transparent); }
.btn:active { border-radius: var(--r-sm); box-shadow: inset 0 0 0 999px color-mix(in srgb, currentColor 12%, transparent); }
.btn-primary { background: var(--primary-container); border-color: transparent; color: var(--on-primary-container); font-weight: 700; }
.btn-tonal { background: var(--secondary-container); border-color: transparent; color: var(--on-secondary-container); }
.btn-text { border-color: transparent; color: var(--primary); }
.btn-danger { background: var(--error-container); border-color: transparent; color: var(--on-error-container); }
.btn-wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn[aria-disabled="true"] { opacity: .7; cursor: not-allowed; border-style: dashed; }
.icon-btn { padding: 0; margin-inline-start: auto; width: 48px; border-color: transparent; }
.chip { display: inline-flex; align-items: center; gap: var(--s1); padding: 2px 12px; min-height: 32px; border-radius: var(--r-full); font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.chip-neutral { background: var(--surface-high); color: var(--on-surface); }
.chip-ok { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.chip-warn { background: var(--warning-container); color: var(--on-warning-container); }
.chip-bad, .chip-error { background: var(--error-container); color: var(--on-error-container); }
.chip-accent { background: var(--primary-subtle); color: var(--on-surface); border-color: var(--primary-container); }
.chip-missing { border: 1px dashed var(--outline); color: var(--on-surface-variant); }
.chip-button { cursor: pointer; min-height: 48px; padding-inline: var(--s3); }
.inactive { display: grid; gap: var(--s1); }
.inactive small { color: var(--on-surface-variant); font-size: 1rem; }

/* פריסה */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); max-width: var(--content-w); margin-inline: auto; padding: var(--s3) var(--s3) var(--s4); }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.block { margin-bottom: var(--s4); }
.block > h2, .heading { margin-bottom: var(--s2); }
.heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); align-items: baseline; }
.panel, .card { background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r-lg); padding: var(--s3); }
.card { display: grid; gap: var(--s2); margin-bottom: var(--s2); }
.card .row-chips { justify-content: flex-start; }
.workspace { display: none; }
.workspace h2 { margin-bottom: var(--s3); }

/* שורות */
.row { display: grid; grid-template-columns: minmax(4rem, auto) minmax(0, 1fr) auto; align-items: center; gap: var(--s3); width: 100%; min-height: 48px; padding: var(--row-pad) var(--s2); border: 0; border-top: 1px solid var(--outline-variant); background: transparent; text-align: start; border-radius: 0; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-container); }
.row[aria-pressed="true"] { background: var(--primary-subtle); border-radius: var(--r-md); }
.time { color: var(--on-surface-variant); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.row-main { display: grid; gap: 2px; min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-note { display: inline-flex; gap: var(--s1); align-items: center; color: var(--on-surface-variant); }
.row-chips { display: flex; flex-wrap: wrap; gap: var(--s1); justify-content: flex-end; }
.row-chips.start { justify-content: flex-start; }
@media (max-width: 480px) {
  .row { grid-template-columns: minmax(3.25rem, auto) minmax(0, 1fr); }
  .row > .row-chips { grid-column: 2; justify-content: flex-start; }
}
.part { background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r-lg); margin-top: var(--s2); padding: 0 var(--s2); }
summary { display: flex; align-items: center; gap: var(--s2); min-height: 48px; list-style: none; cursor: pointer; font-weight: 600; }
summary::-webkit-details-marker { display: none; }
/* תפריט "עוד": כפתור סמל אחד ורשימת פעולות משניות */
.menu { position: relative; }
.menu > summary.menu-btn { width: 48px; height: 48px; min-height: 48px; justify-content: center; padding: 0; border-radius: var(--r-full); color: var(--on-surface-variant); }
.menu > summary.menu-btn::before { display: none; }
.menu > summary.menu-btn:hover, .menu[open] > summary.menu-btn { background: var(--surface-container); }
.menu-list { position: absolute; inset-inline-end: 0; top: 100%; z-index: 30; min-width: 12rem; display: grid; padding: var(--s1); background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r-md); box-shadow: var(--e3); animation: pop var(--t-med) var(--spring); }
.menu-item { display: flex; align-items: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s3); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--on-surface); font: inherit; font-weight: 600; text-align: start; cursor: pointer; }
.menu-item:hover { background: var(--surface-container); }
.menu-item.is-danger { color: var(--error); }
.menu-item:disabled { opacity: .5; cursor: not-allowed; }
.part summary { justify-content: space-between; gap: var(--s3); min-height: 52px; padding: 0 var(--s2); font-weight: 800; font-size: var(--fs-title); }
summary::before { content: ""; width: .6rem; height: .6rem; margin-inline-end: var(--s2); border-inline-start: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); transition: transform var(--t-med) var(--spring); }
details[open] > summary::before { transform: rotate(-45deg); }
.part summary > :first-child { flex: 1; }
#events, #tasks { background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r-lg); padding: var(--s1) var(--s2); }
#events:empty, #tasks:empty { display: none; }

/* טפסים */
.field { display: grid; gap: var(--s1); margin-bottom: var(--s3); }
.field label { font-weight: 600; color: var(--on-surface-variant); }
input, select, textarea { min-height: 48px; width: 100%; padding: var(--s2) var(--s3); border-radius: var(--r-sm); border: 1px solid var(--outline); background: var(--surface-lowest); transition: box-shadow var(--t-fast), border-color var(--t-fast); }
input:hover, select:hover, textarea:hover { border-color: var(--on-surface); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
textarea { min-height: 96px; resize: vertical; }
input[type="radio"], input[type="checkbox"] { width: 24px; min-height: 24px; accent-color: var(--on-surface); }
input[type="checkbox"][role="switch"] { appearance: none; position: relative; flex: none; width: 52px; min-height: 32px; height: 32px; padding: 0; border-radius: var(--r-full); border: 2px solid var(--outline); background: var(--surface-highest); transition: background-color var(--t-med) var(--standard), border-color var(--t-med); }
input[type="checkbox"][role="switch"]::before { content: ""; position: absolute; top: 50%; inset-inline-start: 6px; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--outline); transition: inset-inline-start var(--t-med) var(--spring), width var(--t-med) var(--spring), height var(--t-med) var(--spring), margin-top var(--t-med) var(--spring), background-color var(--t-fast); }
input[type="checkbox"][role="switch"]:checked { background: var(--primary-container); border-color: var(--primary-container); }
input[type="checkbox"][role="switch"]:checked::before { inset-inline-start: 22px; width: 24px; height: 24px; margin-top: -12px; background: var(--on-primary-container); }
input[type="checkbox"][role="switch"]:active::before { width: 28px; }
input[type="checkbox"][role="switch"]:focus { box-shadow: none; }
input[type="checkbox"][role="switch"]:focus-visible { box-shadow: 0 0 0 6px var(--primary-container); }

/* באנרים ומצבים */
.banner { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s2) var(--s3); margin-bottom: var(--s3); border-radius: var(--r-lg); background: var(--surface-high); color: var(--on-surface); flex-wrap: wrap; }
.banner > p, .banner .grow { flex: 1 1 14rem; align-self: center; }
.banner > .icon { margin-top: 10px; }
.banner-offline, .banner-warn { background: var(--warning-container); color: var(--on-warning-container); }
.banner-error { background: var(--error-container); color: var(--on-error-container); }
.banner-ok { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.row-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.empty { padding: var(--s4) var(--s3); text-align: center; display: grid; gap: var(--s2); justify-items: center; }
.empty p { max-width: 28rem; }
.empty .field { width: min(100%, 24rem); text-align: start; }
.skeleton { display: grid; gap: var(--s3); padding: var(--s3); }
.skeleton-row { display: flex; align-items: center; gap: var(--s3); }
.skeleton-dot { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface-high); animation: pulse 1.4s var(--standard) infinite; }
.skeleton-text { display: grid; gap: var(--s2); flex: 1; }
.skeleton-line { display: block; height: 1rem; border-radius: var(--r-full); background: var(--surface-high); animation: pulse 1.4s var(--standard) infinite; }
.skeleton-line.short { width: 55%; }
@keyframes pulse { 50% { opacity: .45; } }
.proposal { background: var(--primary-subtle); border: 1px solid var(--primary-container); border-radius: var(--r-lg); padding: var(--s3); margin-bottom: var(--s3); display: grid; gap: var(--s2); }
.proposal h3 { display: flex; gap: var(--s2); align-items: center; }
.details { display: grid; gap: var(--s2); }
.context-note { background: var(--surface-container); border-radius: var(--r-md); padding: var(--s3); display: grid; gap: var(--s1); }
.context-note h4 { display: flex; gap: var(--s2); align-items: center; }

/* חלונית */
dialog { width: min(100% - 1.5rem, 36rem); max-height: 90vh; border: 0; border-radius: var(--r-xl); padding: var(--s4); background: var(--surface-high); color: var(--on-surface); box-shadow: var(--e3); }
dialog::backdrop { background: var(--scrim); }
dialog[open] { animation: pop var(--t-med) var(--spring); }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); margin-top: var(--s3); }
.choice { border: 1px solid var(--outline-variant); border-radius: var(--r-md); margin: 0 0 var(--s3); padding: var(--s2) var(--s3); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.choice legend { font-weight: 700; padding-inline: var(--s1); }
.choice-item { display: flex; align-items: center; gap: var(--s2); min-height: 48px; }

/* כניסה */
.login-wrap { max-width: 28rem; margin: 0 auto; padding: var(--s4) var(--s3); display: grid; gap: var(--s3); }
.login-brand { justify-content: center; font-size: var(--fs-headline); }
.login-art { margin-bottom: calc(-1 * var(--s2)); }
.login-card { display: grid; gap: var(--s3); border-radius: var(--r-xl); }
.login-more { display: flex; justify-content: center; }
.form-error { color: var(--error); font-weight: 600; margin-bottom: var(--s3); }
.form-error[hidden] { display: none; }

/* מסך נעילה */
.lock-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: var(--s3); background: var(--surface); overflow-y: auto; }
.lock-card { width: min(100%, 26rem); display: grid; gap: var(--s3); justify-items: center; text-align: center; padding: var(--s4); background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r-xl); box-shadow: var(--e1); }
.lock-card .brand-mark { width: 4.5rem; height: 4.5rem; }
.lock-card h1 { margin: 0; font-size: var(--fs-headline); }
.lock-card p { margin: 0; }
.lock-card form { width: 100%; text-align: start; }

/* צ'אט */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); max-width: var(--content-w); margin-inline: auto; padding: var(--s3); }
.chat-list { display: grid; align-content: start; gap: var(--s2); }
.conv { display: grid; gap: 2px; width: 100%; text-align: start; padding: var(--row-pad) var(--s3); min-height: 48px; border: 1px solid var(--outline-variant); border-radius: var(--r-md); background: var(--surface-lowest); }
.conv:hover { background: var(--surface-container); }
.conv[aria-current="true"] { border-color: var(--primary-container); background: var(--primary-subtle); }
.thread { display: flex; flex-direction: column; min-height: 60vh; }
.messages { display: grid; gap: var(--s2); align-content: start; flex: 1; padding-bottom: var(--s3); }
.msg { max-width: 42rem; padding: var(--s2) var(--s3); border-radius: var(--r-lg); background: var(--surface-container); overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.mine { justify-self: start; background: var(--primary-subtle); border-end-start-radius: var(--s1); }
.msg.theirs { justify-self: end; border-end-end-radius: var(--s1); }
.msg-meta { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-top: var(--s1); white-space: normal; color: var(--on-surface-variant); }
.composer { position: sticky; bottom: 0; background: var(--surface-lowest); padding-top: var(--s2); display: grid; gap: var(--s2); }
.composer .row-actions { margin: 0; justify-content: space-between; align-items: center; }
.quick { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); white-space: normal; }
.only-narrow { display: inline-flex; }
@media (max-width: 1023px) {
  .chat-layout[data-view="thread"] .chat-list { display: none; }
  .chat-layout[data-view="list"] .thread { display: none; }
}

/* מחכה לך */
.wait-layout { display: grid; gap: var(--s3); max-width: var(--content-w); margin-inline: auto; padding: var(--s3); }
.wait-layout > .page-head, .wait-layout > #banners { grid-column: 1 / -1; }
.decision { display: grid; gap: var(--s1); }
.decision-row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.decision-row .btn { padding-inline: var(--s3); }
.decision-sep { display: inline-flex; gap: var(--s2); margin-inline-start: auto; padding-inline-start: var(--s3); border-inline-start: 1px solid var(--outline-variant); }
.confirm-rule { background: var(--primary-subtle); border: 1px solid var(--primary-container); border-radius: var(--r-md); padding: var(--s3); display: grid; gap: var(--s2); }

/* עוד */
.more-layout { display: grid; gap: var(--s4); max-width: 44rem; margin-inline: auto; padding: var(--s3); }
.more-list { display: grid; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.more-link { display: flex; align-items: center; gap: var(--s3); min-height: 64px; padding: var(--s2) var(--s3); width: 100%; border: 0; border-radius: var(--r-lg); background: var(--surface-container); text-decoration: none; text-align: start; font-weight: 700; transition: border-radius var(--t-med) var(--spring), background-color var(--t-fast); }
.more-link:hover { background: var(--surface-high); }
.more-link:active { border-radius: var(--r-sm); }
.more-link > .icon { box-sizing: content-box; padding: 8px; border-radius: var(--r-md); background: var(--primary-subtle); color: var(--primary); }
.more-link small { display: block; font-weight: 400; color: var(--on-surface-variant); font-size: 1rem; }
.more-link .grow { flex: 1; }

/* הודעה קצרה (snackbar) */
.sc-toasts { position: fixed; inset-inline: var(--s3); bottom: calc(var(--nav-h) + var(--s3) + env(safe-area-inset-bottom)); z-index: 40; display: grid; gap: var(--s2); justify-items: start; pointer-events: none; }
.sc-toast { pointer-events: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); max-width: min(100%, 32rem); background: var(--inverse-surface); color: var(--inverse-on-surface); border-radius: var(--r-md); padding: var(--s1) var(--s1) var(--s1) var(--s3); box-shadow: var(--e3); animation: pop var(--t-med) var(--spring); }
.sc-toast .btn { color: var(--inverse-on-surface); border-color: transparent; }
.sc-toast-action { color: var(--primary-container) !important; }

/* מחשב: פס צד קבוע, פריסה רחבה */
@media (min-width: 1024px) {
  body.has-bottom-nav { padding-bottom: 0; padding-inline-start: var(--rail-w); }
  .bottom-nav { inset-block: 0; inset-inline: auto; inset-inline-start: 0; width: var(--rail-w); flex-direction: column; justify-content: flex-start; align-items: stretch; gap: var(--s3); padding: var(--s3) var(--s2); border-inline-end: 1px solid var(--outline-variant); background: var(--surface-container); }
  .bottom-nav a { flex: none; max-width: none; width: 100%; }
  .bottom-nav .rail-brand { display: grid; margin-bottom: var(--s3); }
  .bottom-nav .rail-brand .brand-mark { width: 3rem; height: 3rem; }
  .bar .brand { display: none; }
  .layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; padding-top: var(--s4); }
  .workspace { display: block; position: sticky; top: var(--s3); max-height: calc(100vh - 2 * var(--s3)); overflow: auto; }
  .fab { bottom: var(--s4); }
  .sc-toasts { bottom: var(--s4); inset-inline-start: calc(var(--rail-w) + var(--s3)); }
  body.has-bottom-nav .hl-rest, body.has-bottom-nav .composer { bottom: 0; }
  .only-narrow { display: none; }
  .chat-layout { grid-template-columns: 22rem minmax(0, 1fr); align-items: start; }
  .wait-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; padding-top: var(--s4); }
  .more-layout { max-width: 64rem; }
  .more-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 30rem) { .bar .status-zone { order: 5; flex-basis: 100%; } .bar .date-block { flex-basis: 7rem; } .bar .brand b { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .skeleton-dot, .skeleton-line { animation: none; }
}

.day-stats { display: grid; gap: var(--s1); list-style: none; margin: var(--s2) 0; padding: 0; }
.day-stats li { padding: var(--s2) var(--s3); background: var(--surface-container); border-radius: var(--r-sm); }

/* קליטת שיתוף מהטלפון */
.shared-preview { display: block; max-width: 100%; max-height: 40vh; margin-block: var(--s3); border-radius: var(--r-md); }
.shared-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: var(--s3); }

/* דיווח שגרה ודילוג עם סיבה */
.report-form, .skip-form { display: grid; gap: var(--s2); margin-block: var(--s3); }
.report-form .field { display: grid; gap: 4px; }
.report-form input[type="text"], .report-form input[type="number"], .report-form textarea, .skip-form select, .skip-form input { font: inherit; font-size: 1rem; min-height: 44px; padding: 8px 12px; border-radius: var(--r-md); border: 1px solid var(--outline-variant); background: var(--surface-lowest); color: inherit; }
.report-form .check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 1rem; }
.skip-form summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 1rem; }

/* ערכת נושא כהה: גרפיט וקרם, אותם תפקידי צבע. data-theme נקבע ב-shell.js לפי ההעדפה במכשיר (ברירת מחדל: לפי המכשיר). */
html[data-theme="dark"] {
  --primary: rgb(232 184 76); --on-primary: rgb(40 39 34);
  --primary-container: rgb(90 66 16); --on-primary-container: rgb(247 233 194); --primary-container-hover: rgb(108 79 20); --primary-subtle: rgb(58 47 20);
  --secondary: rgb(207 200 178); --secondary-container: rgb(61 58 49); --on-secondary-container: rgb(237 231 212);
  --tertiary: rgb(185 208 138); --tertiary-container: rgb(51 65 28); --on-tertiary-container: rgb(220 232 185);
  --error: rgb(255 180 164); --error-container: rgb(92 33 24); --on-error-container: rgb(255 218 211);
  --warning: rgb(242 195 116); --warning-container: rgb(74 50 16); --on-warning-container: rgb(248 231 196);
  --surface: rgb(28 27 23); --surface-lowest: rgb(20 19 15); --surface-low: rgb(35 34 25); --surface-container: rgb(42 40 32); --surface-high: rgb(52 50 42); --surface-highest: rgb(62 60 51);
  --on-surface: rgb(237 231 212); --on-surface-variant: rgb(201 195 174); --outline: rgb(148 143 126); --outline-variant: rgb(74 71 60);
  --inverse-surface: rgb(237 231 212); --inverse-on-surface: rgb(40 39 34); --scrim: rgb(0 0 0 / .6);
  --e1: 0 1px 2px rgb(0 0 0 / .5), 0 1px 3px 1px rgb(0 0 0 / .3);
  --e3: 0 4px 8px 3px rgb(0 0 0 / .35), 0 1px 3px rgb(0 0 0 / .5);
  color-scheme: dark;
}
