:root {
  --bg: #f4f6f5; --card: #fff; --ink: #14201b; --muted: #5d6b65; --line: #e1e7e4;
  --brand: #0b6e4f; --brand-2: #e7f4ee; --orange: #b45309; --orange-bg: #fff4e5; --red: #b91c1c; --red-bg: #fdecec;
  --blue: #1d4ed8; --blue-bg: #e8efff; --green: #15803d; --green-bg: #e7f6ec; --gray-bg: #eef1f0;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 10px rgba(0,0,0,.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Assistant", "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5;
  padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
a { color: var(--brand); }
h1 { font-size: 1.45rem; margin: .4rem 0 .8rem; } h2 { font-size: 1.1rem; margin: 0 0 .6rem; } h3 { font-size: 1rem; margin: .8rem 0 .4rem; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top));
  background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; text-decoration: none; color: var(--ink); font-size: 1.05rem; }
.brand img { border-radius: 7px; }
.who { margin-inline-start: auto; color: var(--muted); font-size: .75rem; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { text-decoration: none; font-size: 1.2rem; padding: .2rem .35rem; }
main { max-width: 980px; margin: 0 auto; padding: 1rem; }
.loading { padding: 3rem; text-align: center; color: var(--muted); }
.tabbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; padding: .45rem 0 .5rem; font-size: .75rem; color: var(--muted); text-decoration: none; }
.tabbar a span { font-size: 1.3rem; line-height: 1.2; }
.tabbar a.on { color: var(--brand); font-weight: 700; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; border: 1px solid var(--line); }
.card.warn { background: var(--orange-bg); border-color: transparent; } .card.info { background: var(--blue-bg); border-color: transparent; }
.card.error { background: var(--red-bg); } .card.hero { background: var(--brand-2); }
.banner { display: block; text-decoration: none; color: var(--ink); background: var(--blue-bg); }
.banner-inline { background: var(--blue-bg); padding: .5rem .8rem; border-radius: 10px; }
.row { display: flex; align-items: center; gap: .5rem; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; flex-wrap: wrap; margin-top: .8rem; }
.muted { color: var(--muted); } .small, small { font-size: .82rem; } .pre { white-space: pre-wrap; }
.good { color: var(--green); } .bad { color: var(--red); } .warn-text { color: var(--orange); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .6rem 1rem; border-radius: 11px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 44px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; } .btn.danger.ghost { color: var(--red); background: transparent; border-color: var(--red-bg); }
.btn.sm { padding: .35rem .7rem; min-height: 36px; font-size: .88rem; } .btn.block { width: 100%; margin: .25rem 0; }
.btn:disabled { opacity: .6; }
.link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .2rem .4rem; }
.badge { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--gray-bg); color: var(--muted); white-space: nowrap; }
.badge.orange { background: var(--orange-bg); color: var(--orange); } .badge.red { background: var(--red-bg); color: var(--red); } .badge.blue { background: var(--blue-bg); color: var(--blue); } .badge.green { background: var(--green-bg); color: var(--green); }
.miss-tag { display: inline-block; font-size: .7rem; background: var(--orange-bg); color: var(--orange); border-radius: 6px; padding: 0 .35rem; margin-inline-start: .3rem; }
.spend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.spend-grid > div { display: flex; flex-direction: column; } .big { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.alert { border: 1px solid var(--line); border-radius: 12px; padding: .75rem; margin: .5rem 0; border-inline-start: 5px solid var(--blue); }
.alert.overdue { border-inline-start-color: var(--red); } .alert.progress { border-inline-start-color: var(--orange); } .alert.done { opacity: .6; border-inline-start-color: var(--green); }
.alert .next { margin: .35rem 0; font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-inline-start: auto; }
.seg button { background: var(--card); border: 0; padding: .35rem .6rem; font: inherit; font-size: .82rem; cursor: pointer; color: var(--muted); min-height: 36px; }
.seg button.on { background: var(--brand); color: #fff; }
.list { list-style: none; padding: 0; margin: 0; } .list li { padding: .5rem 0; border-bottom: 1px solid var(--line); } .list li:last-child { border-bottom: 0; }
.miss-text { display: block; color: var(--orange); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .3rem 0; } .chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: .35rem .8rem; font: inherit; font-size: .88rem; cursor: pointer; white-space: nowrap; color: var(--ink); }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); } .chip.file { cursor: default; } .chip.file a { text-decoration: none; }
.filters { margin: .6rem 0 1rem; } .filters input[type=search] { width: 100%; margin-bottom: .5rem; } .filters select { flex: 1; min-width: 120px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .65rem; min-height: 44px; width: 100%; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); }
input.sm { min-height: 36px; padding: .3rem .5rem; } .w4 { width: 4.5em; }
select[multiple] { min-height: 64px; }
.fld { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .7rem; border: 0; padding: 0; } .fld > span, .fld legend { font-weight: 600; font-size: .9rem; }
.fld small { color: var(--muted); } .fld.missing input, .fld.missing select { border-color: var(--orange); background: var(--orange-bg); }
fieldset.fld { border: 1px solid var(--line); border-radius: 10px; padding: .6rem; } fieldset.track { border: 1px solid var(--line); border-radius: 12px; margin-bottom: .8rem; }
.check { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; cursor: pointer; }
.member-line { justify-content: space-between; } .member-line input.sm { max-width: 140px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 .8rem; } .grid3 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .6rem; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.cov-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .35rem; margin-bottom: .35rem; }
.split { display: grid; gap: 1rem; } @media (min-width: 900px) { .split { grid-template-columns: 1fr 1.2fr; align-items: start; } .doc-side { position: sticky; top: 70px; } }
.uploader { display: inline-block; border: 2px dashed var(--brand); color: var(--brand); border-radius: 12px; padding: .7rem 1rem; cursor: pointer; font-weight: 700; margin: .3rem 0; }
.doc-wrap { margin-top: .6rem; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--gray-bg); }
.doc-frame { width: 100%; height: 60vh; border: 0; display: block; } .doc-wrap.tall .doc-frame { height: 78vh; } .doc-img { width: 100%; display: block; }
.steps { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; } .steps li { flex: 1; text-align: center; font-size: .8rem; padding: .3rem; border-radius: 8px; background: var(--gray-bg); color: var(--muted); }
.steps li.on { background: var(--brand-2); color: var(--brand); font-weight: 700; }
.sticky-actions { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--card); padding: .6rem 0; }
.kv { display: grid; gap: .1rem; } .kv > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.kv > div > span { color: var(--muted); } .kv > div.missing { background: var(--orange-bg); padding-inline: .4rem; border-radius: 6px; } .kv small { width: 100%; text-align: end; color: var(--muted); }
.two-col { display: grid; gap: 1rem; } @media (min-width: 760px) { .two-col { grid-template-columns: 1fr 1fr; } }
.prow { display: flex; justify-content: space-between; gap: .6rem; padding: .7rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.prow:last-child { border-bottom: 0; } .prow .amt { text-align: end; display: flex; flex-direction: column; white-space: nowrap; } .prow .amt small { color: var(--muted); }
.group { padding: .4rem 0 .6rem; border-bottom: 2px solid var(--line); margin-bottom: .4rem; } .group:last-child { border-bottom: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; } .tbl th, .tbl td { text-align: start; padding: .45rem .35rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; }
.tbl-scroll { overflow-x: auto; margin-bottom: 1rem; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.cmp { border-collapse: separate; border-spacing: 0; background: var(--card); min-width: 100%; font-size: .88rem; }
.cmp th, .cmp td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; min-width: 130px; }
.cmp tbody th { position: sticky; inset-inline-start: 0; background: var(--card); color: var(--muted); font-weight: 600; min-width: 120px; z-index: 1; }
.cmp thead th { background: var(--gray-bg); } .cmp .cur { background: var(--brand-2); } .cmp .chosen { outline: 2px solid var(--green); outline-offset: -2px; }
.tri.yes { color: var(--green); } .tri.no { color: var(--red); } .tri.unknown { color: var(--orange); }
.qs li { margin-bottom: .3rem; }
.prov { background: var(--gray-bg); border-radius: 12px; padding: .6rem .8rem; margin: 1rem 0; font-size: .88rem; } .prov summary { cursor: pointer; font-weight: 700; }
.prov ul { padding-inline-start: 1.1rem; } .miss-head { font-weight: 700; color: var(--orange); margin-bottom: 0; } .ok-line { color: var(--green); }
.explain { padding: .6rem .8rem; border-radius: 10px; background: var(--gray-bg); margin: .4rem 0; } .explain.warn { background: var(--orange-bg); }
.stepper { list-style: none; padding: 0; display: flex; gap: .3rem; overflow-x: auto; margin: 0 0 1rem; } .stepper li button { white-space: nowrap; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: .35rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; color: var(--muted); }
.stepper li.done button { background: var(--green-bg); color: var(--green); } .stepper li.on button { background: var(--brand); color: #fff; }
.checklist { list-style: none; padding: 0; margin: 0 0 .6rem; }
.chart { width: 100%; height: 160px; background: var(--gray-bg); border-radius: 10px; } .legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .85rem; margin-top: .4rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: .3rem; vertical-align: middle; }
.c0 { background: #0b6e4f; } .c1 { background: #c75000; } .c2 { background: #2563eb; } .c3 { background: #7c3aed; } .c4 { background: #be123c; } .c5 { background: #0891b2; }
.empty { text-align: center; padding: 1.2rem .5rem; color: var(--muted); }
.quick { margin-bottom: 1rem; }
.dlg { border: 0; border-radius: 16px; padding: 1rem; width: min(520px, 94vw); background: var(--card); color: var(--ink); max-height: 90vh; overflow: auto; }
.dlg.wide { width: min(720px, 96vw); } .dlg::backdrop { background: rgba(0,0,0,.45); } .dlg h3 { margin-top: 0; }
.toast { position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); inset-inline: 1rem; margin: 0 auto; max-width: 420px; background: var(--ink); color: var(--bg); padding: .7rem 1rem;
  border-radius: 12px; opacity: 0; transform: translateY(10px); transition: .25s; z-index: 50; text-align: center; }
.toast.show { opacity: 1; transform: none; } .toast.err { background: var(--red); color: #fff; } .toast.warn { background: var(--orange); color: #fff; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.list li > .row.between { flex-wrap: wrap; row-gap: .3rem; }
@media (min-width: 760px) { .tabbar { max-width: 980px; margin: 0 auto; border-radius: 14px 14px 0 0; } }
.axis { font-size: 10px; fill: var(--muted); }
.login-page { padding-bottom: 0; min-height: 100vh; display: grid; place-items: center; }
.login-box { max-width: 380px; width: calc(100% - 32px); text-align: center; padding: 2rem 1.2rem; }
.login-box img { border-radius: 18px; } #gbtn { display: flex; justify-content: center; margin: 1.2rem 0 .5rem; min-height: 44px; }
.login-msg { color: var(--red); min-height: 1.5em; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .2rem; } .crumbs a { text-decoration: none; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin-bottom: 1rem; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: flex; flex-direction: column; gap: .2rem; padding: .9rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); min-height: 120px; }
.tile-ico { font-size: 1.7rem; line-height: 1.1; } .tile b { font-size: 1rem; }
.pcard { border: 1px solid var(--line); border-radius: 12px; padding: .7rem; margin: .5rem 0; background: var(--card); }
.pcard.ended { opacity: .6; } .pc-title { text-decoration: none; color: var(--ink); }
.pcard .amt { text-align: end; display: flex; flex-direction: column; white-space: nowrap; } .pcard .amt small { color: var(--muted); }
.top-align { align-items: flex-start; }
.pc-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; } .pc-actions .btn { min-height: 34px; padding: .25rem .6rem; font-size: .82rem; }
.btn.ghost.danger { color: var(--red); }
.member-card h2 { margin: 0; }
.tbl input.sm { min-width: 90px; }

