:root {
  --navy: #0F1E2B;
  --accent: #3FA9E8;
  --ink: #1c2733;
  --muted: #5b6b7a;
  --line: #dde4ea;
  --bg: #f6f8fa;
  --card: #ffffff;
  --head: #0F1E2B;
  --bot: #eef5fb;
  --link: #1677b8;
}
:root[data-theme="dark"] {
  --ink: #E6EEF6;
  --muted: #9FB0C6;
  --line: #1D2A4C;
  --bg: #060A17;
  --card: #0C142B;
  --head: rgba(6,10,23,.72);
  --bot: #111B36;
  --link: #8FC8F2;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--link); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { background: var(--head); color: #fff; border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; font-size: 1.2rem; text-decoration: none; }
nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
nav a { color: #fff; text-decoration: none; }

.hero { padding-top: 48px; padding-bottom: 24px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.15; margin: 8px 0 12px; color: var(--ink); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 640px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--accent); font-weight: 700; margin: 0; }

.btn, .btn-small { display: inline-block; background: var(--accent); color: var(--navy); border: 0; border-radius: 8px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn { padding: 12px 20px; font-size: 1rem; }
.btn-small { padding: 6px 12px; font-size: .9rem; }
.btn:disabled { opacity: .6; cursor: wait; }
button.link { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; }

section { padding-bottom: 32px; }
h2 { color: var(--ink); }

.chat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.chat-log { max-height: 460px; min-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; }
.msg p { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg p:last-child { margin-bottom: 0; }
.msg.bot { background: var(--bot); align-self: flex-start; }
.msg.user { background: linear-gradient(135deg,#4F8DF7,#7C6CF2); color: #fff; align-self: flex-end; }
.msg.waiting { opacity: .7; font-style: italic; }
.actions { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.starters button { background: var(--card); border: 1px solid var(--accent); color: var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: .9rem; }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form textarea { flex: 1; min-width: 0; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; background: var(--card); color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card h3 { margin: 4px 0 8px; color: var(--ink); }
.price { font-weight: 700; }
.notice { background: rgba(240,213,138,.12); border: 1px solid rgba(240,213,138,.5); border-radius: 8px; padding: 10px 14px; font-size: .92rem; }
.small, .small-print { font-size: .85rem; color: var(--muted); }
.muted { color: var(--muted); }
.foot { padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }

@media (max-width: 560px) {
  .msg { max-width: 100%; }
  .chat-form { flex-direction: column; }
}
.card .btn-small { margin-left: 10px; }
