/* ============================================================
   KreweHub — "Regalia" design system
   Boutique Mardi Gras: deep aubergine, one antique gold accent,
   warm ivory paper. Fraunces + DM Sans. Depth on every surface.
   ============================================================ */

:root {
  /* Anchor — deep desaturated aubergine */
  --ink:        #1A1222;
  --plum:       #241634;
  --plum-2:     #2F1F44;
  --plum-line:  #3D2B54;

  /* Warm neutrals */
  --cream:      #F5EDDE;
  --ivory:      #F8F2E7;
  --sand:       #E7DAC2;
  --taupe:      #B8A789;

  /* THE accent — antique gold (only metallic) */
  --gold:       #C49B54;
  --gold-dk:    #A9823F;
  --gold-soft:  rgba(196,155,84,.14);
  --gold-glow:  rgba(196,155,84,.40);

  /* Text */
  --text:       #2A2032;
  --text-soft:  #675F58;
  --text-dim:   #998AA0;

  /* Status — functional only, never decoration */
  --paid:       #6E8A5E;
  --paid-bg:    rgba(110,138,94,.16);
  --due:        #B5703A;
  --due-bg:     rgba(181,112,58,.16);
  --past:       #8E3B3F;
  --past-bg:    rgba(142,59,63,.16);

  /* Type */
  --font-head:  'Fraunces', Georgia, serif;
  --font-body:  'DM Sans', system-ui, -apple-system, sans-serif;

  /* Geometry */
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 22px;
  --r-xl: 30px;

  /* Shadows — warm, soft, layered */
  --sh-1: 0 1px 2px rgba(26,18,34,.06), 0 2px 8px rgba(26,18,34,.05);
  --sh-2: 0 4px 14px -6px rgba(26,18,34,.18), 0 12px 32px -14px rgba(26,18,34,.22);
  --sh-3: 0 18px 50px -18px rgba(26,18,34,.45);
  --sh-gold: 0 8px 24px -10px var(--gold-glow);

  --container: 1180px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.62;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--gold-soft); }

/* ---------- Depth helpers (never a flat dark fill) ---------- */
.bg-dark {
  background:
    radial-gradient(120% 78% at 50% -8%, rgba(196,155,84,.12), transparent 58%),
    radial-gradient(120% 120% at 50% 0%, #301D45 0%, var(--ink) 56%);
  color: var(--ivory);
  position: relative;
}
.grain { position: relative; }
.grain::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: .5; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg-dark > * { position: relative; z-index: 1; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.08;
  letter-spacing: -.015em; color: var(--text); font-optical-sizing: auto; }
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4,
.card-dark h1, .card-dark h2, .card-dark h3, .card-dark h4 { color: var(--ivory); }
h1 { font-size: clamp(2.5rem, 6vw, 4.3rem); line-height: 1.02; letter-spacing: -.022em; }
h2 { font-size: clamp(1.85rem, 4vw, 2.85rem); }
h3 { font-size: 1.4rem; letter-spacing: -.01em; }
h4 { font-size: 1.12rem; font-weight: 600; }
p { color: inherit; }

.eyebrow {
  font-family: var(--font-body); font-weight: 600; font-size: .76rem;
  text-transform: uppercase; letter-spacing: .2em; color: var(--gold);
  display: inline-flex; align-items: center; gap: .6rem;
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft);
}
.lead { font-size: clamp(1.08rem, 1.6vw, 1.28rem); line-height: 1.6; color: var(--text-soft); }
.bg-dark .lead, .card-dark .lead { color: rgba(248,242,231,.9); }
.serif { font-family: var(--font-head); }
.italic { font-style: italic; }
.muted { color: var(--text-soft); }
.bg-dark .muted, .card-dark .muted { color: rgba(248,242,231,.72); }
.gold { color: var(--gold); }

