/* ==========================================================================
   STG Portal V3: layout + engine styles on top of the PWA V3 design system (app.css + stg.css).
   Mobile-first. ≥1024px: permanent sidebar, wide tables, centered content column.
   No pink. No wavy/ridge line art.
   ========================================================================== */
:root { --side-w: 264px; --side-mini-w: 72px; --content-max: none; }   /* owner 11/13: pages use the full window width (was 1440px / 1680px mini) */

/* ---------- Signed-out: no chrome ---------- */
body.signed-out #tabbar, body.signed-out #drawer { display: none !important; }

/* ---------- Sidebar / drawer content ---------- */
.side-brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(var(--sat) + 18px) 18px 14px; }
.side-logo { height: 46px; width: auto; }
.side-brand { flex-direction: column; align-items: stretch; }
.side-brand-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-brand-id { min-width: 0; }
.side-env.side-brand-id { display: flex; flex-wrap: wrap; gap: 6px; }
.side-env:empty { display: none; }
.side-logo-dark { display: none; }
:root[data-theme="dark"] .side-logo-light { display: none; }
:root[data-theme="dark"] .side-logo-dark { display: block; }
.side-env .pill { font-size: 10px; }
.side-imp { display: flex; gap: 10px; align-items: center; text-align: left; margin: 4px 12px 8px; padding: 10px 12px; width: calc(100% - 24px);
  border-radius: 14px; background: var(--amber-soft); color: var(--amber); font-size: var(--fs-sm); }
.side-imp small { display: block; opacity: .8; }
.side-nav { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.side-label { margin: 16px 12px 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 650;
  font-size: var(--fs-md); text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.side-link .ico { width: 20px; height: 20px; color: var(--muted); flex: none; }
.side-link span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-link:hover { background: var(--surface-3); color: var(--text); }
.side-link.active { background: var(--teal-soft); color: var(--teal-strong); }
.side-link.active .ico { color: var(--teal-strong); }
.side-foot { margin-top: auto; padding: 10px 10px calc(var(--sab) + 12px); border-top: 1px solid var(--line); }
.side-me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; color: var(--text); text-decoration: none; cursor: pointer; }
.side-me:hover { background: var(--surface-3); }
.side-me .grow { flex: 1; min-width: 0; }
.side-me b, .side-me small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-me small { color: var(--muted); font-size: var(--fs-xs); }
.side-ver { font-size: 11px; color: var(--faint); padding: 6px 10px 0; }
#drawer .drawer-scroll { display: flex; flex-direction: column; min-height: 100%; }
.avatar.av-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar.av-lg { width: 64px; height: 64px; font-size: 22px; }

/* ---------- Desktop shell ---------- */
@media (min-width: 1024px) {
  #tabbar { display: none !important; }
  #app { left: var(--side-w); transition: left .22s cubic-bezier(.2,.8,.2,1); }
  #drawer { position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40; pointer-events: auto; visibility: visible; transition: width .22s cubic-bezier(.2,.8,.2,1); }
  :root.side-mini #app { left: var(--side-mini-w); }
  :root.side-mini #drawer { width: var(--side-mini-w); }
  #drawer .drawer-scrim { display: none; }
  #drawer .drawer-panel { position: absolute; inset: 0; width: 100%; max-width: none; transform: none !important; border-radius: 0;
    box-shadow: none; border-right: 1px solid var(--line); background: var(--surface); }
  [data-drawer] { display: none !important; }
  .page .pg-head .bar-left:empty, .page .bar-left:has(> [data-drawer]:only-child) { min-width: 0; }
  .page-scroll { padding-bottom: 40px !important; }
  /* Content sits right next to the sidebar (left-aligned) and grows with the window up to --content-max. */
  .page-body, .pg-hero { max-width: var(--content-max); margin-left: 0; margin-right: auto; width: 100%; }
  .page-body, .pg-hero { padding-left: 24px; padding-right: 24px; }
  .pg-bar { max-width: var(--content-max); padding-left: 14px; padding-right: 22px; }
  .page.no-tabbar .page-scroll { padding-bottom: 40px; }
}
@media (min-width: 1024px) {
  .page:not(.is-scrolled) .pg-bar .bar-title { opacity: 0; }
}

