/* =========================================================
   Chrony — design tokens & base styles
   ========================================================= */

:root {
  /* Type */
  --font-ui: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;

  /* Surfaces (warm off-white) */
  --bg: #f7f4ee;
  --bg-2: #f1ede5;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --border: #e8e2d6;
  --border-strong: #d6cfbf;
  --hairline: #efeae0;

  /* Ink */
  --ink: #1c1a16;
  --ink-2: #3a362e;
  --muted: #7a7466;
  --muted-2: #9a9486;
  --faint: #b8b2a3;

  /* Accent (terracotta default) */
  --accent: #d97757;
  --accent-hover: #c2603f;
  --accent-soft: #fbe9df;
  --accent-ink: #6b2f17;
  --on-accent: #ffffff;

  /* States */
  --success: #4f8a5b;
  --success-soft: #e2efe4;
  --success-ink: #1f4a29;

  --danger: #b85450;
  --danger-soft: #f4dedd;
  --danger-ink: #6b2120;

  --warn: #c08a3b;
  --warn-soft: #f3e7cf;

  --info: #4c6b9c;
  --info-soft: #e2e8f1;

  /* AI block (subtle by default) */
  --ai-border: var(--border);
  --ai-bg: var(--surface-2);
  --ai-tag-bg: #ecebe5;
  --ai-tag-ink: #4a4636;

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* Shadows (soft, Cal.com-ish) */
  --sh-1: 0 1px 2px rgba(28, 26, 22, 0.04), 0 1px 1px rgba(28, 26, 22, 0.03);
  --sh-2: 0 2px 8px rgba(28, 26, 22, 0.05), 0 1px 2px rgba(28, 26, 22, 0.04);
  --sh-3: 0 10px 30px -10px rgba(28, 26, 22, 0.18), 0 4px 12px -4px rgba(28, 26, 22, 0.08);
  --sh-pop: 0 20px 60px -20px rgba(28, 26, 22, 0.25), 0 8px 20px -8px rgba(28, 26, 22, 0.1);

  /* Layout */
  --nav-h: 60px;
  --max: 1180px;
}

/* Accent variants — applied via [data-accent="..."] on <html> */
html[data-accent="indigo"] {
  --accent: #5b6ee0;
  --accent-hover: #4856c0;
  --accent-soft: #e3e6f7;
  --accent-ink: #1f2566;
}
html[data-accent="emerald"] {
  --accent: #2f9e6b;
  --accent-hover: #248055;
  --accent-soft: #d8ecdf;
  --accent-ink: #114a30;
}
html[data-accent="slate"] {
  --accent: #2a2c33;
  --accent-hover: #15161c;
  --accent-soft: #e6e6e9;
  --accent-ink: #15161c;
}

/* Font variants */
html[data-font="manrope"] {
  --font-ui: "Manrope", ui-sans-serif, system-ui, sans-serif;
}
html[data-font="onest"] {
  --font-ui: "Onest", ui-sans-serif, system-ui, sans-serif;
}

/* AI emphasis variants */
html[data-ai="accent"] {
  --ai-border: color-mix(in srgb, var(--accent) 35%, var(--border));
  --ai-bg: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
  --ai-tag-bg: color-mix(in srgb, var(--accent-soft) 70%, white);
  --ai-tag-ink: var(--accent-ink);
}
html[data-ai="inline"] {
  --ai-border: var(--border);
  --ai-bg: transparent;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-feature-settings: "ss01", "cv11";
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
  color: inherit;
}

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

::selection {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* =========================================================
   App shell
   ========================================================= */

.app {
  min-height: 100vh;
  background: var(--bg);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(247, 244, 238, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.nav-brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  position: relative;
}

.nav-brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--bg);
  border-top-color: var(--accent);
  transform: rotate(-30deg);
}

.nav-brand-mark--logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.nav-brand-mark--logo::after {
  content: none;
}

.nav-brand-mark--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-brand small {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 4px;
  padding: 2px 6px;
  background: var(--bg-2);
  border-radius: 4px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 500;
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 28px 80px;
}

.page-narrow {
  max-width: 720px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 4px;
}

