/* משחקי הקו – עיצוב משותף לאתר הלקוחות ולניהול
   פלטה: דיו כחול-לילה, צהוב אסימון, ירוק מוביל, כתום-אדום שרוף.
   טיפוגרפיה: Secular One לכותרות ולמספרים גדולים, Assistant לטקסט. */

@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@400;600;700;800&family=Secular+One&display=swap');

:root {
  --bg: #EEF2F8;
  --bg-2: #E3E9F3;
  --card: #FFFFFF;
  --ink: #14213D;
  --text: #1C2740;
  --muted: #64718A;
  --line: #D5DCE8;
  --accent: #F5B70A;       /* אסימון */
  --accent-ink: #3A2A00;
  --accent-soft: #FFF3CC;
  --good: #0F8B6C;          /* מוביל */
  --good-soft: #DDF4EC;
  --info: #2F5BD3;          /* ייחודי */
  --info-soft: #E2EAFD;
  --bad: #D9482B;           /* שרוף */
  --bad-soft: #FCE6E0;
  --warn: #B7791F;
  --warn-soft: #FBF0DB;
  --key: #F7F9FC;
  --key-shadow: #C9D2E1;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 8px 24px -12px rgba(20, 33, 61, .18);
  --font: 'Assistant', 'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
  --s1: #2F5BD3; --s2: #F5B70A; --s3: #0F8B6C; --s4: #D9482B;   /* סדרות בגרפים */
  --side: #14213D; --side-2: #1C2C4F; --side-text: #C9D3E6;      /* סרגל הצד של הניהול – כהה בשני המצבים */
  --gap: 18px;
  --display: 'Secular One', 'Assistant', 'Arial Hebrew', Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1324; --bg-2: #111A30; --card: #162139; --ink: #F1F4FA; --text: #E3E8F2; --muted: #93A0B8;
    --line: #263352; --accent: #FFC83D; --accent-ink: #2A1E00; --accent-soft: #3A3014;
    --good: #35C29A; --good-soft: #12362E; --info: #7C9DFF; --info-soft: #1C2A52;
    --bad: #FF7A5C; --bad-soft: #3D1D17; --warn: #E8B45A; --warn-soft: #3A2C12;
    --key: #1B2843; --key-shadow: #0A1020;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
    --s1: #7C9DFF; --s2: #FFC83D; --s3: #35C29A; --s4: #FF7A5C; --side: #08101F; --side-2: #13203B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C1324; --bg-2: #111A30; --card: #162139; --ink: #F1F4FA; --text: #E3E8F2; --muted: #93A0B8;
  --line: #263352; --accent: #FFC83D; --accent-ink: #2A1E00; --accent-soft: #3A3014;
  --good: #35C29A; --good-soft: #12362E; --info: #7C9DFF; --info-soft: #1C2A52;
  --bad: #FF7A5C; --bad-soft: #3D1D17; --warn: #E8B45A; --warn-soft: #3A2C12;
  --key: #1B2843; --key-shadow: #0A1020;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
  --s1: #7C9DFF; --s2: #FFC83D; --s3: #35C29A; --s4: #FF7A5C; --side: #08101F; --side-2: #13203B;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.55; direction: rtl;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; color: var(--ink); line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(26px, 5vw, 34px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num, .tab { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.section-title { font-family: var(--display); font-size: 15px; color: var(--muted); letter-spacing: .02em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 10px 18px; border-radius: 999px; cursor: pointer; font-weight: 700;
  transition: transform .08s ease, background .15s ease; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--bg-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink); filter: brightness(1.15); }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent); filter: brightness(1.05); }