/* ---------- Sidebar collapse (desktop only) ---------- */
.side-toggle { display: none; }
@media (min-width: 1024px) {
  .side-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 10px;
    color: var(--muted); background: transparent; border: 1px solid transparent; cursor: pointer; transition: background .15s, color .15s; }
  .side-toggle:hover { background: var(--surface-3); color: var(--text); }
  .side-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
  .side-toggle .ico { width: 19px; height: 19px; }
  :root.side-mini .side-brand { flex-direction: column; padding: calc(var(--sat) + 14px) 0 8px; }
  :root.side-mini .side-brand-top { justify-content: center; }
  :root.side-mini .side-brand-id, :root.side-mini .side-imp span, :root.side-mini .side-link span,
  :root.side-mini .side-ext-ic, :root.side-mini .side-me .grow, :root.side-mini .side-me > .ico:last-child, :root.side-mini .side-ver { display: none; }
  :root.side-mini .side-nav { padding: 4px 10px 12px; align-items: stretch; }
  :root.side-mini .side-link { justify-content: center; padding: 11px 0; gap: 0; }
  :root.side-mini .side-link .ico { width: 21px; height: 21px; }
  :root.side-mini .side-label { margin: 12px 14px 8px; height: 1px; padding: 0; font-size: 0; background: var(--line); }
  :root.side-mini .side-imp { justify-content: center; margin: 4px 10px 8px; width: calc(100% - 20px); padding: 10px 0; }
  :root.side-mini .side-foot { padding-left: 0; padding-right: 0; display: flex; justify-content: center; }
  :root.side-mini .side-me { justify-content: center; padding: 6px; }
  /* Hover label for the icon rail */
  .side-tip { position: fixed; z-index: 90; pointer-events: none; padding: 6px 10px; border-radius: 9px; background: var(--navy, #1B2159); color: #fff;
    font-size: 12.5px; font-weight: 700; white-space: nowrap; box-shadow: var(--shadow-2); opacity: 0; transform: translateX(-4px); transition: opacity .12s, transform .12s; }
  .side-tip.show { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { #app, #drawer { transition: none !important; } }

/* ---------- Header action buttons ---------- */
.bar-actions { display: inline-flex; gap: 6px; align-items: center; }
.bar-actions .btn-sm { height: 34px; padding: 0 12px; border-radius: 11px; }
@media (max-width: 420px) { .bar-actions .btn-sm span { display: none; } .bar-actions .btn-sm { width: 38px; padding: 0; justify-content: center; } }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--sat) + 28px) 20px calc(var(--sab) + 24px);
  background: radial-gradient(1200px 600px at 10% -10%, var(--teal-soft), transparent 60%), radial-gradient(900px 500px at 110% 110%, var(--violet-soft), transparent 60%), var(--paper); overflow-y: auto; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 30px 26px 22px; box-shadow: var(--shadow-2); }