.page-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.page-actions {
  display: flex;
  gap: 8px;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  background: transparent;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: translateY(0.5px);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04) inset, 0 1px 2px rgba(28, 26, 22, 0.08);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
}

.btn-ghost:hover {
  background: var(--bg-2);
}

.btn-danger {
  background: var(--surface);
  border-color: var(--border);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.btn-danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 6px;
  gap: 6px;
}

.btn-lg {
  height: 44px;
  padding: 0 22px;
  font-size: 15px;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
}

.btn-icon:hover {
  background: var(--bg-2);
  color: var(--ink);
}

.btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

/* Google sign-in button — original style, not Google's */
.btn-google {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-google:hover {
  background: #000;
  border-color: #000;
}
.btn-google svg {
  background: white;
  border-radius: 50%;
  padding: 2px;
}

/* =========================================================
   Cards
   ========================================================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}

.card-pad {
  padding: 22px;
}

.card-pad-lg {
  padding: 28px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--hairline);
}

.card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-head .muted {
  font-weight: 400;
  color: var(--muted);
}

.card-body {
  padding: 18px 22px;
}

.card-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--hairline);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* =========================================================
   Forms
   ========================================================= */

.field {
  display: block;
  margin-bottom: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.label .hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.5;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-readonly {
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Chip group (durations etc) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

#durationChips .chip {
  flex: 1 1 0;
  justify-content: center;
  white-space: nowrap;
  padding: 0 8px;
}

.custom-duration {
  margin-top: 10px;
}

.custom-duration-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.custom-duration-inputs .input {
  flex: 1 1 0;
  width: auto;
  text-align: center;
}

.custom-duration-inputs .unit {
  font-size: 13px;
  color: var(--muted);
}

/* =========================================================
   Badges
   ========================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.badge.no-dot::before {
  display: none;
}

.badge-open {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink-2);
}

.badge-booked {
  background: var(--success-soft);
  color: var(--success-ink);
}

.badge-cancelled {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.badge-google {
  background: var(--info-soft);
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 20%, transparent);
}

.badge-yandex {
  background: var(--danger-soft);
  color: var(--danger-ink);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.badge-ghost {
  background: var(--bg-2);
  color: var(--muted);
}

.badge-ghost::before {
  display: none;
}

/* =========================================================
   Avatars
   ========================================================= */

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.01em;
  background: var(--accent);
  flex-shrink: 0;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 22px;
  border-radius: 50%;
}

.avatar-xl {
  width: 80px;
  height: 80px;
  font-size: 28px;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

/* =========================================================
   Empty states
   ========================================================= */

.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--bg-2);
  display: grid;
  place-items: center;
  color: var(--muted-2);
}

.empty-title {
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 4px;
}

/* =========================================================
   AI block
   ========================================================= */

.ai-block {
  border: 1px solid var(--ai-border);
  background: var(--ai-bg);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}

.ai-block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--ai-tag-bg);
  color: var(--ai-tag-ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 5px;
}

.ai-block-title {
  font-weight: 600;
  font-size: 14px;
}

.ai-block-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 14px;
}

.ai-agenda-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
}

.ai-agenda-item:first-child {
  border-top: 0;
}

.ai-agenda-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}

.ai-agenda-body {
  flex: 1;
  min-width: 0;
}

