/* Seating Plan Manager v3 — modern theme */
:root {
  --bg: #f4f6fb; --card: #ffffff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0; --line-2: #cbd5e1;
  --primary: #4f46e5; --primary-d: #4338ca; --primary-50: #eef2ff; --accent: #4f46e5;
  --green: #059669; --red: #dc2626; --yellow: #d97706; --teal: #0d9488;
  --seat-available: #a7f3d0; --seat-booked: #fca5a5; --seat-booked-border: #ef4444; --gold: #d4af37;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 24px -8px rgba(15,23,42,.10);
  --shadow-lg: 0 24px 60px -12px rgba(15,23,42,.28);
  --sidebar: 258px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, var(--thaana, "Faruma", "MV Faseyha", "Noto Sans Thaana", "MV Boli"), sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; font-size: 14.5px; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.65rem; margin: 0 0 .25rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 1.08rem; margin: 0 0 .9rem; letter-spacing: -.01em; font-weight: 700; }
h3 { font-size: .98rem; margin: 1.2rem 0 .6rem; font-weight: 700; }
code { background: var(--primary-50); color: #3730a3; padding: 1px 6px; border-radius: 5px; font-size: .86em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1.5rem; } .mt-sm { margin-top: .8rem; }
.ic { width: 18px; height: 18px; flex: none; }
.container { max-width: 1280px; margin: 0 auto; padding: 1.25rem; }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.container.narrow { max-width: 560px; }
.footer { text-align: center; color: #94a3b8; font-size: .76rem; padding: 2rem 0 1.5rem; }
body.has-shell .footer { margin-left: var(--sidebar); }

/* shell: sidebar + main */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%); color: #cbd5e1;
  display: flex; flex-direction: column; z-index: 40; padding: 1rem .8rem; overflow-y: auto; }
