:root {
  --bg: #fcfbf7;
  --bg-grid: rgba(17, 17, 17, 0.035);
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --ink: #111111;
  --muted: #5e6875;
  --line: #e5e2db;
  --line-strong: #1d2b3a;
  --accent: #6fb7c9;
  --accent-strong: #1f4254;
  --success-bg: rgba(111, 183, 201, 0.14);
  --success-line: rgba(31, 66, 84, 0.24);
  --danger: #b13f2d;
  --shadow: 0 20px 44px rgba(17, 17, 17, 0.06);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-display: "Unbounded", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(17, 17, 17, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
}

body {
  font: 500 17px/1.58 var(--font-body, Arial, sans-serif);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.wrap {
  width: min(1280px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.gate-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  gap: 8px;
  text-decoration: none;
  color: #425063;
  font: 700 13px/1 var(--font-mono, monospace);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.top-link::before {
  content: "\2190";
  font-size: 14px;
}

.meta-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  color: #5b6674;
  font: 600 12px/1.2 var(--font-body, Arial, sans-serif);
}

.meta-pill strong {
  color: var(--ink);
}

.gate-stage,
.surface,
.calendar-shell,
.meta-card,
.slot-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.gate-stage,
.surface,
.calendar-shell {
  padding: clamp(20px, 2.6vw, 30px);
}

.gate-grid,
.surface-grid,
.calendar-grid {
  display: grid;
  gap: 22px;
}

.gate-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.eyebrow,
.panel-kicker,
.slot-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid rgba(31, 66, 84, 0.18);
  background: rgba(255, 255, 255, 0.8);
  color: #445465;
  font: 700 11px/1 var(--font-mono, monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 18px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display, Arial, sans-serif);
  letter-spacing: -0.06em;
}

h1 {
  max-width: 16ch;
  font-size: clamp(28px, 3.1vw, 46px);
  line-height: 0.96;
  margin-bottom: 8px;
}

h2 {
  font-size: clamp(24px, 2.3vw, 38px);
  line-height: 1;
  margin-bottom: 10px;
}

h3 {
  font-size: clamp(20px, 1.7vw, 28px);
  line-height: 1.05;
}

p {
  margin: 0;
  color: var(--muted);
}

.gate-copy,
.calendar-panel,
.meta-card,
.slot-card {
  display: grid;
  gap: 12px;
}

.gate-lead {
  max-width: 40ch;
  font-size: clamp(18px, 1.4vw, 24px);
  line-height: 1.5;
}

.proof-strip {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.proof-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.proof-index {
  color: #415263;
  font: 700 12px/1 var(--font-mono, monospace);
  letter-spacing: 0.08em;
}

.proof-item p {
  color: #374352;
  font-weight: 600;
}

.gate-form {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.email-inline-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.email-inline-form .field {
  gap: 6px;
}

.email-inline-form .field label {
  font-size: 14px;
  font-weight: 600;
  color: #4a5563;
}

.email-inline-form .field input {
  min-height: 50px;
  padding: 12px 14px;
}

.email-inline-form .form-error {
  margin-top: 2px;
}

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

.field label {
  color: var(--ink);
  font-weight: 700;
}

.field input {
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.field input:focus-visible {
  outline: none;
  border-color: #1d6df2;
  box-shadow: 0 0 0 3px rgba(29, 109, 242, 0.18);
}

.field-note,
.helper-note,
.summary-note {
  font-size: 14px;
  line-height: 1.55;
}

.chip-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.size-chip,
.calendar-day,
.slot-button,
.calendar-nav {
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.size-chip {
  min-height: 52px;
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
}

.size-chip:hover,
.calendar-day:hover,
.slot-button:hover,
.calendar-nav:hover {
  transform: translateY(-1px);
  border-color: #7ca4b2;
}

.size-chip.is-selected,
.calendar-day.is-selected,
.slot-button.is-selected {
  border-color: var(--line-strong);
  background: rgba(111, 183, 201, 0.12);
  box-shadow: 0 0 0 3px rgba(111, 183, 201, 0.18);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 22px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-dark {
  background: #111111;
  color: #ffffff;
}

.btn-light {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

.btn-wide {
  width: 100%;
}

.status,
.form-error,
.calendar-lock {
  padding: 14px 16px;
  border: 1px solid transparent;
}

.status {
  background: var(--success-bg);
  border-color: var(--success-line);
  color: #214355;
}

.form-error {
  background: rgba(177, 63, 45, 0.08);
  border-color: rgba(177, 63, 45, 0.18);
  color: var(--danger);
}

.status[hidden],
.form-error[hidden] {
  display: none;
}

.calendar-panel {
  position: relative;
  padding: clamp(20px, 2.4vw, 28px);
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.calendar-panel-head {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.calendar-lock {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  background: rgba(17, 17, 17, 0.04);
  border-color: rgba(17, 17, 17, 0.08);
}

.calendar-lock[hidden] {
  display: none;
}

.calendar-widget {
  display: grid;
  gap: 18px;
}

.calendar-widget.is-locked {
  opacity: 0.62;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.calendar-toolbar-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.calendar-month {
  color: var(--ink);
  font: 700 18px/1.2 var(--font-body, Arial, sans-serif);
}

.calendar-timezone {
  color: var(--muted);
  font: 700 11px/1.2 var(--font-mono, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calendar-nav {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font: 700 18px/1 var(--font-body, Arial, sans-serif);
}

.calendar-nav:disabled {
  opacity: 0.36;
  cursor: not-allowed;
  transform: none;
}

.calendar-day-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.calendar-day {
  min-height: 92px;
  padding: 14px 12px;
  display: grid;
  align-content: start;
  gap: 6px;
  text-align: left;
}

.calendar-day-day {
  color: #4b5969;
  font: 700 11px/1 var(--font-mono, monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-day-date {
  color: var(--ink);
  font: 700 22px/1 var(--font-display, Arial, sans-serif);
  letter-spacing: -0.05em;
}

.calendar-day-month {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}

.slot-shell {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.slot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.slot-head h3 {
  margin-top: 6px;
}

.slot-duration {
  color: #51606f;
  font: 700 11px/1 var(--font-mono, monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.slot-button {
  min-height: 48px;
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
}

.slot-button:disabled,
.calendar-day:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.summary-card,
.meta-card,
.slot-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.summary-row,
.meta-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.summary-row:last-of-type,
.meta-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-label,
.meta-label {
  color: var(--muted);
  font-weight: 600;
}

.calendar-shell p:last-child,
.slot-card p:last-child,
.meta-card p:last-child,
.summary-card p:last-child {
  margin-bottom: 0;
}

.calendar-grid,
.surface-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 1040px) {
  .gate-grid,
  .surface-grid,
  .calendar-grid {
    grid-template-columns: minmax(300px, 0.8fr) minmax(460px, 1.2fr);
  }

  .calendar-panel {
    position: sticky;
    top: 20px;
  }
}

@media (max-width: 900px) {
  .calendar-day-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .wrap {
    width: min(100% - 20px, 1280px);
    margin: 18px auto 36px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(24px, 8.6vw, 36px);
  }

  h2 {
    font-size: clamp(22px, 8vw, 30px);
  }

  .chip-row,
  .calendar-day-strip,
  .slot-grid {
    grid-template-columns: 1fr;
  }

  .actions,
  .meta-pill-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .meta-pill {
    width: 100%;
  }

  .gate-topbar {
    align-items: stretch;
  }

  .summary-row,
  .meta-item,
  .slot-head {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .calendar-toolbar {
    grid-template-columns: 44px 1fr 44px;
  }
}
