/* "Clinical Neo-Futurism" palette (designed with ChatGPT, task c2c_9d71): teal → indigo with a violet/magenta accent */
:root {
  --bg: #f4f8fc; --surface: #ffffff; --surface-raised: #ffffff; --surface-2: #eaf1f7; --ink: #152536; --muted: #526579; --line: #d9e4ee;
  --brand: #087f8c; --brand-deep: #07545d; --brand-ink: #ffffff; --brand-soft: #d6f0f1;
  --secondary: #5454d4; --secondary-soft: #e6e6fb; --accent: #c247a2; --accent-soft: #f8e3f2;
  --seat-free: #167d48; --seat-free-soft: #d9f2e3; --seat-busy: #c1394f; --seat-busy-soft: #fbe2e6;
  --seat-mine: #275fcc; --seat-mine-soft: #dfe8fb;
  --amber: #996000; --amber-soft: #fcefd2; --danger: #c1394f;
  --hero-start: #087f8c; --hero-end: #273d91;
  --glow-teal: rgba(28, 190, 181, .18); --glow-violet: rgba(113, 97, 222, .14);
  --shadow: 0 1px 2px rgba(19, 47, 78, .06), 0 6px 20px rgba(19, 47, 78, .06);
  --shadow-raised: 0 12px 34px rgba(19, 47, 78, .10);
  --shadow-strong: rgba(19, 47, 78, .32);
  --radius: 18px;
  --spring: cubic-bezier(.3, 1.45, .45, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080f1c; --surface: #111d2e; --surface-raised: #19283c; --surface-2: #19283c; --ink: #edf5ff; --muted: #a9bacd; --line: #304257;
    --brand: #45d4ce; --brand-deep: #093d49; --brand-ink: #04211d; --brand-soft: #123a44;
    --secondary: #a49bff; --secondary-soft: #24264f; --accent: #f28bd5; --accent-soft: #3d1f38;
    --seat-free: #50e39a; --seat-free-soft: #11392a; --seat-busy: #ff8793; --seat-busy-soft: #43202a;
    --seat-mine: #83b3ff; --seat-mine-soft: #1b2c52;
    --amber: #ffd079; --amber-soft: #3a2f12; --danger: #ff8793;
    --hero-start: #07515f; --hero-end: #242c66;
    --glow-teal: rgba(69, 212, 206, .13); --glow-violet: rgba(164, 155, 255, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-raised: 0 18px 44px rgba(0, 0, 0, .32); --shadow-strong: rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --bg: #080f1c; --surface: #111d2e; --surface-raised: #19283c; --surface-2: #19283c; --ink: #edf5ff; --muted: #a9bacd; --line: #304257;
  --brand: #45d4ce; --brand-deep: #093d49; --brand-ink: #04211d; --brand-soft: #123a44;
  --secondary: #a49bff; --secondary-soft: #24264f; --accent: #f28bd5; --accent-soft: #3d1f38;
  --seat-free: #50e39a; --seat-free-soft: #11392a; --seat-busy: #ff8793; --seat-busy-soft: #43202a;
  --seat-mine: #83b3ff; --seat-mine-soft: #1b2c52;
  --amber: #ffd079; --amber-soft: #3a2f12; --danger: #ff8793;
  --hero-start: #07515f; --hero-end: #242c66;
  --glow-teal: rgba(69, 212, 206, .13); --glow-violet: rgba(164, 155, 255, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-raised: 0 18px 44px rgba(0, 0, 0, .32); --shadow-strong: rgba(0, 0, 0, .6);
}
/* soft light pools behind everything, fixed so scrolling costs nothing */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60vmax 40vmax at 100% 0%, var(--glow-violet), transparent 60%),
              radial-gradient(50vmax 40vmax at 0% 100%, var(--glow-teal), transparent 60%); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { font: 15px/1.5 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.ico { flex: none; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.mobile-only { display: flex; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  border-radius: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; transition: transform .08s, background .15s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.light { background: #fff; color: #07545d; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .5); }
.btn.outline-light { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn.outline-light:hover { background: rgba(255, 255, 255, .12); }
.btn.block { width: 100%; margin-top: 12px; }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.btn:disabled { opacity: .5; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: var(--muted); flex: none; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-weight: 600; font-size: .86rem; min-height: 32px; }
.link.danger { color: var(--danger); font-size: .8rem; }

/* ---------- brand & auth ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; color: var(--brand); }
.brand.light { color: #fff; }
/* Auth Portal V3 (ChatGPT design c2c_3fa8): brand banner on top on phones, two columns on desktop */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.auth-brand { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
  padding: 18px 20px 46px; color: #fff;
  background: radial-gradient(circle at 88% 12%, rgba(242, 139, 213, .38), transparent 42%),
              radial-gradient(circle at 0% 110%, rgba(69, 212, 206, .45), transparent 50%),
              linear-gradient(140deg, var(--hero-start), var(--hero-end)); }
.auth-brand .brand { grid-column: 1 / -1; }
.auth-copy { grid-column: 1; grid-row: 2; min-width: 0; }
.auth-copy h1 { font-size: 1.35rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.auth-copy h1 span { display: block; background: linear-gradient(90deg, #ffd6f2, #c7fff9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-copy p { margin-top: 6px; font-size: .86rem; opacity: .85; }
.auth-points { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.auth-points li { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: .74rem; font-weight: 600;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.auth-art { position: relative; grid-column: 2; grid-row: 2; width: 96px; height: 116px; perspective: 700px;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .4s var(--ease); animation: art-in .55s var(--ease) both; }
@keyframes art-in { from { opacity: 0; transform: translateY(14px) scale(.9); } }
.auth-form { display: flex; justify-content: center; align-items: flex-start; padding: 0 16px 32px; margin-top: -30px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 440px; padding: 18px 18px 20px; border-radius: 24px; background: var(--surface-raised);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); box-shadow: var(--shadow-raised); animation: bloom .3s var(--ease) both; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 14px; }
.auth-tabs button { text-align: center; min-height: 42px; }
.auth-head { margin: 16px 2px 2px; }
.auth-head.swap { animation: bloom .26s var(--ease); }
.auth-head h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.auth-head p { font-size: .88rem; margin-top: 2px; }
.field { margin-top: 14px; }
.field > label { margin: 0 0 6px; }
.field input { margin: 0; }
.field-err { display: block; min-height: 0; color: var(--danger); font-size: .78rem; font-weight: 600; margin-top: 4px; }
.field-err:empty { display: none; }
.pw { position: relative; }
.pw input { padding-right: 48px; }
.pw-eye { position: absolute; right: 2px; top: 50%; translate: 0 -50%; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); }
.pw-eye:hover { color: var(--brand); }
.pw-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.pw-meter i { height: 4px; border-radius: 4px; background: var(--surface-2); transition: background .2s; }
.pw-meter[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-level="2"] i:nth-child(-n+2) { background: var(--amber); }
.pw-meter[data-level="3"] i { background: var(--seat-free); }
.pw-hint { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; }
.auth-submit { margin-top: 16px; min-height: 50px; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--secondary)) !important;
  color: #fff !important; box-shadow: 0 12px 24px -14px var(--secondary); }
.auth-submit .ico { transition: translate .25s var(--ease); }
.auth-submit:hover .ico { translate: 3px 0; }
.auth-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; color: var(--muted); font-size: .76rem; text-align: center; }
.yearpick { border: 0; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.yearpick legend { font-size: .84rem; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 6px; }
.yearpick .field-err { grid-column: 1 / -1; margin-top: 0; }
.yearpick.invalid .yearopt span { border-color: var(--danger); }
.yearopt { position: relative; margin: 0; cursor: pointer; }
.yearopt input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; margin: 0; cursor: pointer; }
.yearopt span { position: relative; display: block; height: 100%; min-height: 64px; padding: 10px 10px 9px; border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink); transition: border-color .18s, background .18s, transform .18s var(--spring), box-shadow .18s; }
.yearopt b { display: block; font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.yearopt small { display: block; color: var(--muted); font-weight: 500; font-size: .7rem; line-height: 1.3; margin-top: 2px; }
.yearopt .tick { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%;
  background: var(--brand); color: #fff; transform: scale(0); transition: transform .2s var(--spring); }
.yearopt input:checked + span { border-color: var(--brand); background: linear-gradient(160deg, var(--brand-soft), var(--secondary-soft)); transform: scale(1.02);
  box-shadow: 0 10px 20px -14px var(--brand); }
.yearopt input:checked + span b { color: var(--brand); }
.yearopt input:checked + span .tick { transform: scale(1); }
.yearopt input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (max-height: 640px) { .auth-art { display: none; } .auth-points { display: none; } }

/* ---------- forms ---------- */
label { display: block; font-size: .84rem; font-weight: 600; color: var(--muted); margin-top: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; font-family: inherit; font-size: 1rem; line-height: 1.4; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 46px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); }
textarea { resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- shell ---------- */
.side { display: none; }
.main { min-width: 0; padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.topbar h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; }
.content { padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 14px; max-width: 1180px; margin: 0 auto; }
/* notched bottom tab bar (Lucian UX/UI Prompt 041, MIT): bar, notch and bubble share --x */
.bottom { --x: 50%; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 6; height: 64px;
  filter: drop-shadow(0 14px 22px var(--shadow-strong)); }
.bottom-bar { position: absolute; inset: 0; border-radius: 24px; background: var(--surface);
  -webkit-mask: radial-gradient(circle 33px at var(--x) -3px, transparent 96%, #000 100%); mask: radial-gradient(circle 33px at var(--x) -3px, transparent 96%, #000 100%); }
.bottom-bub { position: absolute; left: var(--x); top: -25px; width: 50px; height: 50px; margin-left: -25px; border-radius: 50%;
  background: linear-gradient(145deg, var(--hero-start), var(--hero-end)); box-shadow: 0 10px 22px -8px var(--hero-end), inset 0 1px 0 rgba(255, 255, 255, .25); }
.bottom-tabs { position: absolute; inset: 0; display: flex; padding: 0 6px; }
.bottom button { position: relative; flex: 1; min-width: 0; height: 100%; color: var(--muted); }
.b-ic { position: absolute; left: 50%; top: 20px; width: 23px; height: 23px; margin-left: -11.5px; display: grid; place-items: center; transition: transform .55s var(--spring), color .3s; }
.b-lab { position: absolute; left: 0; right: 0; bottom: 7px; text-align: center; font-size: .66rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .45s var(--spring); }
.bottom button[aria-current="page"] .b-ic { transform: translateY(-33px); color: #fff; }
.bottom button[aria-current="page"] .b-lab { opacity: 1; transform: none; }
.bottom em, .side nav em { font-style: normal; font-size: .66rem; font-weight: 700; background: var(--seat-busy); color: #fff; border-radius: 99px; padding: 0 6px; line-height: 16px; }
.bottom em { position: absolute; top: 12px; left: calc(50% + 4px); box-shadow: 0 0 0 2px var(--surface); transition: transform .45s var(--spring), opacity .3s; }
.bottom button[aria-current="page"] em { transform: scale(0); opacity: 0; }
.bottom.none .bottom-bub { opacity: 0; transform: scale(.4); }
.bottom.none .bottom-bar { -webkit-mask: none; mask: none; }

/* notification bell (Lucian UX/UI Prompt 074, MIT) */
.bell { position: relative; }
.bell > .iconbtn { position: relative; }
.bell > .iconbtn em { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--seat-busy); color: #fff;
  font-style: normal; font-size: .64rem; font-weight: 800; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg); animation: badge-in .5s var(--spring); }
.bell > .iconbtn.ring .ico { transform-origin: 50% 10%; animation: bell-ring 1.4s var(--ease) .3s 2; }
@keyframes bell-ring { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-12deg); } 50% { transform: rotate(5deg); } }
@keyframes badge-in { from { transform: scale(0); } }
.bell-pop { position: fixed; left: 12px; right: 12px; top: 58px; max-height: 70vh; overflow-y: auto; z-index: 30; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 50px -20px var(--shadow-strong);
  transform-origin: calc(100% - 74px) 0; animation: pop-in .35s var(--spring); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.94); } }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }
.bell-item { border-top: 1px solid var(--line); }
.bell-item .todo { border-top: 0; padding: 10px 2px; }
.bell-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 2px; border-radius: 10px; }
.bell-row:hover { background: var(--surface-2); }
.bell-row > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.bell-row small { color: var(--muted); font-size: .8rem; }
.bell-empty { display: flex; align-items: center; gap: 8px; padding: 14px 4px 6px; color: var(--muted); font-size: .9rem; }
.todo-ic.green { background: var(--seat-free-soft); color: var(--seat-free); }
.todo-ic.teal { background: var(--brand-soft); color: var(--brand); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.avatar.sm { width: 30px; height: 30px; font-size: .8rem; }

/* ---------- home ---------- */
.hero { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 20px; color: #fff;
  background: radial-gradient(circle at 88% 10%, rgba(242, 139, 213, .35), transparent 42%),
              radial-gradient(circle at 10% 110%, rgba(69, 212, 206, .45), transparent 50%),
              linear-gradient(135deg, var(--hero-start), var(--hero-end));
  position: relative; overflow: hidden; box-shadow: var(--shadow-raised); }
.hero p { opacity: .85; }
.hero h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.hero-date { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .84rem; opacity: .9; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.stat:hover { border-color: var(--brand); }
.stat b { font-size: 1.5rem; font-weight: 800; line-height: 1.2; margin-top: 6px; }
.stat small { color: var(--muted); font-size: .74rem; line-height: 1.3; }
.stat-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; }
.stat-ic.green { background: var(--seat-free-soft); color: var(--seat-free); }
.stat-ic.teal { background: var(--brand-soft); color: var(--brand); }
.stat-ic.amber { background: var(--amber-soft); color: var(--amber); }
.cols { display: grid; grid-template-columns: 1fr; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.panel-head h3 { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; }
.pill { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.pill.green { background: var(--seat-free-soft); color: var(--seat-free); }
.pill.red { background: var(--seat-busy-soft); color: var(--seat-busy); }
.pill.blue { background: var(--seat-mine-soft); color: var(--seat-mine); }
.pill.teal { background: var(--brand-soft); color: var(--brand); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.todo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.todo:first-of-type { border-top: 0; padding-top: 0; }
.todo-ic { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; flex: none; }
.todo.amber .todo-ic { background: var(--amber-soft); color: var(--amber); }
.todo.teal .todo-ic { background: var(--brand-soft); color: var(--brand); }
.todo-body { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.todo-body span { color: var(--muted); font-size: .84rem; }
.todo-act { display: flex; gap: 8px; }
.occ { display: block; width: 100%; padding: 8px 0; }
.occ-head { display: flex; justify-content: space-between; gap: 8px; }
.occ-head span { color: var(--muted); font-size: .86rem; }
.occ-head b { color: var(--seat-free); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.seatbar > span { background: var(--seat-free); }
.tl-group { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tl-group:first-of-type { border-top: 0; padding-top: 0; }
.tl-rows { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tl-row { display: flex; gap: 10px; align-items: flex-start; }
.tl-row div { min-width: 0; display: flex; flex-direction: column; }
.tl-row strong { font-size: .9rem; }
.tl-row span:not(.tl-ic) { color: var(--muted); font-size: .82rem; }
.tl-ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; flex: none; }
.tl-ic.chair { background: var(--seat-mine-soft); color: var(--seat-mine); }
.tl-ic.request { background: var(--brand-soft); color: var(--brand); }
.tl-ic.booking { background: var(--amber-soft); color: var(--amber); }
.dateblock { display: flex; flex-direction: column; align-items: center; width: 50px; flex: none; padding: 6px 0; border-radius: 12px; background: var(--surface-2); font-size: .68rem; color: var(--muted); line-height: 1.25; }
.dateblock strong { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.mini-post { display: flex; gap: 10px; width: 100%; padding: 8px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.mini-post:first-of-type { border-top: 0; }
.mini-post span:last-child { min-width: 0; display: flex; flex-direction: column; }
.mini-post small { color: var(--muted); font-size: .76rem; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 28px 12px; color: var(--muted); }
.empty strong { color: var(--ink); margin-top: 14px; }
.empty span { font-size: .86rem; max-width: 320px; }

/* ---------- filters ---------- */
.filters { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.datestrip { display: flex; gap: 6px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.datestrip::-webkit-scrollbar { display: none; }
.datestrip button { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; width: 52px; padding: 7px 0 9px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.datestrip small { color: var(--muted); font-size: .7rem; }
.datestrip strong { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.datestrip i.dot { position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--seat-free); }
.datestrip button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.datestrip button[aria-pressed="true"] small { color: inherit; opacity: .85; }
/* segmented control + sliding pills (Lucian UX/UI Prompt 047 / 039, MIT): one knob glides under the choice */
.seg { position: relative; display: inline-flex; padding: 4px; gap: 2px; border-radius: 14px; background: var(--surface-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-knob { position: absolute; top: 4px; bottom: 4px; left: var(--l, 4px); right: var(--r, 100%); border-radius: 10px; background: var(--surface);
  box-shadow: 0 4px 12px -6px var(--shadow-strong), 0 0 0 1px var(--line); pointer-events: none; }
.seg.go-r .seg-knob { transition: right .3s var(--ease), left .5s var(--spring) .07s; }
.seg.go-l .seg-knob { transition: left .3s var(--ease), right .5s var(--spring) .07s; }
.seg button { position: relative; padding: 7px 13px; min-height: 36px; border-radius: 10px; font-size: .84rem; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: color .3s, transform .3s var(--spring); }
.seg button:hover { color: var(--ink); }
.seg button:active { transform: scale(.94); }
.seg button[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.seg.pills { border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.seg.pills .seg-knob { border-radius: 999px; background: var(--brand); box-shadow: 0 6px 14px -8px var(--brand); }
.seg.pills button { border-radius: 999px; }
.seg.pills button[aria-pressed="true"] { color: var(--brand-ink); }

/* ---------- seat map ---------- */
.seat-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.seat-count { display: flex; align-items: center; gap: 2px; }
.seat-count b { font-size: 2rem; font-weight: 800; color: var(--seat-free); line-height: 1; letter-spacing: -.02em; }
.seat-count span { font-size: .84rem; font-weight: 600; line-height: 1.3; }
.seat-count small { color: var(--muted); font-weight: 400; font-size: .76rem; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--muted); flex: 1 1 220px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.seat-area { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.seat-area-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.seat-area-head h3 { font-size: 1rem; font-weight: 700; }
.seat-area-head span { color: var(--muted); font-size: .84rem; }
/* theater seat map (Lucian UX/UI Prompt 106, MIT): lettered rows, an aisle, seats with a cushion edge */
.seats { display: grid; grid-template-columns: 12px repeat(5, minmax(0, 1fr)) 4px repeat(5, minmax(0, 1fr)); gap: 8px 3px; align-items: center; }
.row-lab { font-size: .7rem; font-weight: 700; color: var(--muted); text-align: center; }
.aisle { height: 100%; }
/* each seat is the front-facing armchair icon (#chair-shape in index.html), colored by state:
   --c outline, --back backrest fill, --soft arms and cushion, --ink-n the number */
.seat { --c: var(--seat-busy); --back: var(--seat-busy-soft); --soft: var(--seat-busy-soft); --ink-n: var(--seat-busy);
  display: block; min-width: 0; padding: 0; line-height: 0; transition: transform .35s var(--spring), filter .2s; }
svg.chair { display: block; width: 100%; height: auto; overflow: visible; }
/* rules match the symbol itself; the colors resolve per <use>, i.e. per seat */
#chair-shape .cb { fill: var(--back); stroke: var(--back-line, none); stroke-width: 3; stroke-dasharray: var(--back-dash, none); }
#chair-shape .ln { fill: none; stroke: var(--c); stroke-width: 3.7; stroke-linecap: round; stroke-linejoin: round; }
#chair-shape .cs { fill: var(--soft); }
svg.chair text { fill: var(--ink-n); font-family: inherit; font-weight: 800; text-anchor: middle; dominant-baseline: central; font-variant-numeric: tabular-nums; }
.seat:not(.big):not(.mini):hover { transform: translateY(-3px); filter: drop-shadow(0 6px 6px color-mix(in srgb, var(--c) 35%, transparent)); }
.seat:not(.big):not(.mini):active { transform: scale(.92); }
.seat.free, .seat.offer { --c: color-mix(in srgb, #000 18%, var(--seat-free)); --back: var(--seat-free); --soft: var(--seat-free-soft); --ink-n: #fff; }
.seat.taken { --c: color-mix(in srgb, #000 15%, var(--seat-busy)); --back: var(--seat-busy); --soft: var(--seat-busy-soft); --ink-n: #fff; }
.seat.mine { --c: color-mix(in srgb, #000 18%, var(--seat-mine)); --back: var(--seat-mine); --soft: var(--seat-mine-soft); --ink-n: #fff; }
.seat.offer { --back-line: var(--surface); --back-dash: 4 3; }
.seat.pop { animation: seat-pop .55s var(--spring); }
@keyframes seat-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } }
.seat.big { width: 58px; flex: none; }
.seat.mini { display: inline-block; width: 18px; vertical-align: middle; }

/* ---------- item cards ---------- */
.grid-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.item { display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.panel .item { box-shadow: none; }
.content > .grid-list .item { box-shadow: var(--shadow); }
.panel > .item + .item { margin-top: 10px; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.item-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; }
.item-title strong { font-weight: 700; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .84rem; }
.facts span { display: inline-flex; align-items: center; gap: 5px; }
.note { display: flex; gap: 6px; align-items: flex-start; font-size: .84rem; color: var(--muted); }
.warn { font-size: .82rem; color: var(--amber); font-weight: 600; }
.item-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.item-act:empty { display: none; }
.item { transition: transform .35s var(--spring), box-shadow .3s; }
.content .item:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -18px var(--shadow-strong); }

/* event-ticket card (Lucian UX/UI Prompt 059, MIT): a torn-off date stub with a perforated edge */
.item.ticket { position: relative; padding: 0; gap: 0; overflow: hidden; }
.item.ticket .dateblock { width: 64px; border-radius: 0; justify-content: center; padding: 12px 0;
  background: linear-gradient(170deg, var(--brand), var(--brand-deep)); color: rgba(255, 255, 255, .8); }
.item.ticket .dateblock strong { color: #fff; font-size: 1.4rem; }
.item.ticket .item-body { padding: 12px 14px 12px 16px; border-left: 2px dashed var(--line); }
.item.ticket::before, .item.ticket::after { content: ""; position: absolute; left: 57px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.item.ticket::before { top: -8px; }
.item.ticket::after { bottom: -8px; }
.ticket-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.host { display: flex; align-items: center; gap: 8px; min-width: 0; }
.host > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.host small { color: var(--muted); font-size: .72rem; }
.host strong { font-size: .88rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* hold to confirm (Lucian UX/UI Prompt 003, MIT): a red fill rises only while the button is held */
.btn.hold { --p: 0; position: relative; overflow: hidden; isolation: isolate; touch-action: none; user-select: none; -webkit-user-select: none;
  background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 35%, transparent); transition: transform .4s var(--spring); }
.hold-lab { display: inline-flex; align-items: center; gap: 6px; }
.hold-fill { position: absolute; inset: 0; justify-content: center; background: var(--danger); color: #fff; clip-path: inset(0 calc(100% - var(--p) * 100%) 0 0); }
.btn.hold.is-holding { transform: scale(.97); }
.btn.hold.shake { animation: hold-shake .12s linear infinite; }
@keyframes hold-shake { 25% { translate: -.6px .3px; } 75% { translate: .6px -.3px; } }

/* ---------- quota ---------- */
.quota { padding: 8px 0; }
.quota-head { display: flex; justify-content: space-between; gap: 8px; }
.quota-head span { color: var(--muted); font-size: .86rem; }
.quota-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px 24px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.quota-sum { flex: 1 1 200px; min-width: 0; }
.quota-hero h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.quota-hero p { color: var(--muted); }
/* activity rings (Lucian UX/UI Prompt 099, MIT) */
.rings { flex: none; transform: rotate(-90deg); overflow: visible; }
.rings circle { fill: none; stroke-linecap: round; }
.rings .track { stroke: var(--c); stroke-opacity: .18; }
.rings .arc { stroke: var(--c); }
.rings .lap2 { filter: drop-shadow(0 0 2px rgba(0, 0, 0, .45)); }
.rings .lap.fl .arc { animation: ring-flash .8s var(--ease); }
@keyframes ring-flash { 40% { filter: drop-shadow(0 0 7px var(--c)); } }
.rings-wrap { position: relative; flex: none; }
.rings-mid { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.rings-mid strong { font-size: 2rem; font-weight: 800; letter-spacing: -.04em; }
.rings-mid span { font-size: 1rem; font-weight: 700; color: var(--muted); margin-top: 8px; }
.ring-legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ring-legend li { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; }
.ring-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.ring-legend b { margin-left: auto; color: var(--c); font-variant-numeric: tabular-nums; }
.subj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.subj { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.subj > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.subj strong { font-size: .92rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.subj span { color: var(--muted); font-size: .84rem; }
.subj span b { color: var(--c); font-weight: 800; }
.subj small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .76rem; }

/* rolling digits (Lucian UX/UI Prompt 098, MIT) */
.dg { display: inline-block; height: 1.15em; line-height: 1.15em; overflow: hidden; vertical-align: top; }
.dg > span { display: block; text-align: center; transition: transform .9s var(--spring); }
[data-roll] { font-variant-numeric: tabular-nums; }
b[data-roll] span, strong[data-roll] span { font-size: inherit; font-weight: inherit; color: inherit; margin: 0; }

/* ---------- forum ---------- */
.post { display: flex; gap: 12px; width: 100%; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); align-items: flex-start; }
.post:hover { border-color: var(--brand); }
.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.post-body strong { font-weight: 700; }
.post-body small { color: var(--muted); font-size: .78rem; }
.post-text { color: var(--muted); font-size: .88rem; margin-top: 4px; overflow-wrap: anywhere; }
.post-count { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .84rem; flex: none; }
.post-full { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0; }
.comments-title { margin: 18px 0 8px; font-size: .95rem; font-weight: 700; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.comment > div { min-width: 0; flex: 1; }
.comment small { color: var(--muted); font-size: .76rem; }
.comment p { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- self-managed quota ---------- */
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; }
.small-note { font-size: .8rem; margin: 6px 0 4px; }
.tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-style: normal; font-size: .66rem; font-weight: 700; vertical-align: 2px; }
.log-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.log-row:first-of-type { border-top: 0; }
.log-row > div:not(.dateblock) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.log-row span { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.target-list { display: flex; flex-direction: column; margin-top: 8px; }
.target-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: .95rem; }
.target-row > span { display: flex; flex-direction: column; min-width: 0; }
.target-row small { color: var(--muted); font-weight: 500; font-size: .76rem; }
.target-row input { width: 92px; margin: 0; text-align: center; font-weight: 700; flex: none; }

/* ---------- profile ---------- */
.profile-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding: 22px; border-radius: 22px; color: #fff;
  background: radial-gradient(circle at 85% 0%, rgba(242, 139, 213, .32), transparent 45%), linear-gradient(135deg, var(--hero-start), var(--hero-end)); box-shadow: var(--shadow-raised); }
.profile-hero > div { flex: 1 1 220px; min-width: 0; }
.profile-hero h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.profile-hero p { opacity: .85; font-size: .9rem; overflow-wrap: anywhere; }
.profile-hero small { display: block; margin-top: 8px; opacity: .75; font-size: .78rem; }
.profile-hero .pill { background: rgba(255, 255, 255, .16); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.avatar.xl { width: 76px; height: 76px; font-size: 1.9rem; background: rgba(255, 255, 255, .16); color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); }
.stats.four { grid-template-columns: repeat(2, 1fr); }
.stat-ic.blue { background: var(--seat-mine-soft); color: var(--seat-mine); }
.panel .seg { margin-top: 2px; }
.side-user[aria-current="page"] { background: rgba(255, 255, 255, .14); }

/* ---------- people & messages ---------- */
.topbar-title { display: flex; align-items: center; gap: 2px; min-width: 0; }
.topbar-title h1 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msg-btn { position: relative; }
.msg-btn em { position: absolute; top: 6px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--seat-mine); color: #fff;
  font-style: normal; font-size: .64rem; font-weight: 800; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg); animation: badge-in .5s var(--spring); }
.avatar.xs { width: 22px; height: 22px; font-size: .64rem; }
.plink { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 8px 2px 2px; border-radius: 99px; color: var(--ink); font-weight: 600; font-size: .86rem;
  background: var(--surface-2); vertical-align: middle; transition: background .2s; }
.plink span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
button.plink:hover { background: var(--brand-soft); color: var(--brand); }
.plink.self { padding: 2px 10px; }
.people { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.people > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.people small { color: var(--muted); font-size: .72rem; }
.facts-list dd .plink { margin-left: auto; }
.day-row { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.day-slot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.host { text-align: left; border-radius: 12px; padding: 2px 6px 2px 2px; }
.host:hover { background: var(--surface-2); }
.seat.taken { --c: var(--seat-busy); --back: var(--seat-busy); --ink-n: #fff; --cush: color-mix(in srgb, #000 25%, var(--seat-busy)); }
.todo-ic.blue { background: var(--seat-mine-soft); color: var(--seat-mine); }
.profile-hero .btn.light { flex: none; }

.inbox { padding: 6px; }
.convo { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 14px; }
.convo:hover { background: var(--surface-2); }
.convo + .convo { border-top: 1px solid var(--line); }
.convo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.convo-top { display: flex; justify-content: space-between; gap: 8px; }
.convo-top small { color: var(--muted); font-size: .74rem; flex: none; }
.convo-last { color: var(--muted); font-size: .86rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.convo.unread .convo-last { color: var(--ink); font-weight: 600; }
.convo em { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--seat-mine); color: #fff; font-style: normal; font-size: .72rem; font-weight: 800; line-height: 20px; text-align: center; }

.chat { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat-peer { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-peer > span { display: flex; flex-direction: column; min-width: 0; }
.chat-peer small { color: var(--muted); font-size: .78rem; }
.chat-log { display: flex; flex-direction: column; gap: 6px; padding: 14px; height: calc(100vh - 330px); min-height: 260px; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); }
.chat-day { align-self: center; margin: 8px 0 2px; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 600; }
.chat-hint { margin: auto; color: var(--muted); font-size: .86rem; text-align: center; max-width: 280px; }
.bubble { max-width: 78%; padding: 8px 12px 6px; border-radius: 18px; animation: bubble-in .35s var(--spring); }
.bubble p { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble small { display: block; margin-top: 2px; font-size: .68rem; opacity: .7; text-align: right; }
.bubble.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form textarea { margin: 0; min-height: 44px; max-height: 120px; resize: none; border-radius: 22px; padding: 11px 16px; }
.chat-form .btn { width: 44px; padding: 0; border-radius: 50%; flex: none; }

/* ---------- V3 visual layer (ChatGPT design c2c_9d71): depth, color, motion ---------- */
/* hero: a floating 3D chair built from three stacked copies of the icon */
.hero > * { position: relative; z-index: 1; }
.hero .hero-art { position: absolute; z-index: 0; right: -6px; top: 50%; width: 132px; height: 150px; margin-top: -75px;
  perspective: 700px; opacity: .95; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .4s var(--ease); }
.h3d { position: absolute; inset: 0; transform-style: preserve-3d; animation: h3d-float 6s ease-in-out infinite, h3d-turn 9s ease-in-out infinite alternate; }
.h3d-layer { position: absolute; inset: 14px 18px 26px; --c: rgba(255, 255, 255, .95); --back: rgba(255, 255, 255, .22); --soft: rgba(255, 255, 255, .14); }
.h3d-layer.l2 { transform: translateZ(-7px); --c: rgba(255, 255, 255, .45); --back: transparent; --soft: transparent; }
.h3d-layer.l3 { transform: translateZ(-14px); --c: rgba(20, 30, 90, .45); --back: transparent; --soft: transparent; }
.h3d-layer.l1 { transform: translateZ(8px); }
.h3d-shadow { position: absolute; left: 22%; right: 22%; bottom: 6px; height: 12px; border-radius: 50%; background: rgba(0, 0, 0, .28); filter: blur(6px);
  transform: rotateX(80deg) translateZ(-30px); animation: h3d-shadow 6s ease-in-out infinite; }
@keyframes h3d-float { 50% { translate: 0 -8px; } }
@keyframes h3d-turn { from { rotate: y -28deg; } to { rotate: y 28deg; } }
@keyframes h3d-shadow { 50% { opacity: .55; scale: .85; } }
.orb { position: absolute; border-radius: 50%; filter: blur(1px); animation: orb 8s ease-in-out infinite; }
.orb.o1 { width: 10px; height: 10px; left: 6px; top: 22px; background: #f28bd5; }
.orb.o2 { width: 7px; height: 7px; right: 10px; top: 8px; background: #45d4ce; animation-delay: -3s; }
.orb.o3 { width: 5px; height: 5px; left: 30px; bottom: 6px; background: #a49bff; animation-delay: -5s; }
@keyframes orb { 50% { transform: translate(6px, -10px) scale(1.3); opacity: .6; } }
.hero-text { padding-right: 104px; }
.hero h2 { background: linear-gradient(90deg, #fff, #ffd6f2 60%, #c7fff9); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* KPI cards: colored top edge, glow on lift, 3D tilt on desktop */
.stat { --k: var(--brand); position: relative; overflow: hidden; border-color: transparent; background: var(--surface-raised);
  box-shadow: var(--shadow), inset 0 3px 0 var(--k); transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .3s var(--ease), box-shadow .3s; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--k) 22%, transparent), transparent 70%); }
.stat.green { --k: var(--seat-free); } .stat.violet { --k: var(--secondary); } .stat.pink { --k: var(--accent); }
.stat:hover { border-color: transparent; box-shadow: 0 16px 30px -18px var(--k), inset 0 3px 0 var(--k); translate: 0 -3px; }
.stat b { color: var(--k); }
.stat-ic.violet { background: var(--secondary-soft); color: var(--secondary); }
.stat-ic.pink { background: var(--accent-soft); color: var(--accent); }

/* panels and cards sit on raised surfaces */
.panel, .seat-area, .seat-summary, .quota-hero, .post, .chat { background: var(--surface-raised); border-color: color-mix(in srgb, var(--line) 70%, transparent); }
.panel-head h3 .ico { color: var(--brand); }

/* seat map: a clinic floor seen at a slight angle (desktop), flat on phones */
.seat-stage { perspective: 1100px; }
.seat-floor { transform-style: preserve-3d; padding: 10px 6px 14px; border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 6%, transparent), color-mix(in srgb, var(--secondary) 8%, transparent)),
              repeating-linear-gradient(90deg, color-mix(in srgb, var(--line) 55%, transparent) 0 1px, transparent 1px 34px); }
.seat { will-change: auto; }
.seat:active { scale: .97; }

/* tickets: the stub takes the subject color, the card tilts on desktop */
.item.ticket { --sub: var(--brand); transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.item.ticket .dateblock { background: linear-gradient(170deg, var(--sub), color-mix(in srgb, var(--sub) 50%, #0b1530)); }
.item.ticket .item-title strong { color: color-mix(in srgb, var(--sub) 70%, var(--ink)); }
.content.enter .grid-list > :nth-child(-n+8) { animation: bloom .45s var(--ease) both; }   /* long lists: the rest just appear */
.content.enter .grid-list > :nth-child(2) { animation-delay: .035s; }
.content.enter .grid-list > :nth-child(3) { animation-delay: .07s; }
.content.enter .grid-list > :nth-child(4) { animation-delay: .105s; }
.content.enter .grid-list > :nth-child(n+5) { animation-delay: .14s; }

/* avatars: one stable hue per student */
.avatar { background: hsl(var(--av-h, 175) 70% 92%); color: hsl(var(--av-h, 175) 55% 32%); }
:where(:root[data-theme="dark"]) .avatar { background: hsl(var(--av-h, 175) 40% 22%); color: hsl(var(--av-h, 175) 80% 80%); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .avatar { background: hsl(var(--av-h, 175) 40% 22%); color: hsl(var(--av-h, 175) 80% 80%); } }

/* subject cards and quota hero pick up their color */
.subj { background: linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, var(--surface-2)), var(--surface-2)); box-shadow: inset 3px 0 0 var(--c); }

/* chat: gradient bubbles; only messages that just arrived slide in */
.bubble { animation: none; }
.bubble.new { animation: bubble-in .24s var(--ease); }
.bubble.me { background: linear-gradient(135deg, var(--brand), var(--secondary)); color: #fff; }

/* sheets rise in */
dialog[open] { animation: sheet-in .28s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px); } }

/* ---------- dialog ---------- */
dialog { border: 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: var(--surface); color: var(--ink);
  width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 88vh; overflow-y: auto; }
dialog::backdrop { background: rgba(5, 20, 17, .55); }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-head h3 { font-size: 1.15rem; font-weight: 800; overflow-wrap: anywhere; }
.sheet-state { display: flex; align-items: center; gap: 6px; margin: 14px 0 8px; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .88rem; }
.sheet-state.green { background: var(--seat-free-soft); color: var(--seat-free); }
.sheet-state.red { background: var(--seat-busy-soft); color: var(--seat-busy); }
.sheet-state.blue { background: var(--seat-mine-soft); color: var(--seat-mine); }
.facts-list { margin: 12px 0; }
.facts-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.facts-list dt { color: var(--muted); font-size: .86rem; }
.facts-list dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.confirm-msg { font-weight: 600; font-size: 1.05rem; margin: 4px 0 16px; }
.confirm-act { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- loading & toast ---------- */
/* skeleton shaped like the home screen, with a moving sheen (Lucian UX/UI Prompt 079, MIT) */
.loading { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; padding: 8vh 16px; }
.sk { position: relative; overflow: hidden; height: 84px; border-radius: 16px; background: var(--surface-2); }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); animation: sheen 1.3s ease-in-out infinite; }
@keyframes sheen { to { transform: translateX(100%); } }
.sk.hero-sk { height: 150px; border-radius: 20px; }
.sk.tall { height: 200px; }
.sk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sk-row.two { grid-template-columns: 1fr; }
/* content blooms in when a screen opens */
.content.enter > * { animation: bloom .55s var(--ease) both; }
.content.enter > :nth-child(2) { animation-delay: .05s; }
.content.enter > :nth-child(3) { animation-delay: .1s; }
.content.enter > :nth-child(4) { animation-delay: .15s; }
.content.enter > :nth-child(n+5) { animation-delay: .2s; }
@keyframes bloom { from { opacity: 0; transform: translateY(12px) scale(.985); } }

/* empty states with a little life (Lucian UX/UI Prompt 088-093, MIT) */
.empty-art { position: relative; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  animation: float 3.2s ease-in-out infinite; }
.empty-art i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); opacity: .5; animation: orbit 6s linear infinite; }
.empty-art i:nth-child(3) { animation-delay: -2s; background: var(--amber); }
.empty-art i:nth-child(4) { animation-delay: -4s; background: var(--seat-free); }
@keyframes float { 50% { transform: translateY(-5px); } }
@keyframes orbit { from { transform: rotate(0) translateX(46px) rotate(0); } to { transform: rotate(360deg) translateX(46px) rotate(-360deg); } }
.empty .btn { margin-top: 10px; }

/* stacking toasts (Lucian UX/UI Prompt 070, MIT) */
.toasts { position: fixed; inset: auto; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); width: min(380px, calc(100vw - 24px)); height: 0; transform: translateX(-50%); z-index: 40;
  margin: 0; padding: 0; border: 0; background: none; overflow: visible; color: inherit; }
.toast { --c: var(--brand); position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 9px 8px 9px 10px;
  border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 18px 34px -16px var(--shadow-strong);
  transform-origin: 50% 100%; transform: translate(var(--dx, 0px), var(--y, 0px)) scale(var(--s, 1)); opacity: var(--o, 1);
  transition: transform .5s var(--spring), opacity .35s; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.toast.ok { --c: var(--seat-free); }
.toast.err { --c: var(--danger); }
.toast.drag { transition: none; }
.toast.enter { transform: translateY(80px) scale(.9); opacity: 0; }
.toast.leave { opacity: 0; pointer-events: none; }
.toast.leave.side { transform: translate(calc(var(--dir, 1) * 420px), var(--y, 0px)) rotate(calc(var(--dir, 1) * 8deg)); }
.toast > * { transition: opacity .25s; }
.toast.back > * { opacity: 0; }
.toast-ic { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.toast-tx { flex: 1; min-width: 0; font-size: .9rem; font-weight: 600; line-height: 1.35; }
.toast-x { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.toast-x:hover { background: var(--surface-2); color: var(--ink); }
.toast-bar { position: absolute; left: 16px; right: 16px; bottom: 0; height: 2px; border-radius: 2px; background: var(--c); opacity: .5; transform-origin: 0 50%; transform: scaleX(var(--left, 1)); }

/* success burst (Lucian UX/UI Prompt 093, MIT) */
.burst { position: fixed; left: 50%; top: 40%; z-index: 50; pointer-events: none; }
.burst i { position: absolute; width: 8px; height: 12px; border-radius: 2px; animation: burst 1.1s var(--ease) forwards; }
@keyframes burst { from { transform: translate(0, 0) rotate(0) scale(.4); opacity: 1; } 70% { opacity: 1; }
  to { transform: translate(var(--x), calc(var(--y) + 90px)) rotate(var(--r)) scale(1); opacity: 0; } }

/* sign-in feedback (Lucian UX/UI Prompt 062, MIT) */
.auth-err { margin-top: 12px; padding: 9px 12px; border-radius: 10px; background: var(--seat-busy-soft); color: var(--danger); font-size: .86rem; font-weight: 600; animation: pop-in .3s var(--spring); }
input[aria-invalid="true"] { border-color: var(--danger); }
#authForm.shake { animation: shake .45s var(--ease); }
@keyframes shake { 15%, 55% { transform: translateX(-8px); } 35%, 75% { transform: translateX(8px); } 90% { transform: translateX(-3px); } }
.auth-submit .spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.auth-submit.loading .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .hero { flex-direction: row; align-items: flex-end; justify-content: space-between; padding: 26px; }
  .stats { gap: 14px; }
  .stats.four { grid-template-columns: repeat(4, 1fr); }
  .hero .hero-art { width: 190px; height: 210px; margin-top: -105px; right: 30%; }
  .hero-text { padding-right: 0; }
  .seat-floor { transform: rotateX(8deg); transform-origin: 50% 100%; }
  @media (prefers-reduced-motion: reduce) { .seat-floor { transform: none; } }
  .seat-floor .seat:hover { translate: 0 -3px; }
  .stat { padding: 16px; }
  .stat small { font-size: .82rem; }
  .seats { grid-template-columns: 18px repeat(5, minmax(0, 1fr)) 18px repeat(5, minmax(0, 1fr)); gap: 9px 8px; }
  dialog { width: min(520px, calc(100vw - 32px)); margin: auto; border-radius: 20px; padding: 22px; }
}
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
  .side { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; padding: 22px 14px; color: #fff;
    background: radial-gradient(circle at 0% 100%, rgba(69, 212, 206, .25), transparent 55%), linear-gradient(180deg, var(--hero-start), var(--hero-end)); }
  .side .brand { padding: 0 10px; }
  .side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
  .side nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px; color: rgba(255, 255, 255, .78); font-weight: 500; }
  .side nav button:hover { background: rgba(255, 255, 255, .09); color: #fff; }
  .side nav button[aria-current="page"] { background: #fff; color: #07545d; font-weight: 700; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .55); }
  .side nav em { margin-left: auto; }
  .side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; color: #fff; width: 100%; }
  .side-user:hover { background: rgba(255, 255, 255, .09); }
  .side-user .avatar { background: rgba(255, 255, 255, .16); color: #fff; }
  .side-user span:last-child { min-width: 0; display: flex; flex-direction: column; }
  .side-user strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .side-user small { opacity: .75; }
  .bottom, .avatar-btn { display: none; }
  .main { padding-bottom: 0; }
  .topbar { padding: 14px 28px; }
  .topbar h1 { font-size: 1.5rem; }
  .content { padding: 4px 28px 40px; gap: 18px; }
  .cols { grid-template-columns: 1fr 1fr; align-items: start; gap: 18px; }
  .grid-list { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: minmax(0, 52fr) minmax(0, 48fr); grid-template-rows: 1fr; }
  .auth-brand { display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; padding: 44px 52px; min-height: 100vh; }
  .auth-art { align-self: center; width: 260px; height: 290px; margin: 2vh 0; }
  .auth-copy h1 { font-size: 2.4rem; letter-spacing: -.03em; max-width: 14em; }
  .auth-copy p { font-size: 1rem; max-width: 30em; }
  .auth-points li { font-size: .82rem; padding: 6px 12px; }
  .auth-form { align-items: center; padding: 40px; margin-top: 0; }
  .auth-card { padding: 26px 28px 26px; }
  .mobile-only { display: none; }
  .toasts { left: auto; right: 24px; bottom: 28px; transform: none; }
  .bell-pop { position: absolute; left: auto; right: -8px; top: calc(100% + 8px); width: 360px; transform-origin: calc(100% - 30px) 0; }
  .sk-row.two { grid-template-columns: 1fr 1fr; }
}