.ai-agenda-name {
  font-weight: 500;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-agenda-mins {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.ai-agenda-desc {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

/* =========================================================
   Slot grid & schedule
   ========================================================= */

.day-block {
  margin-bottom: 22px;
}

.day-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
}

.day-head h4 {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0;
  text-transform: capitalize;
}

.day-head .day-meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
}

.slot {
  height: 38px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.slot:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.slot.is-selected {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.slot.is-selected:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.slot {
  cursor: pointer;
}

.slot.is-disabled {
  background: var(--bg-2);
  color: var(--faint);
  pointer-events: none;
  border-style: dashed;
}

/* =========================================================
   Modal
   ========================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 22, 0.4);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-pop);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.18s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.modal-wide {
  max-width: 640px;
}

.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--hairline);
  background: var(--surface-2);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
@keyframes modalIn {
  from {
    transform: translateY(8px) scale(0.98);
    opacity: 0;
  }
}

/* =========================================================
   Utility
   ========================================================= */

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.muted {
  color: var(--muted);
}
.mono {
  font-family: var(--font-mono);
}
.small {
  font-size: 12.5px;
}
.tiny {
  font-size: 11.5px;
}
.bold {
  font-weight: 600;
}
.ink-2 {
  color: var(--ink-2);
}
.ellipsis {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.grow {
  flex: 1;
  min-width: 0;
}
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.hr {
  height: 1px;
  background: var(--hairline);
  border: 0;
  margin: 16px 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.cols-8-4 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tips list with check marks */
.tips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tips li {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.45;
}

.tips .tip-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Section header inside cards */
.section-h {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

/* Info alert */
.alert {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink-2);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert .alert-icon {
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-success {
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
  background: var(--success-soft);
  color: var(--success-ink);
}

.alert-success .alert-icon {
  color: var(--success);
}

/* Sticky timeline header for landing */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Meeting list row */
.meeting-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 0.12s;
}

.meeting-row:hover {
  background: var(--surface-2);
}

.meeting-row:first-of-type {
  border-top: 0;
}

.meeting-row-title {
  font-weight: 500;
  font-size: 14.5px;
  margin-bottom: 2px;
}

.meeting-row-meta {
  color: var(--muted);
  font-size: 12.5px;
  font-family: var(--font-mono);
}

/* Calendar mini card */
.cal-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-card-connected {
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
  background: color-mix(in srgb, var(--success-soft) 35%, white);
}

.cal-card-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.cal-card-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}

.cal-card-meta {
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-family: var(--font-mono);
}

/* Time slider */
.time-slider {
  position: relative;
  padding: 22px 8px 6px;
}

.time-slider-track {
  height: 6px;
  background: var(--bg-2);
  border-radius: 3px;
  position: relative;
}

.time-slider-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--ink);
  border-radius: 3px;
}

.time-slider-handle {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--ink);
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: var(--sh-2);
}

.time-slider-handle:hover {
  border-color: var(--accent);
}

.time-slider-bubble {
  position: absolute;
  top: -20px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  transform: translate(-50%, -100%);
  white-space: nowrap;
}

.time-slider-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--ink);
}

.time-slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* Copy field */
.copy-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-md);
  overflow: hidden;
}

.copy-field input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
  outline: none;
  min-width: 0;
}

.copy-field button {
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  height: 100%;
  padding: 0 14px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.copy-field button:hover {
  background: var(--bg-2);
  color: var(--ink);
}

/* Booked meeting hero card */
.booked-hero {
  border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border));
  background: linear-gradient(180deg, var(--success-soft) 0%, white 80%);
  border-radius: var(--r-xl);
  padding: 28px;
}

/* Sidenav for in-prototype routing */
.proto-nav {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  box-shadow: var(--sh-pop);
  font-size: 12.5px;
}

.proto-nav button {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.7);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.proto-nav button:hover {
  color: white;
}

.proto-nav button.is-active {
  background: white;
  color: var(--ink);
}

.proto-nav-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}

/* =========================================================
   App-specific additions (not in original prototype)
   ========================================================= */

/* noUiSlider — restyle to match design tokens */
.noUi-target {
  background: var(--bg-2);
  border: 0;
  box-shadow: none;
  border-radius: 3px;
  height: 6px;
}
.noUi-connects {
  border-radius: 3px;
}
.noUi-connect {
  background: var(--ink);
}
.noUi-horizontal .noUi-handle {
  width: 18px;
  height: 18px;
  right: -9px;
  top: -6px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--sh-2);
  cursor: grab;
}
.noUi-horizontal .noUi-handle:hover {
  border-color: var(--accent);
}
.noUi-handle:before,
.noUi-handle:after {
  display: none;
}
.noUi-tooltip {
  background: var(--ink);
  color: var(--bg);
  border: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  bottom: 22px;
}

