/* «Как раз ИИ» — спокойный рабочий интерфейс: бумага, чернила и одна зелёная краска на действие. */

:root {
  --ink: #15171a;
  --paper: #f4f3f0;
  --card: #ffffff;
  --line: #e2e0db;
  --muted: #5f6368;
  --faint: #8b8f95;
  --accent: #0f6b52;
  --accent-soft: #e6f1ec;
  --amber: #b5730a;
  --danger: #b3261e;
  --font: 'Onest Variable', 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shell: 1120px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 20px; }

/* ---------- Общие элементы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: background-color .15s, opacity .15s;
}
.btn:hover { background: #0c5742; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--card); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn-wide { width: 100%; }
.btn-danger { background: var(--danger); }

.input {
  width: 100%; min-height: 44px; padding: 10px 13px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--card);
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; line-height: 1.45; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 14px; color: var(--muted); }
.err { color: var(--danger); font-size: 14px; min-height: 20px; }
.hint { color: var(--faint); font-size: 14px; line-height: 1.45; }
code, .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13.5px; }

/* ---------- Шапка ---------- */
.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top-in { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.mark { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; color: inherit; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #a8aba8; }
.dots i:nth-child(2) { background: #6b706c; }
.dots i:nth-child(3) { background: var(--accent); }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.balance { font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }

/* ---------- Витрина ---------- */
.hero { padding: 72px 0 56px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -.035em; font-weight: 600; max-width: 18ch; }
.hero p { margin-top: 18px; max-width: 54ch; font-size: 18px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.section { padding: 48px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -.03em; font-weight: 600; }
.section > .shell > p { margin-top: 10px; color: var(--muted); max-width: 60ch; }

.table-wrap { overflow-x: auto; margin-top: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: 13.5px; color: var(--muted); }
td.yes { color: var(--accent); font-weight: 500; }
td.no { color: var(--faint); }
tr.us td { background: var(--accent-soft); }

.plans { display: grid; gap: 16px; margin-top: 26px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.plan { padding: 20px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); display: grid; gap: 10px; align-content: start; }
.plan.is-best { border-color: var(--accent); }
.plan h3 { font-size: 18px; font-weight: 600; }
.plan .price { font-size: 30px; font-weight: 600; letter-spacing: -.03em; }
.plan .price span { font-size: 15px; font-weight: 400; color: var(--muted); }

.steps { counter-reset: s; display: grid; gap: 18px; margin-top: 22px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 14px; }
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600;
}
pre { margin: 10px 0 0; padding: 14px; border-radius: 10px; background: #15171a; color: #e6e6e3; overflow-x: auto; font-size: 13px; line-height: 1.5; }

/* ---------- Приложение ---------- */
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: calc(100vh - 63px); }
.side { border-right: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.side-top { padding: 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.tabs { display: flex; gap: 4px; padding: 10px 12px 0; }
.tab { flex: 1; padding: 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--muted); }
.tab.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.chats { flex: 1; overflow: auto; padding: 8px; }
.chats li { display: flex; align-items: center; gap: 6px; }
.chats button.open {
  flex: 1; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 8px;
  cursor: pointer; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chats button.open:hover, .chats li.is-on button.open { background: var(--paper); }
.chats button.del { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 4px 6px; }

.work { min-height: 0; display: flex; flex-direction: column; }
.pane { flex: 1; overflow: auto; padding: 22px; }
.msgs { max-width: 760px; margin-inline: auto; display: grid; gap: 18px; }
.msg { display: grid; gap: 6px; }
.msg .who { font-size: 13px; color: var(--faint); }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me .text { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.composer { border-top: 1px solid var(--line); background: var(--card); padding: 12px 22px 16px; }
.composer-in { max-width: 760px; margin-inline: auto; display: grid; gap: 8px; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 52px; max-height: 180px; }
.composer-meta { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--faint); }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; }

.dialog { position: fixed; inset: 0; display: grid; place-items: center; background: rgb(21 23 26 / .45); z-index: 50; padding: 20px; }
.dialog-box { width: min(420px, 100%); background: var(--card); border-radius: 16px; padding: 24px; }
.dialog-box h2 { font-size: 20px; font-weight: 600; margin-bottom: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 60;
  padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.toast.is-on { opacity: 1; }

.foot { border-top: 1px solid var(--line); padding: 28px 0; color: var(--faint); font-size: 14px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .chats { max-height: 180px; }
  .hero { padding: 48px 0 36px; }
}
