:root {
  color-scheme: light;
  --ink: #191918;
  --muted: #595956;
  --dark: #20201f;
  --dark-deep: #161616;
  --line: #d7d7d3;
  --canvas: #e9e9e6;
  --orange: #ff6925;
  --starfield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='210' viewBox='0 0 320 210'%3E%3Cg fill='%23efede6' opacity='.35'%3E%3Ccircle cx='12' cy='28' r='.8'/%3E%3Ccircle cx='42' cy='153' r='1'/%3E%3Ccircle cx='76' cy='55' r='.7'/%3E%3Ccircle cx='97' cy='112' r='1.1'/%3E%3Ccircle cx='122' cy='193' r='.8'/%3E%3Ccircle cx='143' cy='22' r='.65'/%3E%3Ccircle cx='169' cy='151' r='.8'/%3E%3Ccircle cx='190' cy='77' r='1'/%3E%3Ccircle cx='229' cy='184' r='.7'/%3E%3Ccircle cx='247' cy='39' r='.9'/%3E%3Ccircle cx='268' cy='126' r='1'/%3E%3Ccircle cx='294' cy='91' r='.7'/%3E%3C/g%3E%3Cg fill='%23ff945b' opacity='.6'%3E%3Cpath d='M55 89l1.1 2.9 2.9 1.1-2.9 1.1-1.1 2.9-1.1-2.9-2.9-1.1 2.9-1.1zM225 112l1 2 2 1-2 1-1 2-1-2-2-1 2-1z'/%3E%3Ccircle cx='303' cy='181' r='1.1'/%3E%3C/g%3E%3C/svg%3E");
  --radius: 17px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .52; cursor: default; }
