/* =====================================================================
   APT WhatsApp — customer portal and shared components.
   Design language: APTWeb (docs/ui/list-page-design.md, docs/ui/modal-design.md in APTNet).
   Tone tokens live on :root; a page may switch tone with <body data-tone="...">.
   Red and green are reserved for meaning (failure / success), never for the tone.
   ===================================================================== */
@font-face{font-family:Heebo;font-style:normal;font-weight:100 900;font-display:swap;src:url('/portal/fonts/Heebo.ttf') format('truetype')}

:root{
  --ink:#152033;--text:#334155;--muted:#4f6177;--subtle:#64748b;--faint:#94a3b8;
  --line:#e3eaf3;--row-line:#eef2f7;--field-line:#cbd5e1;
  --page:#f4f7fb;--surface:#fff;--surface-2:#f8fafc;
  --accent:#2470cc;--accent-strong:#1f63b8;--accent-soft:#dbe9f8;--accent-tint:#eef4fc;
  --row-marker:#39c89a;--row-hover:#e3f5ed;--head-band:#e9eff7;
  --mint:#39c89a;--mint-dark:#176b57;--mint-soft:#eaf8f2;--mint-line:#c9eedd;
  --red:#dc2626;--red-strong:#b91c1c;--red-soft:#fef2f2;--red-line:#fecaca;
  --green:#15803d;--green-soft:#f0fdf4;--green-line:#bbf7d0;
  --amber:#b45309;--amber-soft:#fff7ed;--amber-line:#fed7aa;
  --wa-out:#d9fdd3;--wa-out-line:#c4ecbc;
  --radius:16px;--radius-md:12px;--radius-sm:10px;
  --control-h:38px;
  font-family:Heebo,Arial,sans-serif;color:var(--text);background:var(--page);
  font-synthesis:none;color-scheme:light;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
}
body[data-tone="cobalt"]{--accent:#3463c4;--accent-strong:#2b53a8;--accent-soft:#e2e9f8;--accent-tint:#f1f5fd;--row-marker:#93abe6;--row-hover:#f3f6fd;--head-band:#ecf0f9}
body[data-tone="ocean"]{--accent:#1d6fae;--accent-strong:#195f96;--accent-soft:#dcebf6;--accent-tint:#eff6fb;--row-marker:#82b6de;--row-hover:#f2f8fc;--head-band:#e9f1f8}
body[data-tone="navy"]{--accent:#1d3d7a;--accent-strong:#162f60;--accent-soft:#e6ecf7;--accent-tint:#f3f6fb;--row-marker:#8ea6d3;--row-hover:#f5f8fc;--head-band:#f2f5fb}
body[data-tone="indigo"]{--accent:#4f46e5;--accent-strong:#4338ca;--accent-soft:#e2e4fb;--accent-tint:#f1f2fd;--row-marker:#818cf8;--row-hover:#eef0fd;--head-band:#eceef8}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
html.dialog-lock{overflow:hidden}
body{margin:0;background:var(--page);color:var(--text);font-size:14px;line-height:1.5}
h1,h2,h3,p{margin:0}
h1,h2,h3{color:var(--ink)}
h1{font-size:24px;font-weight:800;letter-spacing:-.3px;line-height:1.25}
h2{font-size:16px;font-weight:800;line-height:1.35}
h3{font-size:15px;font-weight:700}
p{line-height:1.75}
a{color:var(--accent-strong);text-underline-offset:3px}
a:hover{color:var(--accent)}
small,.muted{color:var(--muted);font-size:13px}
.hint{color:var(--subtle);font-size:13px;line-height:1.65}
.lead{color:var(--text);font-size:14px;line-height:1.8}
.eyebrow{color:var(--mint-dark);font-weight:700;font-size:13px}
.stack{display:grid;gap:14px}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.spread{justify-content:space-between}
.grow{flex:1;min-width:0}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
[hidden]{display:none!important}
svg.icon{width:18px;height:18px;flex:none}
svg.flip{transform:scaleX(-1)}
bdi,.when{unicode-bidi:isolate}
.when{white-space:nowrap;font-variant-numeric:tabular-nums}
.money{display:inline-block;direction:ltr;unicode-bidi:isolate;white-space:nowrap;font-variant-numeric:tabular-nums}
code,.inline-code{font-family:ui-monospace,Consolas,'Cascadia Mono',monospace;font-size:13px;direction:ltr;unicode-bidi:isolate;background:#f1f5f9;border:1px solid var(--line);border-radius:6px;padding:1px 6px;color:var(--ink);overflow-wrap:anywhere}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
button,a,input,select,textarea,label{-webkit-tap-highlight-color:transparent}

/* ---------- Buttons: primary (filled tone) · secondary (white) · ghost · danger · icon-only ---------- */
button,.button{
  min-height:var(--control-h);padding:0 16px;display:inline-flex;align-items:center;justify-content:center;gap:8px;
  border:1px solid transparent;border-radius:12px;background:var(--accent);color:#fff;
  font:inherit;font-size:14px;font-weight:600;line-height:1.2;white-space:nowrap;text-decoration:none;cursor:pointer;
  transition:background-color .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease;
}
button:hover,.button:hover{background:var(--accent-strong);color:#fff}
:is(button,.button) svg.icon{width:18px;height:18px}
:is(button,.button).secondary{background:#fff;color:var(--ink);border-color:var(--line)}
:is(button,.button).secondary svg.icon{color:var(--accent)}
:is(button,.button).secondary:hover{background:var(--page);border-color:#d6e0ec;color:var(--ink)}
:is(button,.button).ghost{background:transparent;color:var(--muted);border-color:transparent}
:is(button,.button).ghost:hover{background:#eef2f7;color:var(--ink)}
:is(button,.button).danger{background:var(--red-soft);color:var(--red-strong);border-color:var(--red-line)}
:is(button,.button).danger:hover{background:#fee2e2;color:var(--red-strong)}
button.icon{width:var(--control-h);padding:0}
button.block,.button.block{width:100%}
button:disabled{opacity:.5;cursor:not-allowed}
button.is-busy{cursor:progress}
.button[aria-disabled="true"]{opacity:.5;pointer-events:none}

/* ---------- Fields ---------- */
input,select,textarea{
  width:100%;min-height:40px;padding:8px 12px;border:1px solid var(--field-line);border-radius:10px;background:#fff;color:var(--ink);
  font:inherit;font-size:14px;font-weight:500;outline:none;transition:border-color .15s ease,box-shadow .15s ease;
}
input::placeholder,textarea::placeholder{color:var(--faint)}
input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
input:disabled,select:disabled,textarea:disabled{background:var(--surface-2);color:var(--subtle);cursor:not-allowed}
input[readonly]{background:#f5f9fe;border-style:dashed}
textarea{min-height:96px;resize:vertical;line-height:1.6}
select{appearance:none;-webkit-appearance:none;padding-inline-end:34px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:16px;background-position:left 12px center}
input[type=checkbox]{width:20px;height:20px;min-height:20px;padding:0;flex:none;accent-color:var(--accent);box-shadow:none}
input[type=file]{padding:6px;min-height:44px;font-size:14px}
input[type=file]::file-selector-button{margin-inline-end:10px;height:30px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:var(--page);color:var(--ink);font:inherit;font-weight:600;cursor:pointer}
label{display:grid;gap:6px;font-size:13px;font-weight:600;color:#475569}
label.check{display:flex;align-items:center;gap:10px;min-height:44px;font-size:14px;font-weight:500;color:var(--text)}
.search-field{position:relative;display:flex;align-items:center;width:clamp(200px,22vw,300px);margin:0}
.search-field svg.icon{position:absolute;inset-inline-start:12px;width:18px;height:18px;color:var(--faint);pointer-events:none}
.search-field input{min-height:var(--control-h);padding-inline-start:38px;border-color:var(--line);border-radius:12px}

/* ---------- Status pills ---------- */
.status{display:inline-flex;align-items:center;gap:6px;min-height:26px;padding:0 10px;border-radius:999px;border:1px solid #e2e8f0;background:#f1f5f9;color:#475569;font-size:13px;font-weight:700;line-height:1;white-space:nowrap;vertical-align:middle}
.status::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.status.good{background:var(--mint-soft);border-color:var(--mint-line);color:var(--mint-dark)}
.status.warn{background:var(--amber-soft);border-color:var(--amber-line);color:var(--amber)}
.status.bad{background:var(--red-soft);border-color:var(--red-line);color:var(--red-strong)}
.status.count{background:var(--accent-tint);border-color:var(--accent-soft);color:var(--accent-strong)}
.status.count::before{display:none}

/* ---------- Notices ---------- */
.notice{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:12px;background:var(--accent-tint);border:1px solid #d4e3f6;color:#1e3a5f;font-size:14px;line-height:1.7}
.notice::before{content:'';flex:none;width:20px;height:20px;margin-top:2px;background:currentColor;-webkit-mask:var(--notice-icon) center/contain no-repeat;mask:var(--notice-icon) center/contain no-repeat;--notice-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E")}
.notice.warning{background:#fffbeb;border-color:#fde68a;color:#854d0e}
.notice.error{background:var(--red-soft);border-color:var(--red-line);color:var(--red-strong)}
.notice.success{background:var(--green-soft);border-color:var(--green-line);color:#166534}
.notice:is(.warning,.error)::before{--notice-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E")}
.notice.success::before{--notice-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")}

/* ---------- Cards ---------- */
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px;min-width:0}
.card-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px;min-width:0}
.card-icon{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:var(--accent-tint);color:var(--accent);flex:none}
.card-icon svg.icon{width:19px;height:19px}
.card-title{flex:1;min-width:min(100%,180px)}
.card-title p{margin-top:2px;color:var(--muted);font-size:13px;font-weight:500;line-height:1.55}
.card-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-inline-start:auto}
.card-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}
.panel-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.panel-heading p{color:var(--muted);font-size:13px}
.table-card{padding:0;overflow:hidden}
.table-card>.card-head{margin:0;padding:14px 16px}
.table-card>.empty,.table-card>#ledger-table>.empty{border-top:1px solid var(--row-line)}
.loading{display:flex;align-items:center;justify-content:center;gap:10px;min-height:200px;color:var(--muted);font-weight:600}
.spinner{width:18px;height:18px;border-radius:50%;border:2px solid var(--accent-soft);border-top-color:var(--accent);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.empty{display:grid;justify-items:center;gap:4px;text-align:center;padding:40px 20px;color:var(--muted);font-size:14px}
.empty-icon{width:52px;height:52px;border-radius:14px;display:grid;place-items:center;margin-bottom:8px;background:var(--accent-tint);color:var(--accent)}
.empty-icon svg.icon{width:26px;height:26px}
.empty strong{display:block;color:var(--ink);font-size:16px;font-weight:700}
.empty p{color:var(--muted);font-size:14px;line-height:1.6;margin:2px 0 6px}

/* ---------- Tables (APTWeb list rules: one line per cell, 40px head band, hover with side marker) ---------- */
.table-wrap{width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:#fff}
.table-card .table-wrap{border:0;border-radius:0}
table{width:100%;border-collapse:separate;border-spacing:0;text-align:right;font-size:14px}
th{height:40px;padding:0 12px;background:var(--head-band);color:var(--ink);font-size:13px;font-weight:700;white-space:nowrap;border-bottom:1px solid #d6e0ec;text-align:right;vertical-align:middle}
td{height:50px;padding:0 12px;background:#fff;color:var(--text);font-size:14px;font-weight:500;white-space:nowrap;border-bottom:1px solid var(--row-line);vertical-align:middle}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover td{background:var(--row-hover)}
tbody tr:hover td:first-child{box-shadow:inset -3px 0 0 var(--row-marker)}
tbody tr:hover :is(button,.button).secondary{background:transparent;border-color:#bfe3d3}
:is(th,td):first-child{padding-inline-start:16px}
:is(th,td):last-child{padding-inline-end:14px}
th.col-actions,td.col-actions{width:1%;text-align:left}
td .cell-name{display:inline-block;max-width:34ch;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;color:var(--ink);font-weight:700}
td .cell-muted{display:inline-block;max-width:40ch;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;color:var(--muted)}
td button,td .button{min-height:34px;padding:0 12px;font-size:13px}
td button svg.icon{width:16px;height:16px}
td small{color:var(--muted);font-size:13px}
.units{font-weight:600;font-variant-numeric:tabular-nums}
.is-positive{color:var(--green)}
.is-negative{color:var(--red)}
.table-footer-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 22px;min-height:52px;padding:8px 16px;border-top:1px solid var(--line);background:linear-gradient(180deg,#fff,#f8fafc)}
.mini-stat{display:inline-flex;align-items:center;gap:8px;min-width:0}
.mini-stat>i{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;flex:none;background:var(--accent-soft);border:1px solid var(--line);color:var(--accent-strong)}
.mini-stat>i svg.icon{width:15px;height:15px}
.mini-stat>span{font-size:13px;font-weight:600;color:var(--muted)}
.mini-stat>strong{font-size:15px;font-weight:600;color:var(--ink)}
.mini-stat>code{font-size:13px}

/* ---------- Detail list ---------- */
.details{display:grid;margin:0}
.details>div{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-bottom:1px solid var(--row-line)}
.details>div:first-child{padding-top:0}
.details>div:last-child{border-bottom:0;padding-bottom:0}
.details dt{display:flex;align-items:center;gap:8px;flex:none;width:128px;color:var(--muted);font-size:13px;font-weight:600}
.details dt svg.icon{width:16px;height:16px;color:var(--faint)}
.details dd{margin:0;min-width:0;color:var(--ink);font-size:14px;font-weight:600;overflow-wrap:anywhere}
.details dd small{display:block;margin-top:2px;font-weight:500}
.details.compact dt{width:90px}

/* ---------- Brand + avatar ---------- */
.brand{display:flex;align-items:center;gap:10px;min-width:0;color:var(--ink)}
.brand-mark{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;flex:none;color:#fff;background:linear-gradient(135deg,#2470cc 0%,#39c89a 100%);box-shadow:0 6px 14px -4px rgba(36,112,204,.45)}
.brand-mark svg{width:22px;height:22px}
.brand-name{font-size:18px;line-height:1.1;white-space:nowrap}
.brand-name strong{font-weight:900;letter-spacing:.3px;color:var(--ink)}
.brand-name span{font-weight:700;color:var(--accent)}
.avatar{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;flex:none;background:var(--mint-soft);color:var(--mint-dark);font-size:15px;font-weight:800;line-height:1}

/* ---------- Customer portal shell ---------- */
.shell{display:grid;grid-template-columns:252px minmax(0,1fr);min-height:100dvh;background:linear-gradient(to left,#fff 0 251px,var(--line) 251px 252px,var(--page) 252px)}
.shell .sidebar{position:sticky;top:0;height:100dvh;display:flex;flex-direction:column;gap:14px;padding:18px 14px 14px;background:#fff;border-inline-end:1px solid var(--line);z-index:20}
.shell .side-top{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:2px 6px 16px;border-bottom:1px solid var(--row-line)}
.shell .side-logout{display:none}
.shell .sidebar nav{display:flex;flex-direction:column;gap:4px;min-height:0;overflow-y:auto}
.shell .sidebar nav::before{content:'ניווט';padding:2px 12px 6px;color:var(--faint);font-size:13px;font-weight:700}
.shell .sidebar nav button{min-height:44px;justify-content:flex-start;gap:12px;padding:0 12px;border:0;border-radius:10px;background:transparent;color:var(--muted);font-size:15px;font-weight:600;flex:none}
.shell .sidebar nav button svg.icon{width:20px;height:20px;color:var(--faint);transition:color .15s ease}
.shell .sidebar nav button:hover{background:var(--surface-2);color:var(--ink)}
.shell .sidebar nav button:hover svg.icon{color:var(--accent)}
.shell .sidebar nav button[aria-current="page"]{background:var(--accent-tint);color:var(--accent-strong);font-weight:700;box-shadow:inset -3px 0 0 var(--accent)}
.shell .sidebar nav button[aria-current="page"] svg.icon{color:var(--accent)}
.shell .side-user{margin-top:auto;display:flex;align-items:center;gap:10px;padding:12px 8px 2px;border-top:1px solid var(--row-line);min-width:0}
.shell .side-user-text{display:grid;flex:1;min-width:0}
.shell .side-user-text strong{color:var(--ink);font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shell .side-user-text small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shell .main{min-width:0;display:flex;flex-direction:column;gap:16px;padding:18px 20px 0}
.page-header{display:flex;align-items:center;justify-content:space-between;gap:12px 16px;flex-wrap:wrap;min-width:0}
.page-title{display:flex;align-items:center;gap:12px;min-width:0}
.page-icon{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;flex:none;background:var(--accent-soft);color:var(--accent-strong)}
.page-icon svg.icon{width:22px;height:22px}
.page-title p{margin-top:2px;color:var(--muted);font-size:14px;font-weight:500;line-height:1.5}
.page-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;margin-inline-start:auto}
.content{display:grid;gap:16px;min-width:0;align-content:start}

/* ---------- Overview ---------- */
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.metric{display:flex;align-items:center;gap:14px;padding:18px 20px;background:#fff;min-width:0}
.metric>div{min-width:0}
.metric-icon{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;flex:none;background:var(--accent-tint);color:var(--accent)}
.metric-icon svg.icon{width:22px;height:22px}
.metric.accent .metric-icon{background:var(--mint-soft);color:var(--mint-dark)}
.metric-label{display:block;color:var(--muted);font-size:13px;font-weight:600}
.metric strong{display:block;margin-top:2px;color:var(--ink);font-size:26px;font-weight:800;line-height:1.25;letter-spacing:-.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.metric strong.small-value{font-size:18px;font-weight:700;letter-spacing:0}
.steps{list-style:none;margin:0;padding:0;display:grid}
.step{position:relative;display:flex;gap:14px;align-items:flex-start;padding:10px 0 14px}
.step:not(:last-child)::after{content:'';position:absolute;inset-inline-start:15px;top:44px;bottom:-8px;width:2px;border-radius:2px;background:var(--line)}
.step.done:not(:last-child)::after{background:var(--mint-line)}
.step-num{position:relative;z-index:1;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;flex:none;background:#f1f5f9;border:1px solid var(--line);color:var(--subtle);font-size:14px;font-weight:700}
.step-num svg.icon{width:17px;height:17px}
.step.done .step-num{background:var(--mint-soft);border-color:var(--mint-line);color:var(--mint-dark)}
.step.current .step-num{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 0 0 4px var(--accent-soft)}
.step h3{margin-top:4px;font-size:15px}
.step p{margin-top:2px;color:var(--muted);font-size:14px;line-height:1.6;overflow-wrap:anywhere}
.step.todo h3{color:var(--subtle)}
.facts{list-style:none;margin:16px 0 0;padding:0;display:grid;gap:12px}
.facts li{display:flex;gap:12px;align-items:flex-start;padding:12px;border-radius:12px;background:var(--surface-2);border:1px solid var(--row-line)}
.facts li>span{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;flex:none;background:#fff;border:1px solid var(--line);color:var(--accent)}
.facts strong{display:block;color:var(--ink);font-size:14px;font-weight:700}
.facts p{color:var(--muted);font-size:13px;line-height:1.6;margin-top:2px}

/* ---------- Plans ---------- */
.plan-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:16px}
.plan{position:relative;display:flex;flex-direction:column;gap:12px;padding:22px;overflow:hidden}
.plan::before{content:'';position:absolute;inset:0 0 auto;height:3px;background:linear-gradient(90deg,var(--accent),var(--mint))}
.plan-icon{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--accent-tint);color:var(--accent)}
.plan-icon svg.icon{width:22px;height:22px}
.plan h2{font-size:18px}
.price{color:var(--ink);font-size:30px;font-weight:800;letter-spacing:-.5px;line-height:1.1}
.plan-features,.story-points{list-style:none;margin:0;padding:0;display:grid;gap:10px}
:is(.plan-features,.story-points) li{display:flex;align-items:center;gap:10px;color:var(--text);font-size:14px;font-weight:500}
:is(.plan-features,.story-points) .check-dot{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--mint-soft);border:1px solid var(--mint-line);color:var(--mint-dark)}
:is(.plan-features,.story-points) .check-dot svg.icon{width:13px;height:13px;stroke-width:3}
.plan>button{margin-top:auto}

/* ---------- Inbox ---------- */
.chat{display:grid;grid-template-columns:330px minmax(0,1fr);padding:0;overflow:hidden;height:clamp(520px,calc(100dvh - 176px),940px)}
.conversation-pane{display:flex;flex-direction:column;min-height:0;min-width:0;background:#fff;border-inline-end:1px solid var(--line)}
.pane-head{display:flex;align-items:center;justify-content:space-between;gap:8px;height:56px;padding:0 16px;flex:none;border-bottom:1px solid var(--line);color:var(--ink);font-size:15px;font-weight:800}
.conversation-list{flex:1;overflow-y:auto;padding:6px;display:grid;align-content:start;gap:2px}
.conversation-list>.empty{padding:36px 12px}
.conversation-list>button.ghost{margin:6px}
.conv{width:100%;min-height:70px;display:flex;align-items:center;gap:12px;padding:10px;border:0;border-radius:12px;background:transparent;color:var(--ink);font-weight:400;text-align:right;white-space:normal}
.conv:hover{background:var(--surface-2);color:var(--ink)}
.conv.selected{background:var(--accent-tint);box-shadow:inset -3px 0 0 var(--accent)}
.conv-main{flex:1;min-width:0;display:grid;gap:3px}
.conv-top,.conv-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.conv-top strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:700}
.conv-time{flex:none;color:var(--subtle);font-size:13px}
.conv-last{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:13px}
.unread{flex:none;min-width:22px;height:22px;padding:0 7px;border-radius:999px;display:grid;place-items:center;background:var(--accent);color:#fff;font-size:13px;font-weight:700}
.thread{display:flex;flex-direction:column;min-width:0;min-height:0;background:#fff}
.thread>.empty{flex:1;align-content:center;background:var(--surface-2)}
.thread-head{display:flex;align-items:center;gap:12px;height:64px;padding:0 14px 0 12px;flex:none;border-bottom:1px solid var(--line)}
.thread-who{flex:1;min-width:0;display:grid}
.thread-who strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);font-size:15px;font-weight:800}
.thread-who small:empty{display:none}
.window-state{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 10px;border-radius:999px;background:#f1f5f9;color:#475569;font-size:13px;font-weight:600;white-space:nowrap;min-width:0}
.window-state svg.icon{width:15px;height:15px}
.window-state.is-open{background:var(--mint-soft);color:var(--mint-dark)}
.window-state>span{overflow:hidden;text-overflow:ellipsis}
.mobile-back{display:none}
.bubbles{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding:20px 24px;background-color:#f4f7fb;background-image:radial-gradient(rgba(21,32,51,.05) 1px,transparent 1px);background-size:18px 18px}
.bubbles>button{align-self:center;min-height:32px;background:#fff;border-color:var(--line);font-size:13px}
.bubble{max-width:min(78%,560px);padding:8px 12px 6px;border-radius:14px;border:1px solid var(--line);background:#fff;color:var(--ink);font-size:15px;line-height:1.6;box-shadow:0 1px 1px rgba(15,23,42,.04);align-self:flex-end;border-start-end-radius:4px}
.bubble.out{align-self:flex-start;background:var(--wa-out);border-color:var(--wa-out-line);border-start-end-radius:14px;border-start-start-radius:4px}
.bubble.failed{border-color:var(--red-line);background:var(--red-soft)}
.bubble-text{white-space:pre-wrap;overflow-wrap:anywhere}
.bubble-file{display:inline-flex;align-items:center;gap:6px;margin-top:6px;font-size:14px;font-weight:600}
.bubble-file svg.icon{width:16px;height:16px}
.bubble small{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:2px;color:var(--subtle);font-size:13px}
.bubble small>span{display:inline-flex;align-items:center;gap:3px}
.bubble small svg.icon{width:14px;height:14px;color:#2a9d78;stroke-width:2.6}
.composer{flex:none;display:grid;gap:8px;padding:12px 14px;border-top:1px solid var(--line);background:#fff}
.composer textarea{min-height:52px;max-height:160px;border-radius:12px;background:var(--surface-2)}
.composer textarea:focus{background:#fff}
.composer-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.composer .notice{margin-top:2px}

/* ---------- Dialogs (APTWeb modal language) ---------- */
dialog{width:min(600px,calc(100vw - 48px));max-height:calc(100dvh - 48px);margin:auto;padding:0;border:0;border-radius:20px;background:#f8fafc;color:var(--ink);box-shadow:0 25px 50px -12px rgba(0,0,0,.3);overflow:hidden}
dialog[open]{display:flex;flex-direction:column;animation:dialog-in .18s ease-out}
dialog::backdrop{background:rgba(15,23,42,.4);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
@keyframes dialog-in{from{opacity:0;transform:scale(.985)}to{opacity:1;transform:none}}
.dialog-head{position:relative;flex:none;display:flex;align-items:center;gap:12px;padding:14px 24px 17px;background:linear-gradient(135deg,rgba(37,99,235,.13),rgba(20,184,166,.09)),#fff}
.dialog-head::after{content:'';position:absolute;inset:auto 0 0;height:3px;background:linear-gradient(90deg,#2563eb,#14b8a6,#f59e0b)}
.dialog-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;flex:none;background:#eaf2fc;color:#2563eb}
.dialog-icon svg.icon{width:20px;height:20px}
.dialog-title{flex:1;min-width:0}
.dialog-title h2{color:#0f172a;font-size:19px;font-weight:900;line-height:1.3;overflow-wrap:anywhere}
.dialog-title p{margin-top:1px;color:#475569;font-size:13px;font-weight:600;line-height:1.4}
.dialog-close{width:40px;min-height:40px;padding:0;flex:none;background:#fff;border:1px solid #e2e8f0;border-radius:10px;color:#334155}
.dialog-close:hover{background:#f1f5f9;color:#0f172a}
.dialog-body{padding:16px;overflow-y:auto;overscroll-behavior:contain;min-height:0}
.dialog-body>form,.dialog-body>.stack{display:grid;gap:14px;padding:16px;background:#fff;border:1px solid #e2e8f0;border-radius:14px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.dialog-body>form p,.dialog-body>.stack>p{color:var(--text);font-size:14px;line-height:1.75}
.dialog-body .grid2{gap:12px}
.dialog-body pre{margin:0;padding:14px;white-space:pre-wrap;overflow-wrap:anywhere;font-family:ui-monospace,Consolas,monospace;font-size:13px;background:#f1f5f9;border:1px solid var(--line);border-radius:10px;color:var(--ink)}
.form-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding-top:2px}
.form-actions button{min-height:42px;padding:0 20px;border-radius:10px}
.form-actions button:not(.secondary):not(.ghost):not(.danger){background:linear-gradient(135deg,var(--accent),var(--accent-strong));box-shadow:0 6px 14px -6px rgba(36,112,204,.55)}
.form-actions button:not(.secondary):not(.ghost):not(.danger):hover{background:var(--accent-strong)}
.template-preview{min-height:46px;padding:10px 12px;border-radius:12px;border-start-start-radius:4px;background:var(--wa-out);border:1px solid var(--wa-out-line);color:var(--ink);font-size:15px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.template-preview:empty::before{content:'תצוגה מקדימה של התבנית';color:var(--subtle);font-size:13px}
.connect-result:empty{display:none}
.connect-result{padding:10px 12px;border-radius:10px;background:var(--accent-tint);color:var(--accent-strong);font-size:14px;font-weight:600}

/* ---------- Sign-in ---------- */
.auth-page{min-height:100dvh;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);background:var(--page)}
.auth-story{position:relative;overflow:hidden;display:flex;flex-direction:column;gap:36px;padding:clamp(28px,4vw,56px) clamp(28px,5vw,72px);border-inline-end:1px solid var(--line);background:radial-gradient(circle at 85% 8%,rgba(57,200,154,.20),transparent 42%),radial-gradient(circle at 8% 92%,rgba(36,112,204,.16),transparent 46%),linear-gradient(180deg,#f8fbff,#edf3fb)}
.auth-story::after{content:'';position:absolute;width:520px;height:520px;inset-inline-end:-220px;bottom:-260px;border-radius:50%;border:1px solid rgba(36,112,204,.12);box-shadow:0 0 0 60px rgba(36,112,204,.03),0 0 0 120px rgba(36,112,204,.02);pointer-events:none}
.story-copy{position:relative;z-index:1}
.story-kicker{display:inline-flex;align-items:center;gap:8px;height:32px;padding:0 12px;border-radius:999px;background:#fff;border:1px solid var(--line);color:var(--accent-strong);font-size:13px;font-weight:700}
.story-kicker svg.icon{width:16px;height:16px;color:var(--mint-dark)}
.story-copy h1{margin:16px 0 14px;color:var(--ink);font-size:clamp(34px,3.6vw,52px);font-weight:800;line-height:1.15;letter-spacing:-1px}
.story-copy>p{max-width:480px;color:var(--muted);font-size:17px;line-height:1.8}
.story-points{margin-top:24px}
.story-points li{font-size:15px;color:var(--ink)}
.story-preview{position:relative;z-index:1;width:min(100%,400px);display:grid;gap:10px;padding:14px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 24px 50px -24px rgba(21,32,51,.3)}
.preview-head{display:flex;align-items:center;gap:10px;padding-bottom:10px;border-bottom:1px solid var(--row-line)}
.preview-head div{display:grid}
.preview-head strong{color:var(--ink);font-size:14px}
.preview-head small{color:var(--mint-dark);font-weight:600}
.preview-bubble{justify-self:end;max-width:85%;padding:8px 12px;border-radius:12px;border-start-end-radius:4px;background:#f1f5f9;color:var(--ink);font-size:14px;line-height:1.6}
.preview-bubble.out{justify-self:start;border-start-end-radius:12px;border-start-start-radius:4px;background:var(--wa-out)}
.preview-bubble small{display:flex;justify-content:flex-end;align-items:center;gap:3px;color:var(--subtle)}
.preview-bubble small svg.icon{width:14px;height:14px;color:#2a9d78}
.story-foot{position:relative;z-index:1;margin-top:auto;color:var(--muted)}
.auth-wrap{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:40px 24px 0;min-width:0}
.auth-card{width:min(100%,440px);margin:48px auto;padding:32px;background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:0 24px 60px -32px rgba(21,32,51,.3)}
.auth-wrap .auth-card{margin:0}
.auth-card h1,.auth-card h2{margin:6px 0;font-size:26px;font-weight:800;letter-spacing:-.3px}
.auth-card>p{color:var(--muted);font-size:14px}
.auth-card form{display:grid;gap:16px;margin-top:22px}
.auth-card input:not([type=checkbox]),.auth-card select{min-height:44px}
.auth-card button[type=submit]{min-height:46px;font-size:15px;margin-top:2px}
.auth-links{display:flex;justify-content:center;gap:4px;flex-wrap:wrap;margin-top:20px;padding-top:16px;border-top:1px solid var(--row-line)}
.auth-links a{padding:8px 12px;border-radius:10px;color:var(--muted);font-size:14px;font-weight:600;text-decoration:none}
.auth-links a:hover{background:var(--surface-2);color:var(--ink)}
.auth-links a[aria-current="page"]{background:var(--accent-tint);color:var(--accent-strong)}

/* ---------- Legal pages, footer, toast ---------- */
.legal{max-width:840px;margin:40px auto;padding:36px;display:grid;gap:18px}
.legal h1{font-size:28px}
.legal h2{margin-top:14px;font-size:18px}
.legal p,.legal li{color:var(--text);font-size:15px;line-height:1.85}
.legal-footer{display:flex;justify-content:center;gap:18px;flex-wrap:wrap;padding:20px 0 22px;font-size:13px}
.legal-footer a{color:var(--subtle);text-decoration:none}
.legal-footer a:hover{color:var(--ink);text-decoration:underline}
.toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);z-index:1000;display:flex;align-items:center;gap:10px;max-width:calc(100vw - 32px);padding:12px 18px;border-radius:12px;background:var(--ink);color:#fff;font-size:14px;font-weight:500;box-shadow:0 14px 34px -10px rgba(21,32,51,.5);animation:toast-in .2s ease-out}
.toast svg.icon{color:var(--mint)}
@keyframes toast-in{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}

/* ---------- Responsive ---------- */
@media (max-width:1240px){
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:1100px){
  .grid2{grid-template-columns:1fr}
  .chat{grid-template-columns:280px minmax(0,1fr)}
}
/* Tablet and phone: the side menu becomes a top bar with a scrolling strip of sections. */
@media (max-width:1060px){
  :root{--control-h:44px}
  input,select,textarea{font-size:16px}
  .shell{display:block;background:var(--page)}
  .shell .sidebar{position:sticky;top:0;height:auto;flex-direction:column;gap:6px;padding:10px 12px 0;border-inline-end:0;border-bottom:1px solid var(--line);box-shadow:0 6px 16px -14px rgba(21,32,51,.35)}
  .shell .side-top{padding:0;border:0}
  .shell .side-logout{display:inline-flex}
  .shell .side-user{display:none}
  .shell .sidebar nav{flex-direction:row;overflow-x:auto;overflow-y:hidden;gap:4px;margin:0 -12px;padding:2px 12px 8px;scrollbar-width:none}
  .shell .sidebar nav::-webkit-scrollbar{display:none}
  .shell .sidebar nav::before{display:none}
  .shell .sidebar nav button{min-height:44px;padding:0 14px;font-size:14px;gap:8px;border-radius:999px}
  .shell .sidebar nav button svg.icon{width:18px;height:18px}
  .shell .sidebar nav button[aria-current="page"]{box-shadow:inset 0 0 0 1px var(--accent-soft)}
  .shell .main{padding:14px 12px 0;gap:14px}
  .page-tools{width:100%;justify-content:flex-start;margin-inline-start:0}
  .page-tools .search-field{flex:1 1 220px;width:auto}
  .chat{height:max(480px,calc(100dvh - 250px))}
  td{height:52px}
  th{height:44px}
}
@media (max-width:760px){
  h1{font-size:21px}
  .page-icon{width:38px;height:38px;border-radius:11px}
  .page-icon svg.icon{width:20px;height:20px}
  .page-title p{font-size:13px}
  .panel{padding:16px 14px;border-radius:14px}
  .table-card{padding:0}
  .table-card>.card-head{padding:12px 14px}
  .card-tools{width:100%;margin-inline-start:0}
  .card-tools>:is(button,.button){flex:1 1 auto}
  :is(th,td).hide-sm{display:none}
  :is(th,td){padding:0 8px}
  :is(th,td):first-child{padding-inline-start:12px}
  :is(th,td):last-child{padding-inline-end:12px}
  td .cell-name{max-width:16ch}
  td .cell-muted{max-width:18ch}
  .metric{flex-direction:column;align-items:flex-start;padding:14px;gap:8px}
  .metric-icon{width:38px;height:38px;border-radius:11px}
  .metric strong{font-size:22px}
  .metric strong.small-value{font-size:15px}
  .details dt{width:100px}
  .table-footer-bar{gap:8px 16px;padding:8px 12px}
  .page-tools>button{flex:1 1 auto}
  .chat{display:block;height:max(460px,calc(100dvh - 300px))}
  .conversation-pane{height:100%;border:0}
  .thread{display:none;height:100%}
  .chat.active .conversation-pane{display:none}
  .chat.active .thread{display:flex}
  .mobile-back{display:inline-flex}
  .thread-head{flex-wrap:wrap;height:auto;min-height:56px;gap:6px 8px;padding:8px}
  .thread-head .avatar{width:36px;height:36px;font-size:14px}
  .window-state{order:9;max-width:100%;margin-inline-start:52px}
  .bubbles{padding:12px}
  .bubble{max-width:90%}
  .composer{padding:10px}
  .composer-actions>button{flex:1 1 auto}
  dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:14px}
  .dialog-head{padding:12px 14px 15px;gap:10px}
  .dialog-icon{width:34px;height:34px}
  .dialog-title h2{font-size:16px}
  .dialog-body{padding:10px}
  .dialog-body>form,.dialog-body>.stack{padding:14px}
  .dialog-body .grid2{grid-template-columns:1fr}
  .form-actions button{min-height:44px;flex:1 1 auto}
  .legal{margin:12px;padding:22px 18px}
  .price{font-size:27px}
}
@media (max-width:900px){
  .auth-page{grid-template-columns:1fr}
  .auth-story{gap:18px;padding:20px 16px 24px;border-inline-end:0;border-bottom:1px solid var(--line)}
  .auth-story::after,.story-kicker,.story-points,.story-preview,.story-foot{display:none}
  .story-copy h1{margin:4px 0 8px;font-size:30px;letter-spacing:-.5px}
  .story-copy>p{font-size:15px;line-height:1.7}
  .auth-wrap{justify-content:flex-start;padding:20px 12px 0}
  .auth-card{padding:24px 18px;margin:20px auto}
  .auth-card h1,.auth-card h2{font-size:22px}
}
@media (pointer:coarse){
  :root{--control-h:44px}
  input,select,textarea{font-size:16px;min-height:44px}
  input[type=checkbox]{min-height:20px}
  td button,td .button{min-height:44px}
  .dialog-close{width:44px;min-height:44px}
  tbody tr:hover td{background:#fff}
  tbody tr:hover td:first-child{box-shadow:none}
  .conv:hover{background:transparent}
  .conv.selected{background:var(--accent-tint)}
}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