.auth-logo { height: 70px; width: auto; margin: 0 auto 14px; }
.auth-logo-dark { display: none; }
:root[data-theme="dark"] .auth-logo-light { display: none; }
:root[data-theme="dark"] .auth-logo-dark { display: block; }
.auth-title { text-align: center; font-size: 30px; margin: 0 0 6px; }
.auth-sub { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: var(--fs-sm); }
.auth-err { color: var(--coral-strong); background: var(--coral-soft); border-radius: 12px; padding: 10px 12px; font-size: var(--fs-sm); font-weight: 600; margin: 0 0 12px; }
.auth-forgot { display: block; margin: 14px auto 0; }
.auth-env { margin-top: 18px; text-align: center; font-size: var(--fs-xs); color: var(--muted); display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.auth-foot { margin-top: 18px; font-size: var(--fs-xs); color: var(--faint); }

/* ---------- Home ---------- */
.hm { padding-top: calc(var(--sat) + 8px); }
.hm-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 22px; border-radius: var(--r-hero);
  background: var(--grad-brand); color: #fff; box-shadow: 0 18px 40px -22px rgba(39, 80, 140, .55); margin-top: 6px; }
.hm-date { margin: 0 0 4px; font-size: var(--fs-sm); opacity: .85; font-weight: 600; }
.hm-hello { margin: 0; color: #fff; font-size: clamp(26px, 6vw, 36px); line-height: 1.1; }
.hm-role { margin: 6px 0 0; opacity: .85; font-size: var(--fs-sm); }
.hm-hero .avatar { box-shadow: 0 0 0 3px rgba(255,255,255,.55); flex: none; }
.hm-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
@media (min-width: 900px) { .hm-tiles { grid-template-columns: repeat(4, 1fr); } }
.hm-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.hm-tile:hover { box-shadow: var(--shadow-1); transform: translateY(-1px); }
.hm-tile b { font-size: var(--fs-md); }
.hm-tile small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.hm-tile-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 6px; background: var(--teal-soft); color: var(--teal-strong); }
.hm-tile.violet .hm-tile-ic { background: var(--violet-soft); color: var(--violet); }
.hm-tile.gold .hm-tile-ic { background: var(--gold-soft); color: var(--amber); }
.hm-tile.ink .hm-tile-ic { background: var(--ink); color: #fff; }
:root[data-theme="dark"] .hm-tile.ink .hm-tile-ic { background: var(--violet); }

/* ---------- Module grid ---------- */
.mod-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .mod-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .mod-grid { grid-template-columns: repeat(3, 1fr); } }
.mod-sec + .mod-sec { margin-top: 22px; }
.mod-sec:first-child .section-head { margin-top: 0; }
.mod-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.mod-card:hover { box-shadow: var(--shadow-1); transform: translateY(-1px); }
.mod-card-main { flex: 1; min-width: 0; }
.mod-card-main b, .mod-card-main small { display: block; }
.mod-card-main small { color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; line-height: 1.35; }
.mod-card .chev { color: var(--faint); width: 18px; height: 18px; }

/* ---------- Browse ---------- */
.br-search { margin-bottom: 8px; }

/* ---------- Data list ---------- */
.dl-tools { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; z-index: 2; padding: 6px 0 10px; background: var(--paper); }
@media (min-width: 900px) { .dl-tools { flex-direction: row; align-items: center; } .dl-tools .search-bar { flex: 0 1 380px; } }
.dl-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.dl-chips::-webkit-scrollbar { display: none; }
.dl-chips .chip { white-space: nowrap; gap: 4px; }
.dl-count { font-size: var(--fs-xs); margin: 0 4px 8px; min-height: 1em; }
.dl-thumb { width: 44px; height: 44px; border-radius: 11px; overflow: hidden; flex: none; background: var(--surface-3); }
.dl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dl-badge { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-more { display: flex; justify-content: center; margin: 16px 0; }
.dl-add .ico { width: 18px; height: 18px; }

/* wide table */
.dt-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-group); overflow: auto; }
.dt { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.dt th { position: sticky; top: 0; background: var(--surface-2, var(--surface)); text-align: left; font-weight: 750; color: var(--muted); font-size: 12px;
  letter-spacing: .02em; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
.dt th .ico { display: inline-block; vertical-align: -2px; margin-left: 4px; }
.dt th.on { color: var(--teal-strong); }
.dt td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt tbody tr { cursor: pointer; transition: background .12s; }
.dt tbody tr:hover { background: var(--teal-soft); }
.dt tbody tr:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.dt tbody tr:last-child td { border-bottom: 0; }
.dt .num { text-align: right; font-variant-numeric: tabular-nums; }
.dt-img img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.dt-yes { color: var(--green); }

/* filter sheet */
.fl-opts { max-height: 52vh; overflow-y: auto; margin-top: 10px; }
.fl-none { padding: 14px 6px; }
.action-item.on { color: var(--teal-strong); font-weight: 750; }
.fl-date .field { margin-bottom: 10px; }

/* ---------- Record ---------- */
.rec-card { padding: 4px 18px; }
.rec-kv { margin: 0; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .rec-kv { grid-template-columns: 1fr 1fr; column-gap: 28px; } .rec-item.wide { grid-column: 1 / -1; } }
.rec-item { padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.rec-item:last-child { border-bottom: 0; }
@media (min-width: 900px) { .rec-kv .rec-item:nth-last-child(2):not(.wide) { border-bottom: 0; } }
.rec-item dt { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); margin-bottom: 4px; text-transform: none; }
.rec-item dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.fv-img img { max-width: 260px; max-height: 200px; border-radius: 12px; border: 1px solid var(--line); }
.fv-file { display: inline-flex; gap: 8px; align-items: center; font-weight: 650; }
.fv-pre { white-space: pre-wrap; font-weight: 500; }
.fv-html { font-weight: 450; }
.fv-color { display: inline-flex; gap: 8px; align-items: center; }
.fv-color i { width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--line); }
.rec-danger { margin: 28px 0 10px; display: flex; justify-content: flex-end; }

/* ---------- Edit form ---------- */
.fe-card { padding: 16px 16px 4px; }
@media (min-width: 900px) { .fe-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; } .fe-card > .fe-field:has(textarea), .fe-card > .fe-field:has(.fe-rte), .fe-card > .fe-switch-row { grid-column: auto; } .fe-card > .fe-field:has(.fe-rte), .fe-card > .fe-field:has(textarea) { grid-column: 1 / -1; } }
.fe-field .req { color: var(--coral-strong); font-style: normal; margin-left: 3px; }
.fe-field.has-err .input, .fe-field.has-err .select, .fe-field.has-err .textarea { border-color: var(--coral-strong); box-shadow: 0 0 0 4px var(--coral-soft); }
.field-err { display: block; color: var(--coral-strong); font-size: var(--fs-xs); font-weight: 650; margin: 6px 4px 0; }
.fe-readonly { color: var(--muted); background: var(--surface-3); display: flex; align-items: center; }
.fe-lookup { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; width: 100%; }
.fe-lookup .ico { color: var(--faint); flex: none; }
.fe-lookup-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px 14px; font-weight: 650; }
.fe-multi { display: flex; flex-wrap: wrap; gap: 8px; }
.fe-multi .chip { cursor: pointer; }
.fe-rte { border: 1.5px solid var(--line-2); border-radius: var(--r-input); overflow: hidden; background: var(--surface); }
.fe-rte-bar { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-3); }
.fe-rte-bar button { width: 34px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); }
.fe-rte-bar button:hover { background: var(--surface); }
.fe-rte-body { min-height: 140px; padding: 12px 14px; outline: none; }
.fe-file { display: flex; flex-direction: column; gap: 6px; }
.fe-color { height: 46px; padding: 6px; }
.fe-bar { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 0 calc(var(--sab) + 14px); margin-top: 18px;
  background: linear-gradient(to top, var(--paper) 70%, transparent); z-index: 3; }
