:root {
  --paper: #f4f7fc;
  --surface: #ffffff;
  --ink: #102344;
  --muted: #465875;
  --line: #dae3f1;
  --blue: #184b98;
  --blue-dark: #123570;
  --blue-soft: #eaf1fc;
  --yellow: #ffda44;
  --sans: Outfit, "Avenir Next", system-ui, sans-serif;
  --serif: Newsreader, Georgia, serif;
  --shadow: 0 20px 45px #12357012;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 400 16px/1.5 var(--sans);
}
a { color: inherit; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 max(24px, calc((100% - 1200px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 21px; font-weight: 700; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--yellow);
  font-size: 17px;
}
.brand-dot, .eyebrow, .dialog-eyebrow, .public-label { color: var(--blue); }
.nav-link { font-size: 14px; font-weight: 600; text-decoration: none; }
.nav-link:hover { color: var(--blue); text-decoration: underline; }
.shell { width: min(1200px, calc(100% - 48px)); margin: auto; padding: 30px 0 72px; }
.intro, .signup-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 32px;
  background:
    radial-gradient(ellipse at 80% 44%, #2359aa 0%, transparent 42%),
    radial-gradient(ellipse at 100% 100%, #173c75 0%, transparent 62%),
    #071834;
  color: #ffffff;
}
.intro {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  min-height: 420px;
  padding: clamp(28px, 5vw, 72px);
}
.intro > div:first-child { z-index: 1; min-width: 0; }
.eyebrow, .dialog-eyebrow, .public-label { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .15em; }
.intro .eyebrow { color: var(--yellow); }
.intro h1 {
  margin: 15px 0;
  font-size: clamp(56px, 7vw, 104px);
  line-height: .92;
  font-weight: 700;
  letter-spacing: -.065em;
}
.intro h1 span { color: var(--yellow); }
.intro-copy { max-width: 37ch; color: #e3edff; margin: 19px 0 0; font-size: clamp(16px, 2vw, 19px); }
.ticket-stage { position: relative; display: grid; place-items: center; min-height: 270px; }
.ticket {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: 4fr 1fr;
  width: min(88%, 380px);
  aspect-ratio: 2 / 1;
  border: 1px solid #fff0aa;
  border-radius: 18px;
  box-shadow: 0 26px 58px #020c2280;
}
.ticket-back {
  transform: translate(5%, 4%) rotate(13deg);
  background: linear-gradient(135deg, #27539b, #82a9e9);
}
.ticket-front {
  transform: translate(-3%, -7%) rotate(-13deg);
  background: linear-gradient(145deg, #fff4b5, #ffdb55 60%, #f0bb16);
  color: #102344;
}
.ticket-main { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(12px, 2.5vw, 28px); }
.ticket-mark { font-size: clamp(29px, 5vw, 60px); line-height: .9; }
.ticket-name { font: italic 500 clamp(24px, 5vw, 60px)/.85 var(--serif); }
.ticket-stub { display: grid; place-items: center; border-left: 1px dashed #445275; font-size: clamp(18px, 3vw, 30px); }

.workspace { display: grid; grid-template-columns: minmax(260px, 345px) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.create-card, .draws-section, .signup-card {
  min-width: 0;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.create-card h2, .section-heading h2 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -.035em; }
.muted { color: var(--muted); font-size: 14px; }
.create-card > .muted { margin: 7px 0 22px; }
.create-form, .signup-card form { display: grid; gap: 8px; }
.create-form label, .signup-card label { font-size: 14px; font-weight: 600; }
.create-form label:not(:first-child), .signup-card label:not(:first-child) { margin-top: 9px; }
.create-form input, .signup-card input, .edit-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c9d6ea;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}
input::placeholder { color: #5e6e87; }
.edit-form textarea { resize: vertical; }
.number-field { display: grid; grid-template-columns: 46px 1fr 46px; border: 1px solid #c9d6ea; border-radius: 11px; background: #fff; }
.number-field input { border: 0; text-align: center; background: transparent; appearance: textfield; }
.number-field input::-webkit-inner-spin-button, .number-field input::-webkit-outer-spin-button { appearance: none; }
.stepper { border: 0; border-radius: 10px; background: transparent; color: var(--blue); font-size: 20px; }
.stepper:hover { background: var(--blue-soft); }
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  font-weight: 650;
}
.button-dark, .small-button.primary { background: var(--blue); color: #fff; }
.button-dark:hover, .small-button.primary:hover { background: var(--blue-dark); }
.button-full { width: 100%; margin-top: 10px; }
.privacy-note { display: flex; gap: 8px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.count-pill { display: inline-grid; place-items: center; min-width: 28px; min-height: 28px; padding: 0 7px; border-radius: 50px; background: var(--blue-soft); color: var(--blue-dark); font-size: 13px; vertical-align: 3px; }
.refresh-button, .dialog-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 21px; }
.refresh-button:hover, .dialog-close:hover { background: var(--blue-soft); }
.draw-list { display: grid; gap: 12px; margin-top: 19px; }
.draw-card { display: grid; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.draw-title-row, .draw-meta, .draw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.draw-title { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.status { border-radius: 99px; padding: 4px 9px; background: #fff5c8; color: #453700; font-size: 12px; font-weight: 600; }
.status.closed { background: #eaf1fc; color: #254675; }
.draw-meta { margin-top: 6px; color: var(--muted); font-size: 13px; }
.draw-meta span + span::before { content: "·"; margin-right: 8px; }
.small-button { min-height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; }
.small-button:hover { background: var(--blue-soft); }
.small-button[data-action="delete"] { color: var(--blue-dark); }
.empty-state { padding: 40px 15px; border: 1px dashed #c9d6ea; border-radius: 18px; background: #f5f8ff; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); margin: 0 auto 12px; font-size: 21px; }
.empty-state h3 { margin: 0; font-size: 17px; }
.empty-state p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.toast { position: fixed; z-index: 5; left: 50%; bottom: 22px; width: max-content; max-width: calc(100% - 32px); transform: translateX(-50%); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; opacity: 0; pointer-events: none; }
.toast.show { opacity: 1; }
.draw-dialog { width: min(520px, calc(100% - 24px)); max-height: 90dvh; overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); }
.draw-dialog::backdrop { background: #081a39a0; backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 12px; right: 12px; }
.dialog-title { margin: 8px 43px 0 0; font-size: 26px; line-height: 1.1; overflow-wrap: anywhere; }
.dialog-eyebrow { padding-right: 45px; }
.qr-layout { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 20px; }
.qr-wrap { padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.qr-wrap img { display: block; width: 100%; height: auto; }
.qr-copy, .share-url { font-size: 14px; color: var(--muted); }
.share-url { display: block; margin-top: 9px; overflow-wrap: anywhere; }
.copy-button { margin-top: 10px; }
.result-list, .people-list { display: grid; gap: 8px; margin-top: 17px; }
.result-person, .people-row { padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.result-person .muted { margin: 6px 0 0; }
.result-number { display: inline-grid; place-items: center; min-width: 25px; height: 25px; margin-right: 9px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-size: 13px; }
.people-list { max-height: 340px; overflow: auto; }
.people-row span { display: block; color: var(--muted); font-size: 12px; }
.edit-form { margin-top: 18px; }
.edit-form p { margin: 0; }
.edit-form [role="alert"]:empty { display: none; }

.signup-shell { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; width: min(920px, calc(100% - 48px)); margin: 50px auto; }
.signup-art { display: grid; align-items: center; }
.signup-card h1 { margin: 10px 0 0; font-size: clamp(33px, 5vw, 48px); line-height: 1; letter-spacing: -.04em; overflow-wrap: anywhere; }
.signup-card > .muted { margin: 10px 0 20px; }
.signup-message { margin-top: 14px; padding: 12px; border-radius: 11px; color: #453700; background: #fff5c8; font-weight: 600; }
.signup-message:empty { display: none; }
.signup-message.error { color: #263e65; background: #eaf1fc; border-left: 3px solid var(--blue); }
.signup-footnote { color: var(--muted); font-size: 13px; margin: 16px 0 0; }

@media (max-width: 720px) {
  .shell, .signup-shell { width: calc(100% - 32px); }
  .shell { padding-top: 16px; }
  .intro { min-height: 0; grid-template-columns: 1fr; border-radius: 24px; padding: 26px 24px 14px; }
  .intro h1 { font-size: clamp(50px, 11vw, 76px); }
  .ticket-stage { min-height: 170px; }
  .ticket { width: min(66%, 290px); }
  .workspace, .signup-shell { grid-template-columns: 1fr; gap: 14px; }
  .signup-shell { margin: 18px auto 30px; }
  .signup-art { order: 1; border-radius: 24px; }
}
@media (max-width: 390px) {
  .qr-layout { grid-template-columns: 1fr; }
  .qr-wrap { max-width: 155px; }
}