/* ---------- Wordmark + crown ---------- */
.wordmark { font-family: var(--font-head); font-weight: 600; font-size: 1.32rem;
  letter-spacing: -.02em; color: var(--ink); display: inline-flex; align-items: center; gap: 0; }
.wordmark .crown { margin-right: .42rem; }
.bg-dark .wordmark, .wordmark.on-dark { color: var(--ivory); }
.wordmark b { color: var(--gold); font-weight: 600; }   /* "Hub" — same word, gold only */
.crown { width: 1.5em; height: 1.5em; color: var(--gold); flex: none; }

/* ---------- Buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: .55rem; padding: .92rem 1.5rem; border-radius: 999px; font-weight: 600;
  font-size: .98rem; letter-spacing: .06em; text-transform: uppercase; transition: transform .25s var(--ease),
  box-shadow .25s var(--ease), background .25s var(--ease); min-height: 52px;
  overflow: hidden; white-space: nowrap; }
.btn:active { transform: translateY(1px); }

.btn-gold { color: #2A1B07;
  background: linear-gradient(176deg, #DCB66E 0%, var(--gold) 52%, #B98F47 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1px 0 rgba(120,86,28,.4),
    var(--sh-gold); }
.btn-gold:hover { transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 12px 30px -10px var(--gold-glow); }
.btn-gold::after { content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-18deg); transition: left .6s var(--ease); }
.btn-gold:hover::after { left: 130%; }

.btn-ghost { color: var(--ivory); border: 1px solid rgba(248,242,231,.28);
  background: rgba(248,242,231,.03); backdrop-filter: blur(4px); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-dark { background: var(--ink); color: var(--ivory); box-shadow: var(--sh-2); }
.btn-dark:hover { transform: translateY(-2px); background: #221634; }
.btn-quiet { padding: .5rem .2rem; min-height: 0; color: var(--text-soft); font-weight: 600; }
.btn-quiet:hover { color: var(--gold); }
.btn-sm { padding: .6rem 1.05rem; min-height: 42px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Layout primitives ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.2rem, 4vw, 2.5rem); }
.section { padding-block: clamp(3.5rem, 9vw, 7rem); }
.stack > * + * { margin-top: 1.1rem; }
.stack-sm > * + * { margin-top: .55rem; }
.row { display: flex; gap: 1rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { text-align: center; }
.grid { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.divider { height: 1px; background: var(--plum-line); border: 0; opacity: .5; }
.divider.light { background: rgba(42,32,50,.1); }

/* ---------- Cards ---------- */
.card { background: var(--ivory); border: 1px solid rgba(42,32,50,.07);
  border-radius: var(--r-lg); padding: clamp(1.3rem, 2.5vw, 1.9rem); box-shadow: var(--sh-1);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.card.lift:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.card-dark { background: linear-gradient(168deg, var(--plum-2), var(--plum));
  border: 1px solid var(--plum-line); border-radius: var(--r-lg); color: var(--ivory);
  padding: clamp(1.3rem, 2.5vw, 1.9rem); box-shadow: var(--sh-3); }
.card-pad-lg { padding: clamp(1.6rem, 3vw, 2.6rem); }

/* ---------- Float visual slot (member "Your float" card) ---------- */
/* Photo when one exists (set --float-photo), crest fallback underneath when it doesn't. */
.float-card { --fpad: clamp(1.6rem, 3vw, 2.6rem); position: relative; overflow: hidden;
  padding: var(--fpad); }
.float-visual { position: relative; height: 200px; overflow: hidden;
  margin: calc(-1 * var(--fpad)) calc(-1 * var(--fpad)) 1.4rem; }
.float-visual::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .85; }
/* fallback crest layer */
.float-crest { position: absolute; inset: 0;
  background:
    radial-gradient(70% 120% at 50% 0%, rgba(196,155,84,.28), transparent 60%),
    linear-gradient(168deg, var(--plum-2), #1d1230); }
.float-crest svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* photo layer, only painted when --float-photo is provided */
.float-photo { position: absolute; inset: 0; background-size: cover; background-position: center;
  background-image: var(--float-photo, none); }
.float-photo::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,11,34,.05) 0%, transparent 32%, rgba(18,11,34,.55) 100%); }
.float-card:not([style*="--float-photo"]) .float-photo:not(.float-photo-demo),
.float-card[style*="--float-photo: none"] .float-photo:not(.float-photo-demo) { display: none; }
.float-chip { position: absolute; left: 16px; bottom: 16px; z-index: 2;
  font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); background: linear-gradient(176deg, #DCB66E, var(--gold));
  padding: .34rem .72rem; border-radius: 999px; box-shadow: 0 6px 16px -8px rgba(0,0,0,.6); }
