:root {
  --bg: #f4f7f6; --card: #fff; --ink: #14231f; --muted: #66756f; --line: #e3e9e6;
  --brand: #14806b; --brand-d: #0f5c4d; --brand-l: #e3f2ee; --pos: #13805a; --neg: #c2413a; --warn: #a86400; --warn-l: #fff4e0;
  --r: 16px; --shadow: 0 1px 2px rgba(16,40,34,.06), 0 4px 16px rgba(16,40,34,.06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Rubik, Arial, "Noto Sans Hebrew", sans-serif;
  color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { padding: env(safe-area-inset-top) 0 0; }
h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 17px; }
p { line-height: 1.55; }
a { color: var(--brand-d); }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.row { display: flex; gap: 8px; align-items: center; } .row input { flex: 1; min-width: 0; }
.between { justify-content: space-between; }

.splash { min-height: 80vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--brand-l); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page { max-width: 560px; margin: 0 auto; padding: 14px 14px calc(88px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 2px 8px; }
.empty { text-align: center; } .big-emoji { font-size: 44px; margin-bottom: 6px; }

/* buttons */
.btn { appearance: none; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 16px; font-size: 16px; font-weight: 600; cursor: pointer; min-height: 46px; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.danger { color: var(--neg); border-color: #f1c9c6; }
.btn.subtle { background: transparent; color: var(--muted); }
.btn.small { padding: 7px 12px; min-height: 36px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; }
.link { background: none; border: 0; color: var(--brand-d); padding: 6px 0; font-size: 14px; cursor: pointer; text-decoration: underline; }
.icon-btn { background: var(--card); border: 1px solid var(--line); border-radius: 12px; width: 42px; height: 42px; font-size: 18px; cursor: pointer; }
.i { background: none; border: 0; color: var(--brand); font-size: 14px; padding: 0 2px; cursor: pointer; }

/* forms */
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: #33443e; }
input, select, textarea { font: inherit; font-size: 16px; font-weight: 400; padding: 11px 12px; border: 1px solid #cfd9d5; border-radius: 12px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
form { display: flex; flex-direction: column; gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0; } legend { font-size: 14px; font-weight: 600; color: #33443e; margin-bottom: 6px; padding: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.seg { display: flex; background: #e9efec; border-radius: 12px; padding: 3px; gap: 3px; }
.seg label, .seg button { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; width: 1px; }
.seg span, .seg button { display: block; text-align: center; padding: 9px 4px; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; border: 0; background: none; }
.seg input:checked + span, .seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); color: var(--brand-d); }
.seg.small button { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.type-info { background: var(--brand-l); border-radius: 12px; padding: 10px 12px; margin: -6px 0 0; line-height: 1.5; }
details.more-fields { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; }
details.more-fields[open] { display: flex; flex-direction: column; gap: 10px; }
details summary { cursor: pointer; font-weight: 600; }

/* login */
.login { max-width: 420px; margin: 0 auto; padding: 36px 18px 30px; display: flex; flex-direction: column; gap: 16px; }
.brand { text-align: center; } .brand img { border-radius: 18px; box-shadow: var(--shadow); } .brand h1 { margin-top: 12px; font-size: 26px; }
.brand p { margin: 6px 0 0; }
.tabs { display: flex; background: #e6ecea; border-radius: 12px; padding: 3px; }
.tabs button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 15px; }
.tabs button.on { background: #fff; color: var(--brand-d); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.msg { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.msg.good { background: var(--brand-l); color: var(--brand-d); } .msg.bad { background: #fdecea; color: #8f2a24; }
.lock { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }

/* home */
.hero { background: linear-gradient(145deg, #14806b, #0b4a3e); color: #fff; border-radius: 20px; padding: 18px 18px 16px; box-shadow: 0 8px 24px rgba(15,92,77,.25); }
.hello { font-size: 14px; opacity: .85; }
.hero-label { font-size: 14px; opacity: .85; margin-top: 10px; }
.hero-total { font-size: 38px; font-weight: 800; letter-spacing: -.5px; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.hero-change { font-size: 15px; font-weight: 700; } .hero-change span { font-weight: 400; opacity: .85; font-size: 13px; }
.hero-change.pos { color: #b6f5d8; } .hero-change.neg { color: #ffd0cc; }
.hero-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.18); }
.hero-sub span { display: block; font-size: 12px; opacity: .8; } .hero-sub b { font-size: 16px; }
.hero-sub b.pos { color: #b6f5d8; } .hero-sub b.neg { color: #ffd0cc; }
.hero-note { margin-top: 8px; font-size: 12px; opacity: .8; }
.hero-warn { margin-top: 10px; font-size: 12px; background: rgba(255,255,255,.14); border-radius: 10px; padding: 6px 10px; }
.chart { width: 100%; height: auto; display: block; direction: ltr; }
.chart text { direction: ltr; unicode-bidi: isolate; }
.chart .grid { stroke: #e8eeeb; stroke-dasharray: 3 4; } .chart .ylab, .chart .xlab { font-size: 10px; fill: #7b8a84; }
.chart-empty { text-align: center; color: var(--muted); padding: 8px 6px; font-size: 14px; } .chart-empty-icon { font-size: 30px; } .chart-empty p { margin: 6px 0; }

.areas { display: flex; flex-direction: column; gap: 10px; }
.area { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 13px 14px; text-decoration: none; color: inherit; }
.area-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-l); display: grid; place-items: center; font-size: 21px; flex: none; }
.area-main { flex: 1; min-width: 0; }
.area-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.area-meta { font-size: 13px; color: var(--muted); margin-top: 1px; }
.area-val { text-align: left; flex: none; } .area-val .v { font-weight: 800; font-variant-numeric: tabular-nums; } .area-val .g { font-size: 13px; font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; } .badges:empty { display: none; }
.badge { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: #edf1ef; color: #4f5f59; font-weight: 600; }
.badge.ok { background: var(--brand-l); color: var(--brand-d); } .badge.warn { background: var(--warn-l); color: var(--warn); }

/* area detail */
.topbar { display: flex; align-items: center; gap: 10px; } .topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { width: 42px; height: 42px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-size: 20px; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.chip { font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; font-weight: 600; cursor: default; }
button.chip { cursor: pointer; } .chip .i { font-size: 13px; } .chip.warn { background: var(--warn-l); color: var(--warn); border-color: transparent; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.stat span { display: block; font-size: 13px; color: var(--muted); } .stat b { font-size: 19px; font-variant-numeric: tabular-nums; } .stat small { display: block; font-size: 12.5px; color: var(--muted); }
.stat small.pos { color: var(--pos); } .stat small.neg { color: var(--neg); }
.stat.main { grid-column: 1 / -1; } .stat.main b { font-size: 30px; }
.source { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.h-icon { font-size: 18px; } .h-main { flex: 1; min-width: 0; } .h-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.x { background: none; border: 0; color: #9aa7a2; font-size: 22px; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; flex: none; }
.x.edit { font-size: 16px; } .x:hover { background: #f0f3f2; }
.holding .badge { margin-top: 4px; }
.details { display: flex; flex-direction: column; gap: 8px; } .details div { display: flex; justify-content: space-between; } .details span { color: var(--muted); } .details p { margin: 0; }
.details p.notes { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.6; }
.danger-zone { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.picks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.pick { width: 100%; text-align: right; background: #f4f7f6; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }

/* log + more */
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.log li { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 11px 14px; }
.log .who { font-weight: 700; font-size: 14px; } .log .what { margin: 2px 0; line-height: 1.45; }
.glossary details { border-bottom: 1px solid var(--line); padding: 10px 0; } .glossary p { margin: 8px 0 0; font-size: 14px; color: #33443e; }

/* tab bar */
.tabbar { position: fixed; bottom: 0; inset-inline: 0; display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 5; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); text-decoration: none; padding: 4px; font-weight: 600; }
.tabbar a span { font-size: 20px; } .tabbar a.on { color: var(--brand-d); }

/* modal */
dialog { border: 0; padding: 0; border-radius: 20px 20px 0 0; width: 100%; max-width: 560px; margin: auto auto 0; max-height: 92vh; background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(10,30,25,.45); }
.modal-inner { padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.modal-inner > p { margin: -4px 0 0; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.info-text { line-height: 1.65; font-size: 16px; margin: 0; }
@media (min-width: 600px) { dialog { border-radius: 20px; margin: auto; } }

#toast { position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(20px); background: #1d2f2a; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); } #toast.bad { background: #8f2a24; }

/* employer equity */
.eq-card { border: 1px solid #e7dcc4; }
.eq-link { display: block; color: inherit; text-decoration: none; }
.eq-card .card-head { margin-bottom: 4px; }
.eq-total { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.eq-split { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin: 2px 0 4px; } .eq-split b { color: var(--ink); }
.switch { flex-direction: row; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 500; }
.switch input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.msg.small { font-size: 13px; }
.pen-card { border-color: #cfe0f0; }
.pen-list { list-style: none; margin: 8px 0 6px; padding: 0; font-size: 14px; }
.pen-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; } .pen-list a { color: inherit; }
.switch-row { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
[hidden] { display: none !important; }