.backbar { display: inline-flex; align-items: center; gap: .35rem; background: none; border: 0; color: var(--brand); font: inherit; font-weight: 700; padding: .3rem 0; margin-bottom: .3rem; cursor: pointer; min-height: 40px; }
.backbar span { font-size: 1.2rem; }
.nextbox { background: var(--brand-2); border-radius: 10px; padding: .6rem .8rem; margin: .7rem 0; }
.progress { height: 8px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; margin-bottom: .6rem; } .progress i { display: block; height: 100%; background: var(--brand); width: 0; }
.progress i[style-w="0"] { width: 0%; }
.progress i[style-w="1"] { width: 1%; }
.progress i[style-w="2"] { width: 2%; }
.progress i[style-w="3"] { width: 3%; }
.progress i[style-w="4"] { width: 4%; }
.progress i[style-w="5"] { width: 5%; }
.progress i[style-w="6"] { width: 6%; }
.progress i[style-w="7"] { width: 7%; }
.progress i[style-w="8"] { width: 8%; }
.progress i[style-w="9"] { width: 9%; }
.progress i[style-w="10"] { width: 10%; }
.progress i[style-w="11"] { width: 11%; }
.progress i[style-w="12"] { width: 12%; }
.progress i[style-w="13"] { width: 13%; }
.progress i[style-w="14"] { width: 14%; }
.progress i[style-w="15"] { width: 15%; }
.progress i[style-w="16"] { width: 16%; }
.progress i[style-w="17"] { width: 17%; }
.progress i[style-w="18"] { width: 18%; }
.progress i[style-w="19"] { width: 19%; }
.progress i[style-w="20"] { width: 20%; }
.progress i[style-w="21"] { width: 21%; }
.progress i[style-w="22"] { width: 22%; }
.progress i[style-w="23"] { width: 23%; }
.progress i[style-w="24"] { width: 24%; }
.progress i[style-w="25"] { width: 25%; }
.progress i[style-w="26"] { width: 26%; }
.progress i[style-w="27"] { width: 27%; }
.progress i[style-w="28"] { width: 28%; }
.progress i[style-w="29"] { width: 29%; }
.progress i[style-w="30"] { width: 30%; }
.progress i[style-w="31"] { width: 31%; }
.progress i[style-w="32"] { width: 32%; }
.progress i[style-w="33"] { width: 33%; }
.progress i[style-w="34"] { width: 34%; }
.progress i[style-w="35"] { width: 35%; }
.progress i[style-w="36"] { width: 36%; }
.progress i[style-w="37"] { width: 37%; }
.progress i[style-w="38"] { width: 38%; }
.progress i[style-w="39"] { width: 39%; }
.progress i[style-w="40"] { width: 40%; }
.progress i[style-w="41"] { width: 41%; }
.progress i[style-w="42"] { width: 42%; }
.progress i[style-w="43"] { width: 43%; }
.progress i[style-w="44"] { width: 44%; }
.progress i[style-w="45"] { width: 45%; }
.progress i[style-w="46"] { width: 46%; }
.progress i[style-w="47"] { width: 47%; }
.progress i[style-w="48"] { width: 48%; }
.progress i[style-w="49"] { width: 49%; }
.progress i[style-w="50"] { width: 50%; }
.progress i[style-w="51"] { width: 51%; }
.progress i[style-w="52"] { width: 52%; }
.progress i[style-w="53"] { width: 53%; }
.progress i[style-w="54"] { width: 54%; }
.progress i[style-w="55"] { width: 55%; }
.progress i[style-w="56"] { width: 56%; }
.progress i[style-w="57"] { width: 57%; }
.progress i[style-w="58"] { width: 58%; }
.progress i[style-w="59"] { width: 59%; }
.progress i[style-w="60"] { width: 60%; }
.progress i[style-w="61"] { width: 61%; }
.progress i[style-w="62"] { width: 62%; }
.progress i[style-w="63"] { width: 63%; }
.progress i[style-w="64"] { width: 64%; }
.progress i[style-w="65"] { width: 65%; }
.progress i[style-w="66"] { width: 66%; }
.progress i[style-w="67"] { width: 67%; }
.progress i[style-w="68"] { width: 68%; }
.progress i[style-w="69"] { width: 69%; }
.progress i[style-w="70"] { width: 70%; }
.progress i[style-w="71"] { width: 71%; }
.progress i[style-w="72"] { width: 72%; }
.progress i[style-w="73"] { width: 73%; }
.progress i[style-w="74"] { width: 74%; }
.progress i[style-w="75"] { width: 75%; }
.progress i[style-w="76"] { width: 76%; }
.progress i[style-w="77"] { width: 77%; }
.progress i[style-w="78"] { width: 78%; }
.progress i[style-w="79"] { width: 79%; }
.progress i[style-w="80"] { width: 80%; }
.progress i[style-w="81"] { width: 81%; }
.progress i[style-w="82"] { width: 82%; }
.progress i[style-w="83"] { width: 83%; }
.progress i[style-w="84"] { width: 84%; }
.progress i[style-w="85"] { width: 85%; }
.progress i[style-w="86"] { width: 86%; }
.progress i[style-w="87"] { width: 87%; }
.progress i[style-w="88"] { width: 88%; }
.progress i[style-w="89"] { width: 89%; }
.progress i[style-w="90"] { width: 90%; }
.progress i[style-w="91"] { width: 91%; }
.progress i[style-w="92"] { width: 92%; }
.progress i[style-w="93"] { width: 93%; }
.progress i[style-w="94"] { width: 94%; }
.progress i[style-w="95"] { width: 95%; }
.progress i[style-w="96"] { width: 96%; }
.progress i[style-w="97"] { width: 97%; }
.progress i[style-w="98"] { width: 98%; }
.progress i[style-w="99"] { width: 99%; }
.progress i[style-w="100"] { width: 100%; }
.checklist.todo li { padding: .45rem 0; border-bottom: 1px solid var(--line); } .checklist.todo li.done span { text-decoration: line-through; color: var(--muted); }
.checklist.todo input[type=checkbox] { width: 24px; height: 24px; }