@media (max-width: 600px) { .fe-bar .btn { flex: 1; } }

/* ---------- More / account ---------- */
.mo-me { display: flex; align-items: center; gap: 14px; }
.mo-me b, .mo-me small { display: block; }
.mo-me small { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.mo-info { padding: 0; }
.mo-info > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mo-info > div:last-child { border-bottom: 0; }
.mo-info span { color: var(--muted); font-size: var(--fs-sm); }
.mo-info b { text-align: right; overflow-wrap: anywhere; }
.mo-hint { margin: 8px 2px 0; }
.mo-pw .field { margin-bottom: 12px; }
.mo-show { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); margin: 0 0 12px; cursor: pointer; }
.mo-err { margin: 0 0 12px; color: #E11D48; font-size: var(--fs-sm); font-weight: 600; }
.mo-imp { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); color: var(--muted); }
.mo-imp .ico { flex: none; margin-top: 2px; }
.mo-ver { text-align: center; color: var(--faint); font-size: var(--fs-xs); margin: 26px 0 10px; line-height: 1.6; }

/* small utils */
.mt-2 { margin-top: 10px; } .mb-2 { margin-bottom: 10px; }
.grow { flex: 1; min-width: 0; }

/* ---------- Signed-out / login page: full-bleed, no header ---------- */
body.signed-out #app { left: 0 !important; }
.page[data-route="login"] .pg-head { display: none; }
.page[data-route="login"] .page-bare { overflow-y: auto; }
.page[data-route="login"] .auth-wrap { flex: 1; min-height: 100%; }

