:root {
  --paper: #f7f4ec;
  --paper-deep: #efe9dc;
  --ink: #17201a;
  --muted: #5d665e;
  --line: #d8d1c2;
  --green: #1f4d3a;
  --green-deep: #143528;
  --gold: #9a6f2e;
  --error-bg: #fbeceb;
  --error-ink: #8a2b24;
  --notice-bg: #edf2e9;
  --notice-ink: #2c5133;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(23, 32, 26, 0.05), 0 12px 32px rgba(23, 32, 26, 0.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-deep); }

h1, h2, .brand {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); margin: 0.15em 0 0.45em; }
h2 { font-size: 1.3rem; margin: 0 0 0.5em; }

p { margin: 0 0 1rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.12em 0.35em;
  overflow-wrap: anywhere;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}
.brand span { color: var(--muted); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 0.92rem;
}
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--ink); }

.container {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 3.5rem 0 4.5rem;
  flex: 1;
}

.site-footer {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}
.footer-sep { margin: 0 0.4rem; }

.hero {
  max-width: 760px;
  padding: 2rem 0 3rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--gold);
  margin: 0 0 1rem;
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: 58ch;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: 0.7rem 1.35rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 550;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.button:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.button:active { transform: translateY(1px); }
.button.ghost { background: transparent; color: var(--green); border-color: var(--line); }
.button.ghost:hover { background: var(--paper-deep); border-color: var(--muted); color: var(--green-deep); }
.button.small { padding: 0.42rem 0.9rem; font-size: 0.83rem; }
.button.full { width: 100%; }

.grid { display: grid; gap: 1.25rem; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.feature-grid { margin-top: 1.5rem; }

.card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.card p:last-child { margin-bottom: 0; }
.card-number {
  display: block;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  margin-bottom: 1.35rem;
}

.panel {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  box-shadow: var(--shadow);
}
.panel.narrow { max-width: 520px; margin: 0 auto; }
.panel h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }

.muted { color: var(--muted); }
.subtle { font-size: 0.82rem; }

.form { display: flex; flex-direction: column; margin-top: 1.5rem; }
.form label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 0.35rem;
}
.form input {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 0.7rem 0.8rem;
  margin-bottom: 1.1rem;
}
.form input:focus {
  outline: 2px solid rgba(31, 77, 58, 0.3);
  outline-offset: 1px;
  border-color: var(--green);
}
.form .button { margin-top: 0.4rem; }

.hint { color: var(--muted); font-size: 0.78rem; margin: -0.75rem 0 1.1rem; }
.form-footer { margin: 1.4rem 0 0; font-size: 0.88rem; color: var(--muted); }

.alert {
  border: 1px solid;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.alert-error { background: var(--error-bg); border-color: #e5bbb7; color: var(--error-ink); }
.alert-notice { background: var(--notice-bg); border-color: #c8d8c1; color: var(--notice-ink); }

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 1.35rem 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.google { margin-top: 0; }

.inline-form { display: inline; margin: 0; }
.link-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.link-button:hover { color: var(--ink); }
.link-button.danger { color: var(--error-ink); }

.dev-box {
  background: var(--paper-deep);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin: 1.5rem 0;
}
.dev-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.break { overflow-wrap: anywhere; }

.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.dashboard-head h1 { font-size: clamp(1.8rem, 3.5vw, 2.7rem); overflow-wrap: anywhere; }
.role-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  background: var(--paper-deep);
}

.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; margin: 1rem 0 0; }
.details dt { color: var(--muted); font-size: 0.82rem; }
.details dd { margin: 0; overflow-wrap: anywhere; }

.owner-callout { margin-top: 1.25rem; }

.invite-created { margin-bottom: 1.25rem; border-color: var(--gold); }
.invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  overflow-wrap: anywhere;
  margin: 0.2rem 0 0.6rem;
  color: var(--green-deep);
}

.inline-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin-top: 1rem;
}
.inline-form-grid input { margin-bottom: 0; }
.align-end { display: flex; align-items: flex-end; }
.align-end .button { width: 100%; }

.table-wrap { overflow-x: auto; margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { text-align: left; padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 1.5rem; }

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
}
.status-active { background: var(--notice-bg); border-color: #c8d8c1; color: var(--notice-ink); }
.status-owner { background: var(--notice-bg); border-color: #c8d8c1; color: var(--notice-ink); }
.status-confirmed { background: var(--notice-bg); border-color: #c8d8c1; color: var(--notice-ink); }
.status-cancelled, .status-revoked, .status-expired, .status-used { background: var(--paper-deep); color: var(--muted); }

/* Phase 2 booking controls */
.form select,
.inline-form-grid select,
.row-form select,
.inline-form-grid input[type="time"],
.inline-form-grid input[type="datetime-local"],
.inline-form-grid input[type="date"],
.row-form input {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 0.62rem 0.7rem;
}
.form select,
.inline-form-grid select,
.inline-form-grid input[type="time"],
.inline-form-grid input[type="datetime-local"],
.inline-form-grid input[type="date"] {
  width: 100%;
}
.inline-form-grid select,
.inline-form-grid input[type="time"],
.inline-form-grid input[type="datetime-local"],
.inline-form-grid input[type="date"] { margin-bottom: 0; }

.row-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
}
.row-form input[type="text"],
.row-form input:not([type]) { min-width: 9rem; }
.row-form input[type="number"] { width: 5.5rem; }
.row-form input[type="time"] { width: 7.5rem; }
.row-form input[type="datetime-local"] { width: 12rem; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}
.check input { width: auto; margin: 0; }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}
.slot-form { margin: 0; }
.slot-form .slot { width: 100%; justify-content: center; }

.env-list { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: 0.5rem; }
.env-list code { display: inline-block; }

@media (max-width: 760px) {
  .grid.three, .grid.two { grid-template-columns: 1fr; }
  .site-header { align-items: flex-start; flex-direction: column; gap: 0.6rem; }
  .container { padding-top: 2.25rem; }
  .dashboard-head { flex-direction: column; }
  .inline-form-grid { grid-template-columns: 1fr; }
  .inline-form-grid .align-end { margin-top: 0.4rem; }
  .details { grid-template-columns: 1fr; gap: 0.15rem; }
  .details dd { margin-bottom: 0.7rem; }
  .row-form { align-items: stretch; }
  .row-form input,
  .row-form select { width: 100%; }
}
