:root {
  --red: #e51b23;
  --green: #17503d;
  --green-dark: #103c2f;
  --gold: #d1a354;
  --ink: #242424;
  --muted: #68746f;
  --paper: #f5f4ef;
  --white: #fff;
  --line: #e5e5de;
  --soft-green: #e8f0eb;
  --soft-red: #fff0ed;
  font-family: 'Gotham Pro', 'Avenir Next', Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-width: 280px;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: auto;
  background: var(--paper);
}
.topbar {
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 38px;
  height: 38px;
  padding: 4px;
  border: 2px solid var(--green);
  background: var(--gold);
  color: var(--green);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  transform: skew(-7deg);
}
.brand-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-name strong {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.brand-name small {
  color: var(--red);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
}
.topbar-end {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.topbar-end.badge {
  padding: 6px 9px;
  border-radius: 30px;
  background: var(--soft-green);
  color: var(--green);
}
#app {
  flex: 1;
  min-width: 0;
  padding: 0 20px calc(96px + env(safe-area-inset-bottom));
}
.bottom-nav {
  position: fixed;
  z-index: 3;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  min-height: 68px;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--white);
  border-top: 1px solid var(--line);
  box-shadow: 0 -5px 22px rgba(16, 60, 47, 0.08);
}
.bottom-nav:empty {
  display: none;
}
.bottom-nav[data-count='3'] {
  grid-template-columns: repeat(3, 1fr);
}
.nav-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 60px;
  padding: 8px 3px 7px;
  border: 0;
  background: none;
  color: #607268;
  font-size: 11px;
  font-weight: 750;
}
.nav-button svg {
  width: 22px;
  height: 22px;
  flex: none;
}
.nav-button.active {
  color: var(--green);
  background: var(--soft-green);
}
.nav-button.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 34px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 0 0 3px 3px;
  background: var(--red);
}
.screen {
  padding-top: 20px;
}
.hero {
  position: relative;
  overflow: hidden;
  margin: 0 -20px;
  padding: 21px 20px 24px;
  color: var(--white);
  background: var(--green);
}
.hero::before {
  content: '';
  position: absolute;
  right: -48px;
  top: -30px;
  width: 260px;
  height: 260px;
  border: 42px solid rgba(209, 163, 84, 0.45);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(255, 255, 255, 0.07) inset;
}
.hero::after {
  content: '';
  position: absolute;
  right: -30px;
  bottom: -120px;
  width: 200px;
  height: 200px;
  background: var(--red);
  border-radius: 50%;
  opacity: 0.9;
}
.hero > * {
  position: relative;
  z-index: 1;
}
.eyebrow {
  display: block;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.035em;
}
.hero .eyebrow {
  color: #f8d9af;
}
.hero h1 {
  max-width: 370px;
  margin: 20px 0 8px;
  font-size: clamp(32px, 10vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 900;
}
.hero p {
  margin: 0;
  color: #d6e7dc;
  font-size: 12px;
  line-height: 1.5;
}
.hero-rule {
  width: 92px;
  height: 5px;
  margin: 18px 0;
  background: var(--red);
}
.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.hero-stat {
  min-width: 0;
}
.hero-stat strong {
  display: block;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}
.hero-stat small {
  display: block;
  margin-top: 5px;
  color: #c8ddd0;
  font-size: 10px;
  line-height: 1.25;
}
.hero-stat:last-child {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.hero-stat:last-child strong {
  font-size: 16px;
  line-height: 1.15;
}
.hero-stat:last-child small {
  margin-top: 0;
}
.page-title {
  margin: 7px 0 7px;
  color: var(--green);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.04em;
}
.page-intro {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 23px 0 11px;
}
.section-head h2 {
  margin: 0;
  color: var(--green);
  font-size: 16px;
  font-weight: 850;
}
.section-head span {
  color: var(--muted);
  font-size: 11px;
}
.stack {
  display: grid;
  gap: 9px;
}
.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}
.card h2,
.card h3 {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 16px;
  line-height: 1.25;
}
.card p {
  margin: 0;
  color: #637069;
  font-size: 13px;
  line-height: 1.5;
}
.card.highlight {
  border-left: 5px solid var(--red);
}
.card.gold {
  border-left: 5px solid var(--gold);
}
.card.success {
  border-left: 5px solid var(--green);
}
.card + .card {
  margin-top: 9px;
}
.card-kicker {
  display: block;
  margin: 0 0 8px;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.035em;
}
.card-actions {
  display: flex;
  gap: 9px;
  margin-top: 14px;
}
.card-actions > * {
  flex: 1;
}
.primary,
.secondary,
.danger,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}
.primary {
  border: 1px solid var(--red);
  background: var(--red);
  color: white;
}
.secondary {
  border: 1px solid #cbd7ce;
  background: var(--white);
  color: var(--green);
}
.danger {
  border: 1px solid #f1c4c0;
  background: var(--soft-red);
  color: #a32727;
}
.small-button {
  min-height: 36px;
  padding: 7px 11px;
}
.full {
  width: 100%;
}
.text-button {
  border: 0;
  padding: 3px 0;
  background: none;
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
}
.muted {
  color: var(--muted);
}
.notice {
  margin-top: 15px;
  padding: 13px;
  border-radius: 10px;
  background: var(--soft-green);
  color: #3d6051;
  font-size: 13px;
  line-height: 1.45;
}
.notice.error {
  background: var(--soft-red);
  color: #a32727;
}
.notice.gold {
  background: #f6eddb;
  color: #725521;
}
.progress-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 7px;
  background: #dee6df;
}
.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 7px;
  background: var(--red);
}
.station-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  text-align: left;
}
.station-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e8eee9;
  color: var(--green);
  font-size: 20px;
  font-weight: 900;
}
.station-card.done .station-icon {
  background: #eaf1df;
  color: var(--green);
}
.station-main {
  flex: 1;
  min-width: 0;
}
.station-main strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.station-main small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.station-points {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.chevron {
  color: #a8afa7;
  font-size: 21px;
}
.rating-mine {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
  padding: 15px;
  border-radius: 12px;
  background: var(--green);
  color: var(--white);
}
.rating-mine b {
  font-size: 29px;
}
.rating-mine div {
  flex: 1;
}
.rating-mine strong,
.rating-mine small {
  display: block;
}
.rating-mine strong {
  font-size: 13px;
}
.rating-mine small {
  margin-top: 4px;
  color: #d5e6da;
  font-size: 11px;
}
.rating-mine > span {
  font-size: 14px;
  font-weight: 900;
}
.rating-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}
.rating-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.rating-row:last-child {
  border-bottom: 0;
}
.rating-row.me {
  background: #fff5ec;
}
.rating-row .place {
  width: 27px;
  color: var(--red);
  font-weight: 900;
}
.rating-row .name {
  flex: 1;
  font-weight: 750;
}
.rating-row .points {
  color: var(--green);
  font-weight: 900;
}
.segmented {
  display: flex;
  gap: 4px;
  margin: 12px 0;
  padding: 4px;
  border-radius: 11px;
  background: #e8eae5;
}
.segmented button {
  flex: 1;
  min-height: 35px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #61726a;
  font-size: 11px;
  font-weight: 800;
}
.segmented button.active {
  background: white;
  color: var(--green);
  box-shadow: 0 1px 4px rgba(16, 60, 47, 0.1);
}
.day-strip {
  display: flex;
  gap: 7px;
  overflow: auto;
  margin: 15px -20px;
  padding: 0 20px 5px;
  scrollbar-width: none;
}
.day-strip::-webkit-scrollbar {
  display: none;
}
.day-button {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 58px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}
.day-button strong {
  color: var(--green);
  font-size: 17px;
}
.day-button.active {
  border-color: var(--green);
  background: var(--green);
  color: white;
}
.day-button.active strong {
  color: white;
}
.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.slot-button {
  min-height: 51px;
  border: 1px solid #d7dfd8;
  border-radius: 10px;
  background: white;
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
}
.slot-button small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}
.slot-button.active {
  border: 2px solid var(--red);
  background: var(--soft-red);
}
.field-label {
  display: block;
  margin: 17px 0 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
.input,
.select {
  width: 100%;
  min-height: 45px;
  border: 1px solid #ccd8ce;
  border-radius: 9px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
  font-size: 16px;
}
.form-actions {
  display: grid;
  gap: 9px;
  margin-top: 19px;
}
.queue-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  text-align: left;
}
.queue-time {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  min-height: 42px;
  border-radius: 9px;
  background: var(--soft-green);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}
