:root {
  color-scheme: light;
  --paper: #f7f4ef;
  --paper-deep: #eee9e1;
  --ink: #090909;
  --muted: #69645e;
  --line: #d8d1c7;
  --line-dark: #1a1a1a;
  --accent: #b98b69;
  --danger: #b04444;
  --ok: #2f6d58;
  --shadow: 0 24px 70px rgba(16, 13, 10, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.page-grid {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.content-panel {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 800;
}

h1,
h2,
h3,
.loader-title,
.queue-number,
.metric-value {
  font-family: Didot, "Bodoni 72", Georgia, serif;
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(52px, 7vw, 92px);
  line-height: 0.95;
  margin: 32px 0 24px;
}

h2 {
  font-size: clamp(44px, 6vw, 84px);
  line-height: 0.95;
  margin: 16px 0 24px;
}

p {
  line-height: 1.7;
}

.muted {
  color: var(--muted);
  max-width: 32rem;
}

.content-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(20px, 4vw, 48px);
  font-size: 13px;
}

.hero-grid,
.form-layout,
.status-grid,
.dashboard-preview,
.loading-cell,
.error-cell {
  padding: clamp(24px, 5vw, 64px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(320px, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.hero-grid h2 {
  font-size: clamp(36px, 4vw, 58px);
  margin-top: 0;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.language-button {
  min-height: 68px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  color: var(--ink);
}

.language-button:hover,
.language-button:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.arrow {
  font-size: 18px;
}

.loading-cell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.loader-title {
  margin-top: 18px;
  font-size: clamp(48px, 8vw, 110px);
  line-height: 0.95;
}

.thin-rule {
  width: min(420px, 100%);
  height: 1px;
  background: var(--ink);
  margin-top: 42px;
  transform-origin: left;
  animation: draw 1.2s ease both;
}

@keyframes draw {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(300px, 1fr);
  gap: clamp(28px, 5vw, 70px);
}

.statement {
  border-right: 1px solid var(--line);
  padding-right: clamp(24px, 4vw, 54px);
}

.editorial-form {
  display: grid;
  gap: 18px;
  align-content: start;
}

.editorial-form label {
  display: grid;
  gap: 8px;
}

.editorial-form label span {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.editorial-form input,
.editorial-form select,
.editorial-form textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
  color: var(--ink);
  border-radius: 0;
  min-height: 48px;
  padding: 12px 14px;
  outline: none;
}

.editorial-form input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  text-align: left;
}

.editorial-form input[type="date"]::-webkit-date-and-time-value {
  min-height: 1.2em;
  text-align: left;
}

.editorial-form textarea {
  resize: vertical;
}

.editorial-form input:focus,
.editorial-form select:focus,
.editorial-form textarea:focus {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.primary-button,
.danger-button,
.text-button {
  min-height: 44px;
  border-radius: 0;
  padding: 0 18px;
  border: 1px solid var(--ink);
}

.primary-button {
  background: var(--ink);
  color: var(--paper);
}

.primary-button:hover {
  background: transparent;
  color: var(--ink);
}

.danger-button {
  margin: 0 clamp(24px, 5vw, 64px) clamp(24px, 5vw, 64px);
  color: var(--danger);
  background: transparent;
  border-color: var(--danger);
}

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

.text-button {
  min-height: 34px;
  background: transparent;
}

.form-message {
  border-left: 3px solid var(--danger);
  margin: 0;
  padding: 10px 14px;
  color: var(--danger);
}

.status-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(2, minmax(150px, 0.55fr));
  border-bottom: 1px solid var(--line);
}

.status-grid > * {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(22px, 4vw, 42px);
}

.status-main {
  grid-row: span 2;
}

.queue-number {
  font-size: clamp(110px, 17vw, 220px);
  line-height: 0.85;
  margin-top: 30px;
}

.metric-value {
  font-size: clamp(62px, 8vw, 112px);
  line-height: 0.9;
}

.metric-label {
  margin-top: 12px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.detail-cell dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.detail-cell dt {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.detail-cell dd {
  margin: 0 0 14px;
  font-size: 20px;
}

.dashboard-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.dashboard-preview section {
  min-height: 160px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.staff-view {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(280px, 0.75fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.staff-section {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(24px, 5vw, 56px);
}

.section-head {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.success-message {
  color: var(--ok);
  font-size: 13px;
}

.readonly-row {
  min-height: 48px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
}

.readonly-row span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.reservation-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.reservation-item,
.empty-state {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.reservation-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.reservation-item > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.reservation-item strong {
  font-family: Didot, "Bodoni 72", Georgia, serif;
  font-size: 28px;
  font-weight: 500;
}

.reservation-item span {
  overflow-wrap: anywhere;
}

.empty-state {
  color: var(--muted);
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .page-grid {
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }

  h1 {
    font-size: clamp(42px, 14vw, 50px);
    margin: 20px 0 14px;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  h2,
  .hero-grid h2 {
    font-size: clamp(34px, 10vw, 44px);
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .topbar {
    min-height: 64px;
  }

  .hero-grid,
  .form-layout,
  .status-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .statement {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 20px;
  }

  .language-grid {
    grid-template-columns: 1fr;
  }

  .language-view {
    gap: 20px;
  }

  .language-view h2 {
    font-size: clamp(28px, 8vw, 36px);
    margin-bottom: 8px;
  }

  .language-button {
    min-height: 54px;
    padding: 12px 16px;
  }

  .status-main {
    grid-row: auto;
  }

  .dashboard-preview {
    grid-template-columns: 1fr;
  }

  .staff-view {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
  }

  .reservation-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .reservation-item > div:last-child {
    display: none;
  }
}
