:root {
  --navy: #0d1729;
  --blue: #243850;
  --sky: #6f5a34;
  --gold: #dbb46a;
  --gold-soft: rgba(219, 180, 106, 0.22);
  --card: rgba(231, 232, 228, 0.84);
  --panel: rgba(255,255,255,0.94);
  --ink: #122034;
  --muted: #6e7580;
  --line: rgba(255,255,255,0.15);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 16%, rgba(255,255,255,0.1), transparent 22%),
    radial-gradient(circle at 14% 85%, rgba(255,255,255,0.08), transparent 18%),
    linear-gradient(135deg, var(--navy), var(--blue) 58%, #886f3c);
}
.page-shell { min-height: 100vh; padding: 26px; }
.layout {
  max-width: 1460px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(420px, 580px) minmax(320px, 1fr);
  gap: 26px;
  align-items: start;
}
.app-column {
  position: sticky;
  top: 26px;
  display: flex;
  justify-content: center;
}
.app-frame {
  width: min(100%, 560px, calc((100dvh - 52px) / 1.72));
  aspect-ratio: 9 / 16;
  height: auto;
  max-height: calc(100dvh - 52px);
  border-radius: 34px;
  background: rgba(204, 205, 201, 0.88);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}
.top-panel, .composer-card, .chat-card {
  border-radius: 30px;
  border: 1px solid var(--line);
  background: var(--card);
}
.top-panel { padding: 14px; margin-bottom: 12px; }
.brand-row, .top-panel, .modal-header, .composer-row, .control-row { display: flex; align-items: center; }
.top-panel, .modal-header, .control-row { justify-content: space-between; }
.brand-icon, .empty-logo { width: 54px; height: 54px; border-radius: 16px; object-fit: cover; box-shadow: 0 8px 18px rgba(0,0,0,0.18); }
.empty-logo { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; }
.brand-row { gap: 12px; }
.brand-title { font-size: 3rem; line-height: 0.95; font-weight: 900; letter-spacing: -0.05em; }
.brand-subtitle { color: var(--muted); font-size: 1.02rem; }
.toolbar { display: flex; gap: 10px; }
.circle-btn {
  width: 44px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.9); color: var(--gold); font-size: 1.15rem; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(33,52,73,0.08);
}
.circle-btn.small { width: 38px; height: 38px; font-size: 1rem; }
.control-stack { position: relative; display: grid; gap: 12px; margin-bottom: 16px; flex: 0 0 auto; }
.location-anchor {
  position: relative;
}
.pill-input, .pill-button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border-radius: 22px; border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.82);
  padding: 15px 17px; color: #111; font-size: 1.08rem;
}
.pill-input input {
  width: 100%; border: 0; outline: none; background: transparent; font: inherit; color: #111;
}
.pill-button { cursor: pointer; justify-content: flex-start; font: inherit; }
.wide { flex: 1 1 auto; }
.narrow { width: 146px; }
.picker-pill {
  position: relative;
  overflow: hidden;
}
.picker-anchor-row {
  position: relative;
  z-index: 12;
  align-items: flex-start;
  gap: 12px;
}
.picker-column {
  position: relative;
  display: block;
}
.picker-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  border-radius: 28px;
  background: rgba(255,255,255,0.99);
  border: 1px solid #dfe7f0;
  box-shadow: 0 20px 40px rgba(10,23,41,0.16);
  padding: 14px;
}
.wide-popup { width: 100%; }
.narrow-popup { width: 146px; }
.picker-popup-title {
  margin-bottom: 10px;
  color: #35506d;
  font-size: 0.92rem;
  font-weight: 700;
}
.wheel-picker {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-height: 182px;
}
.wheel-picker-date {
  display: grid;
  grid-template-columns: 62px minmax(120px, 1fr) 78px;
  gap: 10px;
}
.wheel-picker-time {
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  gap: 8px;
}
.wheel-column {
  position: relative;
  height: 168px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: y mandatory;
  border-radius: 20px;
  background: rgba(246,248,251,0.92);
  padding-block: 64px;
  touch-action: pan-y;
  cursor: ns-resize;
}
.wheel-column::-webkit-scrollbar { display: none; }
.wheel-column-wide { min-width: 0; }
.wheel-option {
  display: block;
  width: 100%;
  height: 40px;
  border: 0;
  background: transparent;
  color: #728095;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  scroll-snap-align: center;
  cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
}
.wheel-column.dragging {
  cursor: ns-resize;
}
.wheel-column.dragging .wheel-option {
  pointer-events: none;
}
.wheel-column-wide .wheel-option {
  text-align: left;
  padding-inline: 14px;
}
.wheel-option.is-selected {
  color: #132033;
  font-weight: 800;
  transform: scale(1.03);
}
.picker-separator {
  font-size: 1.15rem;
  font-weight: 700;
  color: #44566e;
  display: grid;
  place-items: center;
  align-self: center;
  z-index: 2;
}
.wheel-highlight {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 64px;
  height: 40px;
  border-radius: 16px;
  background: rgba(219,180,106,0.14);
  box-shadow: inset 0 0 0 1px rgba(219,180,106,0.24);
}
.suggestions {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 20;
  border-radius: 30px; background: rgba(255,255,255,0.99); border: 1px solid #dfe7f0; overflow: hidden;
  box-shadow: 0 20px 40px rgba(10,23,41,0.18);
  padding: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.suggestion-item {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #132033;
  font: inherit;
  font-size: 1rem;
}
.suggestion-item + .suggestion-item { margin-top: 4px; }
.suggestion-item:hover { background: #f6f8fb; }
.chat-card {
  min-height: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
  flex: 1 1 auto;
}
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); gap: 10px; min-height: 0; }
.chat-list { display: flex; flex-direction: column; gap: 16px; overflow: auto; min-height: 0; flex: 1 1 auto; }
.message-wrap { display: flex; flex-direction: column; gap: 8px; }
.message-wrap.user { align-items: flex-end; }
.message-wrap.assistant, .message-wrap.error { align-items: flex-start; }
.message-meta { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; min-height: 36px; }
.timing-chip {
  padding: 7px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--ink); font-size: 0.92rem; font-weight: 600;
}
.assistant-actions { display: flex; gap: 8px; margin-left: auto; }
.message-bubble {
  max-width: 100%; border-radius: 26px; padding: 16px 18px; line-height: 1.55; white-space: pre-wrap;
  background: rgba(255,255,255,0.96); border: 1px solid rgba(255,255,255,0.18); font-size: 1.05rem;
}
.message-wrap.user .message-bubble { background: var(--gold-soft); }
.message-wrap.error .message-bubble { background: #ffeceb; color: #962c20; }
.composer-card { padding: 16px; flex: 0 0 auto; }
.quick-prompts { display: flex; gap: 10px; overflow: auto; padding-bottom: 12px; margin-bottom: 12px; }
.quick-prompt {
  border-radius: 18px; border: 1px solid rgba(17,17,17,0.08); background: rgba(255,255,255,0.95); padding: 10px 14px;
  white-space: nowrap; cursor: pointer; font-size: 1rem;
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.quick-prompts {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
  cursor: grab;
  user-select: none;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
}
.quick-prompts::-webkit-scrollbar { display: none; }
.quick-prompts.dragging { cursor: grabbing; }
.composer-row { gap: 12px; align-items: flex-end; }
#questionInput {
  flex: 1; resize: none; border-radius: 22px; border: 1px solid rgba(17,17,17,0.08); background: rgba(255,255,255,0.95);
  padding: 16px; font: inherit; color: #111; min-height: 56px; outline: none; font-size: 1.02rem;
}
.send-btn {
  width: 48px; height: 48px; border-radius: 999px; border: 0; background: #c9c1b4; color: white; font-size: 1.55rem; cursor: pointer;
}
.hero-card, .feature-card, .modal-card, .history-page {
  border-radius: 32px;
  background: rgba(255,255,255,0.93);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 20px 52px rgba(0,0,0,0.16);
}
.hero-card { padding: 24px; margin-bottom: 16px; }
.eyebrow { color: #876630; font-weight: 800; letter-spacing: 0.08em; font-size: 0.78rem; margin-bottom: 14px; }
.hero-card h1 { margin: 0 0 14px; font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 0.95; letter-spacing: -0.05em; }
.hero-copy { margin: 0 0 22px; color: #34455b; font-size: 1.05rem; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.primary-link, .secondary-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 999px; text-decoration: none;
}
.primary-link { background: var(--ink); color: white; }
.secondary-link { border: 1px solid rgba(18,32,52,0.12); color: var(--ink); background: rgba(255,255,255,0.7); }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.feature-card { padding: 22px; }
.feature-card h2 { margin: 0 0 10px; font-size: 1.2rem; }
.feature-card p { margin: 0; color: #3f4e61; line-height: 1.6; font-size: 1rem; }
.overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(7,13,23,0.34);
}
.modal-card { width: min(760px, 100%); padding: 26px; }
.modal-lead { font-weight: 600; }
.history-page {
  width: min(544px, calc(100vw - 40px));
  height: min(66vh, 560px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(135deg, var(--navy), var(--blue) 60%, #7e693a);
  color: white;
}
.history-list { overflow: auto; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.history-item {
  display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; border-radius: 24px;
  background: rgba(255,255,255,0.97); color: #111; padding: 16px; border: 1px solid #dfe6ef;
}
.history-copy { min-width: 0; }
.history-copy h3 { margin: 0 0 6px; font-size: 1rem; }
.history-chip { display: inline-block; margin-bottom: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(219,180,106,0.16); color: #294563; font-size: 0.82rem; font-weight: 700; }
.history-summary { margin: 0 0 8px; color: #3d4b5d; line-height: 1.55; }
.history-date { color: #7c8795; font-size: 0.82rem; }
.loading { opacity: 0.7; pointer-events: none; }
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .app-column { position: static; }
  .feature-grid { grid-template-columns: 1fr; }
  .app-frame {
    width: min(100%, 560px, calc((100dvh - 40px) / 1.72));
  }
}
@media (max-width: 720px) {
  .page-shell { padding: 14px; }
  .top-panel { padding: 12px; }
  .brand-row {
    min-width: 0;
    gap: 10px;
  }
  .brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }
  .brand-title { font-size: 1.95rem; }
  .brand-subtitle { font-size: 0.95rem; }
  .toolbar {
    gap: 8px;
    flex-shrink: 0;
  }
  .circle-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  .control-row { flex-direction: column; }
  .picker-anchor-row { gap: 12px; }
  .picker-column { width: 100%; }
  .narrow, .wide { width: 100%; }
  .narrow-popup, .wide-popup { width: 100%; }
  .wheel-picker-date {
    grid-template-columns: 58px minmax(110px, 1fr) 74px;
  }
  .app-frame {
    width: 100%;
    aspect-ratio: auto;
    height: calc(100dvh - 28px);
    max-height: calc(100dvh - 28px);
    min-height: calc(100dvh - 28px);
    padding: 14px;
  }
  .chat-card { padding: 14px; }
  .composer-card { padding: 14px; }
  .quick-prompts {
    margin-bottom: 10px;
    padding-bottom: 10px;
  }
  .quick-prompt {
    font-size: 0.95rem;
    padding: 10px 12px;
  }
  #questionInput {
    min-height: 52px;
    padding: 14px;
  }
  .history-page { height: min(72vh, 520px); width: min(100%, 544px); border-radius: 28px; }
  .modal-card { width: 100%; }
}

.ad-panel, .bottom-ad-panel {
  border-radius: 28px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 20px 52px rgba(0,0,0,0.12);
}
.ad-panel { padding: 18px; margin-bottom: 18px; }
.bottom-ad-panel { padding: 18px; margin-top: 18px; }
.ad-label {
  color: #876630;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  margin-bottom: 12px;
}
.ad-slot {
  min-height: 250px;
  border-radius: 20px;
  background: rgba(18,32,52,0.04);
  border: 1px dashed rgba(18,32,52,0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ad-slot-wide { min-height: 140px; }