.tabbar { grid-template-columns: repeat(6, 1fr); } .tabbar a { font-size: .7rem; }
.docrow { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: start; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.docrow:last-child { border-bottom: 0; } .doc-ico { font-size: 1.6rem; text-decoration: none; } .doc-main a { text-decoration: none; color: var(--ink); word-break: break-word; }
.doc-main .badge { text-decoration: none; } .doc-actions { display: flex; gap: .25rem; } .assign select { min-height: 36px; padding: .25rem .5rem; font-size: .85rem; margin-top: .3rem; }

/* ===================== Design refresh: soft, rounded, pastel per insurance type ===================== */
:root {
  --bg: #f7f5f2; --card: #ffffff; --ink: #1f2a2e; --muted: #6b7478; --line: #ece8e3;
  --brand: #2f7d6d; --brand-2: #e3f2ee; --radius: 20px;
  --shadow: 0 1px 2px rgba(40, 30, 20, .04), 0 6px 18px rgba(40, 30, 20, .06);
  /* category pastels: --c = soft background, --c2 = accent, --ci = ink on pastel */
  --health: #fde4e8; --health-2: #e0607a; --hmo: #dff3ea; --hmo-2: #3a9a73; --car: #dcecfb; --car-2: #3d7fc4;
  --life: #ece4fb; --life-2: #7d5cc4; --pension: #fdf0d8; --pension-2: #c58a1e; --mortgage: #e2f0dc; --mortgage-2: #5b9145;
  --home: #f8e6da; --home-2: #c06e3e;
}

body { font-family: -apple-system, "SF Pro Text", "Assistant", "Rubik", "Segoe UI", Arial, sans-serif; letter-spacing: -.005em; }
h1 { font-size: 1.55rem; font-weight: 800; } h2 { font-size: 1.08rem; font-weight: 700; }
.card { border-radius: var(--radius); border-color: transparent; padding: 1.1rem; }
.btn { border-radius: 14px; min-height: 48px; padding: .65rem 1.1rem; font-size: 1rem; }
.btn.sm { min-height: 42px; border-radius: 12px; font-size: .92rem; padding: .45rem .85rem; }
.btn.primary { background: var(--brand); border-color: var(--brand); box-shadow: 0 2px 8px rgba(47, 125, 109, .25); }
input, select, textarea { border-radius: 12px; min-height: 48px; background: var(--card); }
.top { background: rgba(255,255,255,.85); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom-color: var(--line); }

.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; }
.icon-btn:active { background: var(--gray-bg); }