/* demo stand-in "photo" for the sample krewe until a real upload replaces --float-photo */
.float-photo.float-photo-demo { background-image:
    radial-gradient(60% 80% at 24% 78%, rgba(231,182,110,.55), transparent 60%),
    radial-gradient(45% 70% at 70% 60%, rgba(196,155,84,.42), transparent 62%),
    radial-gradient(circle at 20% 74%, rgba(255,224,160,.9) 0 1.4px, transparent 2px),
    radial-gradient(circle at 34% 66%, rgba(255,224,160,.8) 0 1.2px, transparent 2px),
    radial-gradient(circle at 52% 78%, rgba(255,224,160,.85) 0 1.6px, transparent 2px),
    radial-gradient(circle at 66% 70%, rgba(255,224,160,.7) 0 1.2px, transparent 2px),
    radial-gradient(circle at 80% 76%, rgba(255,224,160,.8) 0 1.4px, transparent 2px),
    radial-gradient(120% 140% at 50% 120%, #3a2450 0%, #1b1130 55%, #120b22 100%); }

/* hairline gold top accent for featured cards */
.card-feature { position: relative; overflow: hidden; }
.card-feature::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .8; }

/* ---------- Badges / pills ---------- */
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .75rem;
  border-radius: 999px; font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  background: var(--gold-soft); color: var(--gold-dk); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-paid { background: var(--paid-bg); color: var(--paid); }
.pill-due  { background: var(--due-bg);  color: var(--due); }
.pill-past { background: var(--past); color: var(--ivory); }
.pill-ghost { background: transparent; border: 1px solid var(--plum-line); color: var(--taupe); }

/* ---------- Stat / KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: .25rem; }
.kpi .num { font-family: var(--font-head); font-size: clamp(1.9rem, 3vw, 2.6rem);
  font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.kpi .lbl { font-size: .82rem; color: var(--text-soft); letter-spacing: .04em; }
.bg-dark .kpi .lbl, .card-dark .kpi .lbl { color: rgba(248,242,231,.6); }

/* ---------- Fields ---------- */
.field { display: block; }
.field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--text-soft);
  margin-bottom: .4rem; letter-spacing: .02em; }
.input { width: 100%; padding: .85rem 1rem; border-radius: var(--r-sm);
  border: 1px solid rgba(42,32,50,.16); background: #fff; transition: border .2s, box-shadow .2s;
  min-height: 50px; }
.input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.bg-dark .input { background: rgba(248,242,231,.06); border-color: var(--plum-line); color: var(--ivory); }

/* ---------- App shell (portals) ---------- */
.app { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 1.4rem 1.1rem; gap: .3rem; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 0; padding: .4rem .6rem 1.2rem; }
.sidebar .brand .crown { margin-right: .42rem; }
.nav-group-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--taupe); padding: 1rem .85rem .35rem; }
.nav-item { display: flex; align-items: center; gap: .8rem; padding: .78rem .85rem;
  border-radius: var(--r-sm); color: rgba(248,242,231,.74); font-weight: 500; font-size: .96rem;
  transition: background .2s, color .2s; cursor: pointer; }
