:root {
  color-scheme: light dark;
  font-family: "Instrument Sans", system-ui, sans-serif;
  --bg: light-dark(#f5f4ee, #161715);
  --surface: light-dark(#fffefa, #21221f);
  --inset: light-dark(#eeede5, #2b2d28);
  --ink: light-dark(#191b17, #faf8ef);
  --muted: light-dark(#55574f, #c0bfb3);
  --line: light-dark(#d8d7cb, #44463d);
  --accent: #f2ce4c;
  --accent-hover: #ffe16e;
  --on-accent: #211c0d;
  --link: light-dark(#5a4600, #f4d568);
  --success: light-dark(#235932, #b2e1b9);
  --success-bg: light-dark(#e5f0df, #294231);
  --danger: light-dark(#99302a, #ffb0a7);
  background: var(--bg);
  color: var(--ink);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
.shell { width: min(calc(100% - 2rem), 72rem); margin-inline: auto; }
main { flex: 1; padding-block: clamp(1.3rem, 4vw, 3.25rem) 3rem; }
header, footer { background: var(--surface); }
header { border-bottom: 1px solid var(--line); }
footer { border-top: 1px solid var(--line); }
.top, .top-tools, nav, .row, .footer-inner { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.top { min-height: 4.25rem; justify-content: space-between; padding-block: .6rem; }
.top-tools { gap: .35rem .7rem; }
.top-tools nav:empty { display: none; }
.top-tools nav a { min-height: 44px; display: inline-flex; align-items: center; font-size: .85rem; }
.footer-inner { min-height: 4rem; justify-content: space-between; color: var(--muted); font-size: .78rem; padding-block: .75rem; }
.footer-inner strong { color: var(--ink); font-size: .92rem; }
.brand { display: inline-flex; align-items: center; gap: .52rem; color: inherit; text-decoration: none; font-weight: 850; letter-spacing: -.05em; font-size: 1.25rem; }
.brand-mark { display: flex; align-items: end; justify-content: center; gap: 2px; width: 28px; height: 28px; padding: 7px; border-radius: 8px; color: var(--on-accent); background: var(--accent); }
.brand-mark i { flex: 1; background: currentColor; height: 40%; }
.brand-mark i:nth-child(2) { height: 70%; }
.brand-mark i:nth-child(3) { height: 100%; }
.brand-dot { color: var(--link); margin-left: -.5rem; }
.theme-switch { display: flex; gap: 2px; background: var(--inset); border: 1px solid var(--line); border-radius: 99px; padding: 2px; }
.theme-switch button { background: transparent; color: var(--muted); border: 1px solid transparent; min-height: 40px; border-radius: 99px; padding: .25rem .65rem; font-size: .8rem; }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); }
.theme-switch button:hover { background: var(--surface); color: var(--ink); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(2.3rem, 7vw, 4.25rem); line-height: 1; letter-spacing: -.066em; }
h2 { margin: 0; font-size: 1.22rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
p { line-height: 1.52; }
.eyebrow { color: var(--link); font-size: .75rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; margin: 0 0 .8rem; }
.intro { color: var(--muted); max-width: 54ch; margin: .85rem 0 1.55rem; }
.demo { color: var(--muted); margin: 0 0 1rem; font-size: .8rem; }
a { color: var(--link); text-underline-offset: .2em; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid transparent; padding: .55rem .88rem; border-radius: .65rem; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 760; line-height: 1.2; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--accent-hover); }
.secondary, .quiet { color: var(--ink); background: var(--surface); border-color: var(--line); }
.quiet { border-color: transparent; background: transparent; }
.secondary:hover, .quiet:hover { background: var(--inset); }
.danger { color: var(--danger); }
:focus-visible, .rating input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 3px; }
.hero-home { position: relative; display: grid; grid-template-columns: 1fr; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 1.5rem; }
.hero-copy { padding: clamp(1.25rem, 6vw, 4.15rem); align-self: center; }
.hero-copy h1 { max-width: 14ch; font-size: clamp(2.55rem, 8.5vw, 5.2rem); }
.hero-copy em { color: var(--link); font-style: normal; }
.hero-copy .button { padding: .75rem 1.2rem; min-height: 50px; }
.hero-art { min-height: 8rem; position: relative; overflow: hidden; isolation: isolate; background: #262821; }
.art-grid { position: absolute; inset: 0; background-image: linear-gradient(#f5df8d21 1px, transparent 1px), linear-gradient(90deg, #f5df8d21 1px, transparent 1px); background-size: 27px 27px; mask-image: linear-gradient(to top left, #000, transparent 95%); }
.art-steps { position: absolute; inset: 14% 6% 0 18%; display: flex; align-items: end; gap: clamp(.25rem, 1.2vw, .8rem); transform: skewY(-9deg); }
.art-steps i { flex: 1; background: var(--accent); height: 28%; border-radius: 4px 4px 0 0; }
.art-steps i:nth-child(2) { height: 42%; opacity: .7; }
.art-steps i:nth-child(3) { height: 58%; opacity: .8; }
.art-steps i:nth-child(4) { height: 78%; opacity: .9; }
.art-steps i:nth-child(5) { height: 100%; }
.panel { padding: clamp(.9rem, 3vw, 1.45rem); background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; min-width: 0; }
.state-panel { max-width: 44rem; margin: clamp(1.25rem, 5vw, 3rem) auto 0; padding: clamp(1.35rem, 6vw, 3rem); }
.state-panel h1 { font-size: clamp(2rem, 7vw, 3.35rem); }
.registration-account {
  display: grid; gap: .2rem; margin: 0 0 1rem; padding: .8rem 1rem;
  border: 1px solid var(--line); border-radius: .65rem; background: var(--inset); overflow-wrap: anywhere;
}
.registration-account span, .registration-note { color: var(--muted); font-size: .84rem; }
.registration-note { margin: .9rem 0 0; }
.registration form button { min-height: 48px; }
.refresh { display: inline-flex; align-items: center; min-height: 44px; }
.completed { color: var(--muted); font-size: .87rem; }
.receipt { background: var(--success-bg); color: var(--success); border-radius: .7rem; padding: .7rem .9rem; }
.review-heading, .review, main:has(.review) .completed { max-width: 42rem; margin-inline: auto; }
.review { display: grid; gap: .9rem; }
.review-progress { padding: .85rem 1rem; border: 1px solid var(--line); background: var(--surface); border-radius: .8rem; display: grid; gap: .5rem; font-size: .83rem; color: var(--muted); font-weight: 700; }
progress { width: 100%; height: .55rem; accent-color: var(--link); }
.review fieldset { margin: 0; padding: .75rem; }
.review legend { padding-inline: .35rem; font-weight: 800; letter-spacing: -.02em; }
.hint { color: var(--muted); font-size: .875rem; margin: .15rem 0 .75rem; }
.rating { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .3rem; }
.rating label { position: relative; min-width: 0; display: grid; cursor: pointer; }
.rating input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.rating label > span { display: grid; place-items: center; min-height: 48px; background: var(--inset); border: 1px solid var(--line); border-radius: .65rem; font-size: 1.2rem; }
.rating input:checked + span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.scale-hint { display: flex; justify-content: space-between; gap: .5rem; margin-top: .5rem; font-size: .75rem; color: var(--muted); }
.choice { color: var(--link); font-weight: 750; font-size: .87rem; margin: .45rem 0 0; }
.feedback h2 small { font-size: .75rem; font-weight: 500; color: var(--muted); margin-left: .25rem; }
.comment { display: grid; gap: .45rem; margin-top: .95rem; font-size: .9rem; font-weight: 650; }
input:not([type=radio]), textarea { background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem; padding: .65rem; min-width: 0; border-radius: .6rem; border: 1px solid var(--line); }
textarea { width: 100%; min-height: 5.25rem; resize: vertical; }
.submit-bar { position: sticky; bottom: 0; background: var(--bg); padding: .7rem 0 max(.7rem, env(safe-area-inset-bottom)); }
.submit-bar button { min-height: 52px; width: 100%; padding-inline: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; z-index: 10; inset: .5rem auto auto .5rem; transform: translateY(-150%); padding: .65rem 1rem; border-radius: .55rem; background: var(--surface); }
.skip-link:focus { transform: none; }
.header-panel-link { gap: .35rem; font-weight: 750; }
.workspace { display: grid; gap: 1.4rem; align-items: start; }
.page-content { min-width: 0; }
.workspace-rail { display: contents; }
.rail-title, .workspace-exit, .nav-copy small { display: none; }
.admin-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; position: fixed; z-index: 5; inset: auto 0 0; padding: .35rem .4rem max(.4rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -8px 24px #0001; }
.admin-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .28rem; min-height: 52px; padding: .28rem .1rem; border-radius: .75rem; color: var(--muted); text-decoration: none; text-align: center; }
.admin-nav a:hover { color: var(--ink); background: var(--inset); }
.admin-nav a[aria-current="page"] { color: var(--ink); background: var(--inset); box-shadow: inset 0 -2px var(--accent); }
.nav-copy { font-size: clamp(.62rem, 2.55vw, .78rem); line-height: 1.25; }
.admin-page footer { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
.page-trail { gap: .45rem .65rem; font-size: .83rem; color: var(--muted); margin-bottom: 1.35rem; }
.page-trail a { display: inline-flex; align-items: center; min-height: 36px; }
.page-trail [aria-current="page"] { font-weight: 750; color: var(--ink); }
.trail-separator { opacity: .7; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1.1rem 1.5rem; }
.page-actions a { gap: .4rem; }
@media (min-width: 58rem) {
  .workspace { grid-template-columns: 13rem minmax(0, 1fr); gap: clamp(1.35rem, 3vw, 2.55rem); }
  .workspace-rail { display: grid; gap: .8rem; position: sticky; top: 1rem; padding: .85rem; border: 1px solid var(--line); border-radius: 1.15rem; background: var(--surface); }
  .rail-title { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; margin: .35rem .48rem 0; }
  .admin-nav { position: static; grid-template-columns: 1fr; border: 0; padding: 0; box-shadow: none; }
  .admin-nav a { flex-direction: row; gap: .65rem; justify-content: start; text-align: start; padding: .5rem .75rem; }
  .admin-nav a[aria-current="page"] { box-shadow: inset 2px 0 var(--accent); }
  .nav-copy { display: grid; gap: .22rem; font-size: .86rem; }
  .nav-copy small { display: block; color: var(--muted); font-size: .69rem; }
  .workspace-exit { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .45rem; border-top: 1px solid var(--line); font-size: .79rem; text-decoration: none; }
  .admin-page footer { padding-bottom: 0; }
  .workspace .admin-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,16rem),1fr)); }
}
.round-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; padding: 1rem 1.2rem; background: var(--inset); border: 1px solid var(--line); border-radius: 1rem; }
.round-summary .eyebrow { margin: 0 0 .3rem; }
.round-summary strong { font-size: 1.2rem; overflow-wrap: anywhere; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,20rem),1fr)); gap: 1rem; }
.admin-grid .row { justify-content: space-between; }
.admin-grid input:not([type=radio]) { flex: 1 1 10rem; width: 100%; }
.group-count { color: var(--muted); font-size: .88rem; margin-block: .65rem; }
.active-card { border-color: var(--link); }
.tag { font-size: .78rem; font-weight: 700; color: var(--muted); }
.row > .tag { border-radius: 99px; padding: .28rem .6rem; background: var(--inset); }
.row > .tag.open { color: var(--success); background: var(--success-bg); }
.group-settings { margin-top: .7rem; border-top: 1px solid var(--line); }
summary { cursor: pointer; color: var(--link); padding-block: .7rem; font-size: .87rem; }
.actions { margin-top: .8rem; }
.create-group { border-style: dashed; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { border-bottom: 1px solid var(--line); }
li, .plain span { overflow-wrap: anywhere; }
dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
dd { margin: 0; white-space: nowrap; font-weight: 760; }
.highlights { display: grid; gap: .75rem; }
.highlights > div { background: var(--inset); border-radius: .7rem; padding: .7rem; }
.highlights h3 { margin: 0; }
.highlights ul { margin-bottom: 0; padding-left: 1.15rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
table { border-collapse: collapse; min-width: 48rem; width: 100%; }
th, td { text-align: left; padding: .7rem; border-bottom: 1px solid var(--line); }
thead { background: var(--inset); }
th small { display: block; color: var(--muted); }
.qr-screen { text-align: center; display: grid; justify-items: center; gap: .8rem; }
.qr-image { display: block; width: min(100%, 25rem); height: auto; background: white; border-radius: 1rem; }
.qr-link { margin: 0; font-weight: 750; }
@media (min-width: 45rem) {
  .hero-home { grid-template-columns: 1.25fr 1fr; min-height: 30rem; }
  .art-steps { inset: 14% 9% 6% 12%; }
  .review fieldset { padding: 1rem 1.25rem; }
  .submit-bar { position: static; }
}
@media print {
  :root[data-theme] { color-scheme: light; }
  header, footer, .demo, .workspace-rail, .page-trail, .page-actions, .skip-link, .intro { display: none; }
  .workspace { display: block; }
  .shell { width: 100%; padding: 0; }
  body, .panel { color: #111; background: #fff; }
  .admin-grid { display: block; }
  .panel { margin-bottom: 1rem; }
  h2, h3 { break-after: avoid; }
}

@media screen {
  .round-summary {
    background: linear-gradient(118deg, var(--surface), var(--inset));
    border-inline-start: 4px solid var(--accent);
  }
  .active-card {
    background: linear-gradient(145deg, var(--surface) 64%, light-dark(#fff8da, #302c1a));
  }
  .group-card .actions a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 44px;
    font-size: .88rem;
    font-weight: 730;
    text-decoration: none;
  }
  .group-card .actions a:hover { text-decoration: underline; }
  .group-settings > summary { min-height: 44px; }
  .workspace .table-wrap { margin-bottom: 1rem; }
}