/* category tokens */
.cat-health { --c: var(--health); --c2: var(--health-2); } .cat-hmo { --c: var(--hmo); --c2: var(--hmo-2); }
.cat-car { --c: var(--car); --c2: var(--car-2); } .cat-life { --c: var(--life); --c2: var(--life-2); }
.cat-pension { --c: var(--pension); --c2: var(--pension-2); } .cat-mortgage { --c: var(--mortgage); --c2: var(--mortgage-2); }
.cat-home { --c: var(--home); --c2: var(--home-2); }

/* big, thumb-friendly back button */
.backrow { position: sticky; top: calc(60px + env(safe-area-inset-top)); z-index: 4; padding: .4rem 0 .6rem; background: linear-gradient(var(--bg) 70%, transparent); }
.backbtn { display: inline-flex; align-items: center; gap: .5rem; min-height: 50px; padding: .5rem 1.2rem .5rem 1rem; border-radius: 999px; border: 0;
  background: var(--card); color: var(--ink); font: inherit; font-weight: 700; font-size: 1.02rem; box-shadow: var(--shadow); cursor: pointer; }
.backbtn:active { transform: scale(.97); }
.backico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--c, var(--brand-2)); color: var(--c2, var(--brand)); font-size: 1.5rem; line-height: 1; font-weight: 800; }

