:root {
  --bg: #07111f;
  --panel: rgba(255,255,255,.94);
  --panel-dark: #0f2138;
  --text: #102033;
  --muted: #667085;
  --blue: #1b5cff;
  --cyan: #18b7e8;
  --green: #17a767;
  --orange: #f59e0b;
  --red: #e5484d;
  --line: #d8e3f0;
  --shadow: 0 24px 80px rgba(4, 15, 33, .22);
}
* { box-sizing: border-box; }
html { width: 100%; max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(24,183,232,.34), transparent 28rem),
    radial-gradient(circle at 85% 12%, rgba(27,92,255,.34), transparent 30rem),
    linear-gradient(135deg, #06101e 0%, #10233b 52%, #07111f 100%);
}
.app-shell { width: min(1240px, calc(100vw - 28px)); margin: 0 auto; padding: 28px 0 56px; }
.hero { display: grid; gap: 12px; color: white; margin-bottom: 18px; }
.brand-logo { display: block; width: min(420px, 100%); height: auto; border-radius: 22px; background: white; padding: 12px 18px; box-shadow: 0 16px 44px rgba(0,0,0,.18); }
h1 { font-size: clamp(38px, 6vw, 72px); line-height: .92; margin: 0; letter-spacing: -.06em; }
.card { background: var(--panel); border: 1px solid rgba(216,227,240,.9); border-radius: 26px; box-shadow: var(--shadow); }
.toolbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 14px; margin-bottom: 14px; }
.upload-box { display: flex; gap: 14px; align-items: center; }
.upload-box input { max-width: 260px; color: var(--muted); }
.upload-box p { margin: 3px 0 0; color: var(--muted); }
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.mobile-label { display: none; }
.btn { border: 0; border-radius: 999px; padding: 11px 15px; font-weight: 800; cursor: pointer; background: linear-gradient(135deg, var(--blue), var(--cyan)); color: white; }
.btn.secondary { background: #eef7ff; color: #12528d; border: 1px solid #c7e3f9; }
.btn.danger { background: #fff1f2; color: #b4232a; border: 1px solid #ffcdd2; }
.btn.small { padding: 2px 8px; font-size: 12px; border-radius: 4px; }
.btn.small.danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.btn.small.danger:hover { background: #fecaca; }
.user-list code + .btn.small { margin-left: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.stat { background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: 0 14px 50px rgba(4,15,33,.12); }
.stat span { display:block; color: var(--muted); font-size: 13px; font-weight: 700; }
.stat strong { display:block; font-size: 34px; margin-top: 4px; color: #123c69; }
.stat.arrived strong { color: var(--green); }
.stat.waiting strong { color: var(--orange); }
.main-grid { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: start; }
.controls { padding: 18px; position: sticky; top: 12px; }
label { display: block; margin-bottom: 14px; }
label span { display: block; font-size: 13px; color: var(--muted); font-weight: 800; margin-bottom: 6px; }
input { width: 100%; border: 1px solid #c9d9eb; border-radius: 16px; padding: 13px 14px; font: inherit; outline: none; background: white; }
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(24,183,232,.14); }
.filter-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 12px 0 18px; }
.tab { border: 1px solid #c9d9eb; background: #f7fbff; color: #38506d; border-radius: 14px; padding: 10px; font-weight: 800; cursor: pointer; }
.tab.active { background: #123c69; color: white; border-color: #123c69; }
.hint { background: #f0f8ff; border: 1px solid #c9e6fa; border-radius: 18px; padding: 14px; color: #38506d; font-size: 14px; line-height: 1.45; }
.event-title-block { display: block; margin-bottom: 14px; }
.event-title-block span { display: block; font-size: 13px; color: var(--muted); font-weight: 800; margin-bottom: 6px; }
.event-name-display { display: block; border: 1px solid #d7e4f2; border-radius: 16px; padding: 13px 14px; background: #f7fbff; color: #123c69; font-size: 18px; line-height: 1.2; min-height: 49px; }
.list-card { padding: 16px; }
.list-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; padding: 4px 4px 14px; border-bottom:1px solid var(--line); }
h2 { margin:0; font-size: 26px; color: #123c69; }
.list-head p { margin: 4px 0 0; color: var(--muted); }
.save-state { background:#ecfdf3; color:#067647; border:1px solid #abefc6; padding:6px 10px; border-radius:999px; font-size:12px; font-weight:800; white-space:nowrap; }
.guest-list { display:grid; gap: 10px; padding-top: 14px; max-height: calc(100vh - 280px); overflow:auto; padding-right: 4px; }
.guest-list.empty { min-height: 320px; place-items:center; color: var(--muted); background: #f8fbff; border-radius: 20px; border: 1px dashed #bdd2e8; }
.guest-row { display:grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items:center; border:1px solid #d8e3f0; border-radius: 20px; padding: 12px; background:white; transition: .15s ease; }
.guest-row:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(4,15,33,.08); }
.guest-row.is-arrived { background: linear-gradient(90deg, #effdf5, white); border-color:#abefc6; }
.arrival-toggle { width: 48px; height: 48px; border-radius: 999px; border: 2px solid #c9d9eb; background:#f7fbff; cursor:pointer; font-size: 22px; }
.arrival-toggle::after { content: '✓'; color:#94a3b8; font-weight: 900; }
.is-arrived .arrival-toggle { background: var(--green); border-color: var(--green); }
.is-arrived .arrival-toggle::after { color:white; }
.guest-name { display:block; font-size: 18px; color:#102033; }
.guest-meta { display:block; margin-top: 3px; color: var(--muted); font-size: 14px; }
.guest-status { text-align:right; color: var(--muted); font-size: 13px; min-width: 132px; }
.is-arrived .guest-status { color: var(--green); font-weight: 800; }
@media (max-width: 900px) {
  .hero, .main-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: stretch; }
  .toolbar-actions .btn { flex: 1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .controls { position: static; }
  .guest-list { max-height: none; }
}
@media (max-width: 560px) {
  body { background: #07111f; touch-action: pan-y; }
  .app-shell, .hero, .toolbar, .stats-grid, .main-grid, .controls, .list-card, .guest-list, .guest-row { max-width: 100%; min-width: 0; }
  .app-shell { width: 100%; padding: 10px 7px 28px; overflow-x: hidden; }
  .hero { gap: 7px; margin-bottom: 8px; }
  .brand-logo { width: 100%; max-width: 100%; border-radius: 16px; padding: 8px 12px; box-shadow: 0 8px 22px rgba(0,0,0,.14); }
  h1 { font-size: 30px; margin: 0; letter-spacing: -.045em; }

  .toolbar { padding: 8px; gap: 8px; border-radius: 18px; margin-bottom: 8px; }
  .upload-box { flex-direction: column; align-items: stretch; gap: 6px; }
  .upload-box p { display: none; }
  .upload-box strong { font-size: 13px; }
  .upload-box input { max-width: 100%; min-width: 0; font-size: 12px; }
  .toolbar-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .desktop-label { display: none; }
  .mobile-label { display: inline; }
  .btn { min-width: 0; min-height: 42px; padding: 8px 7px; border-radius: 18px; font-size: 12px; line-height: 1.12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
  .stat { border-radius: 18px; padding: 11px 12px; min-height: 88px; }
  .stat span { font-size: 12px; }
  .stat strong { font-size: 34px; margin-top: 2px; }

  .main-grid { gap: 8px; }
  .controls { padding: 12px; border-radius: 18px; }
  .event-title-block { margin-bottom: 9px; }
  .event-title-block span { font-size: 12px; margin-bottom: 4px; }
  .event-name-display { border-radius: 13px; padding: 10px 11px; min-height: 42px; font-size: 15px; overflow-wrap: anywhere; }
  label { margin-bottom: 9px; }
  label span { font-size: 12px; margin-bottom: 4px; }
  input { max-width: 100%; min-width: 0; border-radius: 13px; padding: 10px 11px; font-size: 15px; }
  .filter-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 8px 0 10px; }
  .tab { min-width: 0; border-radius: 12px; padding: 8px 5px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hint { display: none; }

  .list-card { padding: 10px; border-radius: 18px; }
  .list-head { padding: 0 0 9px; gap: 8px; }
  h2 { font-size: 19px; }
  .list-head p { font-size: 12px; }
  .save-state { display: none; }
  .guest-list { gap: 7px; padding-top: 9px; }
  .guest-row { grid-template-columns: 40px minmax(0, 1fr); gap: 9px; border-radius: 15px; padding: 8px; overflow: hidden; }
  .guest-main { min-width: 0; }
  .guest-status { grid-column: 2; text-align:left; font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
  .arrival-toggle { width: 38px; height: 38px; font-size: 18px; flex: 0 0 auto; }
  .guest-name { font-size: 15px; overflow-wrap: anywhere; }
  .guest-meta { font-size: 12px; margin-top: 1px; overflow-wrap: anywhere; word-break: break-word; }
}
