/* /ai and /ai/connect — loaded after /blog/blog.css (same tokens, nav, footer,
   steps, FAQ and CTA box). Only what those pages add lives here. Zero JS. */

.ai-page .ai-wrap { max-width: 1040px; margin: 0 auto; padding: 32px 20px 64px; }
.ai-page .article-wrap { max-width: 780px; }

/* the shared blog nav overflows below ~460px; on these pages keep it in one row */
@media (max-width: 520px) {
  .ai-page .bnav-links { gap: 12px; }
  .ai-page .bnav-links a:not(.nav-cta) { display: none; }
  .ai-page .nav-cta { padding: 8px 16px; white-space: nowrap; }
}
/* phones: the logo tile alone, so the Telegram button fits next to it */
@media (max-width: 440px) {
  .ai-page .blogo > span:not(.logo-icon) { display: none; }
}

/* ---- hero ---- */
.ai-hero { text-align: center; max-width: 760px; margin: 20px auto 8px; }
.ai-kicker {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--tg-primary); background: rgba(0, 136, 204, .08);
  padding: 6px 14px; border-radius: 999px;
}
.ai-hero h1 { font-size: clamp(32px, 5.6vw, 54px); line-height: 1.1; letter-spacing: -.025em; font-weight: 800; margin-top: 16px; }
.ai-lead { font-size: 18.5px; color: var(--text-soft); margin: 18px auto 0; max-width: 680px; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.ai-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 14px;
  font-weight: 700; font-size: 16.5px; text-decoration: none; transition: transform .2s, box-shadow .2s;
}
.ai-btn:hover { text-decoration: none; transform: translateY(-2px); }
.ai-btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(0, 136, 204, .32); }
.ai-btn-ghost { background: #fff; color: var(--tg-primary); border: 1.5px solid rgba(0, 136, 204, .35); }
.ai-btn .cta-icon { width: 18px; height: 18px; flex: none; }
.ai-langswitch { text-align: center; margin-top: 14px; }

/* ---- sections ---- */
.ai-section { margin-top: 64px; }
.ai-section > h2, .ai-body h2 {
  font-size: clamp(25px, 3.4vw, 32px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2;
  scroll-margin-top: 80px;
}
.ai-section > .ai-sub { color: var(--text-soft); margin-top: 8px; font-size: 17px; max-width: 720px; }

.ai-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin-top: 24px; }
.ai-card {
  display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px 20px;
  background: #fff; color: var(--text); transition: box-shadow .2s, transform .2s;
}
a.ai-card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-2px); }
.ai-card h3 { font-size: 19px; font-weight: 800; }
.ai-card p { color: var(--text-soft); font-size: 15.5px; margin-top: 8px; }
.ai-card .more { display: inline-block; margin-top: 12px; color: var(--tg-primary); font-weight: 700; font-size: 15px; }

/* prompt gallery */
.ai-prompts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; }
.ai-prompt { border-radius: var(--radius); background: var(--bg-soft); padding: 18px 20px; }
.ai-prompt q {
  display: block; font-weight: 700; font-size: 16.5px; quotes: '«' '»'; color: var(--text);
}
.ai-prompt:lang(en) q { quotes: '“' '”'; }
.ai-prompt p { color: var(--text-soft); font-size: 15px; margin-top: 8px; }
.ai-prompt .tag {
  display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--tg-primary-dark);
  background: rgba(0, 136, 204, .08); padding: 3px 9px; border-radius: 999px;
}

.ai-gallery { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; margin-top: 28px; }
.ai-gallery figure { flex: 1 1 280px; max-width: 340px; margin: 0; }
/* Cards differ a lot in height (a receipt is long): flow them in columns so no row leaves a gap. */
@media (min-width: 900px) {
  .ai-gallery { display: block; columns: 3; column-gap: 22px; }
  /* the figures carry an inline margin (shared figure helper), so the column rule must win */
  .ai-gallery figure { max-width: none !important; break-inside: avoid; margin: 0 0 28px !important; }
}
.ai-gallery figcaption, .ai-page figure figcaption {
  font-size: 13.5px; color: var(--text-soft); text-align: center; margin-top: 10px;
}