/* category pages */
.page.cat-health, .page.cat-hmo, .page.cat-car, .page.cat-life, .page.cat-pension, .page.cat-mortgage, .page.cat-home { --brand: var(--c2); }
.page[class*="cat-"] .btn.primary { background: var(--c2); border-color: var(--c2); box-shadow: 0 2px 10px color-mix(in srgb, var(--c2) 35%, transparent); }
.hero-cat { background: var(--c, var(--brand-2)); border-radius: 24px; padding: 1.2rem; margin-bottom: 1rem; }
.hero-top { display: flex; gap: .9rem; align-items: center; } .hero-top h1 { margin: 0 0 .15rem; } .hero-top p { margin: 0; color: var(--ink); opacity: .75; font-size: .93rem; }
.hero-ico { display: grid; place-items: center; width: 60px; height: 60px; flex: none; border-radius: 18px; background: var(--card); font-size: 2rem; box-shadow: var(--shadow); }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1rem; }
.hero-actions .btn { width: 100%; background: var(--card); border-color: transparent; }
.hero-actions .btn.primary { background: var(--c2); color: #fff; }
.page[class*="cat-"] .spend { border-top: 4px solid var(--c2); }
.page[class*="cat-"] .chip.on { background: var(--c2); border-color: var(--c2); }
.chip { min-height: 42px; padding: .45rem 1rem; font-size: .95rem; text-decoration: none; display: inline-flex; align-items: center; }
.member-card h2 { font-size: 1.05rem; }
.cat-card { border-inline-start: 6px solid var(--c2); }

/* tiles on the portfolio */
.tiles { gap: .8rem; }
.tile { background: var(--c); border: 0; border-radius: 22px; min-height: 138px; padding: 1rem; box-shadow: none; transition: transform .12s; }
.tile:active { transform: scale(.97); }
.tile-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--card); font-size: 1.5rem; margin-bottom: .35rem; }
.tile small { color: var(--ink); opacity: .75; }

