/* Jerry HQ — baby blue, device-finish look. Light, dark and auto. */
:root {
  --baby: #9dcff3; --baby-hi: #d7ecfb; --baby-lo: #6fb2e3;
  --bg: #eef6fc; --surface: #ffffff; --surface-2: #f4f9fe; --ink: #0d2236; --muted: #53697d; --line: #d8e7f3;
  --accent: var(--baby); --on-accent: #0d2236; --link: #17639e; --focus: rgba(111,178,227,.55);
  --ok: #17794f; --ok-bg: #dcf4e8; --warn: #8d5a05; --warn-bg: #fcefd2; --bad: #b3323c; --bad-bg: #fde3e5; --info: #17639e; --info-bg: #dceffb; --mut-bg: #e7eff6;
  --shadow: 0 1px 2px rgba(13,34,54,.05), 0 10px 28px -14px rgba(13,34,54,.22);
  --r: 20px; --r-sm: 13px; --side: 252px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hero: linear-gradient(135deg, #dcefff 0%, #a5d4f5 46%, #7dbbe8 100%);
}
:root[data-theme="dark"] {
  --bg: #0a141d; --surface: #112030; --surface-2: #162a3d; --ink: #e8f3fb; --muted: #93abc0; --line: #243a4f;
  --link: #9dcff3; --focus: rgba(157,207,243,.5);
  --ok: #6fd8a6; --ok-bg: #123a2b; --warn: #f1bf63; --warn-bg: #3d2d0c; --bad: #ff8f98; --bad-bg: #44181d; --info: #9dcff3; --info-bg: #14354d; --mut-bg: #1c3043;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0a141d; --surface: #112030; --surface-2: #162a3d; --ink: #e8f3fb; --muted: #93abc0; --line: #243a4f;
    --link: #9dcff3; --focus: rgba(157,207,243,.5);
    --ok: #6fd8a6; --ok-bg: #123a2b; --warn: #f1bf63; --warn-bg: #3d2d0c; --bad: #ff8f98; --bad-bg: #44181d; --info: #9dcff3; --info-bg: #14354d; --mut-bg: #1c3043;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h3 { font-size: 1.08rem; } h4 { font-size: .98rem; margin: 18px 0 8px; }
p { margin: 0 0 .8em; }
a { color: var(--link); text-underline-offset: 2px; }
code { background: var(--mut-bg); padding: 2px 6px; border-radius: 6px; font-size: .85em; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.num, .kpi b, .bal { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .center { text-align: center; } .r { text-align: right; } .block { display: block; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: var(--surface); padding: 10px 14px; border-radius: 10px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.stack > * + * { margin-top: 16px; }

/* shell */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-weight: 750; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--hero); color: #0d2236; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a, .navbtn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .96rem; background: none; border: 0; cursor: pointer; font-family: inherit; width: 100%; text-align: left; }
.side nav a:hover, .navbtn:hover { background: var(--surface-2); color: var(--ink); }
.side nav a.on { background: var(--accent); color: var(--on-accent); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.when-dark { display: none; } :root[data-theme="dark"] .when-light { display: none; } :root[data-theme="dark"] .when-dark { display: inline; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .when-light { display: none; } :root[data-theme="auto"] .when-dark { display: inline; } }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px clamp(16px, 3vw, 36px) 14px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.ttl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top h1 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); font-weight: 750; overflow-wrap: anywhere; }
.backlink { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); flex: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#main { padding: 6px clamp(16px, 3vw, 36px) 56px; max-width: 1240px; }
.foot { margin-top: 24px; font-size: .9rem; }
.lede { color: var(--muted); max-width: 70ch; }
.pad { padding: 0 20px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.tablewrap { padding: 8px 0 4px; overflow: hidden; }
.card.tablewrap .cardhead { padding: 10px 20px 4px; }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card .cardhead + .muted.small:not(.pad) { margin-top: -4px; }
.empty { text-align: center; padding: 40px 20px; } .empty p { color: var(--muted); max-width: 52ch; margin: 0 auto 16px; }
.empty-in { color: var(--muted); padding: 8px 20px 16px; margin: 0; }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; align-items: start; }
.cardgrid > .card { margin-bottom: 0; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.split > * { min-width: 0; } .split .card { margin-bottom: 16px; }
.btns, .chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips { gap: 6px; }

/* kpis */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpis.tight { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--line); }
.kpi.warn::before { background: #e8a93a; } .kpi.bad::before { background: var(--bad); } .kpi.ok::before { background: #3dbb83; }
.kpi .k { font-size: .85rem; color: var(--muted); font-weight: 600; }
.kpi b { font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; overflow-wrap: anywhere; line-height: 1.15; }
.kpi small { font-size: .82rem; }
.kpi .chip { align-self: flex-start; margin-top: 4px; }

/* hero quote: the one loud element */
.hero { position: relative; background: var(--hero); color: #0d2236; border-radius: 28px; padding: clamp(24px, 4vw, 44px); margin-bottom: 18px; box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -18px 40px -24px rgba(23,99,158,.35), var(--shadow); overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.55), rgba(255,255,255,0) 65%); pointer-events: none; }
.hero blockquote { margin: 0; max-width: 46ch; position: relative; }
.hero p { font-size: clamp(1.35rem, 3.2vw, 2.15rem); line-height: 1.22; font-weight: 700; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.hero footer { margin-top: 14px; font-weight: 600; opacity: .72; }
.hero-next { position: absolute; right: 16px; bottom: 16px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.55); color: #0d2236; text-decoration: none; }
.hero-next:hover { background: rgba(255,255,255,.85); }
.greet { font-size: 1.15rem; font-weight: 650; color: var(--muted); margin: 6px 2px 14px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent; font: 650 .96rem var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .08s, background .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 4px 14px -6px rgba(111,178,227,.9); }
.btn.primary:hover { background: #8fc7f0; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); } .btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--bad-bg); color: var(--bad); } .btn.danger:hover { filter: brightness(.97); }
.btn.sm { min-height: 36px; padding: 0 13px; font-size: .88rem; border-radius: 11px; }
.btn.block { width: 100%; } .btn.right { margin-left: auto; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; border: 0; background: none; color: var(--muted); cursor: pointer; text-decoration: none; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-size: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
form.inline { display: inline; margin: 0; } .inline-form { max-width: 440px; }

/* chips */
.chip { display: inline-flex; align-items: center; padding: 2px 10px; min-height: 24px; border-radius: 99px; font-size: .78rem; font-weight: 650; white-space: nowrap; background: var(--mut-bg); color: var(--muted); }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.info { background: var(--info-bg); color: var(--info); }
.count { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--mut-bg); font-size: .78rem; text-align: center; }

/* flash */
.flash { padding: 12px 16px; border-radius: 14px; margin: 0 0 14px; font-weight: 600; background: var(--ok-bg); color: var(--ok); }
.flash.bad { background: var(--bad-bg); color: var(--bad); } .flash.warn { background: var(--warn-bg); color: var(--warn); } .flash.info { background: var(--info-bg); color: var(--info); }

/* forms */
.form h3 { margin-bottom: 12px; } .form h4 { margin: 18px 0 8px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 8px; }
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; } .f.full { grid-column: 1 / -1; }
.f > label:not(.switch):not(.chk), .f > .lbl { font-weight: 650; font-size: .9rem; }
.req { color: var(--bad); font-style: normal; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 1rem; appearance: none; -webkit-appearance: none; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none' stroke='%2353697d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M1 1.5l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--baby-lo); box-shadow: 0 0 0 4px var(--focus); background: var(--surface); }
input[type=color] { width: 64px; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: none; padding: 3px; }
input[type=file] { font: inherit; font-size: .92rem; }
.has-err input, .has-err select, .has-err textarea { border-color: var(--bad); }
small.err { color: var(--bad); font-weight: 600; } small.help { color: var(--muted); font-size: .82rem; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--mut-bg); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; padding: 8px 14px; border-radius: 10px; font-weight: 650; font-size: .92rem; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(13,34,54,.18); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; min-height: 44px; }
.switch input[type=checkbox] { position: absolute; opacity: 0; } .switch { position: relative; }
.knob { width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked ~ .knob { background: var(--baby-lo); } .switch input:checked ~ .knob::after { transform: translateX(18px); }
.switch input:focus-visible ~ .knob { outline: 3px solid var(--focus); outline-offset: 2px; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-weight: 550; } .chk input { width: 20px; height: 20px; accent-color: var(--baby-lo); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.imgpick { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; } .thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }
.copyline { display: flex; gap: 8px; margin: 8px 0; } .copyline input { font-family: ui-monospace, Menlo, monospace; font-size: .84rem; } .copyline.big input { font-size: 1.1rem; letter-spacing: .08em; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px; align-items: center; } .filters select, .filters input { width: auto; flex: 1 1 150px; min-height: 42px; }
.toolbar { margin-bottom: 12px; } .search { max-width: 420px; }
.narrow { max-width: 560px; }

/* bulk income */
.bulkrows { display: grid; gap: 8px; margin: 8px 0 12px; }
.bulkhead, .bulkrow { display: grid; grid-template-columns: 150px 130px 1fr 40px; gap: 8px; align-items: center; }
.bulkhead span { font-size: .82rem; font-weight: 650; color: var(--muted); }

/* tables → cards on mobile */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .8rem; font-weight: 650; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; } .table tbody tr:hover { background: var(--surface-2); }
.table th.r, .table td.r { text-align: right; } .table td.act { text-align: right; white-space: nowrap; width: 1%; }
.table tr.done td, .table tr.muted-row td { opacity: .62; } .table tr.done td.act, .table tr.muted-row td.act { opacity: 1; }
.rowlink { color: var(--ink); font-weight: 650; text-decoration: none; } .rowlink:hover { text-decoration: underline; }
.pos { color: var(--ok); }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; } .pager a { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); } .pager a.on { background: var(--accent); border-color: transparent; font-weight: 700; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--mut-bg); border-radius: 16px; width: fit-content; max-width: 100%; margin-bottom: 16px; }
.tabs.scroll { overflow-x: auto; scrollbar-width: none; } .tabs.scroll::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 9px 16px; border-radius: 12px; font: 650 .93rem var(--font); color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.tabs .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(13,34,54,.16); }