/* safety list */
.ai-safety { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px 28px; margin-top: 24px; }
.ai-safety div { padding-left: 30px; position: relative; }
.ai-safety div::before {
  content: ''; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%;
  background: #4CAF50 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/12px no-repeat;
}
.ai-safety h3 { font-size: 17px; font-weight: 800; }
.ai-safety p { color: var(--text-soft); font-size: 15.5px; margin-top: 4px; }

/* "needs Premium" notice */
.ai-notice {
  border: 1px solid rgba(0, 136, 204, .25); background: rgba(0, 136, 204, .05);
  border-radius: var(--radius); padding: 20px 22px; margin-top: 28px;
}
.ai-notice h2, .ai-notice h3 { font-size: 19px !important; font-weight: 800; margin: 0 !important; }
.ai-notice p { color: var(--text-soft); margin-top: 8px; font-size: 16px; }
.ai-notice .ai-btn { margin-top: 14px; padding: 11px 20px; font-size: 15.5px; }

/* server address */
.ai-url {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 22px;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; background: #fff;
}
.ai-url span { font-weight: 700; }
.ai-url code, .ai-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px;
}
.ai-url code { background: var(--bg-soft); border: 1px solid var(--border); padding: 4px 10px; border-radius: 8px; user-select: all; word-break: break-all; }
.ai-code {
  display: block; white-space: pre; overflow-x: auto; background: #0f1b26; color: #e6f1f8;
  border-radius: 12px; padding: 14px 16px; margin-top: 10px; font-size: 14px; line-height: 1.55;
}
.ai-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.ai-toc a {
  font-size: 14.5px; font-weight: 700; padding: 7px 14px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text);
}
.ai-toc a:hover { text-decoration: none; background: rgba(0, 136, 204, .1); color: var(--tg-primary); }

.ai-body { font-size: 17px; }
.ai-body > * + * { margin-top: 1em; }
.ai-body h2 { margin-top: 2.1em; }
.ai-body h3 { font-size: 19.5px; font-weight: 800; margin-top: 1.4em; }
.ai-body ul, .ai-body ol { padding-left: 24px; }
.ai-body li + li { margin-top: .4em; }
.ai-body .step p { margin-top: 4px; }
.ai-body .step h3 { margin-top: 4px; }
.ai-body .hedge { font-size: 14.5px; color: var(--text-soft); }
.ai-body dt { font-weight: 700; margin-top: 1em; }
.ai-body dd { color: var(--text-soft); margin-top: 2px; }
.ai-body code:not(.ai-code) {
  background: var(--bg-soft); border: 1px solid var(--border); padding: 1px 7px; border-radius: 7px; font-size: .9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ai-readmore { margin-top: 28px; font-weight: 700; }

/* /ai/chatgpt and /ai/claude: each prompt next to the card it shows */
.ai-uses { display: flex; flex-direction: column; gap: 36px; margin-top: 28px; }
.ai-use { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 22px 48px; }
.ai-use .ai-prompt { flex: 1 1 300px; max-width: 460px; padding: 22px 24px; }
.ai-use .ai-prompt q { font-size: 19px; }
.ai-use .ai-prompt p { font-size: 16px; }
/* the shared figure helper sets an inline max-width/margin; the row layout must win */
.ai-use figure.ai-shot { flex: 0 1 340px; margin: 0 !important; }
@media (min-width: 900px) {
  .ai-use-flip { flex-direction: row-reverse; }
}
.ai-use-text .ai-prompt { max-width: 700px; }
.ai-host-connect .ai-notice { margin-top: 20px; }
.ai-host-connect .ai-url { margin-top: 18px; }