.btn-danger { color: var(--bad); border-color: var(--bad-soft); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-s { padding: 6px 12px; font-size: 14px; }
.btn-ghost { border-color: transparent; background: transparent; }

.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--card); color: var(--text); min-height: 44px;
}
textarea.input { min-height: 90px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
label.field .help { font-weight: 400; color: var(--muted); font-size: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; background: var(--bg-2); color: var(--muted); white-space: nowrap;
}
.badge.good, .st-leader { background: var(--good-soft); color: var(--good); }
.badge.info, .st-unique { background: var(--info-soft); color: var(--info); }
.badge.bad, .st-burned { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
:root[data-theme="dark"] .badge.accent { color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.kpi .v { font-family: var(--display); font-size: 30px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .l { font-size: 14px; color: var(--muted); font-weight: 600; }
.kpi .h { font-size: 13px; color: var(--muted); }
.kpi.good { border-color: var(--good); } .kpi.good .v { color: var(--good); }
.kpi.accent { background: var(--accent-soft); border-color: var(--accent); }
.kpi.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); } .kpi.warn .v { color: var(--warn); }
.kpi.bad { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); } .kpi.bad .v { color: var(--bad); }
.kpi.info .v { color: var(--info); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: right; font-weight: 700; color: var(--muted); font-size: 13px; padding: 10px 12px; background: var(--bg-2); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: color-mix(in srgb, var(--bg-2) 50%, transparent); }
.table td.num { font-variant-numeric: tabular-nums; font-weight: 700; }


.toast-host { position: fixed; inset-inline: 0; bottom: 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 1000; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; max-width: 520px; animation: toast-in .25s ease; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.good { background: var(--good); color: #fff; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

.modal-back { position: fixed; inset: 0; background: rgba(12, 19, 36, .55); display: grid; place-items: center; z-index: 900; padding: 16px; }
.modal { background: var(--card); border-radius: 18px; padding: 24px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* מקשי טלפון – המוטיב של האתר */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; direction: ltr; }
.key {
  border: none; background: var(--key); border-radius: 16px; padding: 14px 0 12px; cursor: pointer;
  box-shadow: 0 3px 0 var(--key-shadow); font-family: var(--display); font-size: 26px; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; line-height: 1; transition: transform .06s, box-shadow .06s;
}
.key small { font-family: var(--font); font-size: 11px; color: var(--muted); letter-spacing: .12em; margin-top: 4px; min-height: 13px; }
.key:active, .key.pressed { transform: translateY(3px); box-shadow: 0 0 0 var(--key-shadow); }
.key.k-ok { background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 #C98F00; }
.key.k-del { font-size: 20px; }

.dial-path { display: inline-flex; align-items: center; gap: 6px; direction: ltr; font-family: var(--display); }
.dial-path span { background: var(--ink); color: var(--bg); border-radius: 8px; padding: 1px 9px; font-size: 15px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* =====================================================================
   רכיבים משותפים לניהול (ובהמשך גם לאתר הלקוחות). המדריך: DESIGN.md
   ===================================================================== */

.mono, .code, code { font-family: var(--mono); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 178px), 1fr)); }
.kpi .v { overflow-wrap: anywhere; }
.btn .ico, .ico { width: 18px; height: 18px; flex: none; }
.btn-s .ico { width: 15px; height: 15px; }
.btn-block { width: 100%; }
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
.btn-danger.btn-primary { background: var(--bad); border-color: var(--bad); color: #fff; }

/* כפתור הקריינות: אסימון צהוב עם "גלי קול". is-stale = יש קטעים לא עדכניים */
.btn-narr { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 2px 0 #C98F00; }
.btn-narr:hover { background: var(--accent); filter: brightness(1.05); }
.btn-narr .wave { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.btn-narr .wave i { width: 3px; border-radius: 2px; background: currentColor; height: 40%; }
.btn-narr .wave i:nth-child(2) { height: 100%; } .btn-narr .wave i:nth-child(3) { height: 65%; } .btn-narr .wave i:nth-child(4) { height: 85%; }
.btn-narr.is-stale { animation: narr-pulse 2.4s ease-in-out infinite; }
.btn-narr.is-fresh { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: none; }
@keyframes narr-pulse { 50% { box-shadow: 0 2px 0 #C98F00, 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); } }
.narr-meter { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.narr-meter::before { content: ''; width: 46px; height: 6px; border-radius: 3px; background: linear-gradient(to left, var(--good) calc(var(--p, 0) * 100%), var(--line) 0); }
.tag-narr { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); vertical-align: middle; }
:root[data-theme="dark"] .tag-narr { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag-narr, :root:not([data-theme="light"]) .badge.accent { color: var(--accent); } }

/* התראות */
.alert { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius-s); background: var(--info-soft); color: var(--text); border-inline-start: 4px solid var(--info); }
.alert-text { flex: 1 1 240px; font-weight: 600; }
.alert.good { background: var(--good-soft); border-color: var(--good); }
.alert.warn { background: var(--warn-soft); border-color: var(--warn); }
.alert.bad { background: var(--bad-soft); border-color: var(--bad); }
.alerts { display: flex; flex-direction: column; gap: 8px; }

/* לוח = יחידת תוכן עם כותרת */
.panel { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 18px; }
.panel-head .sub { color: var(--muted); font-size: 14px; }
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.panel-body.flush { padding: 0; gap: 0; }
.panel-body.flush > .table-wrap { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.panel-foot { padding: 10px 18px; border-top: 1px solid var(--line); }
.panels { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }

/* סינון */
.filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 18px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.filter { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); min-width: 130px; flex: 0 1 180px; }
.filter .input { min-height: 38px; padding: 7px 10px; font-size: 15px; font-weight: 400; }
.filters-actions { display: flex; gap: 6px; margin-inline-start: auto; align-items: center; }
.filters .count { font-size: 13px; color: var(--muted); font-weight: 700; }

/* תאים בטבלה לפי סוג עמודה */
.table td.c-num, .table td.c-money, .table td.c-pct, .table td.c-delta { font-variant-numeric: tabular-nums; font-weight: 700; }
.table td.c-phone, .table td.c-date, .table td.c-datetime { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.c-phone { font-family: var(--mono); font-size: 14px; }
.table td.c-datetime .t { color: var(--muted); margin-inline-start: 6px; }
.table td.c-delta.pos { color: var(--good); } .table td.c-delta.neg { color: var(--bad); }
.table td.c-delta { direction: ltr; text-align: right; }
.table td.c-text { max-width: 420px; }
.table td.c-actions { white-space: nowrap; text-align: left; width: 1%; }
.table td.c-actions .btn + .btn { margin-inline-start: 4px; }
.table .yes { color: var(--good); font-weight: 800; } .table .no { color: var(--muted); }
.table th.c-num, .table th.c-money, .table th.c-pct, .table th.c-delta { text-align: right; }
.table tbody tr:first-child td { border-top: 0; }
.table-scroll { max-height: 520px; overflow: auto; }

/* עימוד */
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-start; padding: 10px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager-info { font-size: 13px; color: var(--muted); font-weight: 700; margin-inline-end: auto; font-variant-numeric: tabular-nums; }

/* מצב ריק – לוח מקשים מעומעם */
.empty { padding: 36px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty b { color: var(--ink); font-family: var(--display); font-weight: 400; font-size: 18px; }
.empty p { max-width: 42ch; font-size: 14px; }
.empty-keys { display: grid; grid-template-columns: repeat(3, 10px); gap: 4px; margin-bottom: 6px; direction: ltr; }
.empty-keys i { width: 10px; height: 10px; border-radius: 3px; background: var(--line); }
.empty-keys i:nth-child(5) { background: var(--accent); }

/* טפסים */
.settings { display: flex; flex-direction: column; gap: var(--gap); }
.form-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 0; margin: 0; min-width: 0; }
.form-group > legend { float: right; width: 100%; padding: 14px 18px; border-bottom: 1px solid var(--line); font-family: var(--display); font-size: 17px; color: var(--ink); }
.form-group > legend + * { clear: both; }
.fields { display: grid; gap: 18px 22px; padding: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.field-label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
label.field.wide, .field.wide { grid-column: 1 / -1; }
.field.is-changed .input { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[type="number"], .input[type="time"], .input.ltr { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.input.mono { font-family: var(--mono); font-size: 14px; direction: ltr; text-align: left; }
.form-bar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.form-bar .msg { flex: 1; color: var(--muted); font-weight: 600; }
.form-bar.is-dirty { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 60%, var(--card)); }
.form-bar.is-dirty .msg { color: var(--ink); }

/* מתג (label.switch בלבד – button.switch שייך לאתר המכירה ההפוכה) */
label.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 15px; min-height: 44px; }
label.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start .15s; }
label.switch input:checked + .switch-ui { background: var(--good); }
label.switch input:checked + .switch-ui::after { inset-inline-start: 21px; }
label.switch input:focus-visible + .switch-ui { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ימים בשבוע – מקשים קטנים */
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { cursor: pointer; }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--key); box-shadow: 0 2px 0 var(--key-shadow); font-family: var(--display); color: var(--muted); }
.days input:checked + span { background: var(--ink); color: var(--bg); box-shadow: 0 2px 0 #000; }
.days input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* לשוניות משנה (מתג מקטעים) */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-2); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(20,33,61,.15); }

/* גרפים */
.chart { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.chart figcaption { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 700; color: var(--ink); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--s1); } .chart .bar:hover { fill: var(--accent); }
.chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { stroke: var(--card); stroke-width: 2; }
.chart .s1 { stroke: var(--s1); fill: var(--s1); } .chart .s2 { stroke: var(--s2); fill: var(--s2); } .chart .s3 { stroke: var(--s3); fill: var(--s3); } .chart .s4 { stroke: var(--s4); fill: var(--s4); }
.chart .line.s1, .chart .line.s2, .chart .line.s3, .chart .line.s4 { fill: none; }
.legend { display: flex; gap: 12px; font-size: 13px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.chart-empty { height: 120px; display: grid; place-items: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: var(--radius-s); }

/* קוד ורשימות הגדרה */
pre.code { margin: 0; padding: 14px 16px; border-radius: var(--radius-s); background: var(--side); color: #E8EEF9; font-size: 13px; line-height: 1.6; direction: ltr; text-align: left; overflow-x: auto; white-space: pre; }
.copy-line { display: flex; gap: 8px; align-items: center; }
.copy-line .input { flex: 1; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dl.facts dt { color: var(--muted); font-weight: 700; font-size: 14px; }
dl.facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* פס התקדמות */
.progress { height: 10px; border-radius: 5px; background: var(--bg-2); overflow: hidden; }
.progress > i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--accent); transition: width .3s ease; }

/* רשימה של פריטים (קריינות, שלוחות) */
.list { display: flex; flex-direction: column; }
.list-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item .title { font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-item .body { grid-column: 1 / -1; color: var(--text); font-size: 15px; }
.list-item .meta { color: var(--muted); font-size: 13px; }
.list-item .tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.list-item.is-stale { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.list-item audio { height: 34px; max-width: 260px; }

/* modal: כותרת ופעולות */
.modal h2 { font-size: 21px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
.modal .fields { padding: 0; grid-template-columns: 1fr; }
.table td.c-code code { font-size: 13px; background: var(--bg-2); padding: 2px 8px; border-radius: 6px; }

/* =====================================================================
   אתר הלקוחות – רכיבים משותפים לכל המשחקים (web.js).
   משחק משתמש בהם כמו שהם, ומוסיף CSS רק לחלק שמיוחד לו. המדריך: DESIGN.md
   ===================================================================== */

/* כותרת המשחק: לוח מצב כהה + ארנק/הודעה */
.game-head { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; }
.game-state { flex: 1 1 280px; background: var(--side); color: #fff; border-radius: 18px; padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.game-state h1 { color: #fff; font-size: clamp(24px, 5vw, 30px); }
.game-state .sub { color: rgba(255,255,255,.75); }
.game-state .lbl { color: rgba(255,255,255,.7); font-weight: 600; }
.game-state .big { font-family: var(--display); font-size: clamp(38px, 8vw, 48px); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.game-state .big small { font-family: var(--font); font-size: 16px; color: rgba(255,255,255,.75); margin-inline-start: 8px; }
.game-facts { display: flex; gap: 22px; flex-wrap: wrap; }
.game-facts div { display: flex; flex-direction: column; }
.game-facts b { font-family: var(--display); font-weight: 400; font-size: 22px; color: #fff; font-variant-numeric: tabular-nums; }
.game-facts span { color: rgba(255,255,255,.65); font-size: 13px; }
.pill { align-self: flex-start; display: inline-flex; gap: 8px; align-items: center; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; background: rgba(255,255,255,.12); color: #fff; }
.pill.open, .pill.good { background: var(--good); color: #fff; }
.pill.warn { background: var(--warn); color: #fff; }
.pill.bad { background: var(--bad); color: #fff; }
.game-wallet { flex: 0 1 260px; background: var(--accent-soft); border: 2px solid var(--accent); border-radius: 18px; padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.game-wallet .lbl { font-weight: 700; color: var(--muted); font-size: 14px; }
.game-wallet .big { font-family: var(--display); font-size: 40px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.game-note { flex: 0 1 300px; border-radius: 18px; padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; justify-content: center; background: var(--card); box-shadow: var(--shadow); }
.game-note h2 { color: inherit; font-size: 22px; }
.game-note.win { background: linear-gradient(135deg, var(--accent), #FFD96A); color: var(--accent-ink); box-shadow: none; }
.game-note.win h2 { color: var(--accent-ink); }
.game-note.wide { flex-basis: 100%; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.game-note.closed { background: var(--warn-soft); color: var(--warn); box-shadow: none; }

/* אסימונים */
.coins { display: flex; gap: 6px; flex-wrap: wrap; }
.coin { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15), 0 0 0 2px var(--accent-soft); }
.coin.used { background: transparent; border: 2px dashed var(--accent); box-shadow: none; opacity: .6; }

/* תפריט המשחק = מקשי הטלפון. מקש הספרה זהה למקש בטלפון */
.game-menu { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(74px, 1fr); gap: 6px; background: var(--card); padding: 6px; border-radius: 16px; box-shadow: var(--shadow); position: sticky; top: 62px; z-index: 20; overflow-x: auto; scrollbar-width: none; }
.game-menu button, .game-menu a { border: none; background: transparent; border-radius: 12px; padding: 9px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-weight: 700; color: var(--muted); font-size: 14px; text-decoration: none; white-space: nowrap; }
.game-menu b { font-family: var(--display); font-weight: 400; font-size: 20px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--key); color: var(--ink); box-shadow: 0 2px 0 var(--key-shadow); }
.game-menu [aria-selected="true"], .game-menu [aria-current="page"] { color: var(--ink); background: var(--bg); }
.game-menu [aria-selected="true"] b, .game-menu [aria-current="page"] b { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 #C98F00; }
.game-menu button:active b { transform: translateY(2px); box-shadow: none; }

/* שורות עם מתג (הגדרות והתראות) */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.toggle:first-of-type, .toggle:first-child { border-top: none; }
.toggle .t { font-weight: 700; color: var(--ink); }
.toggle .d { color: var(--muted); font-size: 14px; }
button.switch { width: 52px; height: 30px; border-radius: 999px; background: var(--line); border: none; position: relative; cursor: pointer; flex: none; transition: background .15s; padding: 0; }
button.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
button.switch[aria-checked="true"] { background: var(--good); }
button.switch[aria-checked="true"]::after { inset-inline-start: 25px; }

/* טבלת דירוג */
.rank { display: flex; flex-direction: column; }
.rank-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 6px; border-top: 1px solid var(--line); }
.rank-row:first-child { border-top: none; }
.rank-row.me { background: var(--accent-soft); border-radius: 12px; border-top-color: transparent; }
.rank-row.me + .rank-row { border-top-color: transparent; }
.rank-n { font-family: var(--display); font-size: 19px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink); }
.rank-n.g1 { background: #F5B70A; color: #3A2A00; } .rank-n.g2 { background: #C7CED9; color: #1C2740; } .rank-n.g3 { background: #D59A6A; color: #2E1A08; }
.rank-row.me .rank-n:not(.g1):not(.g2):not(.g3) { background: var(--accent); color: var(--accent-ink); }
.rank-name { display: flex; flex-direction: column; min-width: 0; font-weight: 700; color: var(--ink); }
.rank-name small { font-weight: 600; color: var(--muted); font-size: 13px; }
.rank-v { font-family: var(--display); font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* רשימת שורות (היסטוריה, תיק, תנועות) */
.lines { display: flex; flex-direction: column; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); }
.line:first-child { border-top: none; }
.line .t { font-weight: 700; color: var(--ink); min-width: 0; }
.line .s { color: var(--muted); font-size: 13px; }
.line .n { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.line .n.up, .up { color: var(--good); } .line .n.down, .down { color: var(--bad); }
.line .w { font-family: var(--display); font-size: 22px; color: var(--ink); min-width: 56px; text-align: center; background: var(--bg); border-radius: 10px; padding: 2px 8px; }
.line.mine .w, .line.me .w { background: var(--accent); color: var(--accent-ink); }
.line.me { background: var(--accent-soft); border-radius: 12px; padding-inline: 10px; }

/* בחירת תשובה (חידון, אפשרויות השקעה) */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.choices.col { grid-template-columns: 1fr; }
.choice { position: relative; text-align: right; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font: inherit; font-weight: 600; }
.choice > b { font-family: var(--display); font-weight: 400; width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--key); color: var(--ink); box-shadow: 0 2px 0 var(--key-shadow); }
.choice:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.choice[aria-pressed="true"] { border-color: var(--ink); background: var(--bg); }
.choice[aria-pressed="true"] > b { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 #C98F00; }
.choice.mine { border-color: var(--accent); background: var(--accent-soft); }
.choice.right { border-color: var(--good); background: var(--good-soft); }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice[disabled] { opacity: .5; cursor: not-allowed; }

/* צ'יפים (סינון מהיר, סכומים מוכנים) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
button.chip { cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--text); font-family: inherit; }
button.chip:hover { background: var(--bg-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(20,33,61,.15); }
.game-menu:focus-visible, .game-menu button:focus-visible, .choice:focus-visible, .chip:focus-visible, button.switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* מספרים עם סימן (+340 / −100) נשארים בסדר הנכון גם בעברית */
.kpi .v, .game-state .big, .game-wallet .big, .gstat b { unicode-bidi: plaintext; text-align: right; }
/* plaintext: הכיוון נקבע לפי התוכן – מספר עם סימן נשאר ‎−100, ו"1.22 מיליון ₪" נשאר בעברית */
.line .n, .rank-v, .line .w { unicode-bidi: plaintext; }
.rank-name { align-items: flex-start; }
/* כפתור בתוך מדד – לא חורג מהמסגרת */
.kpi .btn { align-self: flex-start; max-width: 100%; white-space: normal; text-align: center; margin-top: 6px; }