a { color: inherit; }
:focus-visible { outline: 3px solid #ae400d; outline-offset: 3px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.13; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 3.4vw, 3rem); letter-spacing: -.065em; font-weight: 750; }
h2 { font-size: 1.2rem; letter-spacing: -.027em; }
h3 { font-size: 1rem; }
small { color: var(--muted); }
svg { flex: none; }
#page:focus { outline: none; }

.brand { display: flex; align-items: center; gap: 11px; font-size: 1.39rem; line-height: 1; font-weight: 750; letter-spacing: -.045em; }
.brand span { display: block; font-size: .59rem; font-weight: 660; letter-spacing: .13em; color: #b5b5b1; margin-top: 6px; }
.brand img { flex: none; }
.live-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px #ff69252c; }
.overline { font-size: .69rem; font-weight: 780; letter-spacing: .15em; color: #98401b; line-height: 1.4; }
.muted { color: var(--muted); line-height: 1.5; }

.button {
  min-height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 670;
  font-size: .88rem;
  line-height: 1.3;
  transition: background .12s, border-color .12s;
}
.button svg { width: 17px; height: 17px; }
.primary { color: #171716; background: var(--orange); border-color: #f36423; }
.primary:hover:not(:disabled) { background: #ff814a; border-color: #f0672c; }
.secondary { color: var(--ink); background: #fff; border-color: var(--line); }
.secondary:hover:not(:disabled) { background: #f2f2ef; border-color: #aeadab; }
.danger { color: #902d2c; background: #ffefed; border-color: #f7ceca; }
.danger:hover { background: #ffdfdb; }
.small { min-height: 36px; padding: 6px 10px; font-size: .82rem; }
.icon-only { width: 40px; min-height: 40px; padding: 0; color: var(--muted); background: transparent; }
.icon-only:hover { background: #e9e9e6; }
.text-link { color: #9a3512; font-weight: 650; text-underline-offset: 3px; }
.form-message { color: #9a3231; line-height: 1.4; font-size: .88rem; }
.form-message:empty { display: none; }

.login-layout { min-height: 100dvh; display: grid; grid-template-columns: 1fr .83fr; background: #fff; }
.login-brand {
  min-height: 100%;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(ellipse at 90% 38%, #3a3530 0, transparent 50%), var(--dark-deep);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(26px, 5.4vw, 84px);
  position: relative;
  isolation: isolate;
}
.login-brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .26;
  background: repeating-radial-gradient(circle at 90% 48%, #ff692557 0 1px, transparent 2px 45px);
  mask-image: linear-gradient(100deg, transparent 15%, #000 80%);
}
.login-art .overline { color: #ff9e70; display: flex; align-items: center; gap: 10px; }
.login-art h1 { margin: 20px 0 18px; font-size: clamp(3.4rem, 7vw, 7rem); line-height: .98; }
.login-art p { max-width: 315px; color: #d4d3cf; font-size: 1.08rem; line-height: 1.5; }
.login-foot { color: #b5b2ad; font-size: .75rem; letter-spacing: .2em; font-weight: 650; }
.login-panel { display: grid; place-items: center; padding: 36px; }
.login-form { display: grid; gap: 16px; width: min(100%, 370px); }
.login-form h2 { font-size: 2.45rem; letter-spacing: -.06em; }
.login-form > p:not(.overline, .form-message) { color: var(--muted); line-height: 1.5; margin-bottom: 7px; }
.login-form .primary { justify-content: space-between; min-height: 47px; margin-top: 5px; }

.shell { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--dark-deep);
  color: #fff;
  padding: 27px 15px 17px;
}
.sidebar .brand { padding: 0 10px; }
.nav-caption { color: #a8a7a4; font-size: .63rem; font-weight: 750; letter-spacing: .15em; margin: 48px 12px 13px; }
#nav { display: grid; gap: 4px; }
.nav-link { width: 100%; justify-content: flex-start; min-height: 45px; color: #d1d0cc; background: transparent; font-size: .85rem; }
.nav-link:hover { background: #30302f; }
.nav-link[aria-current] { color: #fff1e9; background: #382820; border-color: #69402a; }
.nav-link[aria-current] svg { color: var(--orange); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 9px; border-top: 1px solid #373736; padding: 16px 7px 0; color: #c0bfbb; font-size: .74rem; }
.sidebar-foot .live-dot { width: 6px; height: 6px; }
.foot-tag { margin-left: auto; padding: 3px 6px; border: 1px solid #4b4946; border-radius: 5px; color: #c0bfbb; font-weight: 700; }
.workspace { min-width: 0; }
.topbar { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px clamp(18px, 3.3vw, 48px); border-bottom: 1px solid var(--line); background: #f8f8f5; }
.breadcrumb, .identity { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: .84rem; }
.breadcrumb strong, .identity strong { color: var(--ink); }
.identity strong { display: block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity div > span { display: block; font-size: .72rem; margin-top: 2px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: none; color: #763116; background: #ffdcca; border-radius: 50%; font-size: .74rem; font-weight: 750; }
.page { width: 100%; max-width: 1510px; margin: 0 auto; padding: clamp(21px, 3.2vw, 46px) clamp(17px, 3.3vw, 48px) 48px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.page-head .overline { margin-bottom: 8px; }
.subtitle { color: var(--muted); margin-top: 10px; line-height: 1.45; }
.page-actions, .hero-actions, .page-controls, .camera-actions, .invite-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

.hero { border: 1px solid #373635; border-radius: var(--radius); min-height: 243px; overflow: hidden; isolation: isolate; position: relative; color: #fff; background: var(--starfield), radial-gradient(ellipse at 83% 41%, #563627, transparent 59%), #191918; }
.hero-copy { padding: clamp(24px, 4vw, 44px); position: relative; z-index: 1; }
.hero-kicker { font-size: .66rem; font-weight: 750; color: #ffad88; letter-spacing: .17em; display: flex; align-items: center; gap: 10px; }
.hero h2 { font-size: clamp(2rem, 4.4vw, 3.65rem); letter-spacing: -.067em; margin: 13px 0 8px; max-width: min(100%, 15ch); }
.hero p { color: #deddda; line-height: 1.4; max-width: 32ch; }
.hero-actions { margin-top: 21px; }
.hero-button { color: #efeeeb; border-color: #79746f; background: #ffffff09; }
.hero-button:hover { background: #ffffff1b; }
.galaxy-scene { position: relative; isolation: isolate; min-width: 0; display: grid; justify-items: center; align-content: center; color: #f2e9de; }
.galaxy-scene::before, .galaxy-scene::after, .hero::before, .tv-layout::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--starfield) center / 240px auto repeat; animation: star-twinkle 4.8s ease-in-out infinite alternate;
}
.galaxy-scene::after { background-position: 86px 64px; animation-delay: -2.4s; animation-duration: 5.8s; }
.hero::before, .tv-layout::before { background-position: 58px 35px; animation-delay: -1.2s; }
.galaxy-scene canvas { display: block; width: 100%; max-width: 360px; }
@keyframes star-twinkle { from { opacity: .22; } to { opacity: .92; } }
@media (prefers-reduced-motion: reduce) {
  .galaxy-scene::before, .galaxy-scene::after, .hero::before, .tv-layout::before { animation: none; opacity: .6; }
}
.hero-decoration { position: absolute; width: 43%; right: 0; top: 0; bottom: 0; pointer-events: none; }
.invite-galaxy-label { color: #625950; font-size: .75rem; text-align: center; overflow-wrap: anywhere; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-top: 17px; }
.metric { display: grid; gap: 8px; padding: 16px; }
.metric-top { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 660; color: #464643; }
.metric-icon { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; flex: none; }
.metric-icon svg { width: 18px; height: 18px; }
.metric-icon.neutral { background: #e9e9e6; color: #535350; }
.metric-icon.green { background: #ffeadf; color: #a64015; }
.metric-icon.gold { background: #f0efec; color: #5a5651; }
.metric-icon.lilac { background: #e7e7e5; color: #504d49; }
.metric-value { font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.metric small { font-size: .74rem; }
.overview-grid, .scan-grid, .settings-grid { display: grid; grid-template-columns: 1.23fr 1fr; gap: 16px; margin-top: 16px; }
.detail-panel, .scan-panel { padding: clamp(16px, 2vw, 22px); }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 15px; }
.panel-head p { color: var(--muted); font-size: .86rem; margin-top: 5px; line-height: 1.4; }
.panel-label { font-size: .62rem; font-weight: 770; color: #6a5b51; letter-spacing: .1em; background: #ededea; border-radius: 6px; padding: 6px 8px; text-align: center; }
.activity-row, .table-row, .manual-row { border-top: 1px solid var(--line); padding: 11px 0; }
.activity-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.activity-row strong, .manual-row strong { overflow-wrap: anywhere; }
.activity-row small, .manual-row small { display: block; margin-top: 3px; font-size: .76rem; }
.activity-row time { color: var(--muted); font-size: .72rem; text-align: right; }
.initials { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #e9e9e6; color: #575553; font-size: .72rem; font-weight: 760; }
.table-row > div { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; }
.table-row > div span { color: var(--muted); font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 7px; appearance: none; border: 0; border-radius: 8px; background: #e7e7e4; }
progress::-webkit-progress-bar { background: #e7e7e4; border-radius: 8px; }
progress::-webkit-progress-value { background: #ff6925; border-radius: 8px; }
progress::-moz-progress-bar { background: #ff6925; border-radius: 8px; }
.empty { padding: 32px 15px; text-align: center; display: grid; justify-items: center; gap: 7px; }
.empty-icon { display: grid; place-items: center; width: 37px; height: 37px; margin-bottom: 3px; background: #e9e9e6; color: #5a5652; border-radius: 11px; }
.empty p { color: var(--muted); font-size: .83rem; line-height: 1.4; }

label:not(.search-field) { display: grid; gap: 7px; font-weight: 650; font-size: .87rem; }
input:not([type=checkbox]), select { color: var(--ink); min-width: 0; border: 1px solid #cececa; border-radius: 9px; background: #fff; min-height: 43px; padding: 9px 11px; }
input::placeholder { color: #6e6d68; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: #d64e10; }
.search-field { display: flex; align-items: center; gap: 7px; min-width: 0; color: #585753; border: 1px solid #cececa; background: #fff; padding-left: 10px; border-radius: 9px; }
.search-field input { border: 0; background: transparent; padding-left: 0; width: 100%; min-height: 41px; }
.search-field:focus-within { outline: 2px solid #ae400d; outline-offset: 1px; }
.search-field input:focus { outline: none; }
.search-field svg { width: 17px; height: 17px; }
.guest-tools, .pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 17px; flex-wrap: wrap; }
.guest-tools { justify-content: flex-end; }
.pagination:empty { display: none; }
.pagination > span { color: var(--muted); font-size: .84rem; }
#guest-results { overflow-x: auto; }
.guests-table { width: 100%; border-collapse: collapse; text-align: left; }
.guests-table th { background: #ececea; color: #585751; font-size: .76rem; font-weight: 720; }
.guests-table th, .guests-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.guests-table td { font-size: .89rem; }
.guests-table td:not(.guest-name, .guest-empty) { white-space: nowrap; }
.guests-table th:not(.selection) { vertical-align: top; }
.guests-table th .search-field, .guests-table th select { margin-top: 6px; }
.guests-table th .search-field { min-width: 148px; max-width: 280px; }
.guests-table th select { display: block; max-width: 100%; }
.guests-table .guest-name { font-weight: 680; min-width: 115px; overflow-wrap: anywhere; }
.guests-table .selection { width: 42px; padding-left: 16px; }
.status-chip { border-radius: 15px; display: inline-block; padding: 4px 8px; font-size: .72rem; font-weight: 700; }
.status-chip.pending { color: #615d57; background: #f0efec; }
.status-chip.arrived { color: #24643d; background: #e3f5de; }

.scan-grid { align-items: start; }
.camera-box { aspect-ratio: 4 / 3; max-height: 430px; position: relative; overflow: hidden; display: grid; place-items: center; border-radius: 13px; background: radial-gradient(ellipse at center, #363634, #181817); color: #f0efec; }
.camera-box video { position: absolute; width: 100%; height: 100%; object-fit: contain; }
.camera-frame { width: 57%; max-width: 240px; aspect-ratio: 1; position: absolute; }
.camera-frame i { position: absolute; display: block; width: 23px; height: 23px; border-color: #ff814a; border-style: solid; border-width: 0; }
.camera-frame i:nth-child(1) { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 8px; }
.camera-frame i:nth-child(2) { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 8px; }
.camera-frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 8px; }
.camera-frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 8px; }
#camera-placeholder { z-index: 1; display: grid; place-items: center; gap: 7px; text-align: center; padding: 0 8px; }
#camera-placeholder span { background: #ffffff15; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; }
#camera-placeholder p { font-weight: 700; }
#camera-placeholder small { color: #c4c2bf; font-size: .73rem; }
.camera-actions { margin-top: 14px; }
.camera-actions .qr-photo { display: inline-flex; position: relative; cursor: pointer; }
.qr-photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; clip-path: inset(50%); }
.qr-photo:focus-within { outline: 3px solid #ae400d; outline-offset: 3px; }
.scan-panel .form-message { margin-top: 9px; }
.scan-result { padding: 14px; border: 1px solid #ddddd9; border-radius: 12px; background: #eeeeeb; display: flex; align-items: flex-start; gap: 10px; min-height: 80px; }
.scan-result strong { display: block; font-size: 1.06rem; }
.scan-result p { margin-top: 4px; font-size: .88rem; line-height: 1.4; overflow-wrap: anywhere; }
.result-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #ffffffa8; flex: none; }
.scan-result.accepted { background: #e4f8de; color: #205f35; border-color: #b9dfb1; }
.scan-result.duplicate, .scan-result.missing, .scan-result.error { background: #fff0ed; color: #9a2c2b; border-color: #efbbb5; }
#scan-next { margin-top: 10px; }
.manual { padding-top: 20px; }
.manual > p { color: var(--muted); font-size: .84rem; margin: 5px 0 10px; line-height: 1.4; }
.manual-results { margin-top: 8px; }
.manual-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.manual-row:first-child { border-top: 0; }
.staff-panel { margin-top: 16px; }
.stack-form { display: grid; gap: 13px; }
.stack-form .button { justify-self: start; }
.detail-panel > .stack-form { margin-top: 16px; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); width: min(96vw, 470px); color: var(--ink); background: #fff; padding: 18px 21px 22px; box-shadow: 0 18px 75px #10101044; max-height: 90dvh; }
dialog:has(.invitation-modal) { width: min(96vw, 770px); }
dialog::backdrop { background: #141414c2; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 11px; }
.invite-actions { justify-content: space-between; margin-bottom: 11px; }
.invite-tray { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(205px, 100%), 1fr)); gap: 11px; max-height: 64dvh; overflow: auto; }
.invite-figure { display: grid; justify-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.invite-figure img { display: block; width: min(100%, 280px); border-radius: 6px; }
.toast { position: fixed; z-index: 5; bottom: 18px; right: 18px; max-width: min(380px, calc(100vw - 36px)); border-radius: 11px; color: #fff; background: #242423; padding: 13px 16px; line-height: 1.4; box-shadow: 0 8px 24px #22222240; }
.toast.negative { background: #8c302d; }
#print-area { display: none; }

@media (max-width: 1050px) {
  .shell { grid-template-columns: 186px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .metric { padding: 12px; }
  .metric-top { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 13px 13px 8px; }
  .sidebar .brand { padding: 0 2px; font-size: 1.15rem; }
  .sidebar .brand img { width: 32px; height: 32px; }
  .nav-caption, .sidebar-foot { display: none; }
  #nav { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 9px; }
  .nav-link { width: auto; min-height: 34px; padding: 5px 8px; gap: 4px; font-size: .73rem; }
  .nav-link svg { width: 14px; height: 14px; }
  .topbar { min-height: 50px; padding-block: 4px; }
  .identity div > span, .breadcrumb > span { display: none; }
  .identity { gap: 6px; }
  .avatar { width: 27px; height: 27px; font-size: .64rem; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 17px; }
  .hero-copy { padding: 22px; }
  .hero-decoration { align-content: start; padding-top: 16px; opacity: .77; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-top { align-items: center; flex-direction: row; }
  .overview-grid, .scan-grid, .settings-grid { grid-template-columns: 1fr; gap: 11px; }
  .guests-table th, .guests-table td { padding-inline: 7px; }
  .guests-table .selection { padding-left: 8px; }
  .guest-tools, .pagination { padding-inline: 11px; }
  .login-layout { grid-template-columns: 1fr; align-content: start; }
  .login-brand { min-height: 285px; gap: 34px; padding: 25px; }
  .login-art h1 { font-size: clamp(2.6rem, 9.5vw, 4.4rem); margin: 11px 0 8px; }
  .login-foot { display: none; }
  .login-panel { padding: 27px 22px; }
}
@media (max-width: 390px) {
  .metrics .metric-top { align-items: start; flex-direction: column; }
  .button { padding-inline: 9px; }
  .activity-row { grid-template-columns: auto 1fr; }
  .activity-row time { grid-column: 2; text-align: left; }
}
@media print {
  body, :root { background: #fff; }
  body > :not(#print-area) { display: none !important; }
  #print-area { display: block; }
  #print-area img { display: inline-block; width: 46%; height: auto; margin: 1.5%; break-inside: avoid; vertical-align: top; }
  @page { margin: 10mm; }
}