/* Breadcrumb */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}
.breadcrumbs a,
.breadcrumbs .crumb-link {
  background: transparent;
  border: 0;
  padding: 0 6px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.breadcrumbs a:hover,
.breadcrumbs .crumb-link:hover {
  background: var(--bg-2);
  color: var(--ink);
}
.breadcrumbs .crumb-current {
  color: var(--ink);
  font-weight: 600;
  padding: 0 6px;
}

/* Page-wide alerts (top-of-content errors) */
.alert-warn {
  border-color: color-mix(in srgb, var(--warn) 30%, var(--border));
  background: var(--warn-soft);
  color: #6b4a18;
}
.alert-warn .alert-icon {
  color: var(--warn);
}
.alert-danger {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  background: var(--danger-soft);
  color: var(--danger-ink);
}
.alert-danger .alert-icon {
  color: var(--danger);
}

/* Slot button as <button> — keep visual identical to .slot */
button.slot {
  font-family: var(--font-mono);
  cursor: pointer;
}
button.slot:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Compact metric box used inside hero */
.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.metric-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}
.metric-label {
  font-size: 11.5px;
  color: var(--muted);
}

/* Responsive */
/* Landing hero title — base size, scaled down on smaller viewports below. */
.landing-hero-title {
  font-size: 64px;
}

/* =========================================================
   Responsive — tablet
   ========================================================= */
@media (max-width: 880px) {
  .cols-8-4,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .page {
    padding: 24px 18px 60px;
  }
  .nav {
    padding: 0 18px;
  }

  .landing-hero-title {
    font-size: 46px;
  }
  /* Stacked preview card (inline grid-template-columns needs overriding). */
  .landing-preview {
    grid-template-columns: 1fr !important;
  }
  .meeting-meta-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* =========================================================
   Responsive — phone
   ========================================================= */
@media (max-width: 560px) {
  .page {
    padding: 20px 14px 52px;
  }
  .nav {
    padding: 0 14px;
  }
  .nav-brand {
    font-size: 14px;
  }
  .nav-brand small {
    display: none;
  }
  .nav-brand-mark--logo {
    width: 40px;
    height: 40px;
  }

  .page-title {
    font-size: 24px;
  }
  .landing-hero-title {
    font-size: 34px;
  }

  /* Single-column forms and meta blocks. */
  .field-row {
    grid-template-columns: 1fr;
  }
  .meeting-meta-grid {
    grid-template-columns: 1fr !important;
  }

  /* Let inline flex rows wrap instead of overflowing the screen. */
  .row,
  .row-between {
    flex-wrap: wrap;
  }

  /* Full-width primary CTAs read better than cramped side-by-side ones. */
  .btn-lg {
    width: 100%;
  }

  /* Tighten the duration presets so 8 chips still fit two rows cleanly. */
  #durationChips .chip {
    font-size: 12.5px;
    padding: 0 6px;
  }

  /* Demo slot grid (inline 4-col) gets cramped on narrow phones. */
  .landing-preview .slot-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* (3) Long-label full-width buttons must wrap instead of overflowing the
     page (a fixed-height, nowrap button is what pushes the viewport wide). */
  .btn-block {
    white-space: normal;
    height: auto;
    min-height: 44px;
    padding-top: 9px;
    padding-bottom: 9px;
    line-height: 1.3;
  }

  /* (1) Dashboard meeting rows: stop squeezing date/time/duration into a
     thin column — give the title+meta a full line, actions below. */
  .meeting-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 10px;
    row-gap: 6px;
  }
  .meeting-row > .grow {
    flex: 1 1 100%;
  }
  .meeting-row-meta {
    font-size: 13px;
    line-height: 1.5;
  }
  .meeting-row > [data-action="delete"] {
    margin-left: auto;
  }

  /* (5) Keep the edit modal inside the viewport. */
  .modal-backdrop {
    padding: 12px;
  }
  .modal,
  .modal-wide {
    max-width: 100%;
  }

  /* Let card headers and breadcrumbs wrap instead of overflowing. */
  .card-head {
    flex-wrap: wrap;
  }
  .breadcrumbs {
    flex-wrap: wrap;
  }

  /* (4) Copy field: keep the button intact and let the input take the rest. */
  .copy-field button {
    flex-shrink: 0;
  }
}