/* ---------- Upload widget ---------- */
.fe-file { display: flex; flex-direction: column; gap: 10px; }
.fe-file-prev img { max-width: 220px; max-height: 160px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; }
.fe-file-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.fe-up { cursor: pointer; }
.fe-file.busy { opacity: .6; pointer-events: none; }
.mod-note { margin: 10px 4px 0; }
/* Owner 11/13: grouped Browse sections + the note under eVouchers */
.br-sub { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #64748b); margin: 14px 4px 6px; }
.br-grp:first-of-type .br-sub { margin-top: 2px; }
.grp-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: rgba(30, 58, 138, .07); color: var(--navy, #1e3a8a); font-size: 13px; line-height: 1.4; }
.grp-note .ico-sm { flex: none; margin-top: 2px; }
.side-ext .side-ext-ic { width: 14px; height: 14px; color: var(--faint); margin-left: auto; }
.side-env { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; } .side-lock { display: inline-flex; align-items: center; gap: 3px; }
.dev-lock-note { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; } .dev-lock-note .ico { flex: none; margin-top: 2px; color: var(--coral); }

/* ---------------- Maintenance (js/core/maintenance.js, Settings > Maintenance) ---------------- */
#maint { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 80% at 50% 0%, #2E3A8C 0%, #1B2159 55%, #10143A 100%); overflow-y: auto; }
body.maint-on { overflow: hidden; }
.mt-card { width: min(440px, 100%); background: var(--surface); color: var(--ink); border-radius: 22px; padding: 30px 24px 20px;
  text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); display: flex; flex-direction: column; align-items: center; gap: 10px; }
#maint .mt-logo { width: 180px; max-width: 70%; height: auto; margin-bottom: 4px; }
:root[data-theme="dark"] .mt-logo { background: #fff; border-radius: 12px; padding: 8px 12px; }
.mt-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--amber); }
:root[data-theme="dark"] .mt-ic { color: var(--gold); }
.mt-ic .ico { width: 26px; height: 26px; }
.mt-card h1 { font-size: 1.5rem; margin: 2px 0 0; }
.mt-msg { margin: 0; white-space: pre-line; color: var(--muted); line-height: 1.5; }
.mt-until { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); }
.mt-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.mt-foot { color: var(--muted); margin-top: 10px; font-size: .72rem; }
#maint-banner { position: fixed; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); z-index: 70; display: inline-flex; align-items: center; gap: 7px;
  max-width: calc(100vw - 24px); padding: 8px 14px; border-radius: 999px; background: var(--gold); color: #1B2159; font-size: var(--fs-sm); font-weight: 700;
  text-decoration: none; box-shadow: 0 8px 22px rgba(16, 20, 58, .28); }
