/* Staff portal. Phone: top bar + bottom tabs + bottom sheets. Desktop (900+): sidebar + side panel. */

/* ---------- login ---------- */
.loginwrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, #173f7c 0%, #22559a 50%, #5b95e0 100%); }
.logincard { width: 100%; max-width: 400px; background: #fff; border-radius: 28px; padding: 28px 24px; box-shadow: var(--sh-2); display: grid; justify-items: stretch; }
.logincard > img { margin: 0 auto 8px; height: 60px; width: auto; }
.logincard h1 { text-align: center; font-size: 1.5rem; letter-spacing: -.02em; }
.logincard .sub { text-align: center; color: var(--mut); margin: 4px 0 22px; }
.logincard .check { margin-top: 8px; }
.logincard .btn { margin-top: 12px; }
.formerr { color: var(--err); font-weight: 600; font-size: .9rem; margin-top: 12px; }
.formerr:empty { display: none; }
.backlink { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; margin-top: 12px; text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--mut); }
.backlink:hover { color: var(--brand); }

/* ---------- shell ---------- */
.app { min-height: 100dvh; }
.sbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.sbrand img { height: 30px; width: auto; }
.sbar-title { flex: 1; font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.who { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px 0 0; border: 0; background: transparent; border-radius: var(--pill); }
.who:hover { background: var(--soft); }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: .9rem; text-transform: uppercase; }
.whoname { display: none; font-weight: 700; font-size: .9rem; padding-right: 8px; }

.snav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.snav button { flex: 1; min-height: 56px; display: grid; justify-items: center; align-content: center; gap: 2px; border: 0; background: transparent; color: var(--mut); border-radius: var(--r-md); font-weight: 700; font-size: .75rem; transition: background var(--t-fast), color var(--t-fast); }
.snav button[aria-current="page"] { color: var(--brand); background: var(--soft); }
.snav button:active { transform: scale(.97); }
.smain { padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px)); max-width: 1100px; margin: 0 auto; outline: 0; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sbar { grid-column: 1 / -1; padding: 12px 28px; }
  .sbrand img { height: 36px; }
  .whoname { display: block; }
  .snav { position: sticky; top: 61px; align-self: start; height: calc(100dvh - 61px); flex-direction: column; gap: 4px; padding: 16px 12px; background: transparent; border-top: 0; border-right: 1px solid var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .snav button { flex: none; width: 100%; min-height: 48px; grid-auto-flow: column; justify-content: start; justify-items: start; align-content: center; gap: 12px; padding: 0 16px; font-size: .95rem; }
  .snav button:hover { background: var(--soft); }
  .smain { padding: 28px 32px 48px; width: 100%; }
}

/* ---------- page heads ---------- */
.vhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.vhead h1 { font-size: 1.5rem; letter-spacing: -.02em; }
.vact { display: flex; gap: 8px; }
@media (max-width: 899px) { .sbar-title { display: block; } .vhead h1 { display: none; } .vhead { justify-content: flex-end; } }
@media (min-width: 900px) { .sbar-title { display: none; } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--sh-1); min-width: 0; }
.stat small { display: block; color: var(--mut); font-weight: 600; font-size: .8125rem; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.25; letter-spacing: -.02em; }
.stat span { font-size: .78rem; color: var(--mut); }
.stat.attn b { color: var(--warn); }

/* ---------- toolbar ---------- */
.toolbar { display: grid; gap: 10px; margin-bottom: 14px; }
.searchbox { position: relative; display: block; }
.searchbox .ico { position: absolute; left: 14px; top: 14px; color: var(--mut); pointer-events: none; }
.searchbox .input { padding-left: 44px; background: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; margin: -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { flex: none; }
@media (min-width: 900px) { .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; } .searchbox { flex: 1 1 300px; max-width: 380px; } .chips { overflow: visible; flex-wrap: wrap; } }

/* ---------- booking list ---------- */
.blist { display: grid; gap: 10px; }
.bhead { display: none; }
.brow {
  display: grid; grid-template-areas: "when when stat" "guest amt pay"; grid-template-columns: 1fr auto auto; gap: 4px 12px; align-items: center; text-align: left; width: 100%;
  padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-1); color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.brow:hover { border-color: var(--brand-2); box-shadow: var(--sh-2); }
