:root {
  --bg: #f6efe3;
  --surface: rgba(255, 252, 247, 0.96);
  --surface-strong: #ffffff;
  --line: rgba(33, 30, 26, 0.12);
  --text: #211e1a;
  --muted: #666056;
  --primary: #21493f;
  --primary-soft: #dce9e4;
  --accent: #b36042;
  --accent-soft: #f7dfd5;
  --warning: #8c6a20;
  --warning-soft: #f5ebcb;
  --danger: #822f2f;
  --danger-soft: #f6d9d7;
  --shadow: 0 18px 40px rgba(33, 30, 26, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --font-sans: "SUIT Variable", "Pretendard", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(33, 73, 63, 0.12), transparent 26%),
    linear-gradient(180deg, #fbf7f0 0%, #f0e5d4 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(100vw, 430px);
  margin: 0 auto;
  padding: 14px 10px 28px;
}

.top-bar {
  padding: 4px 4px 2px;
}

.app-header,
.page-card,
.flash,
.modal-card,
.login-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-header {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.page-card {
  margin-top: 12px;
  padding: 16px;
}

.compact-card {
  padding: 14px;
}

.page-card[data-page] {
  display: none;
}

.page-card[data-page].is-active {
  display: block;
}

.brand-button,
.brand-panel,
.modal-brand {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.brand-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

.brand-wordmark {
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--text);
}

.admin-wordmark,
.modal-wordmark {
  font-size: 2rem;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.84rem;
}

.hero-card {
  display: grid;
  gap: 12px;
}

.intro-hero-card {
  gap: 14px;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(1.65rem, 7vw, 2.3rem);
  line-height: 1.06;
}

.hero-text,
.section-guide,
.modal-text,
.helper-box,
.locked-note,
.room-card-detail,
.slot-card-detail,
.management-title span,
.management-meta dt,
.management-meta dd,
.waitlist-card h3 span,
.choice-card span,
.mini-rule-card,
.selection-banner span {
  color: var(--muted);
}

.hero-text,
.section-guide,
.modal-text,
.helper-box {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.hero-meta,
.selection-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compact-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-meta div,
.selection-summary div {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(33, 30, 26, 0.08);
  background: rgba(255, 255, 255, 0.76);
  display: grid;
  gap: 4px;
}

.hero-meta span,
.selection-summary span {
  font-size: 0.78rem;
}

.hero-meta strong,
.selection-summary strong {
  font-size: 0.98rem;
  line-height: 1.35;
}

.status-banner {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-weight: 800;
  line-height: 1.45;
  font-size: 0.93rem;
}

.status-open {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.mini-rule-row {
  display: grid;
  gap: 8px;
}

.rule-list {
  display: grid;
  gap: 8px;
}

.mini-rule-card {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(33, 30, 26, 0.08);
  font-size: 0.84rem;
  line-height: 1.5;
}

.flash {
  margin-top: 12px;
  padding: 14px 16px;
  font-size: 0.95rem;
  line-height: 1.55;
}

.flash-success {
  background: rgba(33, 73, 63, 0.1);
}

.flash-info {
  background: rgba(179, 96, 66, 0.12);
}

.flash-error {
  background: rgba(130, 47, 47, 0.1);
}

.page-tabs,
.slot-chip-row {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.page-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-tab,
.slot-chip-button,
.room-chip-button,
.preset-button {
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.page-tab.is-active,
.slot-chip-button.is-active,
.room-chip-button.is-active {
  background: #111;
  border-color: #111;
  color: #fff;
}

.slot-chip-button {
  display: grid;
  gap: 2px;
  text-align: left;
}

.slot-chip-button span {
  font-size: 0.78rem;
  opacity: 0.76;
}

.room-chip-button {
  display: grid;
  gap: 2px;
  text-align: left;
}

.room-chip-button span {
  font-size: 0.74rem;
  opacity: 0.76;
}

.section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.compact-heading h2,
.section-heading h2 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.18;
}

.choice-grid,
.summary-strip,
.room-selector-grid,
.room-tab-grid,
.settings-room-list,
.management-list,
.waitlist-grid {
  display: grid;
  gap: 10px;
}

.summary-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-summary {
  gap: 8px;
}

.summary-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(33, 30, 26, 0.08);
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 6px;
}

.summary-card span {
  font-size: 0.82rem;
}

.summary-card strong {
  font-size: 1.5rem;
  line-height: 1;
}

.choice-card,
.room-pick-card,
.slot-card,
.room-card,
.board-room-card,
.board-slot-card,
.settings-room-card,
.management-card,
.waitlist-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
}

.choice-card,
.room-pick-card,
.slot-card,
.room-card {
  width: 100%;
  padding: 14px;
  text-align: left;
}

.choice-card {
  display: grid;
  gap: 6px;
}

.room-selector-grid,
.room-tab-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.room-pick-card {
  display: grid;
  gap: 8px;
}

.room-pick-head {
  display: grid;
  gap: 4px;
}

.room-pick-head strong,
.slot-card-title {
  font-size: 1rem;
  line-height: 1.35;
}

.room-pick-head small,
.room-pick-detail,
.room-card-detail,
.slot-card-detail,
.selection-banner span {
  color: var(--muted);
}

.room-pick-head small {
  font-size: 0.82rem;
  font-weight: 800;
}

.room-pick-detail {
  font-size: 0.84rem;
  line-height: 1.55;
}

.room-pick-action {
  font-size: 0.9rem;
  font-weight: 800;
}

.room-pick-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(33, 73, 63, 0.14);
}

.room-pick-card-open {
  border-color: rgba(33, 73, 63, 0.18);
  background: rgba(255, 255, 255, 0.9);
}

.room-pick-card-wait {
  border-color: rgba(179, 96, 66, 0.18);
  background: rgba(255, 246, 240, 0.92);
}

.room-pick-card-fixed {
  border-color: rgba(140, 106, 32, 0.18);
  background: rgba(245, 235, 203, 0.9);
}

.room-pick-card-closed {
  background: rgba(238, 230, 220, 0.88);
}

.choice-card-active {
  border-color: var(--primary);
  background: rgba(220, 233, 228, 0.92);
}

.slot-card,
.room-card,
.board-room-card,
.board-slot-card {
  display: grid;
  gap: 8px;
}

.slot-card-head,
.room-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.slot-card-head strong,
.room-card-head strong,
.room-card-title,
.selection-banner strong {
  font-size: 1rem;
}

.slot-card-head small,
.room-card-head small {
  font-size: 0.8rem;
  color: var(--muted);
}

.slot-card-badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.slot-card-action {
  font-weight: 800;
  font-size: 0.92rem;
}

.slot-card-open {
  border-color: rgba(33, 73, 63, 0.18);
}

.slot-card-available,
.board-slot-card-available {
  border-color: rgba(33, 73, 63, 0.18);
}

.slot-card-full {
  border-color: rgba(179, 96, 66, 0.18);
  background: rgba(255, 247, 242, 0.92);
}

.slot-card-reserved,
.board-slot-card-reserved {
  border-color: rgba(179, 96, 66, 0.18);
  background: rgba(255, 246, 240, 0.92);
}

.slot-card-fixed {
  border-color: rgba(140, 106, 32, 0.18);
  background: rgba(245, 235, 203, 0.9);
}

.board-slot-card-fixed {
  border-color: rgba(140, 106, 32, 0.18);
  background: rgba(245, 235, 203, 0.9);
}

.slot-card-closed {
  background: rgba(238, 230, 220, 0.88);
}

.board-slot-card-closed {
  background: rgba(238, 230, 220, 0.88);
}

.slot-card.is-selected,
.room-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(33, 73, 63, 0.14);
}

.room-pick-card:disabled,
.room-card:disabled,
.slot-card:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.room-card-available {
  border-color: rgba(33, 73, 63, 0.18);
}

.room-card-reserved,
.board-room-card-reserved {
  border-color: rgba(179, 96, 66, 0.18);
  background: rgba(255, 246, 240, 0.92);
}

.room-card-fixed,
.board-room-card-fixed {
  border-color: rgba(140, 106, 32, 0.18);
  background: rgba(245, 235, 203, 0.9);
}

.room-card-closed,
.board-room-card-closed {
  background: rgba(238, 230, 220, 0.88);
}

.room-panel {
  display: block;
}

.board-slot-panel,
.board-room-panel,
.settings-panel {
  display: none;
}

.board-slot-panel.is-active,
.board-room-panel.is-active,
.settings-panel.is-active {
  display: grid;
  gap: 12px;
}

.selection-banner {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(33, 73, 63, 0.08);
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.compact-banner {
  margin-bottom: 10px;
}

.booking-form,
.inline-form,
.login-form {
  display: grid;
  gap: 12px;
}

.compact-form {
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 0.88rem;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(33, 30, 26, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

.field-wide {
  grid-column: 1 / -1;
}

.helper-box {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(33, 73, 63, 0.07);
}

.confirm-prompt {
  padding: 14px;
  border: 1px solid rgba(179, 96, 66, 0.18);
  border-radius: var(--radius-md);
  background: rgba(255, 246, 240, 0.92);
  display: grid;
  gap: 6px;
}

.confirm-prompt strong {
  font-size: 0.95rem;
}

.confirm-prompt p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.compact-helper {
  font-size: 0.88rem;
}

.page-actions,
.compact-actions,
.preset-row {
  display: grid;
  gap: 8px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 52px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--primary);
  color: #fff8f1;
}

.secondary-button {
  background: #111;
  color: #fff;
}

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 16px;
  background: rgba(18, 18, 18, 0.56);
  display: grid;
  place-items: center;
}

.modal-card,
.login-card {
  width: min(100%, 400px);
  padding: 18px 16px;
  display: grid;
  gap: 14px;
}

.modal-close {
  justify-self: end;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.table-tag {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
}

.management-card,
.waitlist-card,
.settings-room-card,
.board-room-card,
.board-slot-card {
  padding: 14px;
}

.management-header,
.management-title,
.settings-room-head {
  display: grid;
  gap: 4px;
}

.management-meta {
  margin: 0;
  display: grid;
  gap: 8px;
}

.management-meta div {
  display: grid;
  gap: 4px;
}

.management-meta dd {
  margin: 0;
}

.mode-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mode-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.mode-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-pill.is-selected {
  background: var(--primary-soft);
  color: var(--primary);
}

.mode-pill.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fixed-label-field input:disabled {
  background: rgba(238, 230, 220, 0.8);
  color: var(--muted);
}

.locked-note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.preset-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preset-button {
  min-height: 46px;
  font-size: 0.82rem;
}

.waitlist-list,
.inline-waitlist,
.waitlist-panel ol {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.65;
}

.inline-waitlist {
  font-size: 0.84rem;
}

.room-waitlist-block {
  margin-top: 10px;
}

.empty-state {
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
  line-height: 1.6;
}

@media (max-width: 380px) {
  .page-shell {
    padding-inline: 8px;
  }

  .page-tabs,
  .compact-meta,
  .hero-meta,
  .selection-summary,
  .summary-strip,
  .mode-group,
  .preset-row {
    grid-template-columns: 1fr;
  }
}