.queue-name {
  flex: 1;
  min-width: 0;
}
.queue-name strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.queue-name small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.pill {
  display: inline-block;
  padding: 5px 7px;
  border-radius: 30px;
  background: var(--soft-green);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}
.pill.waiting {
  background: var(--soft-red);
  color: #b6483a;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.metric strong {
  display: block;
  color: var(--green);
  font-size: 23px;
  font-weight: 900;
}
.metric small {
  color: var(--muted);
  font-size: 11px;
}
.admin-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.admin-slot strong {
  display: block;
  color: var(--green);
  font-size: 13px;
}
.admin-slot small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 7px;
}
.stepper button {
  width: 30px;
  height: 30px;
  border: 1px solid #ccd8ce;
  border-radius: 7px;
  background: white;
  color: var(--green);
  font-size: 17px;
  font-weight: 900;
}
.stepper b {
  min-width: 21px;
  color: var(--green);
  font-size: 13px;
  text-align: center;
}
.role-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.role-row strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}
.role-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}
.role-actions {
  display: flex;
  gap: 5px;
}
.role-actions button {
  flex: 1;
}
.role-actions button {
  min-height: 31px;
  padding: 5px 7px;
  font-size: 10px;
}
.loading {
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 45vh;
  color: var(--muted);
  font-size: 12px;
}
.loading-wheel {
  width: 30px;
  height: 30px;
  border: 3px solid #d9e4db;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.toast {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: calc(81px + env(safe-area-inset-bottom));
  width: min(calc(100% - 32px), 520px);
  padding: 12px 14px;
  transform: translate(-50%, 16px);
  border-radius: 10px;
  background: var(--green-dark);
  box-shadow: 0 8px 24px #0003;
  color: white;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.empty {
  padding: 24px 16px;
  border: 1px dashed #c8d7c9;
  border-radius: 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.settings-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.settings-fields .field-label {
  margin-top: 12px;
}
.norm-heading {
  margin-top: 14px !important;
  font-weight: 800;
  color: var(--green) !important;
}
.norm-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.norm-row span {
  flex: 1;
  font-size: 12px;
}
.norm-row .small-button {
  min-height: 29px;
  padding: 5px 8px;
}
.rules-input {
  min-height: 145px;
  resize: vertical;
  line-height: 1.45;
}
.screen > .card + .secondary,
.screen > .card + .primary,
.screen > .input + .secondary,
.screen > .input + .primary,
.screen > .notice + .primary {
  margin-top: 12px;
}
@media (max-width: 899px) {
  .queue-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-areas:
      'time name'
      'time status';
    justify-content: stretch;
    column-gap: 10px;
    row-gap: 6px;
  }
  .queue-time {
    grid-area: time;
    align-self: stretch;
  }
  .queue-name {
    grid-area: name;
  }
  .queue-card .pill {
    grid-area: status;
    justify-self: start;
  }
}
@media (max-width: 380px) {
  .brand-name strong {
    font-size: 11px;
  }
  .brand-name small {
    display: none;
  }
  .topbar-end.badge {
    padding: 6px 7px;
    font-size: 9px;
    white-space: nowrap;
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .settings-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card-actions {
    flex-wrap: wrap;
  }
  .card-actions > * {
    flex-basis: 100%;
  }
}
@media (min-width: 900px) {
  body {
    background: #e9eee9;
  }
  .app-shell {
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr);
    grid-template-rows: 70px minmax(0, 1fr);
    max-width: 1240px;
    min-height: 100dvh;
    border-inline: 1px solid #d5dfd6;
    box-shadow: 0 0 50px rgba(20, 46, 36, 0.08);
  }
  .app-shell:has(.bottom-nav:empty) {
    grid-template-columns: 1fr;
  }
  .app-shell:has(.bottom-nav:empty) #app {
    grid-column: 1;
  }
  .topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    padding-inline: 30px;
  }
  #app {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    max-width: 920px;
    margin-inline: auto;
    padding: 0 32px 56px;
  }
  .bottom-nav {
    position: sticky;
    top: 0;
    left: auto;
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: auto;
    min-height: calc(100dvh - 70px);
    padding: 24px 12px;
    border-top: 0;
    border-right: 1px solid var(--line);
    box-shadow: none;
  }
  .bottom-nav[data-count='3'] {
    display: flex;
  }
  .bottom-nav:empty {
    display: none;
  }
  .nav-button {
    flex-direction: row;
    justify-content: flex-start;
    gap: 13px;
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border-radius: 10px;
    text-align: left;
    font-size: 13px;
  }
  .nav-button.active::after {
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 3px;
    height: auto;
    transform: none;
    border-radius: 0 3px 3px 0;
  }
  .hero {
    margin: 24px 0 0;
    border-radius: 18px;
    padding: 32px;
  }
  .hero h1 {
    max-width: 620px;
  }
  .screen {
    padding-top: 28px;
  }
  .hero + .screen {
    padding-top: 24px;
  }
  .day-strip {
    margin-inline: 0;
    padding-inline: 0;
  }
  .card {
    padding: 20px;
  }
  .card-actions > * {
    flex: 0 1 auto;
    min-width: 170px;
    max-width: 280px;
  }
  .station-main strong,
  .queue-name strong {
    font-size: 15px;
  }
  .page-title {
    font-size: 34px;
  }
  .page-intro,
  .card p,
  .notice {
    font-size: 14px;
  }
  .slot-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .toast {
    bottom: 24px;
  }
}
@media (min-width: 900px) and (max-width: 1050px) {
  #app {
    padding-inline: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
