: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);
  --app-vh: 100vh;
}
* { 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);
  width: 100%;
}
.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;
}
.native-control {
  justify-content: flex-start;
}
.time-anchor {
  position: relative;
  width: 146px;
}
.mobile-native-time {
  display: none;
}
.desktop-time-button {
  min-height: 58px;
  width: 100%;
}
.native-control-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  color: #111;
  appearance: none;
  -webkit-appearance: none;
}
.pill-button { cursor: pointer; justify-content: flex-start; font: inherit; }
.wide { flex: 1 1 auto; }
.narrow { width: 146px; }
.pill-button > span:first-child,
.pill-input > span:first-child {
  flex: 0 0 auto;
}
.picker-anchor-row {
  position: relative;
  z-index: 12;
  align-items: flex-start;
  gap: 12px;
}
.desktop-time-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 220px;
  border-radius: 24px;
  background: rgba(255,255,255,0.99);
  border: 1px solid #dfe7f0;
  box-shadow: 0 20px 40px rgba(10,23,41,0.18);
  padding: 14px;
  z-index: 24;
}
.desktop-time-columns {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}
.time-wheel {
  height: 188px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 72px 0;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  cursor: ns-resize;
}
.time-wheel::-webkit-scrollbar {
  display: none;
}
.time-wheel-option {
  border: 0;
  background: transparent;
  color: #132033;
  font: inherit;
  font-size: 1rem;
  min-height: 44px;
  border-radius: 14px;
  cursor: pointer;
  scroll-snap-align: center;
}
.time-wheel-option.active {
  background: rgba(219, 180, 106, 0.2);
  color: var(--ink);
  font-weight: 700;
}
.time-separator {
  font-size: 1.4rem;
  font-weight: 800;
  color: #4a5a70;
}
.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;
  width: 100%;
  min-width: 0;
}
#questionInput {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  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 {
  flex: 0 0 auto;
  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) {
  html, body {
    overflow-x: hidden;
  }
  .page-shell {
    padding: 6px;
    min-height: var(--app-vh);
  }
  .layout {
    gap: 10px;
    justify-items: center;
  }
  .app-column {
    width: 100%;
    justify-content: center;
  }
  .info-column {
    display: none;
  }
  .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; }
  .narrow, .wide { width: 100%; }
  .time-anchor {
    width: 100%;
  }
  .location-anchor .suggestions {
    display: block;
    max-height: 180px;
  }
  .app-frame {
    width: min(100%, 420px);
    aspect-ratio: auto;
    height: auto;
    max-height: none;
    min-height: 0;
    padding: 10px;
    border-radius: 24px;
  }
  .control-stack {
    gap: 10px;
    margin-bottom: 10px;
  }
  .pill-input,
  .pill-button {
    padding: 12px 14px;
    border-radius: 18px;
    min-height: 52px;
  }
  .pill-input input,
  .native-control-input,
  #questionInput {
    font-size: 16px;
  }
  .native-control-input {
    appearance: auto;
    -webkit-appearance: auto;
    min-height: 28px;
    line-height: 1.2;
    color: #111;
  }
  .mobile-native-time {
    display: flex;
  }
  .desktop-time-button,
  .desktop-time-popup {
    display: none !important;
  }
  .chat-card {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 22px;
    min-height: 0;
    height: clamp(180px, 32vh, 240px);
    flex: 0 0 auto;
  }
  .composer-card {
    padding: 12px;
    border-radius: 22px;
    margin-top: 0;
  }
  .quick-prompts {
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    margin-bottom: 8px;
    padding-bottom: 0;
    min-height: auto;
    gap: 8px;
  }
  .quick-prompt {
    font-size: 0.92rem;
    padding: 9px 12px;
    border-radius: 16px;
    white-space: normal;
  }
  #questionInput {
    min-height: 50px;
    padding: 13px;
  }
  .send-btn {
    width: 46px;
    height: 46px;
  }
  .chat-empty {
    padding: 12px 8px;
  }
  .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; }