.nav-item svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(248,242,231,.06); color: var(--ivory); }
.nav-item.active { background: rgba(196,155,84,.14); color: var(--ivory); }
.nav-item.active svg { color: var(--gold); opacity: 1; }
.nav-item .badge { margin-left: auto; background: var(--gold); color: var(--ink);
  font-size: .7rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; }
.sidebar .foot { margin-top: auto; padding-top: 1rem; }
.userchip { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: var(--r);
  background: rgba(248,242,231,.05); border: 1px solid var(--plum-line); }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 600; color: var(--ink);
  background: linear-gradient(168deg, #DCB66E, var(--gold)); }

.main { background: var(--cream); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
  padding: 1rem clamp(1.2rem, 3vw, 2.2rem); background: rgba(245,237,222,.82);
  backdrop-filter: blur(12px); border-bottom: 1px solid rgba(42,32,50,.08); }
.topbar h1 { font-size: 1.5rem; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: var(--r-sm);
  align-items: center; justify-content: center; border: 1px solid rgba(42,32,50,.14); }
.content { padding: clamp(1.4rem, 3vw, 2.4rem); max-width: 1120px; }

.section-pane { display: none; }
.section-pane.active { display: block; animation: fade .4s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Tables ---------- */
.table-wrap { background: var(--ivory); border: 1px solid rgba(42,32,50,.08); border-radius: var(--r-lg);
  overflow-x: auto; -webkit-overflow-scrolling: touch; box-shadow: var(--sh-1); }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-soft); font-weight: 700; padding: .9rem 1.1rem; background: rgba(42,32,50,.03);
  border-bottom: 1px solid rgba(42,32,50,.08); }
.table td { padding: .95rem 1.1rem; border-bottom: 1px solid rgba(42,32,50,.06); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(196,155,84,.05); }
.cell-name { display: flex; align-items: center; gap: .7rem; font-weight: 600; }
.cell-name .avatar { width: 32px; height: 32px; font-size: .8rem; }

/* ---------- Progress ---------- */
.bar { height: 9px; border-radius: 999px; background: rgba(42,32,50,.1); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), #DCB66E); }
.bar.on-dark { background: rgba(248,242,231,.12); }

/* ---------- Ride / float assignment board ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.float { background: var(--ivory); border: 1px solid rgba(42,32,50,.1); border-radius: var(--r);
  padding: 1rem; min-height: 160px; transition: border .2s, background .2s, box-shadow .2s; }
.float.over { border-color: var(--gold); background: var(--gold-soft); box-shadow: var(--sh-gold); }
.float .float-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: .7rem; }
.float .float-h .name { font-family: var(--font-head); font-weight: 600; }
.float .seats { font-size: .76rem; color: var(--text-soft); }
.float.full .seats { color: var(--paid); font-weight: 600; }
.rider { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border-radius: var(--r-sm);
  background: #fff; border: 1px solid rgba(42,32,50,.08); margin-bottom: .45rem; cursor: grab;
  font-size: .9rem; font-weight: 500; transition: box-shadow .15s, transform .1s; }
.rider:hover { box-shadow: var(--sh-1); }
.rider.dragging { opacity: .4; }
.rider .avatar { width: 26px; height: 26px; font-size: .72rem; }
.rider.sub { border-style: dashed; border-color: var(--due); }
.pool { background: rgba(42,32,50,.03); border: 1px dashed rgba(42,32,50,.2); border-radius: var(--r);
  padding: 1rem; }

/* tap-to-assign (works on touch where drag does not) */
.rider.selected { border-color: var(--gold); background: var(--gold-soft);
  box-shadow: 0 0 0 3px var(--gold-soft), var(--sh-1); }
