:root {
  --bg: #0b0d10;
  --bg-soft: #12151a;
  --card: #171b21;
  --border: #262b33;
  --text: #eef1f5;
  --text-dim: #9aa4b2;
  --accent: #4f8cff;
  --accent-dark: #2f6fe0;
  --success: #35c07a;
  --warning: #e0a53f;
  --danger: #e05f5f;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

header.site {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
header.site .container { display: flex; align-items: center; justify-content: space-between; }
header.site .brand { font-weight: 700; font-size: 1.1rem; }

.hero { padding: 72px 0 48px; text-align: center; }
.hero h1 { font-size: 2.4rem; margin-bottom: 16px; }
.hero p.lead { font-size: 1.15rem; color: var(--text-dim); max-width: 640px; margin: 0 auto 28px; }

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.secondary:hover { border-color: var(--accent); }
.btn.block { display: block; width: 100%; text-align: center; }

section { padding: 48px 0; }
section.alt { background: var(--bg-soft); }
h2.section-title { font-size: 1.6rem; margin-bottom: 8px; text-align: center; }
p.section-sub { text-align: center; color: var(--text-dim); margin-bottom: 36px; }

.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { margin-top: 0; }

.price-card { text-align: center; }
.price-card .price { font-size: 2.2rem; font-weight: 700; margin: 12px 0; }
.price-card .price span { font-size: 1rem; font-weight: 400; color: var(--text-dim); }
.price-card ul { text-align: left; color: var(--text-dim); padding-left: 20px; }

form.stacked { display: flex; flex-direction: column; gap: 16px; max-width: 640px; overflow: visible; }
form.stacked label { font-weight: 600; font-size: 0.92rem; display: block; margin-bottom: 6px; }
form.stacked input[type=text], form.stacked input[type=email], form.stacked input[type=tel],
form.stacked input[type=password], form.stacked select, form.stacked textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.98rem;
  font-family: inherit;
}
form.stacked textarea { min-height: 90px; resize: vertical; }
form.stacked .hint { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 0; overflow: visible; }
fieldset legend { padding: 0 8px; font-weight: 700; }

.label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.label-row.mt,
.check-row.mt { margin-top: 12px; }
.check-row.mt-sm { margin-top: 8px; }
.label-row .label-text { font-weight: 600; font-size: 0.92rem; }
form.stacked .label-row > label { display: inline; margin-bottom: 0; }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
form.stacked .check-row > label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.field-info {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  z-index: 1;
}
.field-info:hover,
.field-info:focus-within { z-index: 40; }
.field-info-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  padding: 0;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.field-info-btn:hover,
.field-info-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.field-info-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(300px, calc(100vw - 48px));
  padding: 10px 12px;
  background: #1c222c;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 50;
  text-align: left;
  white-space: normal;
}
.field-info-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #1c222c;
}
.field-info:hover .field-info-tip,
.field-info:focus-within .field-info-tip {
  opacity: 1;
  visibility: visible;
}

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
table.data th { color: var(--text-dim); font-weight: 600; }

/* Horizontal pan/swipe for dashboard tables. Native overflow so finger swipe
   follows the table on iOS/Android; thin scrollbar on pointer devices. */
.table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  padding-bottom: 6px;
}
.table-scroll table.data {
  width: max-content;
  min-width: 100%;
}
.table-scroll table.data th,
.table-scroll table.data td {
  white-space: nowrap;
}
.table-scroll table.data td[colspan] {
  white-space: normal;
}
@media (hover: hover) and (pointer: fine) {
  .table-scroll {
    scrollbar-width: thin;
    scrollbar-color: #4a5360 transparent;
  }
  .table-scroll::-webkit-scrollbar { height: 8px; }
  .table-scroll::-webkit-scrollbar-track {
    background: var(--bg-soft);
    border-radius: 4px;
  }
  .table-scroll::-webkit-scrollbar-thumb {
    background: #4a5360;
    border-radius: 4px;
  }
  .table-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
  }
}

.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 32px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat .value { font-size: 1.8rem; font-weight: 700; }
.stat .label { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge.open { background: rgba(79,140,255,0.15); color: var(--accent); }
.badge.booked { background: rgba(53,192,122,0.15); color: var(--success); }
.badge.escalated { background: rgba(224,95,95,0.15); color: var(--danger); }
.badge.pending { background: rgba(224,165,63,0.15); color: var(--warning); }
.badge.confirmed { background: rgba(53,192,122,0.15); color: var(--success); }
.badge.closed { background: rgba(154,164,178,0.15); color: var(--text-dim); }

.code-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  display: inline-block;
}

.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; border: 1px solid var(--border); }
.alert.danger { border-color: var(--danger); color: var(--danger); }
.alert.success { border-color: var(--success); color: var(--success); }
.alert.warning { border-color: var(--warning); color: var(--warning); }

.guide-intro { color: var(--text-dim); margin-bottom: 16px; }
.plain-list { color: var(--text-dim); padding-left: 20px; }
.plain-list li { margin-bottom: 10px; }
.hint { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }

.setup-banner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}
.setup-banner p {
  margin: 0 0 16px;
  color: var(--text-dim);
}
.setup-banner strong { color: var(--text); }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; margin-bottom: 14px; padding-left: 42px; position: relative; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}

footer.site { border-top: 1px solid var(--border); padding: 28px 0; color: var(--text-dim); font-size: 0.85rem; text-align: center; margin-top: 48px; }

.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; color: var(--text); text-decoration: none; }
.pagination a:hover { border-color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }
.pagination .disabled { opacity: 0.35; padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; }

.chat-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); max-width: 480px; margin: 0 auto; overflow: hidden; }
.chat-messages { height: 420px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { padding: 10px 14px; border-radius: 14px; max-width: 80%; font-size: 0.95rem; }
.chat-msg.assistant { background: var(--bg-soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.user { background: var(--accent); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input-row { display: flex; border-top: 1px solid var(--border); }
.chat-input-row input { flex: 1; border: none; background: transparent; color: var(--text); padding: 14px; font-size: 0.95rem; }
.chat-input-row input:focus { outline: none; }
.chat-input-row button { border: none; background: var(--accent); color: white; padding: 0 20px; font-weight: 600; cursor: pointer; }