.brow:active { transform: scale(.99); }
.brow.cancelled { opacity: .72; }
.c-when { grid-area: when; font-weight: 800; line-height: 1.3; }
.c-when small { display: block; font-weight: 600; color: var(--mut); font-size: .875rem; }
.c-stat { grid-area: stat; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.c-guest { grid-area: guest; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.c-guest small { display: block; font-weight: 500; color: var(--mut); font-size: .8125rem; }
.c-amt { grid-area: amt; font-weight: 800; text-align: right; }
.c-code { grid-area: code; font-size: .78rem; font-weight: 700; color: var(--mut); letter-spacing: .04em; }
.c-go { display: none; }
@media (min-width: 700px) {
  .blist { gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
  .bhead, .brow { display: grid; grid-template-areas: none; grid-template-columns: minmax(120px, 1.3fr) minmax(120px, 1.1fr) 72px 108px 108px 18px; gap: 12px; align-items: center; }
  .bhead { padding: 12px 16px; background: var(--soft); color: var(--mut); font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
  .brow { border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 14px 16px; }
  .brow:hover { background: var(--soft); box-shadow: none; }
  .c-when, .c-stat, .c-pay, .c-guest, .c-amt, .c-code { grid-area: auto; }
  .c-pay { justify-content: flex-start; }
  .c-code { order: 0; font-size: .8125rem; }
  .c-stat { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; align-items: center; }
  .c-amt { text-align: left; }
  .c-go { display: block; color: var(--mut); }
  .brow > * { min-width: 0; }
  .brow .c-code { order: -1; }
}
.empty { text-align: center; color: var(--mut); padding: 40px 16px; background: #fff; border: 1px dashed var(--line); border-radius: var(--r-lg); }
.empty b { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }
.skel { height: 84px; border-radius: var(--r-md); background: linear-gradient(90deg, #e8eef8 25%, #f3f6fc 50%, #e8eef8 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- sheets (detail + editor) ---------- */
.sheet { width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; overflow: auto; overscroll-behavior: contain; box-shadow: var(--sh-2); }
.sheet[open] { animation: slideUp var(--t-med) var(--ease); }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
@media (min-width: 900px) {
  .sheet { width: 480px; height: 100dvh; max-height: none; margin: 0 0 0 auto; border-radius: 24px 0 0 24px; }
  .sheet[open] { animation: slideIn var(--t-med) var(--ease); }
}
.sh-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 12px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.sh-head h2 { font-size: 1.15rem; letter-spacing: .03em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sh-body { padding: 20px; display: grid; gap: 20px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.sec h3 { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); margin-bottom: 8px; }
.kv { display: grid; gap: 0; margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.kv div:first-child { border-top: 0; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.kv a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.notebox { padding: 12px 14px; background: var(--soft); border-radius: var(--r-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.paybar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: var(--r-md); background: var(--warn-bg); color: var(--warn); font-weight: 700; flex-wrap: wrap; }
.paybar.paid { background: var(--ok-bg); color: var(--ok); }
.paybar .btn { box-shadow: none; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acts .full { grid-column: 1 / -1; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hist li { position: relative; padding: 0 0 14px 20px; font-size: .875rem; border-left: 2px solid var(--line); margin-left: 6px; }
.hist li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-2); border: 2px solid #fff; }
.hist li:last-child { border-left-color: transparent; }
.hist b { text-transform: capitalize; }
.hist small { display: block; color: var(--mut); overflow-wrap: anywhere; }
.cancelnote { padding: 12px 14px; border-radius: var(--r-sm); background: var(--err-bg); color: var(--err); font-weight: 600; }

/* editor */
.hours-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.hp-slot { min-height: 54px; padding: 6px 4px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; display: grid; justify-items: center; align-content: center; line-height: 1.2; font-weight: 700; font-size: .9rem; transition: background var(--t-fast), border-color var(--t-fast); }
.hp-slot small { font-weight: 500; font-size: .7rem; color: var(--mut); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-slot[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.hp-slot[aria-pressed="true"] small { color: #e3eefc; }
.hp-slot:disabled { background: var(--busy); border-color: var(--busy); color: #66728a; cursor: not-allowed; }
.hp-slot:disabled b { text-decoration: line-through; }
.hp-total { margin-top: 10px; font-weight: 700; color: var(--brand); }
.sh-foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--line); }
.sh-foot .btn { flex: 1; }
.sh-foot .btn.ghost { flex: 0 0 auto; }
.two { display: grid; gap: 16px; }
@media (min-width: 400px) { .two { grid-template-columns: 1fr 1fr; } }
.two .field { margin-top: 0; }

/* ---------- schedule ---------- */
.datenav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.datepill { flex: 1; min-width: 150px; max-width: 240px; }
.daylabel { margin: 12px 2px 12px; font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.day { display: grid; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.hr { display: grid; grid-template-columns: 64px 1fr; align-items: stretch; border-top: 1px solid var(--line); }
.hr:first-child { border-top: 0; }
.hr time { align-self: center; padding: 0 0 0 14px; font-size: .8125rem; font-weight: 700; color: var(--mut); }
.cell { text-align: left; min-height: 56px; padding: 10px 14px; border: 0; background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); width: 100%; transition: background var(--t-fast); }
.cell.free { color: var(--mut); font-weight: 600; font-size: .9rem; }
.cell.free:hover { background: var(--soft); color: var(--brand); }
.cell.free .ico { margin-right: 6px; }
.cell.booked { background: #eaf1fc; border-left: 4px solid var(--brand-2); font-weight: 700; }
.cell.booked:hover { background: #dce8fa; }
.cell.booked.unpaid { background: #fff7dc; border-left-color: #e0a800; }
.cell.booked.unpaid:hover { background: #ffefb8; }
.cell.cont { min-height: 40px; }
.cell.cont .who2 { color: var(--mut); font-weight: 600; font-size: .8125rem; }
.cell small { display: block; font-weight: 500; color: var(--mut); }
.cell .who2 { min-width: 0; overflow-wrap: anywhere; }

/* ---------- team ---------- */
.tcard { margin-bottom: 16px; padding: 20px; }
.tcard h2 { font-size: 1.1rem; }
.tcard .help { margin: 2px 0 14px; }
.slist { display: grid; gap: 0; }
.srow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.srow:first-child { border-top: 0; }
.srow .sinfo { flex: 1; min-width: 160px; }
.srow .sinfo b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srow .sinfo small { display: block; color: var(--mut); }
.srow.off { opacity: .65; }
.qrrow { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qrrow img { height: 193px; width: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; padding: 4px; }
.qrbtns { display: grid; gap: 10px; }
.filebtn { position: relative; cursor: pointer; }
.filebtn:focus-within { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.field, .formerr { scroll-margin-top: 90px; }

/* fade hint that the filter chips scroll sideways on phones */
@media (max-width: 899px) { .chips { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; } }

/* ---------- schedule: view switch, week, month ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: var(--pill); }
.seg button { min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--pill); background: transparent; color: var(--brand); font-weight: 700; font-size: .9rem; transition: background var(--t-fast), color var(--t-fast); }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(34, 85, 154, .25); }
@media (max-width: 899px) { #vSchedule .vhead { justify-content: flex-start; } }

.legend2 { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; padding: 0; font-size: .8125rem; color: var(--mut); }
.legend2 li { display: flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 5px; border: 1.5px solid var(--line); }
.l0 .lg, .lg.l0 { background: #fff; }
.lg.l1 { background: #dce9fb; border-color: #b9d1f4; } .lg.l2 { background: #ffe9a8; border-color: #f0cd5e; } .lg.l3 { background: #f7b9b2; border-color: #e58b82; }

.meter { display: block; height: 6px; border-radius: 3px; background: rgba(20, 41, 74, .09); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--brand-2); }
.l2 .meter i { background: #d9a400; } .l3 .meter i { background: var(--err); }

.weekgrid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.wday { text-align: left; display: grid; gap: 8px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-1); transition: border-color var(--t-fast), transform var(--t-fast); }
.wday:hover { border-color: var(--brand-2); } .wday:active { transform: scale(.99); }
.wday.l1 { background: #f3f8ff; } .wday.l2 { background: #fff8e0; } .wday.l3 { background: #fdebe9; border-color: #f0c4c0; }
.wday.past { opacity: .7; }
.wday.today { box-shadow: 0 0 0 2px var(--brand-2); }
.wd-h { display: flex; align-items: center; gap: 8px; }
.wd-h b { font-size: 1.05rem; } .wd-h .num { color: var(--mut); font-weight: 600; }
.wd-t b { font-size: .95rem; } .l3 .wd-t b { color: var(--err); }
.wday small { color: var(--mut); }
@media (min-width: 900px) { .weekgrid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; } .wday { align-content: start; min-height: 180px; padding: 14px; } .wd-h { flex-wrap: wrap; } }

.monthgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mh { text-align: center; font-size: .75rem; font-weight: 800; color: var(--mut); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; }
.mday { display: grid; align-content: space-between; gap: 4px; min-height: 62px; padding: 6px 4px 6px 6px; text-align: left; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); transition: border-color var(--t-fast), transform var(--t-fast); }
.mday:hover { border-color: var(--brand-2); } .mday:active { transform: scale(.97); }
.mday.l1 { background: #eaf2fd; } .mday.l2 { background: #fff3c9; } .mday.l3 { background: #fbd5d1; border-color: #eba39b; }
.mday.out { opacity: .45; } .mday.past { opacity: .6; } .mday.out.past { opacity: .35; }
.mday.today { box-shadow: 0 0 0 2px var(--brand-2); }
.mday .dn { font-weight: 800; font-size: .95rem; }
.mday .mt { font-size: .6875rem; font-weight: 700; color: var(--mut); line-height: 1.1; min-height: 1.1em; }
.mday.l3 .mt { color: var(--err); }
@media (min-width: 900px) { .monthgrid { gap: 8px; } .mday { min-height: 92px; padding: 10px 12px; } .mday .dn { font-size: 1.1rem; } .mday .mt { font-size: .8125rem; } }

/* court / room switch on the schedule */
.spaceseg { margin: 0 0 12px; }

/* history: "Edited by Admin 1" */
.hist b.who { text-transform: none; color: var(--brand); }
.hist small.when { margin-top: 1px; }

/* ---------- notifications ---------- */
.bellbtn { position: relative; }
.bellbtn .dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger, #d92d20); color: #fff; font-size: .7rem; font-weight: 800; line-height: 18px; text-align: center; border: 2px solid #fff; box-sizing: content-box; }
.nlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nitem { display: flex; gap: 12px; width: 100%; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.nitem:hover { background: var(--soft); }
.nitem.new { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, #fff); }
.nitem .ni { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--brand); }
.nitem.bad .ni { color: var(--danger, #d92d20); }
.nitem b { display: block; font-size: .95rem; }
.nitem small { display: block; color: var(--muted, #667); font-size: .82rem; margin-top: 1px; }
.nsec { font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #667); margin: 0 0 8px; }
.nempty { color: var(--muted, #667); text-align: center; padding: 24px 0; }

.proof { display: inline-block; }
.proof img { display: block; max-width: 100%; max-height: 280px; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); }
.payacts { display: flex; gap: 8px; flex-wrap: wrap; }
.paybar.dp { background: var(--soft); color: var(--brand); }
.c-pay { grid-area: pay; display: flex; justify-content: flex-end; align-items: center; }
@media (min-width: 700px) { .brow .c-pay { grid-area: auto; justify-content: flex-start; } }

/* ---------- check-in & timers ---------- */
.nowp { margin: 0 0 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.nowhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; }
.nowhead h2 { font-size: 1.05rem; }
.nowhead small { color: var(--mut); font-weight: 600; }
.nrow { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.nrow.playing { background: var(--ok-bg); }
.ninfo { text-align: left; border: 0; background: transparent; padding: 0; min-width: 0; color: var(--ink); }
.ninfo b { display: block; overflow-wrap: anywhere; }
.ninfo small { display: block; color: var(--mut); font-weight: 600; font-size: .84rem; }
.ncd, .cdwrap { display: flex; align-items: baseline; gap: 6px; justify-content: flex-end; }
.cd { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; }
.cd.big { font-size: 2.2rem; }
.cd[data-lvl="warn"] { color: #b45309; }
.cd[data-lvl="crit"], .cd[data-lvl="over"] { color: var(--err, #d92d20); }
.cdcap { color: var(--mut); font-weight: 700; font-size: .85rem; }
.until { color: var(--mut); font-weight: 700; font-size: .9rem; text-align: right; }
.until[data-late="1"] { color: var(--err, #d92d20); }
.nacts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 700px) {
  .nrow { grid-template-columns: minmax(0, 1fr) 150px auto; }
  .nacts { grid-column: auto; justify-content: flex-end; }
}
.arrbox { display: grid; gap: 12px; margin-top: 12px; padding: 14px; border-radius: var(--r-md); background: var(--soft); }
.arrline { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-weight: 700; }
.arrtime { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.arrtime .lbl { margin: 0; }
.arrtime .input { width: auto; flex: 0 1 140px; background: #fff; }
.nrow.here { background: var(--soft); }
.herebox { display: grid; gap: 8px; justify-items: start; }
.herebox .until { text-align: left; }

/* ---------- filter bar ---------- */
.fbar { display: grid; gap: 8px; margin-bottom: 8px; }
.fdds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 600px) { .fdds { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1150px) { .fdds { display: flex; flex-wrap: wrap; } .ddb { width: auto; } }
.dd { position: relative; }
.ddb { display: flex; width: 100%; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: #fff; color: var(--ink); font-weight: 600; font-size: .9rem; }
.ddb:hover { background: var(--soft); }
.ddb.on { background: var(--soft); border-color: var(--brand-2); color: var(--brand); }
.ddm { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 210px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-2); }
.ddm[hidden] { display: none; }
.ddb > span { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd:first-child .ddm { min-width: 280px; }
.ddm { max-width: calc(100vw - 32px); }
@media (max-width: 599px) { .dd:nth-child(even) .ddm { left: auto; right: 0; } }
@media (min-width: 600px) { .dd:nth-child(n+3) .ddm { left: auto; right: 0; } }
.ddi { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-weight: 600; text-align: left; }
.ddi:hover { background: var(--soft); }
.ddi.on { color: var(--brand); }
.ddc { margin-top: 6px; padding: 10px 6px 4px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.ddl { margin: 0; font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); padding: 0 4px; }
.ddr { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; font-size: .85rem; color: var(--mut); }
.ddr .input { min-height: 38px; padding: 0 8px; font-size: .85rem; }
.fact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; min-height: 28px; }
.fcount { color: var(--mut); font-weight: 600; font-size: .85rem; }
.fchip { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 8px 0 10px; border: 0; border-radius: var(--pill); background: var(--soft); color: var(--brand); font-weight: 700; font-size: .8rem; }
.fchip:hover { background: var(--line); }
.fclear { margin-left: auto; border: 0; background: transparent; color: var(--brand); font-weight: 700; font-size: .85rem; min-height: 32px; padding: 0 4px; }
@media (min-width: 1150px) { .fbar { grid-template-columns: minmax(200px, 1fr) auto; align-items: center; } }

.dlog { margin-top: 18px; padding: 14px 16px; background: #fff; border: 1px dashed var(--line); border-radius: var(--r-lg); }
.dlog h3 { font-size: .95rem; }
.dlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.dlist li { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.dlist li:first-child { border-top: 0; padding-top: 0; }
.dlist span { font-weight: 600; overflow-wrap: anywhere; }
.dlist small { color: var(--mut); }

.tcardhead { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.tcardhead > div { flex: 1 1 240px; min-width: 0; }
.pwgen { display: flex; gap: 8px; align-items: center; }
.pwgen .input { flex: 1; min-width: 0; }

/* ---------- finances ---------- */
.fin { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .fin { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
.fcard { text-align: left; display: grid; gap: 2px; padding: 16px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-1); color: var(--ink); }
.fcard:hover { border-color: var(--brand-2); }
.fcard[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--sh-1); }
.fcard small { color: var(--mut); font-weight: 700; font-size: .8125rem; }
.fcard b { font-size: 1.9rem; line-height: 1.2; letter-spacing: -.02em; }
.fsub { color: var(--mut); font-size: .8rem; font-weight: 600; }
.fd { margin-top: 4px; font-size: .8rem; font-weight: 800; }
.fd.up { color: var(--ok); } .fd.down { color: var(--err, #d92d20); } .fd.flat { color: var(--mut); }
.fh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.fh small { color: var(--mut); font-weight: 600; }
.fchart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 6px; }
.fcol { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.fbr { width: 100%; max-width: 34px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.fbr i { display: block; width: 100%; min-height: 0; }
.fbr .fc { background: var(--brand); border-radius: 4px 4px 0 0; }
.fbr .fu { background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn); border-radius: 4px 4px 0 0; opacity: .8; }
.fbr .fu + .fc { border-radius: 0; }
.fl { font-size: .68rem; color: var(--mut); font-weight: 700; white-space: nowrap; }
.fcol.now .fl { color: var(--brand); }
.flegend { display: flex; gap: 16px; margin: 10px 0 18px; font-size: .8rem; color: var(--mut); font-weight: 600; }
.flegend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.sw.c { background: var(--brand); } .sw.u { background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn); }
.fstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
@media (min-width: 700px) { .fstats { grid-template-columns: repeat(4, 1fr); } }
.fsplits { display: grid; gap: 18px; }
@media (min-width: 700px) { .fsplits { grid-template-columns: 1fr 1fr; gap: 28px; } }
.fsplit h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); margin-bottom: 8px; }
.frow { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-bottom: 10px; font-weight: 600; }
.ftrack { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.ftrack i { display: block; height: 100%; background: var(--brand-2); border-radius: 3px; }
.fnote { margin-top: 16px; }