/* reminders */
.rem { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 14px; text-decoration: none; color: var(--ink); }
.rem:hover { background: var(--surface-2); }
.ric { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--info-bg); color: var(--info); }
.rem.warn .ric { background: var(--warn-bg); color: var(--warn); } .rem.bad .ric { background: var(--bad-bg); color: var(--bad); }
.rt, .rr { display: flex; flex-direction: column; min-width: 0; } .rr { text-align: right; } .rt b { overflow-wrap: anywhere; } .rt small, .rr small { color: var(--muted); font-size: .8rem; }
.rem.bad .rr small { color: var(--bad); font-weight: 650; }

/* bills */
.group h3 { margin-bottom: 8px; }
.acc { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 14px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); }
.acc:first-of-type { border-top: 0; } .acc:hover { background: var(--surface-2); } .acc.off { opacity: .55; }
.acc small { display: block; } .acc .r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 24px; margin: 0; }
.dl dt { font-size: .8rem; color: var(--muted); font-weight: 650; } .dl dd { margin: 2px 0 0; overflow-wrap: anywhere; } .dl .wide { grid-column: 1 / -1; }
.info { margin-bottom: 16px; }

/* bank + cards */
.bankcard { border-left: 7px solid var(--bank, var(--baby)); }
.bal { font-size: 1.6rem; font-weight: 750; margin: 4px 0 8px; } .bal small { font-size: .8rem; font-weight: 500; }
.copylines { display: grid; gap: 2px; margin: 6px 0 12px; }
.cl { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.cl:first-child { border-top: 0; } .cl .k { color: var(--muted); font-size: .82rem; font-weight: 650; } .cl .v { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; overflow-wrap: anywhere; }
.paycard { display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 1.586; border-radius: 22px; padding: 20px 22px; color: #0d2236; text-decoration: none; background: linear-gradient(135deg, #e0f1ff, #9dcff3 55%, #78b9e6); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), var(--shadow); margin-bottom: 0 !important; }
.paycard.credit { background: linear-gradient(135deg, #1d3b57, #14283b 60%, #0e1d2c); color: #e9f4fd; }
.paycard.prepaid, .paycard.virtual { background: linear-gradient(135deg, #f1e9ff, #c7b8f3 60%, #a998e6); }
.pc-top, .pc-bot { display: flex; justify-content: space-between; font-weight: 650; font-size: .9rem; gap: 10px; } .pc-num { font: 650 1.2rem ui-monospace, Menlo, monospace; letter-spacing: .06em; }
.paycard.off { opacity: .55; }
.cardwrap { display: flex; flex-direction: column; gap: 10px; } .cardmeta { display: flex; flex-direction: column; gap: 4px; padding: 0 6px 6px; }
.progress { height: 10px; border-radius: 99px; background: var(--mut-bg); overflow: hidden; margin: 8px 0; } .progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--baby-hi), var(--baby-lo)); } .progress.hot i { background: linear-gradient(90deg, #f6b0b6, #d94c58); }
.loancard { text-decoration: none; color: var(--ink); display: block; } .loancard.off { opacity: .6; }
.row2 { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 6px; } .row2 .k { display: block; font-size: .8rem; color: var(--muted); font-weight: 650; } .row2 b { font-size: 1.15rem; }

/* wishlist */
.wish { padding: 0; overflow: hidden; display: flex; flex-direction: column; } .wish.off { opacity: .7; }
.wimg { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: var(--mut-bg); } .wimg.ph { display: grid; place-items: center; color: var(--muted); } .wimg.ph .ic { width: 34px; height: 34px; }
.wbody { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; } .wbody h3 { font-size: 1.1rem; } .wprice { font-size: 1.3rem; font-weight: 750; margin: 0; }

/* pets */
.petcard { text-decoration: none; color: var(--ink); padding: 0; overflow: hidden; display: block; }
.pphoto { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--info-bg); } .pphoto.ph { display: grid; place-items: center; color: var(--info); } .pphoto.ph .ic { width: 48px; height: 48px; }
.pbody { padding: 14px 18px 18px; } .pbody h3 { font-size: 1.25rem; margin-bottom: 2px; }
.pethead { display: flex; gap: 18px; align-items: center; }
.pavatar { width: 92px; height: 92px; border-radius: 28px; object-fit: cover; flex: none; } .pavatar.ph { display: grid; place-items: center; background: var(--info-bg); color: var(--info); } .pavatar.ph .ic { width: 40px; height: 40px; }
.pinfo h2 { font-size: 1.6rem; margin-bottom: 2px; }
.board { display: grid; gap: 4px; } .brow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); border-left: 5px solid var(--line); flex-wrap: wrap; }
.brow small { display: block; } .brow.st-ok { border-left-color: #3dbb83; } .brow.st-warn, .brow.st-never { border-left-color: #e8a93a; } .brow.st-bad { border-left-color: var(--bad); } .brow .r { display: flex; gap: 10px; align-items: center; }
.inlineform .fgrid { max-width: 520px; }

/* charts */
.chart { width: 100%; min-height: 200px; position: relative; } .chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--baby-lo); } .chart .bar:hover, .chart .bar.hl { fill: var(--link); } .chart .ax { fill: var(--muted); font: 600 11px var(--font); } .chart .grid { stroke: var(--line); stroke-width: 1; } .chart .ln { fill: none; stroke: var(--baby-lo); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; } .chart .dot { fill: var(--surface); stroke: var(--baby-lo); stroke-width: 2.5; } .chart .area { fill: var(--baby); opacity: .22; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); padding: 4px 9px; border-radius: 9px; font-size: .8rem; font-weight: 650; transform: translate(-50%, -120%); white-space: nowrap; opacity: 0; transition: opacity .1s; }