body.seating .float { cursor: pointer; }
body.seating .float .drop { outline: 2px dashed rgba(196,155,84,.55); outline-offset: 5px; border-radius: var(--r-sm); }
body.seating .pool { border-color: var(--gold); border-style: dashed; }
.seat-bar { position: fixed; left: 50%; bottom: 1.2rem; z-index: 150; display: flex; align-items: center;
  gap: .9rem; padding: .7rem .7rem .7rem 1.3rem; border-radius: 999px; background: var(--ink); color: var(--ivory);
  box-shadow: var(--sh-3); max-width: calc(100vw - 1.6rem); transform: translateX(-50%) translateY(150%);
  transition: transform .32s var(--ease); }
.seat-bar.show { transform: translateX(-50%) translateY(0); }
.seat-bar .txt { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-bar .txt b { color: var(--gold); font-weight: 600; }
.seat-bar .x { flex: none; padding: .6rem 1.1rem; min-height: 44px; border-radius: 999px;
  background: rgba(248,242,231,.12); color: var(--ivory); font-weight: 600; font-size: .85rem; }
.seat-bar .x:hover { background: rgba(248,242,231,.2); }

/* ---------- Modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20,12,28,.55); backdrop-filter: blur(4px);
  display: none; place-items: center; z-index: 100; padding: 1.2rem; }
.scrim.open { display: grid; animation: fade .3s var(--ease); }
.modal { background: var(--cream); border-radius: var(--r-xl); padding: clamp(1.5rem, 4vw, 2.6rem);
  max-width: 480px; width: 100%; box-shadow: var(--sh-3); border: 1px solid rgba(255,255,255,.4); }
.modal.wide { max-width: 720px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: .6rem; align-items: center; }
.toast { display: flex; align-items: center; gap: .7rem; padding: .85rem 1.3rem; border-radius: 999px;
  background: var(--ink); color: var(--ivory); box-shadow: var(--sh-3); font-weight: 500; font-size: .94rem;
  animation: toastin .4s var(--ease); }
.toast .tick { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--ink);
  display: grid; place-items: center; flex: none; font-weight: 700; }
@keyframes toastin { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Misc ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.icon-btn { width: 42px; height: 42px; border-radius: var(--r-sm); display: grid; place-items: center;
  border: 1px solid rgba(42,32,50,.12); transition: background .2s, border .2s; }
.icon-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.icon-btn svg { width: 19px; height: 19px; }
.list-clean { list-style: none; padding: 0; }
.check-li { display: flex; gap: .7rem; align-items: flex-start; }
.check-li .tick { color: var(--gold); flex: none; margin-top: .15rem; }
.hide { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 280px;
    transform: translateX(-100%); transition: transform .35s var(--ease);
    box-shadow: var(--sh-3); }
  .sidebar.open { transform: none; }
  .menu-btn { display: flex; }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(20,12,28,.5); z-index: 55; display: none; }
  .nav-backdrop.open { display: block; }
}
@media (max-width: 620px) {
  .cols-2, .cols-4 { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .row.actions { flex-direction: column; align-items: stretch; }
  .hide-sm { display: none !important; }
  h1 { font-size: clamp(2.1rem, 9vw, 2.8rem); }
  /* portal topbar: keep menu + title + action on one tidy row */
  .topbar { padding: .6rem .9rem; gap: .55rem; }
  .topbar h1 { font-size: 1.12rem; line-height: 1.2; min-width: 0; }
  .content { padding: 1.1rem .9rem 5.5rem; }
  /* collapse inline two-column splits, but leave tile grids (floor plan) alone */
  .grid[style*="grid-template-columns"]:not([style*="auto-fill"]) { grid-template-columns: 1fr !important; }
  /* substitute request cards stack cleanly */
  .sub-card { flex-wrap: wrap; }
  .sub-card > div[style*="flex:1"] { flex: 1 1 60%; }
  .sub-card .row { flex-basis: 100%; }
  .sub-card .row .btn { flex: 1; }
  /* board goes single column with roomy drop zones */
  .board { grid-template-columns: 1fr; }
  /* segmented control scrolls instead of squashing */
  .seg { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