#maint-banner .ico { flex: none; }
@media (min-width: 1024px) { #maint-banner { bottom: 18px; right: 18px; } }

/* Settings > Maintenance cards */
.mt-set { display: grid; gap: 12px; }
@media (min-width: 900px) { .mt-set { grid-template-columns: 1fr 1fr; } }
.mt-set .card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.mt-set .card.is-on { box-shadow: inset 4px 0 0 var(--gold), var(--shadow-1, 0 1px 3px rgba(0,0,0,.08)); }
.mt-set-top { display: flex; align-items: center; gap: 12px; }
.mt-set-top .st-ic { flex: none; }
.mt-set-top .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mt-set-top small { color: var(--muted); }
.mt-set-msg { white-space: pre-line; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: var(--fs-sm); }
.mt-set-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-sm); color: var(--muted); }
.mt-set-meta span { display: inline-flex; align-items: center; gap: 5px; }
.mt-form .field { margin-bottom: 14px; }
.mt-form textarea { min-height: 96px; }
.mt-count { float: right; color: var(--muted); font-weight: 600; font-size: .75rem; }
.mt-set .btn { align-self: flex-start; }

/* Dark mode: --ink turns near-white, so every "white text on --ink" badge, header and chip went white-on-white
   (calendar date badges first, owner 11/11). Give them a solid navy surface in dark mode instead. */
:root[data-theme="dark"] :is(.hx-badge small, .mt-card:not(.is-past) .mt-date, .hx-day.today .hx-dn, .hx-ql, .btn-ink,
  .sh-count, .gy-count, .ss-count, .gy-table th, .ss-table th, .ck-grid thead th, .pol-admin-strip > span:first-child,
  .acs-av, .acs-tf, .sc-typebtn.on, .fb-field.is-section .fb-f-ic, .fb-type.is-section .fb-f-ic, .mt-logo.is-mono,
  .tx-fr-pill, .bk-num, .fx-choice input:checked + span) { background: #3A46A8; border-color: #3A46A8; color: #fff; }
:root[data-theme="dark"] .bk-g.on .bk-ck { background: #3A46A8; border-color: #3A46A8; }
:root[data-theme="dark"] .hx-badge { background: var(--surface-3); }

/* Photo-card view for data pages with display.view 'cards' (BOOST Board, owner 11/11) + the Cards / List switch */
.dl-view { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-3); margin: 4px 0 8px; }
.dl-view .seg-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 700; font-size: var(--fs-sm); padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.dl-view .seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1, 0 1px 3px rgba(0,0,0,.12)); }
.dl-pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); grid-auto-rows: 1fr; gap: 12px; }   /* every card the same size */
.dl-pcard { margin: 0; padding: 14px 12px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; color: var(--text); text-decoration: none; }
.dl-pcard-img { position: relative; width: 112px; height: 112px; border-radius: 50%; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; margin-bottom: 8px; color: var(--muted); }
.dl-pcard-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dl-pcard-img .ico { width: 34px; height: 34px; }
.dl-pcard-title { font-size: var(--fs-md); max-width: 100%; }
.dl-pcard-sub { color: var(--text-2); font-weight: 700; max-width: 100%; }
.dl-pcard-extra { color: var(--muted); font-size: var(--fs-xs); max-width: 100%; }
.dl-pcards > .dl-pcard { margin: 0; height: 100%; justify-content: flex-start; }   /* app.css '.card + .card' margin made card 1 taller (owner 11/11) */
/* Owner 11/14: URL fields with an Upload File button (Meets Sessions / General Info Link) */
.fe-urlup { display: flex; flex-direction: column; gap: 8px; }
.fe-urlup-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.fe-urlup-btn.busy { opacity: .6; pointer-events: none; }

/* Owner 11/16: cards in any grid are the same size. The global '.card + .card' gap (meant for stacked cards) pushed every
   grid card but the first down and made the first one taller (News, Settings, …). Grids space with gap instead. */