.sb-brand { display: flex; align-items: center; gap: .7rem; color: #fff; padding: .3rem .5rem 1rem; }
.sb-brand:hover { text-decoration: none; }
.sb-brand strong { display: block; font-size: 1.02rem; letter-spacing: -.01em; }
.sb-brand small { display: block; color: #94a3b8; font-size: .74rem; }
.sb-logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #818cf8, #4f46e5); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px -4px rgba(99,102,241,.6); }
.sb-logo .ic { width: 22px; height: 22px; }
.sb-event { margin: 0 .3rem 1rem; }
.sb-event label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #94a3b8; margin-bottom: .3rem; font-weight: 600; }
.sb-event select { width: 100%; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: .55rem .6rem; font: inherit; font-weight: 600; }
.sb-event select option { color: #0f172a; }
.sb-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sb-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #64748b; font-weight: 700; padding: .9rem .7rem .35rem; }
.sb-nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; color: #cbd5e1; font-weight: 500; font-size: .9rem; }
.sb-nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sb-nav a.active { background: rgba(129,140,248,.18); color: #fff; box-shadow: inset 3px 0 0 #818cf8; }
.sb-nav a .ic { opacity: .85; }
.sb-user { display: flex; align-items: center; gap: .6rem; padding: .8rem .5rem 0; border-top: 1px solid rgba(255,255,255,.08); margin-top: 1rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #334155; color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.sb-user-text { flex: 1; min-width: 0; }
.sb-user-text strong { display: block; color: #fff; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-text small { color: #94a3b8; font-size: .74rem; }
.sb-logout { color: #94a3b8; padding: .35rem; border-radius: 8px; display: grid; }
.sb-logout:hover { background: rgba(255,255,255,.08); color: #fff; }
.main { margin-left: var(--sidebar); padding: 1.6rem 2rem; max-width: calc(1400px + var(--sidebar)); }
.topbar { display: none; }
.sb-backdrop { display: none; }
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 35; }
  .main { margin-left: 0; padding: 1rem; }
  body.has-shell .footer { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: .6rem; position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line); padding: .55rem .9rem; }
  .topbar-title { font-weight: 700; line-height: 1.15; }
  .topbar-title small { display: block; color: var(--muted); font-weight: 500; font-size: .74rem; }
  .nav-toggle { background: none; border: 0; padding: .35rem; border-radius: 8px; cursor: pointer; color: var(--text); display: grid; }
  .nav-toggle .ic { width: 22px; height: 22px; }
}

/* layout */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: .2rem 0 1.4rem; }
.page-head.center-head { justify-content: center; text-align: center; }
.page-head p { margin: .2rem 0 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(226,232,240,.7); padding: 1.3rem; margin-bottom: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2, .grid-3 { margin-bottom: 1.25rem; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.empty-state { text-align: center; padding: 2.5rem 1.5rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; border-radius: 10px; border: 1px solid var(--line-2);
  background: #fff; color: var(--text); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; transition: background .15s, box-shadow .15s, transform .05s; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: #f8fafc; box-shadow: 0 2px 6px -2px rgba(15,23,42,.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary, .btn-blue { background: linear-gradient(180deg, #6366f1, #4f46e5); border-color: #4f46e5; color: #fff; box-shadow: 0 4px 12px -4px rgba(79,70,229,.55); }
.btn-primary:hover, .btn-blue:hover { background: linear-gradient(180deg, #5b5ff0, #4338ca); }
.btn-green { background: linear-gradient(180deg, #10b981, #059669); border-color: #059669; color: #fff; } .btn-green:hover { background: #047857; }
.btn-red { background: linear-gradient(180deg, #ef4444, #dc2626); border-color: #dc2626; color: #fff; } .btn-red:hover { background: #b91c1c; }
.btn-yellow { background: linear-gradient(180deg, #fbbf24, #f59e0b); border-color: #f59e0b; color: #fff; } .btn-yellow:hover { background: var(--yellow); }
.btn-teal { background: linear-gradient(180deg, #14b8a6, #0d9488); border-color: #0d9488; color: #fff; } .btn-teal:hover { background: #0f766e; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: .32rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: 1.1rem; }
.btn-grid .span2 { grid-column: span 2; }
form.inline { display: inline; }

/* forms */
.form label { display: block; font-weight: 600; font-size: .84rem; margin-bottom: .85rem; color: #334155; }
.form input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=range]), .form select, .input, .filters input, .filters select, .bulk-bar select, .bulk-bar input {
  display: block; width: 100%; margin-top: .35rem; padding: .6rem .75rem; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; font-weight: 400; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.form input:focus, .form select:focus, .input:focus, textarea:focus, .filters input:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 4px rgba(99,102,241,.15); }
.form input[type=color] { width: 48px; height: 34px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; vertical-align: middle; margin-left: .4rem; background: #fff; }
.form label.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; }
.form input[type=range] { width: 100%; display: block; margin-top: .35rem; accent-color: var(--primary); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.hint { color: var(--muted); font-weight: 400; font-size: .78rem; }
.input-lg { font-size: 1.1rem !important; padding: .85rem 1rem !important; margin: 0 !important; }
.guest-select { margin-top: .5rem !important; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; margin: 0; flex: 1 1 160px; }
.filters input[type=search] { flex: 2 1 240px; }
.bulk-bar { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; margin-bottom: .6rem; flex-wrap: wrap; }
.bulk-bar span { margin-right: auto; }
.bulk-bar select, .bulk-bar input { width: auto; margin: 0; }

/* alerts, badges, toasts */
.alert { padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-size: .9rem; border: 1px solid transparent; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-info { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.alert-warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 700; margin-right: .3rem; letter-spacing: .01em; }
.b-confirmed { background: #d1fae5; color: #065f46; }
.b-invited { background: #e2e8f0; color: #334155; }
.b-declined { background: #fee2e2; color: #991b1b; }
.b-checked { background: #ede9fe; color: #5b21b6; }
.b-self { background: #e0f2fe; color: #075985; }
.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: .5rem; max-width: min(400px, calc(100vw - 32px)); }
.toast { padding: .85rem 1.1rem; border-radius: 12px; color: #fff; background: #1e293b; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px); transition: all .25s; font-size: .9rem; font-weight: 500; }
.toast.show { opacity: 1; transform: none; }
.toast-success { background: #059669; } .toast-error { background: #dc2626; } .toast-info { background: #4f46e5; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { border-radius: var(--radius); padding: 1rem 1.1rem; background: #fff; box-shadow: var(--shadow); border: 1px solid rgba(226,232,240,.7); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, #6366f1); }
.stat-num { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.stat-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.s-blue { --c: #6366f1; } .s-green { --c: #10b981; } .s-red { --c: #f43f5e; } .s-purple { --c: #8b5cf6; } .s-gray { --c: #94a3b8; }
.progress { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: .5rem; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #10b981, #059669); border-radius: 99px; transition: width .4s; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .6rem .65rem; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 700; background: #f8fafc; }
.table td { padding: .6rem .65rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.table tr:hover td { background: #fafbff; }
.log { max-height: 360px; overflow-y: auto; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--line-2); margin-right: 3px; vertical-align: middle; }
.seat-pill { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 800; background: var(--primary-50); color: #3730a3; padding: .15rem .6rem; border-radius: 8px; font-size: 1.2rem; }
.seat-pill.sm { font-size: .82rem; }
.danger { border: 1px solid #fecaca; }

/* legend */
.legend-bar { display: flex; gap: .75rem; align-items: stretch; margin-bottom: 1.25rem; flex-wrap: wrap; }
.legend-bar .legend { flex: 1 1 500px; margin: 0; }
.group-filter { flex: 0 1 240px; padding: .55rem .7rem; border: 1px solid #d1d5db; border-radius: 10px; font: inherit; background: #fff; box-shadow: var(--shadow); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem 1.1rem; padding: .7rem 1rem; font-size: .86rem; }
.legend-item { display: flex; align-items: center; gap: .4rem; }
.legend-sep { width: 1px; height: 22px; background: var(--line); }
.seat.mini { --u: .55; transform: none !important; box-shadow: none; }
.seat.mini.box { --u: .5; }
.ci-badge.static { position: static; }

/* plan */
.plan { padding: 1.25rem 1rem; position: relative; overflow: hidden; }
.plan > :not(.hall-bg) { position: relative; z-index: 1; }
.hall-bg { position: absolute; inset: 0; background-position: center; background-repeat: no-repeat; pointer-events: none; z-index: 0; display: none; }
.stage { border: 3px dashed #9ca3af; color: #4b5563; max-width: 460px; margin: 0 auto 1.6rem; padding: .9rem; text-align: center; font-weight: 700; letter-spacing: .3em; border-radius: 10px; background: rgba(255,255,255,.75); }
.plan-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 10px 0 .5rem; }
.route-wrap { position: relative; min-width: max-content; padding: 0 70px; }
.route-svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.route-svg.back { z-index: 0; }
.route-svg.front { z-index: 6; }
.chart { --u: 1; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: calc(10px * var(--u)); min-width: max-content; margin: 0 auto; padding: 0 .5rem; }
.seat-row { display: flex; align-items: flex-end; justify-content: center; gap: calc(6px * var(--u)); }
.row-label { width: 28px; font-weight: 700; color: var(--muted); text-align: center; flex: none; align-self: center; }
.walkway { width: calc(50px * var(--u)); flex: none; align-self: stretch; }
.section-title { display: flex; align-items: center; gap: .8rem; width: 100%; max-width: 720px; color: #6b7280; font-weight: 700; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; }
.section-title::before, .section-title::after { content: ""; flex: 1; height: 1px; background: #d1d5db; }
.section-title span { background: rgba(255,255,255,.85); padding: 2px 8px; border-radius: 99px; }

/* seat (shared) */
.seat { --w: 44px; width: calc(var(--w) * var(--u)); height: calc(var(--w) * var(--u)); position: relative; flex: none; user-select: none;
  transition: transform .15s, filter .15s; color: #86efac; }
.seat.regular { --w: 44px; }
.seat.vip { --w: 50px; }
.seat.vvip { --w: 60px; }
.seat-text { position: absolute; z-index: 2; display: block; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: clip;
  font-weight: 700; color: #374151; font-size: calc(8.5px * var(--u)); letter-spacing: -.02em; pointer-events: none; }
.seat-text:not(.name) { font-weight: 600; color: rgba(0,0,0,.5); }
.seat.vvip .seat-text { font-size: calc(9.5px * var(--u)); }
.seat.clickable { cursor: pointer; }
.seat.clickable:hover, .seat.clickable:focus-visible { transform: scale(1.14); z-index: 4; outline: none; filter: drop-shadow(0 0 4px #60a5fa); }
.seat.highlight { transform: scale(1.18); z-index: 5; }
.seat.highlight .seat-text { color: #fff !important; font-weight: 800; }
.seat.dim { opacity: .2; }
.seat.moving { animation: pulse 1.1s infinite; filter: drop-shadow(0 0 5px var(--primary)); }
.seat.selected { filter: drop-shadow(0 0 0 #f59e0b) drop-shadow(0 0 4px #f59e0b); }
.seat.selected .seat-text { color: #92400e; }
@keyframes pulse { 50% { transform: scale(1.12); } }
.ci-badge { position: absolute; top: -5px; right: -5px; z-index: 3; width: 15px; height: 15px; border-radius: 50%; background: #7c3aed; color: #fff;
  font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.sel-badge { position: absolute; top: -7px; left: -7px; z-index: 4; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 9px; background: #f59e0b; color: #fff;
  font-size: 9.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }

/* chair drawings */
.seat.chair .chair-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.c-main { fill: currentColor; stroke: rgba(0,0,0,.32); stroke-width: 1; }
.c-shade { fill: #000; opacity: .1; }
.c-leg { fill: #6b7280; }
.c-trim { fill: none; stroke: #a16207; stroke-width: 1.3; opacity: .8; }
.seat.chair .seat-text { left: 20%; right: 20%; top: 8%; height: 48%; line-height: calc(var(--w) * var(--u) * .48); }
.seat.chair.vip .seat-text { left: 21%; right: 21%; top: 6%; height: 52%; line-height: calc(var(--w) * var(--u) * .52); }
.seat.chair.vvip .seat-text { left: 22%; right: 22%; top: 8%; height: 46%; line-height: calc(var(--w) * var(--u) * .46); }
.seat.chair.booked { color: #f87171; }
.seat.chair.booked .seat-text { color: #7f1d1d; }
.seat.chair.blocked { color: #d1d5db; }
.seat.chair.blocked .seat-text { color: #9ca3af; }
.seat.chair.highlight { color: var(--accent) !important; filter: drop-shadow(0 0 6px var(--accent)); }

/* uploaded chair images */
.seat.pic .seat-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.seat.pic .seat-text { left: 0; right: 0; bottom: -3px; margin: 0 auto; width: max-content; max-width: 100%; padding: 1px 3px; border-radius: 4px;
  background: rgba(255,255,255,.88); font-size: calc(7.5px * var(--u)); }
.seat.pic.booked .seat-img { filter: sepia(1) saturate(5) hue-rotate(-40deg) brightness(.9); }
.seat.pic.booked .seat-text { background: #fecaca; color: #7f1d1d; }
.seat.pic.blocked .seat-img { filter: grayscale(1); opacity: .45; }
.seat.pic.highlight .seat-img { filter: drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 6px var(--accent)); }
.seat.pic.highlight .seat-text { background: var(--accent); }

/* classic boxes */
.seat.box { border-radius: 8px; border: 2px solid #d1d5db; background: #a7f3d0; }
.seat.box .seat-text { left: 2px; right: 2px; top: 0; bottom: 0; line-height: calc(var(--w) * var(--u) - 4px); }
.seat.box.vvip { border: 3px solid var(--gold); }
.seat.box.vip { border-color: #4b5563; }
.seat.box.booked { background: var(--seat-booked); border-color: var(--seat-booked-border); }
.seat.box.booked .seat-text { color: #7f1d1d; }
.seat.box.blocked { background: repeating-linear-gradient(45deg, #e5e7eb 0 5px, #cbd5e1 5px 10px); border-color: #94a3b8; }
.seat.box.highlight { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37,99,235,.25), 0 0 18px var(--accent); }

.move-banner { position: sticky; top: 12px; z-index: 20; background: #1e40af; color: #fff; padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem;
  display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; box-shadow: var(--shadow); flex-wrap: wrap; }
.move-banner .btn-row { margin: 0; }

/* entrances, route */
.doors { position: relative; height: 34px; margin-top: 64px; z-index: 1; }
.door { position: absolute; top: 0; transform: translateX(-50%); background: #4b5563; color: #fff; padding: .45rem .8rem; border-radius: 6px; font-weight: 700; font-size: .75rem; letter-spacing: .05em; white-space: nowrap; }
.aisle { fill: rgba(254, 226, 226, .85); }
.route { stroke: var(--guide, var(--accent)); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 10 8; animation: ants 1.2s linear infinite; }
@keyframes ants { to { stroke-dashoffset: -18; } }

@media (max-width: 640px) {
  .container { padding: .8rem; }
  h1 { font-size: 1.3rem; }
  .chart { --u: .78; }
  .row-label { width: 20px; font-size: .8rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .route-wrap { padding: 0 46px; }
}

/* modal */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 80; opacity: 0; transition: opacity .2s; }
.modal.open { opacity: 1; }
.modal-box { background: #fff; border-radius: 18px; width: 100%; max-width: 470px; max-height: calc(100vh - 2rem); overflow-y: auto; padding: 1.4rem; transform: scale(.96); transition: transform .2s; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.open .modal-box { transform: none; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.modal-title { margin: 0; font-size: 1.3rem; }
.modal-close { background: none; border: 0; font-size: 1.9rem; line-height: 1; color: var(--muted); cursor: pointer; }
.kv { display: flex; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid #f3f4f6; }
.kv span { width: 110px; color: var(--muted); flex: none; }

/* guest page */
.guest-page { max-width: 1100px; margin: 0 auto; }
.h-event { font-size: 1.3rem; color: #374151; }
.guest-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; max-width: 680px; margin: 1rem auto; }
.g-name { font-size: 1.25rem; font-weight: 700; }
.g-seat { display: flex; align-items: center; gap: .5rem; }
.g-seat .seat-pill { font-size: 1.6rem; }
.staff-box { max-width: 680px; margin: 0 auto 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #f5f3ff; }
@keyframes ants { to { stroke-dashoffset: -18; } }
.spinner { width: 40px; height: 40px; border: 4px solid #dbeafe; border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto .8rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* search results */
.result-list { display: flex; flex-direction: column; gap: .7rem; }
.result { display: flex; align-items: center; gap: 1rem; margin: 0; padding: .9rem 1rem; flex-wrap: wrap; }
.result.is-checked { background: #faf5ff; }
.result-seat { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 1.35rem; background: #eef2ff; color: #1e3a8a; border-radius: 8px; padding: .4rem .7rem; min-width: 64px; text-align: center; }
.result-seat.none { font-size: .8rem; background: #f3f4f6; color: var(--muted); font-family: inherit; }
.result-main { flex: 1 1 220px; }
.result-name { font-weight: 700; font-size: 1.05rem; }
.result-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* v2.1 additions */
.modal-box.wide { max-width: 680px; }
.check-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: .25rem; margin-bottom: .8rem; }
.form .check-item, .check-item { display: flex; gap: .55rem; align-items: flex-start; padding: .35rem .45rem; margin: 0; font-weight: 400; border-radius: 6px; cursor: pointer; }
.check-item:hover { background: #f3f4f6; }
.check-item input { margin-top: .2rem; }
.bulk-tools { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; flex-wrap: wrap; }
.bulk-tools strong { margin-right: auto; }
.form .label { font-weight: 600; font-size: .9rem; margin: .4rem 0 .5rem; }
.form .indent { padding-left: 1.6rem; margin-bottom: .6rem; }
.form .indent .input { margin-top: 0; }
.review { max-height: 340px; overflow-y: auto; margin-bottom: .6rem; }
.b-group { background: #e0f2fe; color: #075985; }
textarea { width: 100%; margin-top: .3rem; padding: .55rem .7rem; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; resize: vertical; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.table.compact td { padding: .35rem .45rem; vertical-align: middle; }
.table input { width: 100%; padding: .32rem .45rem; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; min-width: 60px; }
.grid-3.tight, .grid-2.tight { gap: 1rem; margin-bottom: 1rem; }
.type-box { border: 1px solid var(--line); border-radius: 10px; padding: .9rem; }
.type-box h3 { margin-top: 0; }
.upload-box { margin-bottom: .6rem; }
.upload-label { font-weight: 500; font-size: .88rem; margin-bottom: .3rem; }
.img-preview { display: block; max-width: 100%; height: 80px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #f9fafb; padding: 4px; margin-bottom: .35rem; }
.img-preview.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }
.upload-box input[type=file] { font-size: .85rem; }
.style-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
@media (max-width: 760px) { .style-pick { grid-template-columns: 1fr; } }
.style-opt { margin: 0 !important; cursor: pointer; }
.style-opt input { position: absolute; opacity: 0; }
.style-card { display: flex; flex-direction: column; gap: .25rem; border: 2px solid var(--line); border-radius: 12px; padding: .8rem; height: 100%; }
.style-opt input:checked + .style-card { border-color: var(--primary); background: #eff6ff; }
.style-demo { --u: .8; display: flex; gap: 10px; align-items: flex-end; justify-content: center; padding-top: .6rem; min-height: 60px; }
.door-row { align-items: end; }
.guest-banner { display: block; width: 100%; max-height: 280px; object-fit: cover; border-radius: var(--radius); margin: 0 auto 1rem; box-shadow: var(--shadow); }
body.guest-bg { background-size: cover; background-position: center; background-attachment: fixed; }
body.guest-bg .guest-head { background: rgba(255,255,255,.85); border-radius: var(--radius); padding: .6rem 1rem; max-width: 680px; margin: 0 auto; }
body.guest-bg .guest-msg { background: rgba(255,255,255,.85); border-radius: 10px; padding: .4rem .8rem; max-width: 680px; margin: 0 auto 1rem; }
.guest-msg { color: #4b5563; }
.seat-pill.accent { background: var(--accent); color: #fff; }
.guest-page .legend { max-width: 680px; margin: 0 auto 1rem; }
#preview h2 { margin-top: 1rem; }

/* v2.2 custom hall */
.zoom-ctl { display: none; position: absolute !important; top: 10px; right: 10px; z-index: 8 !important; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.zoom-ctl button { border: 0; background: #fff; padding: .35rem .65rem; font: inherit; font-weight: 700; cursor: pointer; }
.zoom-ctl button + button { border-left: 1px solid var(--line); }
.zoom-ctl button:hover { background: #f3f4f6; }
.plan.custom .zoom-ctl { display: flex; }
.plan.custom > .stage, .plan.custom .doors { display: none; }
.plan.custom .route-wrap { padding: 0; min-width: 0; }
.plan.custom .plan-scroll { padding-top: 0; }
.plan.custom .route-wrap > .route-svg { display: none; }
.chart.is-custom { display: block; padding: 0; min-width: 0; gap: 0; }
.hall-viewport { position: relative; margin: 0 auto; }
.hall-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fbfaf7; border: 1px solid #e7e5e4; border-radius: 6px; overflow: hidden; }
.hall-canvas.grid { background-image: linear-gradient(#eceae6 1px, transparent 1px), linear-gradient(90deg, #eceae6 1px, transparent 1px); background-size: var(--grid, 20px) var(--grid, 20px); }
.hall-img { position: absolute; inset: 0; background-position: center; background-repeat: no-repeat; pointer-events: none; }
.hall-canvas .route-svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.hall-canvas .route-svg.back { z-index: 1; }
.hall-canvas .route-svg.front { z-index: 9; }
.route-glow { stroke: var(--guide, var(--accent)); stroke-opacity: .14; stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; }
.seg { position: absolute; z-index: 3; display: flex; align-items: flex-end; gap: calc(6px * var(--u)); transform-origin: center; }
.seg .row-label { position: absolute; top: 50%; transform: translateY(-50%); width: 22px; font-size: .8rem; }
.seg .seg-l { right: calc(100% + 2px); }
.seg .seg-r { left: calc(100% + 2px); }
.hall-item { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; gap: .3em; text-align: center; border-radius: 6px;
  font-weight: 700; line-height: 1.1; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); padding: 2px 4px; user-select: none; transform-origin: center; }
.hall-item.round { border-radius: 50%; }
.hall-item .it-label { overflow: hidden; text-overflow: ellipsis; }
.hall-item .it-icon { font-size: 1.15em; line-height: 1; }
.hall-item.it-stage { border: 3px dashed #9ca3af; box-shadow: none; letter-spacing: .3em; color: #4b5563 !important; }
.hall-item.it-text { background: transparent !important; box-shadow: none; letter-spacing: .12em; text-transform: uppercase; }
.hall-item.it-door { letter-spacing: .05em; font-size: 12px; }
.hall-item.it-wall, .hall-item.it-pillar { box-shadow: none; }
.hall-item.it-screen { letter-spacing: .1em; font-size: 10px !important; }
.hall-item.it-box { border: 2px dashed rgba(0,0,0,.2); box-shadow: none; }
.measure { position: absolute; left: -12000px; top: 0; width: 1300px; visibility: hidden; pointer-events: none; }

/* editor */
.he-mode { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; padding: .8rem 1.1rem; }
.he-mode label { display: flex; gap: .45rem; align-items: center; }
.he-toolbar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding: .6rem 1rem; position: sticky; top: 8px; z-index: 15; }
.he-group { display: flex; gap: .35rem; align-items: center; }
.he-group + .he-group { border-left: 1px solid var(--line); padding-left: 1rem; }
.he-group input[type=number] { width: 80px; padding: .25rem .4rem; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; }
.he-group label.check { display: flex; gap: .3rem; align-items: center; }
.he-zoom { min-width: 46px; text-align: center; font-weight: 600; font-size: .85rem; }
.dirty { color: #b45309; font-weight: 600; font-size: .9rem; align-self: center; }
.he-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 260px; gap: 1rem; align-items: start; }
.he-layout > .card { margin: 0; }
@media (max-width: 1100px) { .he-layout { grid-template-columns: 1fr; } .he-palette { order: 2; } .he-props { order: 3; } }
.he-palette h3, .he-props h3 { margin-top: 0; }
.palette-grid { display: grid; grid-template-columns: 1fr; gap: .3rem; }
@media (max-width: 1100px) { .palette-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.pal-btn { display: flex; align-items: center; gap: .55rem; padding: .35rem .5rem; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font: inherit; font-size: .84rem; text-align: left; }
.pal-btn:hover { background: #eff6ff; border-color: #93c5fd; }
.pal-swatch { width: 26px; height: 20px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); font-weight: 700; }
.pal-swatch.round { border-radius: 50%; width: 22px; height: 22px; }
.he-stage-wrap { padding: .5rem; }
.he-scroll { overflow: auto; height: min(72vh, 900px); background: #f3f4f6; border-radius: 8px; }
.he-host { touch-action: none; padding: 10px !important; min-width: max-content; }
.he-host .hall-viewport { margin: 0; }
.he-host .seg, .he-host .hall-item { cursor: move; }
.he-host .seat { pointer-events: none; }
.he-host .sel { outline: 2px solid var(--primary); outline-offset: 3px; z-index: 7; }
.he-host .seg.sel { background: rgba(37,99,235,.06); }
.rz { position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; background: var(--primary); border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; z-index: 3; }
.band { position: absolute; z-index: 20; border: 1.5px dashed var(--primary); background: rgba(37,99,235,.08); pointer-events: none; }
.he-props .form label { font-size: .82rem; margin-bottom: .55rem; }
.he-props .form input:not([type=checkbox]), .he-props select { padding: .35rem .5rem !important; }
.he-props .form input[type=color] { width: 100%; height: 32px; margin: .3rem 0 0; }
.stack { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; }
.stack .btn-row { margin: 0; }
.stack .btn-row .btn { flex: 1; }

/* ================= v3 additions ================= */
body.bare { background: radial-gradient(1200px 600px at 10% -10%, #e0e7ff 0%, transparent 60%), radial-gradient(900px 500px at 110% 10%, #fae8ff 0%, transparent 55%), var(--bg); min-height: 100vh; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10b981; margin-right: .3rem; box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: livepulse 1.8s infinite; vertical-align: middle; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }

/* login */
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; max-width: 980px; margin: 6vh auto 0; }
.auth-side h1 { font-size: 2.3rem; }
.auth-side p { color: var(--muted); font-size: 1.05rem; }
.auth-logo { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, #818cf8, #4f46e5); color: #fff; display: grid; place-items: center; font-size: 1.6rem; box-shadow: 0 12px 30px -8px rgba(79,70,229,.6); margin-bottom: 1rem; }
.auth-logo .ic { width: 30px; height: 30px; }
.auth-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .7rem; }
.auth-points li { display: flex; gap: .6rem; align-items: center; color: #334155; font-weight: 500; }
.auth-points .ic { color: var(--primary); }
.auth-card { padding: 2rem; }
@media (max-width: 820px) { .auth-wrap { grid-template-columns: 1fr; margin-top: 1rem; } .auth-side { text-align: center; } .auth-side .auth-logo { margin: 0 auto 1rem; } .auth-points { justify-items: center; } }

/* guests: google sheets */
.gsheet-card h2 { display: flex; align-items: center; gap: .5rem; }
.gs-icon { width: 30px; height: 30px; border-radius: 8px; background: #dcfce7; color: #15803d; display: grid; place-items: center; }
.b-group { background: #e0f2fe; color: #075985; }

/* settings */
.code-box { display: flex; align-items: center; gap: 1rem; background: #f8fafc; border: 1px dashed var(--line-2); border-radius: 12px; padding: .8rem 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.big-code { font-family: ui-monospace, Menlo, monospace; font-size: 1.6rem; letter-spacing: .25em; color: var(--text); }
.code-box label { margin: 0 0 0 auto !important; }

/* users */
.user-list { display: flex; flex-direction: column; gap: .5rem; }
.user-row { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.user-row[open] { box-shadow: var(--shadow); }
.user-row.inactive { opacity: .65; }
.user-row summary { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; cursor: pointer; list-style: none; flex-wrap: wrap; }
.user-row summary::-webkit-details-marker { display: none; }
.ur-main { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.avatar.sm { width: 30px; height: 30px; font-size: .8rem; background: var(--primary-50); color: #3730a3; }
.ur-form { padding: 0 .9rem; margin-top: .3rem; }
.ur-actions { padding: 0 .9rem .9rem; }
.event-scope { background: #f8fafc; border-radius: 10px; padding: .6rem .8rem; margin-bottom: .8rem; }
.event-scope label { margin-bottom: .3rem !important; }
.ev-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .1rem .8rem; padding: .3rem 0 0 1.5rem; }
.add-role { display: flex; gap: .4rem; flex-wrap: wrap; }
.add-role input, .add-role select { padding: .35rem .55rem; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; }
.perm-table td, .perm-table th { vertical-align: middle; }
.perm-table th.center { min-width: 110px; }
.perm-group td { background: #f8fafc; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted); }

/* events */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.event-card { margin: 0; display: flex; flex-direction: column; gap: .8rem; }
.event-card.current { border: 2px solid #a5b4fc; }
.event-card.archived { opacity: .75; }
.event-card h2 { margin: 0; }
.ev-top { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; }
.ev-badges { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.ev-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; background: #f8fafc; border-radius: 12px; padding: .7rem; text-align: center; }
.ev-stats strong { display: block; font-size: 1.2rem; }
.ev-stats span { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.ev-more summary { cursor: pointer; color: var(--muted); font-size: .84rem; }
.copy-opts { background: #f8fafc; border-radius: 12px; padding: .8rem 1rem .2rem; margin-bottom: 1rem; }

/* check-in desk */
.ci-stats { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.ci-main { flex: 1 1 320px; }
.ci-num { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ci-num small { font-size: 1rem; color: var(--muted); font-weight: 600; margin-left: .4rem; letter-spacing: 0; }
.progress.lg { height: 12px; margin: .7rem 0 .5rem; }
.ci-types { display: flex; gap: .6rem; flex-wrap: wrap; }
.ci-type { border-radius: 12px; padding: .6rem .9rem; text-align: center; background: #f8fafc; min-width: 90px; border-top: 4px solid #94a3b8; }
.ci-type strong { display: block; font-size: 1.2rem; }
.ci-type span { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.ci-type.t-vvip { border-color: #f59e0b; } .ci-type.t-vip { border-color: #6366f1; } .ci-type.t-regular { border-color: #10b981; }
.ci-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .ci-layout { grid-template-columns: 1fr; } }
.search-card { position: sticky; top: 10px; z-index: 5; }
.recent-list { display: flex; flex-direction: column; gap: .5rem; max-height: 560px; overflow-y: auto; }
.recent-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 10px; background: #f8fafc; animation: slidein .35s ease; }
.ri-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ri-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } }
.result-list { display: flex; flex-direction: column; gap: .7rem; }
.result { display: flex; align-items: center; gap: 1rem; margin: 0; padding: .9rem 1rem; flex-wrap: wrap; }
.result.is-checked { background: linear-gradient(90deg, #f5f3ff, #fff 40%); }
.result-seat { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 1.35rem; background: var(--primary-50); color: #3730a3; border-radius: 10px; padding: .45rem .7rem; min-width: 68px; text-align: center; }
.result-seat.none { font-size: .8rem; background: #f1f5f9; color: var(--muted); font-family: inherit; }
.result-main { flex: 1 1 220px; }
.result-name { font-weight: 700; font-size: 1.05rem; }
.result-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* QR scanner */
.scanner { position: fixed; inset: 0; z-index: 70; background: rgba(2,6,23,.82); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.scanner-box { background: #fff; border-radius: 20px; width: 100%; max-width: 520px; overflow: hidden; box-shadow: var(--shadow-lg); }
.scanner-head { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; }
.scanner-view { position: relative; background: #000; aspect-ratio: 4 / 3; }
.scanner-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 14% 22%; border: 3px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scan-frame span { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #22d3ee; box-shadow: 0 0 12px #22d3ee; animation: scanline 1.8s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 10%; } 50% { top: 90%; } }
.scan-result { padding: 1rem; min-height: 110px; }
.scan-state { font-weight: 800; font-size: 1.1rem; padding: .55rem .8rem; border-radius: 10px; margin-bottom: .7rem; text-align: center; }
.scan-state.ok { background: #d1fae5; color: #065f46; animation: pop .35s ease; }
.scan-state.again { background: #fef3c7; color: #92400e; }
.scan-state.wait { background: #e0e7ff; color: #3730a3; }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } }
.scan-guest { display: flex; gap: 1rem; align-items: center; margin-bottom: .6rem; }
.scan-seat { font-family: ui-monospace, Menlo, monospace; font-size: 2rem; font-weight: 800; background: var(--primary-50); color: #3730a3; border-radius: 12px; padding: .4rem .8rem; text-align: center; line-height: 1.1; }
.scan-seat small { display: block; font-size: .62rem; letter-spacing: .15em; font-family: Inter, sans-serif; color: var(--muted); }

/* guest page */
.guest-page { max-width: 1100px; margin: 0 auto; }
.gh-org { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.h-event { font-size: 1.6rem; color: var(--text); margin-top: .2rem; }
.guest-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; max-width: 700px; margin: 1rem auto; background: linear-gradient(135deg, #fff 55%, color-mix(in srgb, var(--accent) 10%, #fff)); }
.gc-hello { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.g-name { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.g-seat { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.g-seat .muted { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.g-seat .seat-pill { font-size: 2rem; padding: .25rem .9rem; border-radius: 12px; box-shadow: 0 8px 20px -8px var(--accent); }
.seat-pill.accent { background: var(--accent); color: #fff; }
.self-box, .staff-box, .guide-box { max-width: 700px; margin: 0 auto 1rem; }
.self-box { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border: 1px solid #a7f3d0; background: #f0fdf4; }
.self-text { flex: 1 1 220px; }
.self-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.code-input { width: 170px !important; margin: 0 !important; text-transform: uppercase; letter-spacing: .2em; font-family: ui-monospace, Menlo, monospace; font-weight: 700; text-align: center; }
.ci-done { display: flex; align-items: center; gap: .8rem; }
.ci-tick { width: 40px; height: 40px; border-radius: 50%; background: #10b981; color: #fff; display: grid; place-items: center; font-size: 1.3rem; font-weight: 800; box-shadow: 0 6px 16px -6px #10b981; }
.staff-box { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #f5f3ff; border-color: #ddd6fe; }
.guide-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.guide-steps { list-style: none; counter-reset: st; margin: 0; padding: 0; display: grid; gap: .45rem; }
.guide-steps li { display: flex; align-items: center; gap: .7rem; padding: .45rem .6rem; background: #f8fafc; border-radius: 10px; }
.gs-ic { width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 14%, #fff); display: grid; place-items: center; flex: none; }
.guest-msg { color: #475569; }
body.guest-bg .guest-head { background: rgba(255,255,255,.88); border-radius: var(--radius); padding: .7rem 1rem; max-width: 700px; margin: 0 auto; backdrop-filter: blur(6px); }
body.guest-bg .guest-msg { background: rgba(255,255,255,.88); border-radius: 10px; padding: .4rem .8rem; max-width: 700px; margin: 0 auto 1rem; }
.guest-page .legend { max-width: 700px; margin: 0 auto 1rem; }

/* walking guide */
.walker { filter: drop-shadow(0 2px 2px rgba(15,23,42,.35)); }
.walker line, .walker .w-head { stroke: var(--guide, var(--accent)); stroke-width: 3.6; stroke-linecap: round; fill: none; }
.walker .w-head { fill: var(--guide, var(--accent)); stroke-width: 0; }
.walker .w-shadow { fill: rgba(15,23,42,.18); stroke: none; }
.walker.sitting line { stroke-width: 3.4; }
.trail { fill: none; stroke: var(--guide, var(--accent)); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.route.dim { opacity: .25; }
.seat.arrived { animation: arrived 1.2s ease 2; }
@keyframes arrived { 0%, 100% { filter: drop-shadow(0 0 6px var(--accent)); } 50% { filter: drop-shadow(0 0 16px var(--accent)) brightness(1.15); } }

/* public self check-in */
.self-ci { max-width: 460px; margin: 6vh auto 0; }
.sc-card { text-align: center; padding: 2rem 1.5rem; }
.sc-icon { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 28px -10px var(--accent); }
.sc-icon .ic { width: 30px; height: 30px; }
.sc-card .input-lg { text-align: center; }
.sc-done { margin-bottom: 1rem; }
.sc-tick { width: 72px; height: 72px; border-radius: 50%; background: #10b981; color: #fff; font-size: 2.4rem; display: grid; place-items: center; margin: 0 auto .6rem; animation: pop .4s ease; box-shadow: 0 14px 30px -10px #10b981; }
.sc-seat { display: inline-block; margin-top: .6rem; font-family: ui-monospace, Menlo, monospace; font-size: 2.6rem; font-weight: 800; background: var(--primary-50); color: #3730a3; border-radius: 14px; padding: .3rem 1.2rem; line-height: 1.1; }
.sc-seat small { display: block; font-family: Inter, sans-serif; font-size: .65rem; letter-spacing: .15em; color: var(--muted); }

/* ================= v3.1 seat editor ================= */
.se-toolbar { display: flex; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; align-items: center; margin-bottom: .9rem; }
.se-sel, .se-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.se-sel strong { min-width: 92px; }
.se-spec { padding: .35rem .6rem; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; width: 190px; }
.se-actions select { padding: .35rem .5rem; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; }
.se-actions input[type=color] { width: 34px; height: 30px; border: 1px solid var(--line-2); border-radius: 7px; padding: 0; background: #fff; }
.se-sep { width: 1px; height: 22px; background: var(--line); margin: 0 .2rem; }
.se-map-wrap { background: #f8fafc; border-radius: 12px; padding: 1rem .5rem; }
.se-stage { margin-bottom: 1rem; }
.se-map { user-select: none; touch-action: pan-y; min-height: 120px; }
.se-map .seat { cursor: pointer; }
.se-map .seat.se-selected { filter: drop-shadow(0 0 0 #2563eb) drop-shadow(0 0 5px #2563eb); }
.se-map .seat.se-selected::after { content: "✓"; position: absolute; top: -6px; left: -6px; width: 16px; height: 16px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; z-index: 4; box-shadow: 0 0 0 2px #fff; }
.row-label.clickable-row { cursor: pointer; border-radius: 6px; }
.row-label.clickable-row:hover { background: var(--primary-50); color: var(--primary); }
.se-legend { box-shadow: none; border: 0; padding: .8rem 0 0; }
.type-chip { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; margin: 0 .2rem .2rem 0; background: color-mix(in srgb, var(--tc) 35%, #fff); border: 1px solid color-mix(in srgb, var(--tc) 70%, #fff); }
.type-preview { display: inline-flex; min-width: 64px; min-height: 50px; align-items: flex-end; justify-content: center; }
.type-preview .seat { --u: .9; }
.types-table select { padding: .32rem .45rem; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; }
.types-table input[type=color] { width: 40px; height: 30px; margin: 0; }
.new-type td { background: #f8fafc; }

.guide-table select, .row-rules select { padding: .32rem .45rem; border: 1px solid var(--line-2); border-radius: 7px; font: inherit; width: 100%; }
.row-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .4rem .8rem; margin-top: .6rem; }
.row-rules label { display: flex !important; align-items: center; gap: .4rem; margin: 0 !important; }
.guide-color { align-self: end; }

/* ticket designer */
.td-layout { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .td-layout { grid-template-columns: 1fr; } }
.td-form h2 { margin-top: 1.2rem; font-size: .95rem; }
.td-form h2:first-of-type { margin-top: 0; }
.seg-pick { display: grid; gap: .2rem; margin-bottom: .6rem; }
.td-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.td-colors input[type=color] { display: block; width: 100%; height: 38px; margin: .3rem 0 0; }
.td-presets { display: flex; gap: .5rem; margin-bottom: .8rem; }
.td-preset { width: 38px; height: 38px; border-radius: 10px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.td-preset:hover { box-shadow: 0 0 0 2px var(--primary); }
.td-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem .8rem; }
.td-fields label { margin-bottom: .35rem !important; }
.td-save { position: sticky; bottom: 0; background: linear-gradient(transparent, #fff 30%); padding-top: 1rem; }
.td-preview { position: sticky; top: 12px; }
.td-preview iframe { width: 100%; height: 420px; border: 0; border-radius: 12px; background: #eef2f7; }

/* hall editor v2 */
.seg-toggle { gap: 0 !important; }
.seg-toggle .btn { border-radius: 0; }
.seg-toggle .btn:first-child { border-radius: 8px 0 0 8px; }
.seg-toggle .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.he-toolbar .btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.he-host.seat-mode .seg { cursor: default; }
.he-host.seat-mode .seat { pointer-events: auto; cursor: move; }
.he-host.seat-mode .seat:hover { filter: drop-shadow(0 0 4px #60a5fa); }
.he-host.seat-mode .seg { outline: 1px dashed rgba(99,102,241,.25); outline-offset: 3px; }
.he-host .seat.sel { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; z-index: 8; }
.he-host.preview .seg, .he-host.preview .hall-item { cursor: default; }
.he-host.preview .hall-canvas { box-shadow: 0 0 0 3px #a5b4fc; }
.al-tools { margin: .8rem 0 .4rem; }
.al-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: .35rem; }
.al-label output { text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 600; margin-left: .3rem; }
.al-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; }
.al-btn { padding: .35rem 0; }
.al-btn svg { display: block; }
.sp-ctl { margin: .7rem 0 .3rem; padding: .6rem .7rem; background: #f8fafc; border-radius: 10px; }
.sp-ctl input[type=range] { width: 100%; accent-color: var(--primary); }
.sp-ctl label { margin: .2rem 0 0 !important; }

/* google sheets wizard */
.gs-links { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .2rem 0 .7rem; }
.gs-link { font-size: .76rem; background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; border-radius: 99px; padding: .12rem .55rem; }
.gs-link b { font-weight: 700; }
.gs-wizard { border: 2px solid #bbf7d0; }
.gs-steps { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1rem; flex-wrap: wrap; }
.gs-steps li { display: flex; align-items: center; gap: .5rem; padding: .4rem .8rem; border-radius: 99px; background: #f1f5f9; color: var(--muted); font-weight: 600; font-size: .85rem; cursor: pointer; }
.gs-steps li span { width: 22px; height: 22px; border-radius: 50%; background: #cbd5e1; color: #fff; display: grid; place-items: center; font-size: .75rem; }
.gs-steps li.on { background: #dcfce7; color: #14532d; }
.gs-steps li.on span { background: #16a34a; }
.gs-steps li.done span { background: #16a34a; }
.gs-loading { text-align: center; padding: 2rem 0; }
.gs-bar { display: flex; gap: .6rem 1rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.gs-inline { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .86rem; }
.gs-hr { width: 80px !important; margin: 0 !important; }
.gs-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.gs-table { font-size: .8rem; }
.gs-table th.col, .gs-table td.rn { background: #f8fafc; color: var(--muted); font-weight: 700; text-align: center; font-size: .7rem; position: sticky; }
.gs-table th.col { top: 0; z-index: 1; }
.gs-table td.rn { left: 0; width: 34px; }
.gs-table td { white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.gs-table tr.above td:not(.rn) { color: #94a3b8; font-style: italic; }
.gs-table tr.heading-row td:not(.rn) { background: #eef2ff; font-weight: 800; color: #3730a3; border-bottom: 2px solid #a5b4fc; }
.gs-table tr.heading-row td.linked { background: #dcfce7; color: #14532d; border-bottom-color: #4ade80; }
.gs-nav { margin-top: 1rem; }
.gs-two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 1.5rem; }
@media (max-width: 900px) { .gs-two { grid-template-columns: 1fr; } }
.gs-two h3 { margin-top: 0; }
.gs-side h3 + * { margin-top: 0; }
.gs-side label { display: block; margin-bottom: .7rem; font-weight: 600; }
.gs-map td { vertical-align: middle; }
.gs-map select { margin: 0 !important; min-width: 200px; }
.gs-map tr.need td { background: #fffbeb; }
.gs-arrow { color: #16a34a; font-weight: 800; width: 24px; text-align: center; }
.gs-ex { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req { color: var(--red); }
.gs-unlinked { margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.gs-chip { display: inline-block; font-size: .74rem; background: #f1f5f9; border: 1px solid var(--line); border-radius: 6px; padding: .05rem .45rem; margin: 0 .2rem .2rem 0; }
.gs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.gs-tile { border-radius: 12px; padding: .8rem; background: #f8fafc; border-top: 4px solid #cbd5e1; text-align: center; }
.gs-tile strong { display: block; font-size: 1.6rem; }
.gs-tile span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.gs-tile.add { border-color: #22c55e; } .gs-tile.upd { border-color: #0ea5e9; } .gs-tile.rem { border-color: #ef4444; } .gs-tile.skip { border-color: #f59e0b; }
.gs-done { text-align: center; padding: 1.2rem 0; }

/* ============================================================ Programme / agenda (v3.4) */
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0; }
.toolbar .grow, .grow { flex: 1 1 200px; }
.btn-row.spread { justify-content: space-between; align-items: center; }
p.error { color: #b91c1c; }
.ag-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; align-items: start; }
.ag-layout aside { position: sticky; top: 1rem; display: grid; gap: 1rem; }
@media (max-width: 980px) { .ag-layout { grid-template-columns: 1fr; } .ag-layout aside { position: static; } }
.ag-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .7rem; }
.ag-item { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: start; padding: 1rem 1.1rem; scroll-margin-top: 1rem; }
.ag-item:target { box-shadow: 0 0 0 3px var(--primary-50), var(--shadow); }
.ag-no { display: inline-grid; place-items: center; min-width: 2.4rem; height: 2.4rem; padding: 0 .5rem; border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-weight: 800; font-size: 1.05rem; flex: none; }
.ag-no.big { min-width: 3rem; height: 3rem; font-size: 1.3rem; }
.ag-top { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.ag-top h3 { margin: 0; font-size: 1.05rem; }
.ag-time { font-size: .78rem; font-weight: 700; color: #4338ca; background: var(--primary-50); padding: .1rem .5rem; border-radius: 99px; white-space: nowrap; }
.ag-presenter { margin-top: .25rem; font-size: .9rem; }
.ag-details { margin-top: .3rem; }
.ag-guests { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; align-items: center; }
.ag-guest { display: inline-flex; gap: .4rem; align-items: center; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: .2rem .3rem .2rem .6rem; font-size: .85rem; }
.ag-guest em { font-style: normal; color: #7c3aed; font-size: .78rem; font-weight: 600; }
.ag-actions { display: flex; gap: .2rem; align-items: center; }
.ag-chip { display: inline-block; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; font-weight: 700; font-size: .82rem;
  padding: .15rem .6rem; border-radius: 99px; white-space: nowrap; }
.ag-chip.sm { font-size: .72rem; padding: .05rem .45rem; }
.ag-pick { max-height: 52vh; overflow: auto; border: 1px solid #e2e8f0; border-radius: 12px; }
.ag-pick-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto minmax(110px, 180px); gap: .6rem; align-items: center;
  padding: .45rem .7rem; border-bottom: 1px solid #f1f5f9; cursor: pointer; margin: 0; font-weight: 400; }
.ag-pick-row.on { background: #eef2ff; }
.ag-pick-row:last-child { border-bottom: 0; }
.ag-pick-name { display: flex; flex-direction: column; min-width: 0; }
.ag-pick-name strong, .ag-pick-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-pick-row .ag-role { padding: .3rem .5rem; font-size: .82rem; }
.ag-pick-row .ag-role:disabled { opacity: .35; }
.seat-pill.none { background: #f1f5f9; color: #94a3b8; }
@media (max-width: 640px) { .ag-pick-row { grid-template-columns: auto minmax(0, 1fr) auto; } .ag-pick-row .ag-role { grid-column: 2 / -1; } .ag-pick-row .ag-chip { display: none; } }

/* guest page */
.g-seat .ag-chip { margin-top: .35rem; }
.mine-agenda { border: 2px solid #fcd34d; background: linear-gradient(135deg, #fffbeb, #fff); }
.ma-head { font-weight: 800; color: #92400e; margin-bottom: .6rem; }
.ma-item { display: flex; gap: .8rem; align-items: center; padding: .4rem 0; }
.ma-item + .ma-item { border-top: 1px dashed #fde68a; }
.programme h2 { margin: 0 0 .7rem; font-size: 1.1rem; }
.prog-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.prog-item { display: flex; gap: .75rem; padding: .55rem .4rem; border-radius: 12px; align-items: flex-start; }
.prog-item .ag-no { min-width: 2rem; height: 2rem; font-size: .9rem; background: #e2e8f0; color: #334155; }
.prog-item.mine { background: #fffbeb; box-shadow: inset 3px 0 0 #f59e0b; }
.prog-item.mine .ag-no { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; }
.prog-top { display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.prog-details { white-space: pre-line; color: #475569; margin-top: .15rem; }

/* ============================================================ Guest photos & smart seating (v3.5) */
.avatar { --s: 34px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #e0e7ff, #f5d0fe); color: #4338ca; font-weight: 800; font-size: calc(var(--s) * .42); line-height: 1; vertical-align: middle;
  box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(15,23,42,.18); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar svg { width: 55%; height: 55%; }
.avatar.xs { --s: 22px; } .avatar.sm { --s: 28px; } .avatar.lg { --s: 52px; } .avatar.xl { --s: 92px; } .avatar.xxl { --s: 160px; }
.avatar-btn { background: none; border: 0; padding: 0; cursor: pointer; position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: .3rem; font: inherit; }
.avatar-edit { font-size: .74rem; color: var(--primary); font-weight: 600; }
.seat-who { display: flex; gap: 1rem; align-items: center; margin-bottom: .9rem; }
.sw-name { font-size: 1.2rem; font-weight: 800; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.type-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--c); margin-right: .35rem; vertical-align: middle; }
.center-row { justify-content: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-field { display: flex; gap: .9rem; align-items: center; padding: .7rem; border: 1px dashed #c7d2fe; border-radius: 12px; background: #fafaff; }
.photo-field .avatar { --s: 64px; color: #a5b4fc; }
.photo-inputs { flex: 1; min-width: 0; display: grid; gap: .35rem; }
.photo-inputs .btn-row { margin-top: 0; align-items: center; }
.photo-dialog { display: grid; gap: .6rem; justify-items: center; }
.photo-dialog .avatar { --s: 140px; }
.photo-dialog > input, .photo-dialog > p, .photo-dialog > .btn-row:last-child { justify-self: stretch; }
.photo-zoom img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 14px; background: #f1f5f9; }
.scan-photo { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin: .4rem 0 .6rem; }
.scan-photo img { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 4px #fff, 0 0 0 7px #a5b4fc, var(--shadow); }
.scan-photo span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.recent-item .avatar { --s: 26px; }
.result .avatar.lg { --s: 56px; }
.check-item .avatar { margin-top: -.1rem; }
.cell-who { display: inline-flex; gap: .45rem; align-items: center; }
tr.warn-row td { background: #fffbeb; }
.ag-pick-name { display: grid !important; grid-template-columns: auto minmax(0, 1fr); column-gap: .5rem; align-items: center; }
.ag-pick-name .avatar { grid-row: span 2; }
.ag-guest .avatar { margin-left: -.35rem; }

/* plan + waiting panel */
.plan-layout.with-panel { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.plan-main { min-width: 0; }
@media (max-width: 1100px) { .plan-layout.with-panel { grid-template-columns: 1fr; } .plan-layout.with-panel .waiting-panel { order: -1; position: static; max-height: 46vh; } }
.waiting-panel { position: sticky; top: 1rem; padding: .9rem; display: flex; flex-direction: column; gap: .6rem; max-height: calc(100vh - 2rem); }
.w-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.w-count { background: var(--primary-50); color: #3730a3; }
.w-tools { display: grid; grid-template-columns: 1fr auto; gap: .4rem; }
.w-tools input, .w-tools select { padding: .45rem .6rem; font-size: .88rem; min-width: 0; }
.w-tools select { max-width: 130px; }
.w-list { overflow-y: auto; display: flex; flex-direction: column; gap: .35rem; margin: 0 -.3rem; padding: .1rem .3rem; min-height: 60px; }
.w-card { display: flex; gap: .6rem; align-items: center; padding: .5rem .55rem; border-radius: 12px; border: 1px solid #e2e8f0; background: #fff;
  cursor: grab; user-select: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.w-card:hover { border-color: #c7d2fe; background: #f8faff; }
.w-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.w-card.on { border-color: var(--primary); background: #eef2ff; box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
.w-card:active { cursor: grabbing; }
.w-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.w-main strong, .w-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-chips { display: flex; gap: .25rem; flex-wrap: wrap; margin-top: .15rem; }
.w-chip { font-size: .68rem; font-weight: 700; padding: .02rem .42rem; border-radius: 99px; background: color-mix(in srgb, var(--c, #94a3b8) 18%, #fff); color: #334155;
  border: 1px solid color-mix(in srgb, var(--c, #94a3b8) 55%, #fff); white-space: nowrap; }
.w-chip.prio { --c: #64748b; }
.w-auto { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #fde68a; background: #fffbeb; color: #d97706; font-size: .95rem; cursor: pointer; }
.w-auto:hover { background: #fde68a; }
.w-empty { text-align: center; padding: 1.2rem .5rem; display: grid; gap: .3rem; justify-items: center; }
.w-empty-ic { font-size: 2rem; }
.w-hint { margin: 0; padding-top: .4rem; border-top: 1px solid #f1f5f9; }

/* seat hints while placing */
.seat.pref-ok { filter: drop-shadow(0 0 3px rgba(16,185,129,.7)); }
.seat.suggest { animation: sug-pulse 1.4s ease-in-out infinite; z-index: 4; }
.seat.suggest.best { filter: drop-shadow(0 0 6px #f59e0b) drop-shadow(0 0 2px #f59e0b); }
@keyframes sug-pulse { 50% { transform: scale(1.16); } }
@media (prefers-reduced-motion: reduce) { .seat.suggest { animation: none; } }
.sug-badge { position: absolute; top: -8px; right: -8px; z-index: 5; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #f59e0b; color: #fff;
  font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.25); pointer-events: none; }
.chart.dropping .seat.available { cursor: copy; }
.seat.drop-hover { transform: scale(1.25) !important; filter: drop-shadow(0 0 7px #4f46e5) !important; z-index: 6; }
.place-banner { background: linear-gradient(90deg, #312e81, #4f46e5); display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; }
.pb-who { display: flex; gap: .7rem; align-items: center; min-width: 0; }
.pb-who small { opacity: .85; }
.pb-chain { color: #fff; font-size: .82rem; margin: 0; }
.pb-last { flex-basis: 100%; font-size: .85rem; background: rgba(255,255,255,.12); padding: .3rem .6rem; border-radius: 8px; }
.place-banner .btn:not(.btn-green) { background: rgba(255,255,255,.95); }

/* hover card on booked seats */
.seat-tip { position: fixed; z-index: 75; display: flex; gap: .7rem; align-items: center; background: #fff; border-radius: 14px; padding: .6rem .8rem;
  box-shadow: 0 12px 32px rgba(15,23,42,.22); border: 1px solid #e2e8f0; max-width: 320px; pointer-events: none; }
.seat-tip.hidden { display: none; }

/* ranked guest picker */
.assign-form { gap: .6rem; }
.pick-list { max-height: 48vh; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 12px; }
.pick-sec { position: sticky; top: 0; z-index: 1; background: #f8fafc; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #64748b; padding: .35rem .8rem; border-bottom: 1px solid #e2e8f0; }
.pick-item { display: flex; gap: .7rem; align-items: center; padding: .5rem .8rem; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.pick-item:hover { background: #f8faff; }
.pick-item.top { background: #fffdf5; }
.pick-item.on { background: #eef2ff; box-shadow: inset 3px 0 0 var(--primary); }
.pi-main { flex: 1; min-width: 0; }
.pi-meta { display: flex; flex-wrap: wrap; gap: .25rem .35rem; margin-top: .15rem; align-items: center; }
.pi-why { font-size: .72rem; font-weight: 600; }
.pi-why.ok { color: #047857; } .pi-why.no { color: #b45309; }
.contact-more summary { cursor: pointer; font-size: .85rem; color: var(--muted); font-weight: 600; }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.cap { border-radius: 10px; border: 1px solid #e2e8f0; border-top: 4px solid var(--c); padding: .45rem .6rem; display: flex; flex-direction: column; }
.cap strong { font-size: 1.2rem; }
.cap span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.cap small { font-size: .72rem; color: #047857; font-weight: 600; }
.cap small.over { color: #b91c1c; }
.smart-opts[hidden], .indent[hidden] { display: none; }
.avatar.user-av { background: #334155; color: #fff; box-shadow: none; }
@media (max-width: 900px) { .move-banner { top: 62px; } .place-banner .pb-who small { display: none; } }

/* ============================================================ Dhivehi + live programme (v3.6) */
@font-face { font-family: "Noto Sans Thaana"; font-weight: 400; font-display: swap; src: url("fonts/noto-thaana-400.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Thaana"; font-weight: 700; font-display: swap; src: url("fonts/noto-thaana-700.woff2") format("woff2"); }
.dv, [lang=dv] { font-family: var(--thaana, "Faruma", "MV Faseyha", "Noto Sans Thaana", "MV Boli"), system-ui, sans-serif; direction: rtl; text-align: right; line-height: 1.8; }
[dir=rtl] .en { text-align: right; }
.h-dv { font-size: .8em; font-weight: 700; color: #4338ca; margin-inline-start: .4rem; }

/* language switch */
.lang-toggle { display: inline-flex; background: #f1f5f9; border-radius: 99px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.lt-btn { border: 0; background: none; padding: .32rem .8rem; border-radius: 99px; font: inherit; font-size: .82rem; font-weight: 600; color: #475569; cursor: pointer; white-space: nowrap; }
.lt-btn.dv { font-family: var(--thaana, "Faruma", "MV Faseyha", "Noto Sans Thaana", "MV Boli"), sans-serif; direction: rtl; line-height: 1.3; }
.lt-btn.on { background: #fff; color: #3730a3; box-shadow: 0 1px 3px rgba(15,23,42,.15); }

/* Thaana keyboard fields */
.thaana-wrap { position: relative; display: block; }
.thaana-wrap > input, .thaana-wrap > textarea { width: 100%; padding-left: 2.4rem; }
.thaana-btn { position: absolute; left: .35rem; top: .4rem; width: 1.8rem; height: 1.8rem; border-radius: 8px; border: 1px solid #c7d2fe; background: #eef2ff; color: #3730a3;
  font-family: var(--thaana, "Faruma", "MV Faseyha", "Noto Sans Thaana", "MV Boli"), sans-serif; font-weight: 700; cursor: pointer; line-height: 1; }
.thaana-btn.off { background: #fff; color: #64748b; border-color: #e2e8f0; font-family: inherit; }
label .thaana-wrap { margin-top: .3rem; }

/* programme management list */
.ag-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .7rem; }
.ag-live-mini { display: flex; gap: .4rem; align-items: center; }
.ag-list.lang-dv .en, .ag-list.lang-en .dv { display: none; }
.ag-list.lang-dv .ag-main { direction: rtl; }
.ag-item h3.dv { font-size: 1.12rem; margin: .1rem 0; }
.ag-item h3.en { margin: .1rem 0; }
.ag-item.lv-1 { margin-inline-start: 2.4rem; padding: .7rem .9rem; }
.ag-item.lv-1 .ag-no { min-width: 2.6rem; height: 2rem; font-size: .9rem; background: #e0e7ff; color: #3730a3; }
.ag-no.extra { background: linear-gradient(135deg, #06b6d4, #3b82f6); font-size: .72rem; min-width: 3.6rem; white-space: nowrap; }
.ag-no.note { background: #f1f5f9; color: #94a3b8; }
.ag-item.k-note { background: #fafafa; }
.ag-actions { flex-direction: column; align-items: flex-end; gap: .3rem; }
.ag-live-btns, .ag-edit-btns { display: flex; gap: .2rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.st-badge:empty { display: none; }
.st-badge { font-size: .74rem; font-weight: 700; padding: .05rem .5rem; border-radius: 99px; background: #e0e7ff; color: #3730a3; }
.ag-item.st-done { opacity: .62; }
.ag-item.st-done .st-badge { background: #dcfce7; color: #166534; }
.ag-item.st-done .ag-no { background: #22c55e; }
.ag-item.is-now { opacity: 1; box-shadow: 0 0 0 3px #fbbf24, var(--shadow); background: #fffbeb; }
.ag-item.is-now .ag-no { background: linear-gradient(135deg, #f59e0b, #f97316); animation: now-pulse 1.6s ease-in-out infinite; }
.ag-item.is-now .st-badge { background: #f59e0b; color: #fff; }
.ag-item.st-current:not(.is-now) { background: #fffdf5; }
@keyframes now-pulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .ag-item.is-now .ag-no, .prog-item.is-now .ag-no { animation: none; } }
.sub-check { align-self: end; padding-bottom: .5rem; }
@media (max-width: 640px) { .ag-item { grid-template-columns: auto 1fr; } .ag-actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; } .ag-item.lv-1 { margin-inline-start: 1rem; } }

/* programme list (guest page, live control) */
.prog-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.prog-head h2 { margin: 0; }
.prog-item { position: relative; }
.prog-item.lv-1 { margin-inline-start: 1.6rem; }
.prog-item.lv-1 .ag-no { min-width: 2.3rem; height: 1.8rem; font-size: .8rem; background: #eef2ff; color: #4338ca; }
.prog-item .ag-no.extra { background: linear-gradient(135deg, #06b6d4, #3b82f6); color: #fff; font-size: .66rem; min-width: 3.2rem; }
.prog-item .ag-no.note { background: none; color: #94a3b8; }
.prog-body { flex: 1; min-width: 0; }
.prog-title { font-weight: 700; }
.prog-title.dv { font-size: 1.05rem; }
.prog-title.dv + .prog-title.en { font-weight: 600; font-size: .9rem; color: #475569; }
.prog-presenter { font-size: .86rem; color: #475569; }
.prog-details { font-size: .82rem; color: #64748b; white-space: pre-line; }
.prog-meta { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .25rem; align-items: center; }
.now-pill { background: #f59e0b; color: #fff; font-size: .72rem; font-weight: 800; padding: .05rem .5rem; border-radius: 99px; }
.next-pill { background: #e0e7ff; color: #3730a3; font-size: .72rem; font-weight: 700; padding: .05rem .5rem; border-radius: 99px; }
.done-pill { background: #dcfce7; color: #166534; font-size: .72rem; font-weight: 700; padding: .05rem .5rem; border-radius: 99px; }
.prog-item.st-done { opacity: .55; }
.prog-item.st-done .ag-no { background: #bbf7d0; color: #166534; }
.prog-item.is-now { opacity: 1; background: #fffbeb; box-shadow: inset 3px 0 0 #f59e0b; }
[dir=rtl] .prog-item.is-now { box-shadow: inset -3px 0 0 #f59e0b; }
.prog-item.is-now .ag-no { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; animation: now-pulse 1.6s ease-in-out infinite; }
.prog-item.is-parent-now { background: #fffdf5; }
.prog-item.mine:not(.is-now) { background: #faf5ff; box-shadow: inset 3px 0 0 #a855f7; }
.ma-alert { font-weight: 800; padding: .6rem .8rem; border-radius: 12px; margin-bottom: .6rem; text-align: center; }
.ma-alert.now { background: #f59e0b; color: #fff; animation: now-pulse 1.6s ease-in-out infinite; }
.ma-alert.next { background: #e0e7ff; color: #3730a3; }
.ma-item.done { opacity: .55; }
.ma-item.now .ag-no { background: linear-gradient(135deg, #f59e0b, #f97316); }
.ma-title.dv + .ma-title.en { font-size: .88rem; color: #475569; }

/* live control page */
.pl-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.pl-now { display: grid; gap: .8rem; padding: 1.1rem; }
.pl-block { border-radius: 14px; padding: .9rem 1rem; }
.pl-block.now { background: linear-gradient(135deg, #fffbeb, #fff7ed); border: 2px solid #fbbf24; }
.pl-block.next { background: #f8fafc; border: 1px dashed #cbd5e1; }
.pl-block.idle { background: #f8fafc; text-align: center; }
.pl-label { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #b45309; margin-bottom: .4rem; }
.pl-block.next .pl-label { color: #64748b; }
.pl-row { display: flex; gap: .9rem; align-items: flex-start; }
.pl-block.now .ag-no.big { min-width: 3.6rem; height: 3.6rem; font-size: 1.5rem; background: linear-gradient(135deg, #f59e0b, #f97316); }
.pl-text { flex: 1; min-width: 0; }
.pl-title { font-size: 1.15rem; font-weight: 800; }
.pl-title.dv { font-size: 1.3rem; }
.pl-title.dv + .pl-title.en { font-size: .98rem; font-weight: 600; color: #475569; }
.pl-by { color: #475569; font-size: .92rem; }
.pl-details { color: #64748b; font-size: .86rem; white-space: pre-line; margin-top: .2rem; }
.pl-controls { display: flex; gap: .6rem; margin: .9rem 0 1.2rem; position: sticky; bottom: .8rem; z-index: 15; }
.pl-controls .btn { box-shadow: var(--shadow); }
.pl-controls .grow { flex: 1; }
.prog-list.live .prog-item { cursor: pointer; border-radius: 12px; }
.prog-list.live .prog-item:hover { background: #f8faff; }
.pl-more { margin-inline-start: auto; border: 0; background: #f1f5f9; border-radius: 8px; width: 2rem; height: 2rem; font-size: 1.1rem; cursor: pointer; flex: none; }
.prog-item.mine:not(.is-now) .ag-no { background: #a855f7; color: #fff; }
.ag-time, .done-pill, .now-pill, .next-pill, .st-badge { unicode-bidi: isolate; }
.ag-time, .done-pill, .st-badge { direction: ltr; }
.is-dv .ag-no.extra { font-size: .74rem; padding: 0 .45rem; }

/* Thaana font settings */
.font-list { display: grid; gap: .45rem; }
.font-opt { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem .75rem; border: 1px solid #e2e8f0; border-radius: 12px; cursor: pointer; margin: 0; font-weight: 400; }
.font-opt.on { border-color: var(--primary); background: #eef2ff; }
.font-opt input { margin-top: .3rem; }
.fo-main { display: grid; gap: .1rem; flex: 1; min-width: 0; }
.fo-sample { font-size: 1.25rem; line-height: 1.8; text-align: right; }
.font-files { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .3rem; }
.font-files li { display: flex; gap: .6rem; align-items: center; padding: .4rem .6rem; border: 1px solid #e2e8f0; border-radius: 10px; }
.font-files li > span[lang=dv] { font-size: 1.3rem; min-width: 3.5rem; }
.font-files form { margin-left: auto; }

/* ============================================================ Users & permissions (v3.7) */
.user-tools { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin-bottom: .6rem; }
.ur-access { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: .6rem .7rem; }
.access { display: grid; gap: .3rem; margin-top: .3rem; }
.acc-g { display: flex; flex-wrap: wrap; gap: .25rem .35rem; align-items: baseline; font-size: .8rem; }
.acc-g.none { opacity: .55; }
.acc-h { font-weight: 800; color: #475569; min-width: 7.5rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; }
.acc-p { background: #ecfdf5; color: #047857; border-radius: 99px; padding: .02rem .5rem; font-weight: 600; }
.acc-g.none .acc-p { background: none; color: var(--muted); }
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.role-card { border: 1px solid #e2e8f0; border-radius: 14px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .3rem; background: #fff; }
.role-card.sys { background: linear-gradient(135deg, #eef2ff, #fff); border-color: #c7d2fe; }
.role-card p { margin: 0; }
.rc-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.rc-count { color: #4338ca; font-weight: 700; }
.rc-edit summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.rc-actions { display: flex; gap: .3rem; align-items: center; margin-top: auto; padding-top: .2rem; }
.perm-search { max-width: 240px; }
.perm-wrap { max-height: 70vh; overflow: auto; }
.perm-table thead th { position: sticky; top: 0; background: #fff; z-index: 2; box-shadow: 0 1px 0 #e2e8f0; }
.perm-table td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 260px; }
.perm-table .perm-group td { background: #f1f5f9; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #475569; }
.perm-label { font-weight: 600; }
.perm-needs { color: #b45309; }
.perm-table td.changed { background: #fffbeb; }
.perm-table input[type=checkbox] { width: 1.1rem; height: 1.1rem; cursor: pointer; }
.perm-save { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: .8rem; padding: .7rem 0 .2rem; background: #fff; }
.perm-save.dirty { box-shadow: 0 -6px 12px -10px rgba(15,23,42,.4); }
#perm-dirty.warn { color: #b45309; font-weight: 700; }