/* pick lists (CV) */
.pick { display: flex; gap: 12px; align-items: flex-start; padding: 8px 6px; border-radius: 12px; cursor: pointer; } .pick:hover { background: var(--surface-2); } .pick input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--baby-lo); flex: none; }
.cvlayout { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 16px; align-items: start; }
.cvpreview { position: sticky; top: 84px; padding: 0; overflow: hidden; } .cvpreview .cardhead { padding: 14px 18px 0; } .cvpreview iframe { width: 100%; height: 76vh; border: 0; background: #fff; border-radius: 0 0 var(--r) var(--r); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; } .codes code { font-size: 1.05rem; padding: 10px; text-align: center; }
.settings { display: grid; gap: 0; max-width: 820px; }

/* mobile nav */
.tabbar, .sheet, .sheet-back { display: none; }
.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--hero); }
.authcard { width: 100%; max-width: 410px; background: var(--surface); border-radius: 28px; padding: 32px 28px; box-shadow: 0 30px 60px -30px rgba(13,34,54,.5); display: grid; gap: 14px; }
.authcard h1 { font-size: 1.7rem; } .brandmark { width: 52px; height: 52px; border-radius: 16px; background: var(--hero); display: grid; place-items: center; color: #0d2236; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); } .brandmark .ic { width: 26px; height: 26px; }
.authcard p { margin: 0; }

@media (max-width: 1023px) {
  .shell { display: block; } .side { display: none; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); } body.bare { padding-bottom: 0; }
  .top { padding-top: calc(14px + env(safe-area-inset-top)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 24px; padding: 6px; box-shadow: 0 14px 34px -12px rgba(13,34,54,.4); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 18px; color: var(--muted); text-decoration: none; font: 650 .7rem var(--font); background: none; border: 0; cursor: pointer; min-height: 54px; justify-content: center; }
  .tabbar .on { background: var(--accent); color: var(--on-accent); }
  .sheet-back { position: fixed; inset: 0; background: rgba(5,15,25,.45); z-index: 50; }
  .sheet-back:not([hidden]), .sheet:not([hidden]) { display: block; }
  .sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-radius: 28px 28px 0 0; padding: 10px 16px calc(24px + env(safe-area-inset-bottom)); max-height: 82vh; overflow-y: auto; animation: up .22s ease-out; }
  .sheet-grip { width: 42px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sheet-grid a, .sheet-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 18px; background: var(--surface-2); color: var(--ink); text-decoration: none; font: 650 .82rem var(--font); border: 0; cursor: pointer; text-align: center; }
  .sheet-grid .on { background: var(--accent); color: var(--on-accent); }
  .cvlayout { grid-template-columns: 1fr; } .cvpreview { position: static; } .cvpreview iframe { height: 60vh; }
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .card { padding: 16px; border-radius: 18px; } .card.tablewrap { padding: 6px 0 2px; }
  .fgrid { grid-template-columns: 1fr; }
  .top { gap: 8px; } .top .actions { width: 100%; } .top .actions .btn { flex: 1 1 auto; }
  .table thead { display: none; } .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); position: relative; } .table tbody tr:last-child { border-bottom: 0; }
  .table td { padding: 3px 0; border: 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  .table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 650; text-align: left; flex: none; }
  .table td.act { justify-content: flex-end; width: 100%; padding-top: 6px; } .table td.r { text-align: right; }
  .table td > small.block { text-align: right; }
  .bulkhead { display: none; } .bulkrow { grid-template-columns: 1fr 1fr 40px; } .bulkrow input[name="row_desc[]"] { grid-column: 1 / 3; grid-row: 2; }
  .pethead { align-items: flex-start; } .pavatar { width: 72px; height: 72px; border-radius: 22px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { padding: 14px; } .kpi b { font-size: 1.3rem; }
  .hero { border-radius: 24px; } .hero-next { right: 12px; bottom: 12px; }
}
@media (max-width: 380px) { .kpis { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .side, .tabbar, .top .actions, .sheet { display: none !important; } .shell { display: block; } body { background: #fff; color: #000; } .card, .kpi { box-shadow: none; } }