:is(.aa-grid, .ab-av, .ab-gyms, .ab-hero-ic, .ab-tic, .ab-tick, .ab-types, .ab-when, .ac-foot2, .ac-stats, .ac-when, .acs-av, .acs-ic, .acs-init, .acs-pay-ic, .acs-prow, .acs-sum, .acs-tr, .au-row, .au-tiles, .avatar, .ax-actions, .ax-check, .ax-kv, .ax-pc-grid, .ax-profile, .ax-sent-ic, .ax-ugrid, .bb-row, .bk-gs, .bk-modes, .bk-sum, .bs-fr, .bs-legs, .bs-split, .ck-fcard, .ck-metrics, .ct-feeds, .ct-noimg, .cv-time, .dc-ic, .dc-list, .dl-pcard-img, .dl-pcards, .ev-hero-parts, .ev-mail-dl, .ev-mailrow, .ev-pdf, .ev-receipts, .ev-stats, .fa-ic, .fa-row, .fa-tools, .fb-box, .fb-f-ic, .fb-grid, .fb-icon, .fb-icons, .fb-map, .fb-seg, .fb-tabs, .fb-types, .fe-card, .fi-tabs, .fi-view, .field-row, .fm-acts, .fm-cols, .fm-done-ico, .fm-glist, .fm-head, .fm-ico, .fm-kids, .fm-tile-ic, .fm-tiles, .fr-ic, .fs-facts, .fs-status, .fx-thumb, .gy-facts, .gy-grid, .gy-photo, .gy-stats, .hf-main, .hf-tile-ic, .hf-tiles, .hm-pol-ic, .hm-tile-ic, .hm-tiles, .hr-tabs, .hx-bar-row, .hx-dow, .hx-feed, .hx-fin, .hx-grid, .hx-month, .hx-progs, .hx-tr-stats, .hx-week, .icon-btn, .kv, .mod-grid, .ms-meets, .ms-summary, .mt-fees, .mt-grid, .mt-ic, .mt-logo, .mt-set, .mt-stats, .mtk-grid, .mx-chip-i, .mx-chips, .mx-empty-art, .mx-filter-btn, .mx-glyph, .mx-grid, .mx-guard-i, .mx-heat, .mx-hist, .mx-kpis, .mx-legend, .mx-peak-i, .mx-rank, .mx-split-leg, .mx-ti, .mx-tr, .mx-trio, .pb-ic, .pd-mark, .pol-bar, .pol-card-ic, .pol-cmp-pick, .pol-due-ic, .pol-file-ic, .pol-kpis, .pol-rep-kpis, .pol-ring, .ra-grid, .rc-foot, .rc-ico, .rc-list, .rc-row3, .rc-stats, .rec-kv, .rn-bar, .rn-ch, .rn-dep, .rn-exc, .rn-grid, .rn-hist, .rn-line, .row-icon, .rq-alerts, .rq-facts, .rq-form, .rq-ic, .rq-modes, .rq-seg, .rq-segs, .rv-choices, .rv-date, .rv-items, .rv-stats, .sc-avatar, .sc-class-head, .sc-classes, .sc-closure-ic, .sc-imp-tiles, .sc-mnum, .sc-month-dow, .sc-month-grid, .sc-people, .sc-tb-coach, .sc-tl-axis, .sc-tl-lane, .sc-tpl-day, .sc-typegrid, .sc-wg, .sc-wg-row, .sc-wk-grid, .segmented, .sh-act-ic, .sh-actions, .sh-cols, .sh-desk, .sh-hero-ico, .sh-lgrid, .ss-bests, .ss-evs, .ss-grid, .ss-photo, .st-ic, .st-tabs, .tb-head, .tb-row, .tiles, .tk-check, .tk-facts, .tk-groups, .tk-stats, .tr-cards, .tr-daylist, .tr-logo, .tvm-add-ic, .tvm-grid, .tvm-pos, .tvm-screen, .tvm-slides, .tvm-sum-ic, .tvm-thumb, .tx-fee-head, .tx-fee-row, .tx-grid, .tx-ra, .tx-ra-head) > .card + .card, :is(.aa-grid, .ab-av, .ab-gyms, .ab-hero-ic, .ab-tic, .ab-tick, .ab-types, .ab-when, .ac-foot2, .ac-stats, .ac-when, .acs-av, .acs-ic, .acs-init, .acs-pay-ic, .acs-prow, .acs-sum, .acs-tr, .au-row, .au-tiles, .avatar, .ax-actions, .ax-check, .ax-kv, .ax-pc-grid, .ax-profile, .ax-sent-ic, .ax-ugrid, .bb-row, .bk-gs, .bk-modes, .bk-sum, .bs-fr, .bs-legs, .bs-split, .ck-fcard, .ck-metrics, .ct-feeds, .ct-noimg, .cv-time, .dc-ic, .dc-list, .dl-pcard-img, .dl-pcards, .ev-hero-parts, .ev-mail-dl, .ev-mailrow, .ev-pdf, .ev-receipts, .ev-stats, .fa-ic, .fa-row, .fa-tools, .fb-box, .fb-f-ic, .fb-grid, .fb-icon, .fb-icons, .fb-map, .fb-seg, .fb-tabs, .fb-types, .fe-card, .fi-tabs, .fi-view, .field-row, .fm-acts, .fm-cols, .fm-done-ico, .fm-glist, .fm-head, .fm-ico, .fm-kids, .fm-tile-ic, .fm-tiles, .fr-ic, .fs-facts, .fs-status, .fx-thumb, .gy-facts, .gy-grid, .gy-photo, .gy-stats, .hf-main, .hf-tile-ic, .hf-tiles, .hm-pol-ic, .hm-tile-ic, .hm-tiles, .hr-tabs, .hx-bar-row, .hx-dow, .hx-feed, .hx-fin, .hx-grid, .hx-month, .hx-progs, .hx-tr-stats, .hx-week, .icon-btn, .kv, .mod-grid, .ms-meets, .ms-summary, .mt-fees, .mt-grid, .mt-ic, .mt-logo, .mt-set, .mt-stats, .mtk-grid, .mx-chip-i, .mx-chips, .mx-empty-art, .mx-filter-btn, .mx-glyph, .mx-grid, .mx-guard-i, .mx-heat, .mx-hist, .mx-kpis, .mx-legend, .mx-peak-i, .mx-rank, .mx-split-leg, .mx-ti, .mx-tr, .mx-trio, .pb-ic, .pd-mark, .pol-bar, .pol-card-ic, .pol-cmp-pick, .pol-due-ic, .pol-file-ic, .pol-kpis, .pol-rep-kpis, .pol-ring, .ra-grid, .rc-foot, .rc-ico, .rc-list, .rc-row3, .rc-stats, .rec-kv, .rn-bar, .rn-ch, .rn-dep, .rn-exc, .rn-grid, .rn-hist, .rn-line, .row-icon, .rq-alerts, .rq-facts, .rq-form, .rq-ic, .rq-modes, .rq-seg, .rq-segs, .rv-choices, .rv-date, .rv-items, .rv-stats, .sc-avatar, .sc-class-head, .sc-classes, .sc-closure-ic, .sc-imp-tiles, .sc-mnum, .sc-month-dow, .sc-month-grid, .sc-people, .sc-tb-coach, .sc-tl-axis, .sc-tl-lane, .sc-tpl-day, .sc-typegrid, .sc-wg, .sc-wg-row, .sc-wk-grid, .segmented, .sh-act-ic, .sh-actions, .sh-cols, .sh-desk, .sh-hero-ico, .sh-lgrid, .ss-bests, .ss-evs, .ss-grid, .ss-photo, .st-ic, .st-tabs, .tb-head, .tb-row, .tiles, .tk-check, .tk-facts, .tk-groups, .tk-stats, .tr-cards, .tr-daylist, .tr-logo, .tvm-add-ic, .tvm-grid, .tvm-pos, .tvm-screen, .tvm-slides, .tvm-sum-ic, .tvm-thumb, .tx-fee-head, .tx-fee-row, .tx-grid, .tx-ra, .tx-ra-head) > * + .card { margin-top: 0; }
.hx-feed, .mt-set { grid-auto-rows: 1fr; }   /* owner 11/16: every News / Settings card the same height */
