:root {
  color-scheme: light;
  --canvas: #f4f6f3;
  --paper: #fff;
  --ink: #142922;
  --muted: #50645b;
  --muted-light: #b5c9bf;
  --line: #d9e2db;
  --forest: #142e26;
  --forest-deep: #10281f;
  --green: #286349;
  --lime: #d6f998;
  --danger: #9b2e26;
  --sidebar: 15rem;
  --radius: 16px;
  font: 16px/1.48 "Inter", "Avenir Next", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
h1, h2, p, dl, dd { margin: 0; }
h1, h2, p, td, .breadcrumb, .sidebar-account { overflow-wrap: anywhere; }
h1 { font-size: clamp(1.9rem, 3vw, 2.9rem); line-height: 1.12; letter-spacing: -.045em; font-weight: 750; }
h2 { font-size: 1.12rem; line-height: 1.22; letter-spacing: -.015em; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
button:not(:disabled), select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #aa5a00; outline-offset: 3px; }
svg { width: 1.2rem; height: 1.2rem; flex: none; vertical-align: middle; }

.skip { position: fixed; top: .5rem; left: .5rem; z-index: 10; padding: .75rem; background: var(--paper); transform: translateY(-150%); }
.skip:focus { transform: none; }
#shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
#shell.collapsed { --sidebar: 5rem; }
#sidebar { position: sticky; top: 0; height: 100dvh; min-width: 0; overflow: auto; display: flex; flex-direction: column; padding: 1.2rem .85rem .85rem; background: var(--forest-deep); color: #edf8ef; }
.brand { display: flex; align-items: center; gap: .7rem; padding: .35rem .3rem 1.65rem; line-height: 1.15; min-width: 0; }
.brand > div { min-width: 0; overflow-wrap: anywhere; }
.brand strong { display: block; font-size: 1.16rem; letter-spacing: -.02em; }
.brand small, .sidebar-account small { display: block; margin-top: .22rem; color: var(--muted-light); font-size: .76rem; }
.brand-mark { display: inline-grid; flex: none; width: 2.55rem; height: 2.55rem; place-items: center; border-radius: .7rem; background: var(--lime); color: var(--forest); }
.brand-mark svg { width: 1.35rem; height: 1.35rem; }
nav { display: grid; gap: .3rem; }
.nav-label { margin: 1rem .75rem .16rem; color: var(--muted-light); font-size: .71rem; letter-spacing: .12em; font-weight: 700; }
.nav-item, .sidebar-toggle { display: flex; align-items: center; gap: .8rem; min-height: 2.75rem; border-radius: .6rem; padding: .5rem .75rem; color: #dce9e2; font-size: .9rem; font-weight: 650; }
.nav-item:hover, .sidebar-toggle:hover, #sidebar .button:hover { background: #264638; }
.nav-item[aria-current="page"] { background: #315442; color: var(--lime); }
#sidebar :focus-visible, .auction-hero :focus-visible { outline-color: var(--lime); }
.sidebar-footer { display: grid; gap: .3rem; margin-top: auto; padding-top: 1.4rem; }
.sidebar-account { margin-bottom: .25rem; padding: .75rem .7rem .3rem; border-top: 1px solid #375045; font-weight: 700; }
#sidebar .button, .sidebar-toggle { color: #e1eee6; justify-content: flex-start; }
.sidebar-toggle { background: none; border: 0; text-align: left; width: 100%; }
.sidebar-toggle svg { transform: rotate(180deg); }
#shell.collapsed .sidebar-toggle svg { transform: none; }
#shell.collapsed #sidebar .brand > div, #shell.collapsed #sidebar .nav-label,
#shell.collapsed #sidebar .nav-item span, #shell.collapsed #sidebar .sidebar-toggle span,
#shell.collapsed #sidebar .sidebar-account, #shell.collapsed #sidebar .button span {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
#shell.collapsed #sidebar .brand, #shell.collapsed .nav-item, #shell.collapsed #sidebar .button,
#shell.collapsed .sidebar-toggle { justify-content: center; }
.workspace { min-width: 0; }
#topbar { min-height: 4.2rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; padding: .55rem clamp(.9rem, 3vw, 2.5rem); background: var(--paper); border-bottom: 1px solid var(--line); }
.top-left, .top-right { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.top-left { flex: 1 1 12rem; }
.top-right { margin-left: auto; }
.breadcrumb { color: var(--muted); font-size: .87rem; }
.breadcrumb strong { color: var(--ink); }
.menu-button { display: none !important; }
.connection { display: flex; align-items: center; flex: none; gap: .4rem; color: #216100; font-size: .77rem; font-weight: 700; }
.connection::before, .phase i { width: .44rem; height: .44rem; border-radius: 50%; background: currentColor; content: ""; }
.connection.offline { color: #984000; }
main { width: min(100%, 100rem); padding: clamp(1.2rem, 3vw, 2.6rem); margin: 0 auto; min-width: 0; }
main:focus { outline: none; }
.page-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .8rem 1.6rem; margin-bottom: 1.65rem; }
.page-heading > p, .page-heading > div > p { color: var(--muted); margin-top: .42rem; }
.page-heading > p { flex-basis: 100%; margin-top: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .53rem .85rem; min-height: 2.75rem; min-width: 2.75rem; border: 1px solid transparent; border-radius: .6rem; font-size: .88rem; line-height: 1.25; font-weight: 700; text-align: center; transition: background-color 150ms ease, border-color 150ms ease; }
.button:disabled, .disconnected button[data-action="bid"] { opacity: .52; cursor: default; }
.primary { color: white; background: var(--green); }
.primary:hover:not(:disabled) { background: #1b4d37; }
.secondary { color: var(--ink); background: var(--paper); border-color: #cbd8d0; }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { background: #eaf1eb; }
.quiet { color: var(--green); background: transparent; }
.danger-outline { color: var(--danger); background: var(--paper); border-color: #e7bdb7; }
.danger-outline:hover { background: #fff1ef; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 2vw, 1.4rem); }
.panel-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .45rem .75rem; min-height: 2rem; margin-bottom: .65rem; }
.panel-heading .button { font-size: .82rem; }
.stack, .workspace-groups { display: grid; gap: 1rem; }
.empty, .muted { color: var(--muted); font-size: .9rem; }
.empty { padding: .5rem 0; }
.welcome { width: min(100%, 35rem); padding: clamp(1.4rem, 5vw, 3rem); margin: clamp(1rem, 6vh, 5rem) auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.welcome h1 { margin-top: 1rem; }
.welcome p { margin: .5rem 0 1.25rem; color: var(--muted); }
.event-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: .7rem; }
.event-card { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .85rem; min-height: 4.3rem; background: var(--paper); border: 1px solid var(--line); border-radius: .7rem; overflow-wrap: anywhere; }
.event-card:hover { border-color: var(--green); }
.event-card > div { flex: 1; min-width: 0; }
.event-card strong, .event-card small { display: block; }
.event-card small { color: var(--muted); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(13.75rem, 1fr); gap: 1rem; }
.auction-hero { min-width: 0; min-height: 16.9rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1.2rem; position: relative; overflow: hidden; padding: clamp(1.1rem, 3vw, 2.2rem); border-radius: var(--radius); background: radial-gradient(ellipse at 91% 4%, #2b5643, var(--forest) 65%); color: #f3faf3; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; color: #c5d6cb; font-size: .75rem; letter-spacing: .1em; font-weight: 750; }
.phase { display: inline-flex; flex: none; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: 1rem; background: #edf2ee; color: #43564b; font-size: .72rem; letter-spacing: .01em; font-weight: 750; }
.phase.live { background: var(--lime); color: #213b18; }
.phase.paused { background: #ffe6ad; color: #623c05; }
.phase.ended { background: #e0edfc; color: #1d476f; }
.hero-core { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: .6rem 1.6rem; }
.hero-core h2 { font-size: clamp(1.65rem, 3.2vw, 3.35rem); line-height: 1.08; letter-spacing: -.055em; }
.hero-core p { margin-top: .35rem; color: #c5d6cb; }
.hero-price { display: grid; justify-items: end; text-align: right; overflow-wrap: anywhere; }
.hero-price strong { color: var(--lime); font-size: clamp(1.9rem, 4.25vw, 4.5rem); font-variant-numeric: tabular-nums; line-height: 1.05; letter-spacing: -.05em; }
.hero-price > span { color: #d9e8dd; font-size: .83rem; }
.next-bid { display: flex; gap: .65rem; align-items: center; color: #d9e8dd; font-size: .88rem; }
.hero-actions { border-top: 1px solid #537064; padding-top: .9rem; }
.auction-hero .primary { background: var(--lime); color: var(--forest-deep); }
.auction-hero .primary:hover:not(:disabled) { background: #e6ffbe; }
.auction-hero .secondary { background: #284738; border-color: #587367; color: #f3faf3; }
.auction-hero .secondary:hover:not(:disabled) { background: #3a5c4a; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; }
.metrics > div { padding: .8rem 1.05rem .95rem; background: var(--paper); border: 1px solid var(--line); border-radius: .75rem; }
.metrics dt { font-size: .82rem; font-weight: 650; color: var(--muted); }
.metrics dd { font-size: 1.8rem; font-weight: 750; line-height: 1.15; }
.captain-summary { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-bottom: 1rem; padding: .65rem 1rem; border-radius: .7rem; background: #e7efe8; color: #315141; font-size: .9rem; }
.bid-list { list-style: none; margin: 0; padding: 0; }
.bid-list li { display: flex; justify-content: space-between; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.bid-list li:last-child { border-bottom: 0; }
.bid-list small, .cell-detail { display: block; color: var(--muted); font-size: .76rem; }
.bid-list li > span { min-width: 0; overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
th, td { border-bottom: 1px solid var(--line); padding: .65rem .6rem; vertical-align: middle; }
th { color: var(--muted); background: #f1f5f1; font-size: .79rem; white-space: nowrap; }
td { min-width: 4rem; }
td:first-child { min-width: 8rem; }
td .toolbar { flex-wrap: nowrap; }
.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
.settings-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .5rem; }
.settings-list > div { padding: .65rem .75rem; border-radius: .55rem; background: #f1f5f1; }
.settings-list dt { color: var(--muted); font-size: .82rem; }
.settings-list dd { font-weight: 650; overflow-wrap: anywhere; }
.access-actions:not(:empty) { margin: 0 0 .8rem; }

dialog { width: min(36rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 60px #10281f44; color: var(--ink); }
dialog::backdrop { background: #11291fb3; }
.dialog-heading, .dialog-actions { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; background: var(--paper); }
.dialog-heading { position: sticky; top: 0; z-index: 1; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-actions { position: sticky; bottom: 0; justify-content: flex-end; border-top: 1px solid var(--line); }
.dialog-body { padding: 1rem; }
.dialog-body > p { margin: .35rem 0 .65rem; }
label { display: grid; gap: .3rem; margin-bottom: .8rem; font-size: .88rem; font-weight: 700; }
input, select { width: 100%; min-width: 0; min-height: 2.75rem; border: 1px solid #81988a; border-radius: .5rem; padding: .48rem .62rem; background-color: var(--paper); color: var(--ink); font-weight: 500; font-size: 1rem; }
select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, #294538 50%), linear-gradient(135deg, #294538 50%, transparent 50%); background-size: 5px 5px; background-position: calc(100% - 16px) center, calc(100% - 11px) center; background-repeat: no-repeat; }
.form-grid, .preview-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .75rem; }
.preview-counts { gap: .5rem; margin-bottom: .9rem; }
.preview-counts > div { background: #eef4ef; border-radius: .5rem; padding: .6rem; }
.preview-counts dd { font-size: 1.25rem; font-weight: 750; }
.form-error { color: var(--danger); font-weight: 650; }
.form-error:empty { display: none; }
.spectator-qr { display: block; width: min(13.75rem, 100%); height: auto; margin: 1rem auto 0; }
dialog details summary { padding: .4rem 0; font-weight: 650; }
#notice:not(:empty) { position: fixed; z-index: 5; right: clamp(.6rem, 3vw, 2rem); bottom: 1rem; width: max-content; max-width: calc(100% - 1.2rem); padding: .75rem 1rem; border-radius: .65rem; background: var(--forest-deep); color: white; box-shadow: 0 5px 25px #0003; overflow-wrap: anywhere; }

#shell.projector { display: block; background: #142b22; color: #f3faf3; }
.projector #sidebar { display: none; }
.projector #topbar { background: #10241d; border-color: #3d594b; }
.projector .breadcrumb, .projector .connection { color: #d5edc7; }
.projector .connection.offline { color: #ffd09e; }
.projector main { width: min(100%, 120rem); }
.projector .dashboard-grid { grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr); }
.projector .auction-hero { min-height: clamp(18rem, 48vh, 43rem); background: radial-gradient(ellipse at 91% 4%, #3a6149, #1c3d30 65%); border: 1px solid #547363; }
.projector .hero-core h2, .projector .hero-price strong { font-size: clamp(2.2rem, 5vw, 7rem); }
.projector .panel, .projector .metrics > div { background: #204032; border-color: #547363; }
.projector .metrics dt, .projector .empty, .projector .bid-list small { color: #ccded1; }
.projector .bid-list li { border-color: #547363; font-size: clamp(.92rem, 1.35vw, 1.5rem); }
.projector .hero-top, .projector .hero-top .phase, .projector .hero-core p,
.projector .hero-price > span, .projector .next-bid, .projector .metrics dt,
.projector .panel h2 { font-size: clamp(.92rem, 1.25vw, 1.55rem); }
.projector .bid-list small { font-size: clamp(.77rem, .9vw, 1.12rem); }
.projector .metrics dd { font-size: clamp(1.8rem, 3vw, 3.5rem); }
#shell.projector ~ #notice { display: none; }

@media (max-width: 1120px) {
  .hero-core { grid-template-columns: 1fr; }
  .hero-price { justify-items: start; text-align: left; }
}
@media (max-width: 900px) {
  #shell, #shell.collapsed { --sidebar: 13rem; grid-template-columns: minmax(0, 1fr); }
  #sidebar { display: none; position: fixed; inset: 0 auto 0 0; width: min(18rem, calc(100vw - 3.5rem)); z-index: 4; box-shadow: 0 0 0 100vmax #162a2480; }
  #shell.nav-open:not(.projector) #sidebar { display: flex; }
  #shell:not(.projector) .menu-button { display: inline-flex !important; }
  .nav-open #topbar { position: relative; }
  .nav-open .menu-button { position: fixed; top: .35rem; left: min(calc(18rem + .3rem), calc(100vw - 3.2rem)); z-index: 5; background: white; }
  .sidebar-toggle, #shell.collapsed .sidebar-toggle { display: none; }
  #shell.collapsed .nav-item, #shell.collapsed #sidebar .brand, #shell.collapsed #sidebar .button { justify-content: flex-start; }
  #shell.collapsed #sidebar :is(.brand > div, .nav-item span, .sidebar-account, .button span, .nav-label) {
    position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal;
  }
  .hero-core { grid-template-columns: minmax(0, 1fr) minmax(0, auto); }
  .hero-price { justify-items: end; text-align: right; }
}
@media (max-width: 650px) {
  .dashboard-grid, .projector .dashboard-grid { grid-template-columns: 1fr; }
  .hero-core { grid-template-columns: minmax(0, 1fr); }
  .hero-price { justify-items: start; text-align: left; }
  .top-left { flex: 1 1 9rem; }
  .page-heading { margin-bottom: 1.2rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  th, td { padding-inline: .45rem; }
  td:first-child { min-width: 6rem; }
}
@media (max-width: 380px) {
  .top-right .button svg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
