/* Layout: one narrow column for parents, a wider tabbed workspace for the owner. */
:root {
  --bg: #020A1C;
  --surface: #071634;
  --surface-2: #0E2250;
  --ink: #F4F7FF;
  --muted: #93A6CB;
  --line: #1B3166;
  --accent: #1973F2;
  --accent-ink: #ffffff;
  --accent-soft: rgba(25, 115, 242, 0.28);
  --ok: #3DD68C;
  --ok-bg: #0f2a1a;
  --warn: #F5B94A;
  --warn-bg: #30230a;
  --bad: #FF6B6B;
  --bad-bg: #331512;
  --font: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  --radius: 12px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F4F7FF; --surface: #ffffff; --surface-2: #e8eef8; --ink: #020A1C; --muted: #4a5f88;
    --line: #c5d2ea; --accent: #1973F2; --accent-ink: #ffffff; --accent-soft: #d6e6ff;
    --ok: #167a45; --ok-bg: #dcf2e4; --warn: #8f5200; --warn-bg: #ffecc9; --bad: #b3261e; --bad-bg: #fcdedb;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F4F7FF; --surface: #ffffff; --surface-2: #e8eef8; --ink: #020A1C; --muted: #4a5f88;
  --line: #c5d2ea; --accent: #1973F2; --accent-ink: #ffffff; --accent-soft: #d6e6ff;
  --ok: #167a45; --ok-bg: #dcf2e4; --warn: #8f5200; --warn-bg: #ffecc9; --bad: #b3261e; --bad-bg: #fcdedb;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 var(--font);
  padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px);
  padding-inline: max(14px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-left, 0px));
}
h1, h2, h3, h4 { margin: 0; line-height: 1.3; text-wrap: balance; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; } h4 { font-size: 14px; color: var(--muted); font-weight: 500; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.wrap { max-width: 520px; margin: 0 auto; padding-block: 16px 40px; display: grid; gap: 14px; }
.wrap.wide { max-width: 1040px; }
.wrap { grid-template-columns: minmax(0, 1fr); }
html, body { overflow-x: clip; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.card.flat { background: var(--surface-2); }

/* Buttons */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 500; min-height: 40px;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.sm { padding: 4px 10px; min-height: 32px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Forms */
label.f { display: grid; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
input, select, textarea {
  width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pill.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.banner { border-radius: var(--radius); padding: 10px 14px; font-weight: 500; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.info { background: var(--accent-soft); color: var(--accent); }

/* Parent */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 6px; }
.loc { display: grid; gap: 8px; }
.loc .state { display: flex; gap: 10px; align-items: center; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.in { background: var(--ok); box-shadow: 0 0 0 5px var(--ok-bg); }
.dot.out { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.wait { animation: pulse 1.2s ease-in-out infinite; background: var(--accent); }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .dot.wait { animation: none; } }

.kid h3 { font-size: 18px; }
.enr { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 12px; display: grid; gap: 8px; }
.enr:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); }
.meter.over > i { background: var(--warn); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12.5px; padding: 1px 9px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.chip.off { background: var(--warn-bg); color: var(--warn); }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; flex-wrap: wrap; }
details > summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* Admin */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.tab { appearance: none; border: 0; background: transparent; padding: 10px 14px; cursor: pointer; white-space: nowrap; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.tile b { display: block; font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--muted); }
.list { display: grid; gap: 8px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.item .main { min-width: 0; flex: 1 1 200px; }
.item .main b { display: block; }
.item.link { cursor: pointer; }
.item.link:hover { background: var(--surface-2); }
.sect { display: grid; gap: 8px; }
.sect > h3 { display: flex; gap: 8px; align-items: baseline; }
.daychips { display: flex; gap: 6px; flex-wrap: wrap; }
.daychips label { cursor: pointer; }
.daychips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.daychips span { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--surface); }
.daychips input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.daychips input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.tbl { overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 13px; }

/* Modal / toast */
.back { position: fixed; inset: 0; background: rgba(8, 16, 26, .55); display: grid; place-items: center; padding: 14px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: calc(100dvh - 28px); overflow-y: auto; padding: 18px; display: grid; gap: 14px; }
.modal.big { width: min(760px, 100%); }
.modal .head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
#toast { position: fixed; inset-inline: 0; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; pointer-events: none; z-index: 80; padding-inline: 14px; }
#toast div { background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 500; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

.demo { border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--surface-2); }
.login { max-width: 400px; margin: 10vh auto 0; display: grid; gap: 14px; justify-items: center; text-align: center; }
.login .f, .login .btn, .login p { width: 100%; }
.logo { width: 168px; height: 168px; border-radius: 50%; background: transparent; color: var(--accent-ink); display: block; object-fit: cover; font-weight: 700; font-size: 22px; }
.logo.sm { width: 40px; height: 40px; font-size: 20px; margin: 0; }
.branch-badge { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: inherit; text-align: start; padding: 0; cursor: default; }
.branch-badge[data-act] { cursor: pointer; }
.branch-badge img { width: 38px; height: 38px; border-radius: 50%; flex: none; }
.branch-badge b { display: block; font-size: 16px; line-height: 1.2; }
.branch-badge .chev { margin-inline-start: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
.br-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; background: var(--surface-2); width: 100%; color: inherit; text-align: start; cursor: pointer; }
.br-row img { width: 54px; height: 54px; border-radius: 50%; }
.br-row.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.br-row.off { opacity: .6; cursor: default; }
.br-row .tag { margin-inline-start: auto; font-size: 12px; border-radius: 99px; padding: 1px 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.br-row.on .tag { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Month calendar */
.pkg { display: grid; gap: 6px; }
.paybox { display: grid; gap: 6px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.cal { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cw { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 2px; }
.cd { aspect-ratio: 1; max-height: 42px; width: 100%; display: grid; place-items: center; border-radius: 8px; font-size: 13px; border: 1px solid transparent; font-variant-numeric: tabular-nums; padding: 0; background: transparent; color: var(--muted); }
button.cd { cursor: pointer; }
.cd.blank { visibility: hidden; }
.cd.none { opacity: .55; }
.cd.pre { opacity: .3; }
.cd.att { background: var(--ok); color: var(--surface); font-weight: 700; }
.cd.abs { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); font-weight: 700; }
.cd.up { border: 1.5px dashed var(--accent); color: var(--accent); font-weight: 500; }
.cd.closed { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--line) 4px, var(--line) 8px); color: var(--muted); }
.cd.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.cal-sum { display: flex; gap: 6px; flex-wrap: wrap; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg.att { background: var(--ok); } .lg.abs { background: var(--bad-bg); border: 1px solid var(--bad); }
.lg.up { border: 1.5px dashed var(--accent); } .lg.closed { background: var(--line); }

/* Group roster */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; width: fit-content; max-width: 100%; }
.seg button { appearance: none; border: 0; background: var(--surface); padding: 8px 18px; cursor: pointer; font-weight: 500; color: var(--muted); min-height: 40px; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.gt th.c, .gt td.c { text-align: center; padding-inline: 6px; }
.gt td:first-child, .gt th:first-child { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; min-width: 96px; }
.gc { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; border: 1px solid transparent; padding: 0; font-size: 14px; font-weight: 700; background: transparent; color: var(--muted); }
button.gc { cursor: pointer; }
.gc.att { background: var(--ok); color: var(--surface); }
.gc.abs { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.gc.up { border: 1.5px dashed var(--accent); color: var(--accent); }
.gc.closed { background: var(--line); font-size: 12px; font-weight: 500; }
.gc.pre { opacity: .35; font-weight: 400; }
.linkbtn { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; font-weight: 700; color: var(--ink); text-decoration: underline dotted; text-underline-offset: 4px; }
.badtxt { color: var(--bad); }

/* Attendance tables */
.dt th.c, .dt td.c, .wk th.c, .wk td.c { text-align: center; }
.dt td:first-child, .dt th:first-child, .wk td:first-child, .wk th:first-child { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; min-width: 96px; }
.dt tbody tr:hover td, .wk tbody tr:hover td { background: var(--surface-2); }
.dt tr.r-abs td:first-child { box-shadow: inset -3px 0 0 var(--bad); }
.dt tr.r-att td:first-child { box-shadow: inset -3px 0 0 var(--ok); }
.ab { width: 30px; height: 30px; border-radius: 7px; display: inline-grid; place-items: center; border: 2px solid var(--line); background: var(--surface); padding: 0; font-size: 16px; font-weight: 700; color: var(--muted); vertical-align: middle; }
button.ab { cursor: pointer; }
button.ab:disabled { cursor: not-allowed; opacity: .45; }
.ab.att { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.ab.abs { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.ab.up { border: 2px dashed var(--accent); }
.ab.closed { background: var(--line); border-color: var(--line); font-size: 12px; font-weight: 500; }
.ab.pre, .ab.none { border-color: transparent; background: transparent; opacity: .4; font-weight: 400; }
.wk tr.grp td { background: var(--accent-soft); color: var(--ink); position: static; padding-block: 10px; }
.wk tr.sum td { background: var(--surface-2); font-size: 13px; color: var(--muted); }
.wk td.tdy, .wk th.tdy { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }

.agetx { display: block; font-weight: 400; line-height: 1.2; }

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; padding: 0; font-size: 12px; }
  #toast, .tabs, .topbar .row, .btn, .seg, select, .demo, .legend, .banner.info, details > summary::marker, input.sel, label.f { display: none !important; }
  .card, .tile, .item { border-color: #999; break-inside: avoid; }
  .tbl { overflow: visible; }
  .wrap { max-width: none; padding: 0; }
  .dt td:first-child, .dt th:first-child, .wk td:first-child, .wk th:first-child { position: static; }
  body[data-print="modal"] #app { display: none; }
  body[data-print="modal"] .back { position: static; background: none; padding: 0; display: block; }
  body[data-print="modal"] .modal { width: 100%; max-height: none; overflow: visible; padding: 0; }
  body[data-print="page"] #modal { display: none; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

.prompt { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.cd.outp { opacity: .3; }

/* Per-player weekly planner and week distribution */
.planner { display: grid; gap: 6px; }
.plrow { display: grid; grid-template-columns: 22px 72px 1fr auto 1fr; gap: 8px; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.plrow input[type="time"] { min-height: 34px; }
.plrow .dn { font-weight: 500; }
.plan-cell { vertical-align: top; min-width: 90px; white-space: normal !important; }
.plan-cell .chip { display: inline-block; margin: 2px 2px 2px 0; }
.chip.up { background: transparent; border: 1.5px dashed var(--accent); }
.tm { font-size: 11px; line-height: 1.1; }
.okx b { color: var(--ok); }

.ab.opt, .gc.opt { border: 2px dashed var(--line); background: transparent; color: var(--muted); }
button.ab.opt:hover, button.gc.opt:hover { border-color: var(--accent); }

/* Commitment ring */
.rate { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface); }
.rate-top { display: flex; gap: 14px; align-items: center; }
.rate-label { font-size: 17px; }
.rate.compact { border: 0; padding: 0; }
.dot-s { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.okt { color: var(--ok); font-weight: 700; }

[hidden] { display: none !important; }

.paystat { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.paystat.ok { background: var(--ok-bg); color: var(--ok); }
.paystat.bad { background: var(--bad-bg); color: var(--bad); }
.paystat.warn { background: var(--warn-bg); color: var(--warn); }
.paystat b { font-size: 15px; }

/* Timetable */
.sblock { display: grid; gap: 8px; }
.sblock.opt { border-style: dashed; }
.chipbtn { border: 0; cursor: pointer; font: inherit; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mc { min-height: 74px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 4px; display: grid; align-content: start; justify-items: center; gap: 2px; cursor: pointer; font: inherit; color: var(--ink); }
.mc.blank { visibility: hidden; border: 0; }
.mc.today { outline: 2px solid var(--accent); }
.mc.cl { background: var(--surface-2); color: var(--muted); }
.mc .mt { font-size: 10px; color: var(--muted); line-height: 1.1; }
.mc .pill { font-size: 11px; padding: 0 7px; }
.tdyh { color: var(--accent); }
.sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }

.strip { display: flex; gap: 6px; flex-wrap: wrap; }
.subtabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.subtabs button { appearance: none; border: 0; background: transparent; padding: 8px 12px; cursor: pointer; white-space: nowrap; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; }
.subtabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

/* Money summary */
.tile.big b { font-size: 30px; }
.split { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.sp-venue { background: #8a6d3b; } .sp-coach { background: #5b7ea3; } .sp-exp { background: #b0a28a; } .sp-net { background: var(--ok); }
.lg.sp-venue, .lg.sp-coach, .lg.sp-exp, .lg.sp-net { border: 0; }
.finbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fl { display: flex; gap: 8px; align-items: center; padding: 10px 12px; }
.fl .c { min-width: 82px; text-align: end; }
.fh { color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
details.d1 > summary, details.d2 > summary, details.d3 > summary { list-style: none; cursor: pointer; color: var(--ink); font-size: 14px; }
details.d1 { border-top: 1px solid var(--line); }
details.d2 { padding-inline-start: 14px; border-top: 1px dashed var(--line); }
details.d3 { padding-inline-start: 14px; border-top: 1px dashed var(--line); }
details.d1[open] > summary, details.d2[open] > summary, details.d3[open] > summary { background: var(--surface-2); }
details.d1 > .list, details.d2 > .list, details.d3 > .list { padding: 8px 12px; }

.wf .kv { padding: 5px 0; font-size: 15px; }
.wf .wfh { font-weight: 600; } .wf .wft { border-top: 1px solid var(--line); padding-top: 9px; margin-top: 3px; font-size: 17px; }
.tbar { height: 5px; background: var(--surface-2); border-radius: 9px; margin-top: 4px; min-width: 60px; } .tbar i { display: block; height: 100%; background: var(--ok); border-radius: 9px; } .tbar i.neg { background: var(--bad); }
.goitem { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; font: inherit; color: var(--ink); text-align: start; min-height: 46px; }
.goitem:hover { border-color: var(--accent); }
.winrow { border: 1px dashed var(--line); }

.gcard { padding: 0; overflow: hidden; }
.gsum { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; background: transparent; border: 0; padding: 12px 14px; font: inherit; color: var(--ink); cursor: pointer; text-align: start; min-height: 48px; }
.gcard .tbl { margin: 0; border-radius: 0; border-inline: 0; border-bottom: 0; }
.gs { position: relative; flex: 1 1 220px; min-width: 180px; max-width: 420px; }
.gs input { width: 100%; }
.gsr { position: absolute; top: calc(100% + 4px); inset-inline: 0; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }

.gtag { --bgc: hsl(var(--gh) 62% 87%); --fgc: hsl(var(--gh) 60% 20%); display: inline-flex; align-items: center; gap: 4px; background: var(--bgc); color: var(--fgc); border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.gtag.hex { background: var(--gc); color: #fff; }
.gtag.sm { font-size: 11.5px; padding: 1px 8px; }
.gtag.mtag { flex-direction: column; gap: 0; border-radius: 7px; padding: 2px 4px; line-height: 1.15; white-space: normal; text-align: center; width: 100%; font-size: 11px; }
.gtag.mtag small { font-weight: 500; font-size: 10px; opacity: .85; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gtag { --bgc: hsl(var(--gh) 38% 21%); --fgc: hsl(var(--gh) 75% 82%); } }
:root[data-theme="dark"] .gtag { --bgc: hsl(var(--gh) 38% 21%); --fgc: hsl(var(--gh) 75% 82%); }
.gbtn { background: hsl(var(--gh) 62% 87%); color: hsl(var(--gh) 60% 20%); border-color: transparent; }
:root[data-theme="dark"] .gbtn { background: hsl(var(--gh) 38% 21%); color: hsl(var(--gh) 75% 82%); }
.gbtn.hex { background: var(--gc); color: #fff; }
.mc { align-content: start; justify-items: stretch; }
.mc b { justify-self: center; }
.mgrid.wk .mc { min-height: 130px; }
.gbtn.on { outline: 2px solid currentColor; outline-offset: 1px; font-weight: 700; }

.hist table { font-size: 13px; } .hist th, .hist td { padding: 7px 6px; } .hist .pill { font-size: 12px; padding: 0 7px; }

.receipt { border: 1.5px dashed var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 9px; background: var(--surface); }
.rc-head { display: flex; align-items: center; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 12px; }
.rc-head .grow, .rc-head > div:nth-child(2) { flex: 1; }
.rc-head .logo.sm { width: 40px; height: 40px; font-size: 20px; margin: 0; }
.rc-no { text-align: end; display: grid; } .rc-no b { font-size: 20px; }
.rc-amt { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; }
.rc-amt b { font-size: 26px; color: var(--accent); }
.rc-foot { text-align: center; border-top: 1px dashed var(--line); padding-top: 10px; }

.wfv { display: inline-flex; align-items: baseline; gap: 10px; } .wfp { min-width: 52px; text-align: end; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.wf .wft .wfp { color: var(--ink); font-weight: 600; }

.lvl { display: flex; gap: 6px; flex-wrap: wrap; } .lvl label { cursor: pointer; } .lvl input { position: absolute; opacity: 0; pointer-events: none; }
.lvl span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-weight: 500; min-height: 40px; }
.lvl input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lvl input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.evt { min-width: 0 !important; width: 100%; } .evt th, .evt td { padding: 7px 5px; vertical-align: top; } .evt td b { overflow-wrap: anywhere; } .evt .small { overflow-wrap: anywhere; }
.tbl .evt th, .tbl .evt td { white-space: normal; } .evt td:first-child, .evt th:first-child { width: 28px; } .evt td:last-child, .evt th:last-child { width: 78px; }

.evt tr.sechd td { background: var(--surface-2); padding: 8px 6px; border-bottom: 1px solid var(--line); } .sechd2 { margin: 14px 0 2px; font-size: 15px; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 4px; }

.partrow { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.partrow > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; cursor: pointer; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; } .thumbs img { width: 84px; height: 112px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumbs.big img { width: calc(50% - 4px); max-width: 220px; height: auto; aspect-ratio: 3/4; }
.ev-sc { color: var(--accent); }

.ed .acts { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; } .ed .acts .btn { padding: 4px 10px; min-height: 32px; } .ed td:last-child, .ed th:last-child { width: 42% !important; } .ed td:nth-child(2) { width: 58%; }

.thumbs.sm img { width: 52px; height: 70px; } .cmp th, .cmp td { white-space: normal; vertical-align: top; padding: 7px 5px; min-width: 68px; font-size: 13px; } .cmp td:first-child, .cmp th:first-child { min-width: 96px; position: sticky; inset-inline-start: 0; background: var(--surface); } .cmp tr.sechd td { background: var(--surface-2); } .ev-ip { max-width: 100%; font-size: 12px; }
