:root {
  --bg: #0c0c0c;
  --card: #161616;
  --line: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --gold: #c5a059;
  --gold-deep: #a68540;
  --danger: #ffb4b4;
  --font: "Montserrat", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(197, 160, 89, 0.16), transparent 32rem),
    var(--bg);
}

button,
input { font: inherit; }

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.loading { color: var(--muted); }

.auth {
  width: min(100%, 32rem);
}

.home {
  width: min(100%, 52rem);
}

.brand {
  margin-bottom: 1.25rem;
}

.brand p,
.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand h1,
.home h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.05;
}

.lede {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.card {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.person-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.add-person-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.add-person-foot p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.add-person-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.add-person-actions .primary,
.add-person-actions .ghost {
  margin-top: 0;
}

.add-person-fields label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.phone-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.phone-code {
  color: var(--muted);
  font-weight: 700;
}

.phone-row input {
  flex: 1;
}

.prospect-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15rem, 1fr);
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.prospect-column {
  min-height: 16rem;
  background: #111;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  overflow: hidden;
}

.prospect-column header {
  padding: 0.75rem 0.9rem;
  color: #fff;
  font-weight: 700;
}

.prospect-card {
  margin: 0.65rem;
  padding: 0.85rem 0.9rem;
  background: #1c1c1c;
  border-radius: 0.7rem;
}

.prospect-card strong {
  color: var(--gold);
}

.prospect-source {
  margin: 0.35rem 0 0;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prospect-visit {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.prospect-card .meta {
  margin: 0.35rem 0 0;
}

.prospect-empty {
  margin: 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.prospect-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.prospect-stat {
  margin: 0;
  padding: 0.75rem 0.85rem;
  background: #161616;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}

.prospect-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prospect-stat strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.6rem;
}

.prospect-stat em {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
}

.delta-up { color: #9ddeaf; }
.delta-down { color: var(--danger); }

.prospect-card {
  touch-action: none;
  cursor: grab;
}

.prospect-card.is-dragging {
  cursor: grabbing;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.45);
}

.prospect-column.is-target {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.prospect-note {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.prospect-note:empty { display: none; }

.prospect-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.prospect-comment-btn,
.prospect-tools button,
.attach-image,
.sheet-close {
  border: 0;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
}

.prospect-comment-btn {
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prospect-tools {
  display: flex;
  gap: 0.15rem;
}

.prospect-tools button {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border-radius: 999px;
}

.prospect-tools svg {
  width: 1.15rem;
  height: 1.15rem;
}

.prospect-heat.is-hot {
  color: #111;
  background: #e07a2f;
}

.prospect-heat.is-cold {
  color: #111;
  background: #7eb6e0;
}

.prospect-card button {
  cursor: pointer;
  touch-action: manipulation;
}

.heat-menu {
  position: fixed;
  z-index: 40;
  display: grid;
  min-width: 7.5rem;
  background: #1c1c1c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  overflow: hidden;
  box-shadow: 0 0.8rem 1.6rem rgba(0, 0, 0, 0.4);
}

.heat-menu button {
  border: 0;
  padding: 0.7rem 0.9rem;
  color: var(--text);
  background: transparent;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.heat-menu button[aria-checked="true"] {
  color: var(--gold);
}

.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.62);
}

.sheet {
  width: min(100%, 28rem);
  padding: 1rem 1rem 0.9rem;
  background: #161616;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.sheet header,
.sheet footer,
.sheet form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sheet header h3,
.sheet footer span,
.sheet-count,
.talk-file {
  margin: 0;
}

.sheet header h3 {
  font-size: 1.05rem;
}

.sheet-close {
  font-size: 1.4rem;
  line-height: 1;
}

.sheet label {
  margin-top: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sheet-count,
.sheet footer,
.talk-file {
  color: var(--muted);
  font-size: 0.78rem;
}

.sheet footer {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.sheet-actions {
  display: flex;
  gap: 0.45rem;
}

.sheet .error { margin: 0.7rem 0 0; }

.sheet > p {
  margin: 0.85rem 0 0;
}

.sheet-talk {
  display: grid;
}

.talk-log {
  height: 16rem;
  margin-top: 0.8rem;
  padding: 0.8rem;
  overflow: auto;
  background: #101010;
  border-radius: 0.7rem;
}

.talk-empty {
  margin: 4.5rem 0 0;
  color: var(--muted);
  text-align: center;
}

.talk-bubble {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 0.55rem;
  padding: 0.55rem 0.7rem;
  background: #242424;
  border-radius: 0.7rem;
}

.talk-bubble p,
.talk-bubble time {
  margin: 0;
}

.talk-bubble time {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.talk-bubble img {
  display: block;
  max-width: 12rem;
  margin-top: 0.4rem;
  border-radius: 0.45rem;
}

.sheet form {
  margin-top: 0.75rem;
}

.sheet form input { flex: 1; }

.sheet form .primary {
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border-radius: 999px;
}

.attach-image {
  margin-top: 0.55rem;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.prospect-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.prospect-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.85rem 0 1rem;
  padding: 0.85rem;
  background: #161616;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}

.filter-dates {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.filter-dates p,
.color-label,
.sheet-notice,
.sheet .hint {
  margin: 0;
}

.filter-dates p,
.color-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#filter-clear {
  grid-column: 1 / -1;
  justify-self: end;
}

.prospect-filters label,
.color-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
}

.prospect-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.stage-menu-button {
  border: 0;
  padding: 0 0.15rem;
  color: #fff;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.stage-menu {
  position: fixed;
  z-index: 40;
  display: grid;
  min-width: 12rem;
  background: #1c1c1c;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  overflow: visible;
  box-shadow: 0 0.8rem 1.6rem rgba(0, 0, 0, 0.4);
}

.stage-menu > button,
.stage-fields > button {
  border: 0;
  padding: 0.7rem 0.85rem;
  color: var(--text);
  background: transparent;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.stage-fields { position: relative; }

.stage-flyout {
  position: absolute;
  top: 0;
  left: calc(100% + 0.35rem);
  display: grid;
  gap: 0.45rem;
  min-width: 9rem;
  padding: 0.7rem 0.8rem;
  background: #1c1c1c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.stage-menu.flyout-left .stage-flyout {
  left: auto;
  right: calc(100% + 0.35rem);
}

.stage-flyout label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.stage-flyout input { width: auto; }

.color-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.color-dots button {
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.color-dots button[aria-checked="true"] {
  border-color: #fff;
}

.sheet-notice {
  margin-top: 0.7rem;
  color: #9ddeaf;
}

.sheet .hint { margin-top: 0.7rem; }

.family-name-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.family-name-row input {
  flex: 1;
}

.family-suffix {
  color: var(--muted);
  font-weight: 600;
}

.primary-person {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 0.7rem;
}

.primary-person legend {
  margin-bottom: 0.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.add-person-fields .choice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: auto;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.add-person-fields .choice input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
}

.tabs button,
.primary,
.ghost {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.tabs button {
  padding: 0.7rem 0.8rem;
  color: var(--muted);
  background: transparent;
}

.tabs button[aria-selected="true"],
.tabs button[aria-pressed="true"] {
  color: #111;
  background: var(--gold);
  font-weight: 700;
}

form {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.8rem 0.85rem;
  color: var(--text);
  background: #0c0c0c;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

input[type="checkbox"] {
  width: auto;
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

input:focus {
  outline: 2px solid var(--gold);
  border-color: transparent;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.primary {
  margin-top: 0.25rem;
  padding: 0.9rem 1rem;
  color: #111;
  background: var(--gold);
  font-weight: 700;
}

.primary:hover { background: var(--gold-deep); color: #111; }

.ghost {
  padding: 0.7rem 1rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.home-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
}

.home-top > div {
  min-width: 0;
  flex: 1;
}

.home-top .ghost {
  flex-shrink: 0;
  white-space: nowrap;
}

.gym-name {
  margin: 0.2rem 0 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.meta {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.empty {
  display: grid;
  gap: 0.35rem;
}

.empty strong { font-size: 1.05rem; }

.empty p,
.hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.list-head,
.students {
  margin-top: 1.25rem;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.list-head h2,
.ai-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.list-head .primary {
  margin-top: 0;
  width: auto;
}

.students {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}

.student {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr 1fr;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 1rem;
  color: var(--text);
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  cursor: pointer;
}

.student span {
  color: var(--muted);
}

.student-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.student-form legend {
  margin-bottom: 0.7rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ai-reply:empty {
  display: none;
}

.ai-reply {
  color: var(--text);
}

.search-label { margin-top: 1rem; }

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.calendar-head .ghost { white-space: nowrap; }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.cal-dow {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}

.cal-day {
  min-height: 4.6rem;
  padding: 0.35rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.cal-day span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.cal-day.is-today { border-color: var(--gold); }

.cal-day.is-out { background: transparent; }

.due-chip {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.25rem 0.3rem;
  color: #111;
  background: var(--gold);
  border: 0;
  border-radius: 0.4rem;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.class-chip {
  display: block;
  margin-top: 0.3rem;
  padding: 0.25rem 0.3rem;
  color: #111;
  background: var(--gold);
  border-radius: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
}

button.class-chip {
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
}

button.class-chip.is-open {
  outline: 2px solid #111;
}

button.class-chip.is-open-slot {
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold);
}

button.class-chip.is-mine {
  color: #111;
  background: var(--gold);
  border: 0;
}

.coach-checks {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.coach-checks legend {
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.private-chip {
  display: block;
  margin-top: 0.3rem;
  padding: 0.25rem 0.3rem;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
}

.request {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.check input { width: auto; }

.inventory-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.inventory-tabs button {
  font-size: 0.78rem;
}

.stock-list {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

#email-list [hidden] {
  display: none;
}

.stock-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.stock-actions {
  display: flex;
  gap: 0.4rem;
}

.stock-item .ghost {
  margin: 0;
  padding: 0.45rem 0.8rem;
}

.sale-flag { color: var(--gold); }

.thumbs {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.thumb,
.photo-slot img {
  width: 2.6rem;
  height: 2.6rem;
  object-fit: cover;
  border-radius: 0.35rem;
  background: #1b1b1b;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.photo-slot {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  color: var(--muted, #9a9a9a);
  font-size: 0.75rem;
}

.photo-slot .ghost {
  padding: 0.35rem 0.4rem;
  font-size: 0.72rem;
}

.chat-photo {
  font-size: 0.78rem;
}

.chat-photo input { padding: 0.35rem 0; }

.stock-item .hint { margin-top: 0.2rem; }

.search-results {
  max-height: 22rem;
  overflow: auto;
}

.match-empty { padding: 0.2rem 0.1rem; }

.shell { width: min(100%, 52rem); padding-bottom: 5.5rem; }

.topbar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.topbar-title { min-width: 0; flex: 1; }

.topbar .ghost,
.menu-button { flex-shrink: 0; }

.menu-button {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  gap: 0.28rem;
  place-content: center;
  padding: 0;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  cursor: pointer;
}

.menu-button span:not(.sr) {
  display: block;
  width: 1.05rem;
  height: 2px;
  background: #fff;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.55);
}

.nav-drawer {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(18rem, 86vw);
  display: grid;
  align-content: start;
  gap: 0.45rem;
  padding: 1.4rem 1rem;
  background: #111;
  border-right: 1px solid var(--line);
}

.nav-drawer button,
.nav-drawer a {
  display: block;
  padding: 0.85rem 1rem;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 0.8rem;
  cursor: pointer;
}

.nav-drawer button[aria-current="page"] {
  color: #111;
  background: var(--gold);
  font-weight: 700;
}

.chat-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 45;
  width: 3.6rem;
  height: 3.6rem;
  padding: 0;
  color: #111;
  background: var(--gold);
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.chat-panel {
  position: fixed;
  right: 1.1rem;
  bottom: 5.3rem;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: min(22rem, calc(100vw - 1.6rem));
  max-height: min(32rem, calc(100vh - 7rem));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.chat-head .ghost { padding: 0.4rem 0.75rem; }

.chat-log {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  min-height: 10rem;
  padding: 0.9rem;
  overflow: auto;
}

.bubble {
  max-width: 90%;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 0.8rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.bubble-user { justify-self: end; background: #2a2418; }

.bubble-assistant { justify-self: start; background: #0c0c0c; }

.chat-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
}

.chat-form .primary {
  width: auto;
  margin-top: 0;
}

.order-code {
  margin: 0.2rem 0 0.6rem;
  color: var(--gold);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; }
  .home-top { flex-direction: column; }
  .student { grid-template-columns: 1fr; }
  .chat-panel { right: 0.8rem; left: 0.8rem; width: auto; }
}

.kiosk {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.kiosk-card {
  width: min(36rem, 100%);
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
}

.kiosk-card h1 {
  margin: 0.2rem 0 0.4rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.kiosk-card input {
  min-height: 4.2rem;
  font-size: 2rem;
  letter-spacing: 0.28em;
  text-align: center;
}

.kiosk-card .primary {
  width: 100%;
  min-height: 3.6rem;
  font-size: 1.15rem;
}

.kiosk-classes {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.pin-display {
  min-height: 4.4rem;
  margin: 0.2rem 0 0;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  background: #0c0c0c;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.pin-display.is-empty {
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0.14em;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 1rem;
}

.keypad button {
  min-height: 4.4rem;
  color: var(--text);
  font: inherit;
  font-size: 1.7rem;
  font-weight: 700;
  background: #111;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  cursor: pointer;
}

.keypad button:active {
  color: #111;
  background: var(--gold);
}

.keypad button[data-key="clear"],
.keypad button[data-key="back"] {
  font-size: 1rem;
}

.kiosk-card .primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.shell.is-wide { width: min(100%, 76rem); }

.board {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.board-main,
.board-side {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.board-calendar,
.board-panel { margin: 0; }

.board-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.board-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.board-nav .ghost {
  padding: 0.45rem 0.7rem;
}

.board-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.9rem;
}

.board-dow {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.board-day {
  min-height: 3.6rem;
  padding: 0.4rem 0.15rem;
  color: var(--text);
  background: #111;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  cursor: pointer;
}

.board-day strong {
  display: block;
  font-size: 0.9rem;
}

.board-mark {
  display: block;
  margin-top: 0.2rem;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
}

.board-day.is-out { opacity: 0.38; }

.board-day.is-today { border-color: var(--gold); }

.board-day.is-live .board-mark { text-decoration: underline; text-underline-offset: 0.15rem; }

.board-day.is-selected {
  color: #111;
  background: var(--gold);
  border-color: var(--gold);
}

.board-day.is-selected .board-mark { color: #111; }

.board-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.board-panel h2 + .board-row,
.board-panel .hint + .board-row { border-top: 0; }

.board-row strong { display: block; }

.board-row span {
  color: var(--muted);
  font-size: 0.85rem;
}

.board-names { margin-top: -0.35rem; }

@media (min-width: 900px) {
  .board { grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr); }
}

.board-follow {
  grid-column: 1 / -1;
  display: grid;
  gap: 1rem;
}

.board-money {
  grid-column: 1 / -1;
  display: grid;
  gap: 1rem;
}

.stage-meter {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 2rem;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.7rem;
}

.stage-meter span,
.stage-meter strong { font-size: 0.85rem; }

.stage-meter i {
  display: block;
  height: 0.45rem;
  min-width: 0.45rem;
  border-radius: 999px;
}

.heat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.heat-pill {
  padding: 0.3rem 0.65rem;
  color: var(--text);
  background: #111;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.board-absent .list-head .hint { margin: 0; }

@media (min-width: 900px) {
  .board-follow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .board-absent { grid-column: 1 / -1; }
  .board-money { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