/* policy cards */
.pcard { border: 0; border-radius: 18px; padding: .95rem; background: var(--card); box-shadow: inset 5px 0 0 var(--c2, var(--line)), 0 1px 2px rgba(0,0,0,.04); }
[dir="rtl"] .pcard { box-shadow: inset -5px 0 0 var(--c2, var(--line)), 0 1px 2px rgba(0,0,0,.04); }
.member-card .pcard, .card .pcard { background: color-mix(in srgb, var(--c, #fff) 35%, var(--card)); }
.pc-title { font-size: 1.02rem; }
.pc-actions { gap: .45rem; margin-top: .7rem; } .pc-actions .btn { min-height: 42px; padding: .4rem .8rem; font-size: .9rem; border-radius: 12px; background: var(--card); }
.move-row { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; width: 100%; }
.btn.move { min-height: 52px; font-size: 1.05rem; background: var(--c, var(--brand-2)); border: 0; }

/* tab bar: bigger targets, pill on the active tab */
.tabbar { padding: .3rem .3rem calc(.3rem + env(safe-area-inset-bottom)); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

.tabbar a { min-height: 56px; justify-content: center; border-radius: 14px; margin: 0 .1rem; font-size: .72rem; }
.tabbar a.on { background: var(--brand-2); }
.alert { border-radius: 16px; border: 0; background: var(--card); box-shadow: inset -5px 0 0 var(--blue), 0 1px 2px rgba(0,0,0,.05); }
.alert.overdue { box-shadow: inset -5px 0 0 var(--red), 0 1px 2px rgba(0,0,0,.05); background: color-mix(in srgb, var(--red-bg) 45%, var(--card)); }
.alert.progress { box-shadow: inset -5px 0 0 var(--orange), 0 1px 2px rgba(0,0,0,.05); }
.seg button { min-height: 42px; padding: .35rem .8rem; font-size: .9rem; }
.badge { padding: .15rem .6rem; font-size: .76rem; }
.nextbox { border-radius: 14px; }

/* ===== phone fit: never wider than the screen, light theme only ===== */
html, body { max-width: 100%; overflow-x: hidden; }
html { color-scheme: light; background: var(--bg); }
main { overflow-wrap: anywhere; }
img, iframe, svg, video { max-width: 100%; }
.card, .pcard, .hero-cat, .tile { min-width: 0; max-width: 100%; }
.tbl th, .tbl td { overflow-wrap: anywhere; }
.tbl-scroll { max-width: 100%; }
.tabbar { left: 0; right: 0; width: 100%; max-width: 100vw; box-sizing: border-box; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tabbar a { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-inline: 0; }
@media (min-width: 760px) { .tabbar { max-width: 760px; left: 50%; right: auto; transform: translateX(-50%); border-radius: 18px 18px 0 0; } }
@media (max-width: 520px) { .who { display: none; } .top { gap: .2rem; } h1 { font-size: 1.35rem; } }
.prov { font-size: .9rem; }
.prov .src { color: var(--muted); margin: .3rem 0 .6rem; }
.miss-group { padding: .45rem 0; border-top: 1px solid var(--line); } .miss-group b { display: block; }
.miss-group span { color: var(--orange); }
.uploader { display: block; text-align: center; } .uploader + .muted, .uploader + span.muted { display: block; margin-top: .3rem; font-size: .85rem; }
.card.login-box { max-width: 400px; margin-inline: auto; }
