/* ============================================================
   ТС Пиот — main.css
   Design system sourced from claude-design-kit (futurepitcher):
   - ui-reasoning.csv #43 "B2B Service" → Style_Priority:
     "Trust & Authority + Minimalism", Color_Mood:
     "Professional blue + Neutral grey" (anti-pattern flagged in the
     same row: playful design, AI purple/pink gradients — avoided).
   - colors.csv #6 "B2B Service": Primary #0F172A, CTA #0369A1,
     Background #F8FAFC, Text #020617, Border #E2E8F0.
   - styles.csv #26 "Trust & Authority": adds --security-green
     #059669 and --metric-highlight #F59E0B for badges/status.
   - typography.csv #16 "Corporate Trust": Lexend (heading) +
     Source Sans 3 (body) — "Enterprise, government, healthcare,
     finance, accessibility-focused".
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@500;600;700&family=Source+Sans+3:wght@400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:             #F8FAFC;
  --bg-elevated:    #FFFFFF;
  --fg:             #020617;
  --fg-muted:       #47526B;
  --fg-subtle:      #94A3B8;
  --accent:         #0369A1;
  --accent-hover:   #075985;
  --accent-subtle:  #E0F2FE;
  --border:         #E2E8F0;
  --border-subtle:  #EEF2F6;
  --success:        #059669;
  --error:          #DC2626;
  --warning:        #F59E0B;
  --radius:         8px;
  --radius-sm:      5px;
  --radius-lg:      12px;
  --shadow-sm:      0 1px 2px rgba(15,23,42,0.05);
  --shadow:         0 4px 6px rgba(15,23,42,0.10);
  --shadow-lg:      0 20px 40px rgba(15,23,42,0.16);
  --sidebar-w:      264px;
  --section-accent: #0369A1;
  --trust-navy:     #0F172A;
  --font-display:   'Lexend', 'Inter', -apple-system, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Source Sans 3', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);

  color: var(--fg);
  line-height: 1.65;
  min-height: 100vh;
}

/* Display type: typography.csv #16 "Corporate Trust" pairs Lexend
   (headings) with Source Sans 3 (body) — "designed for readability,
   excellent accessibility", recommended for enterprise/finance. */
h1, h2, h3, h4,
.sidebar-logo, .mob-logo,
.hero h1, .section-title,
.thread-title, .thread-item-title,
.instruction-card h3, .download-card h3,
.reply-form-title, .faq-card-header h4,
.btn, .partner-code, .sidebar-partner strong {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 200;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 60px;
  padding: 0 20px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.sidebar-logo span { color: var(--accent); }

.sidebar-nav {
  flex: 1;
  padding: 12px 0 16px;
  overflow-y: auto;
}

/* top-level links */
.sidebar-nav > a {
  display: flex;
  align-items: center;
  padding: 9px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #ff0000;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color .15s, background .15s;
}
.sidebar-nav > a:hover { color: var(--fg); background: #F5F5F7; }
.sidebar-nav > a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-subtle);
  font-weight: 600;
}

/* section label (обновленный) */
.sidebar-section {
  padding: 24px 20px 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #00000;
  user-select: none;
}

/* sub-links */
.sidebar-sub {
  display: flex;
  align-items: center;
  padding: 7px 20px 7px 32px;
  font-size: 0.865rem;
  font-weight: 450;
  color: #001dff;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color .15s, background .15s;
}
.sidebar-sub:hover { color: var(--fg); background: #F5F5F7; }
.sidebar-sub.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-subtle);
  font-weight: 600;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 16px;
}

.sidebar-bottom {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* contacts block — phone numbers & email were unstyled bare <a> tags
   and collapsed into one glued-together line; give each its own row,
   an icon, and breathing room. */
.sidebar-contacts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.sidebar-contacts-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fg-subtle);
  margin-bottom: 6px;
}
.sidebar-phone,
.sidebar-email {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  line-height: 1.3;
  transition: background .15s, color .15s;
}
.sidebar-phone::before,
.sidebar-email::before {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  display: inline-block;
  background: currentColor;
  opacity: .55;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.sidebar-phone::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.2.5 2.5.8 3.9.8.6 0 1 .4 1 1V21c0 .6-.4 1-1 1C10.6 22 2 13.4 2 3c0-.6.4-1 1-1h3.9c.6 0 1 .4 1 1 0 1.4.3 2.7.8 3.9.1.4 0 .8-.2 1L6.6 10.8z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.2.5 2.5.8 3.9.8.6 0 1 .4 1 1V21c0 .6-.4 1-1 1C10.6 22 2 13.4 2 3c0-.6.4-1 1-1h3.9c.6 0 1 .4 1 1 0 1.4.3 2.7.8 3.9.1.4 0 .8-.2 1L6.6 10.8z'/%3E%3C/svg%3E");
}
.sidebar-email::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M2 5.5A1.5 1.5 0 0 1 3.5 4h17A1.5 1.5 0 0 1 22 5.5v13a1.5 1.5 0 0 1-1.5 1.5h-17A1.5 1.5 0 0 1 2 18.5v-13zm2.2.5 7.3 5.8a1 1 0 0 0 1 0L19.8 6H4.2zM20 8.1l-6.9 5.4a2.5 2.5 0 0 1-3.2 0L4 8.1V18h16V8.1z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M2 5.5A1.5 1.5 0 0 1 3.5 4h17A1.5 1.5 0 0 1 22 5.5v13a1.5 1.5 0 0 1-1.5 1.5h-17A1.5 1.5 0 0 1 2 18.5v-13zm2.2.5 7.3 5.8a1 1 0 0 0 1 0L19.8 6H4.2zM20 8.1l-6.9 5.4a2.5 2.5 0 0 1-3.2 0L4 8.1V18h16V8.1z'/%3E%3C/svg%3E");
}
.sidebar-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-phone:hover,
.sidebar-email:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}
.sidebar-phone:hover::before,
.sidebar-email:hover::before {
  opacity: 1;
  background: var(--accent);
}
.sidebar-lk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 12px;
}
/* Trust & Authority badge-pulse (styles.csv #26: "Badge hover effects,
   metric pulse animations") applied to the one place it means
   something — a live, verified account link. */
.sidebar-lk::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: badgePulse 2.2s ease-out infinite;
}
.sidebar-lk:hover { text-decoration: underline; }
@keyframes badgePulse {
  0%   { box-shadow: 0 0 0 0 rgba(5,150,105,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(5,150,105,0); }
  100% { box-shadow: 0 0 0 0 rgba(5,150,105,0); }
}
.sidebar-partner {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #F59E0B;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-partner span { font-size: 0.72rem; color: #78350F; }
.sidebar-partner strong { font-size: 1rem; font-weight: 800; color: #92400E; }

/* ── Main area ──────────────────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Mobile topbar ──────────────────────────────────────────── */
.mob-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.mob-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.mob-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: .2s;
}
.mob-logo {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
}
.mob-logo span { color: var(--accent); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
}

/* ── Containers ─────────────────────────────────────────────── */
.page-main {
  flex: 1;
  padding: 0;
}
.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 32px 80px;
}
/* wider for home page */
.page-home .page-content {
  max-width: 1100px;
}
/* inner .container used by home page — let page-content handle max-width */
.page-home .container {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  padding: 20px 0 8px;
  font-size: 0.84rem;
  color: var(--fg-subtle);
}
.breadcrumb a {
  color: var(--fg-subtle);
  text-decoration: none;
  transition: color .15s;
}
.breadcrumb a:hover { color: var(--fg); }

/* ── Article typography ─────────────────────────────────────── */
article { padding-bottom: 80px; }

h1 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.2;
  margin-bottom: 8px;
}
h1 .accent { color: var(--section-accent); }

.subhead {
  color: var(--fg-muted);
  font-size: 1.02rem;
  margin-bottom: 36px;
  line-height: 1.6;
}

h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 48px 0 20px;
  padding-left: 14px;
  border-left: 4px solid var(--section-accent);
  line-height: 1.3;
}
h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 32px 0 14px;
}
h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 10px;
}
p { margin-bottom: 14px; line-height: 1.7; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 22px; margin-bottom: 14px; }
li { margin-bottom: 6px; }

/* ── Step boxes ─────────────────────────────────────────────── */
.step {
  display: flex;
  gap: 16px;
  margin-bottom: 22px;
}
.step-num {
  width: 32px;
  height: 32px;
  background: var(--section-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-content h4 { margin-top: 0; }

/* ── Info boxes ─────────────────────────────────────────────── */
.note, .warning {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 20px 0;
  line-height: 1.6;
}
.note    { background: var(--accent-subtle); border-left: 4px solid var(--accent); }
.warning { background: #FEF3C7;              border-left: 4px solid var(--warning); }
.note strong, .warning strong { font-weight: 600; }

.success-box {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin: 40px 0 0;
}
.success-box h3 { color: #15803D; margin-bottom: 8px; font-size: 1.15rem; margin-top: 0; }
.success-box p  { color: #166534; margin: 0; }

/* ── Code ───────────────────────────────────────────────────── */
.code-block {
  background: #0F172A;
  color: #CBD5E1;
  padding: 16px 20px;
  border-radius: var(--radius);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.84rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 14px 0;
}
.inline-code {
  font-family: 'JetBrains Mono', monospace;
  background: #EEF2F6;
  color: #111;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.86em;
}

/* ── Param table ────────────────────────────────────────────── */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.88rem;
}
.param-table th, .param-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.param-table th { background: var(--bg-elevated); font-weight: 600; }
.param-table tr:nth-child(even) td { background: #FAFAFA; }

/* ── Images ─────────────────────────────────────────────────── */
.img-block {
  margin: 22px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.img-block img { width: 100%; }
.img-caption {
  padding: 10px 16px;
  background: var(--bg-elevated);
  font-size: 0.82rem;
  color: var(--fg-muted);
}

/* ── Nav footer (prev/next) ─────────────────────────────────── */
.nav-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.nav-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: opacity .15s;
}
.nav-footer a:hover { opacity: .7; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.93rem;
  text-decoration: none;
  transition: all .2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-primary   { background: var(--fg); color: #fff; }
.btn-primary:hover   { background: #333; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--bg); color: var(--fg); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--fg-muted); transform: translateY(-2px); }
.btn-accent    { background: var(--accent); color: #fff; }
.btn-accent:hover    { background: var(--accent-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost     { background: transparent; color: var(--fg-muted); border: 1px solid var(--border); }
.btn-ghost:hover     { background: var(--bg-elevated); color: var(--fg); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 32px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.87rem;
  transition: color .15s;
}
.footer-links a:hover { color: var(--fg); }
.footer-copy { color: var(--fg-subtle); font-size: 0.84rem; }

/* ══════════════════════════════════════════════════════════════
   HOME PAGE (index.php)
   ══════════════════════════════════════════════════════════════ */
.hero {
  padding: 64px 0 44px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 14px;
}
.hero h1 .accent { color: var(--accent); }
.hero p {
  font-size: 1.1rem;
  color: var(--fg-muted);
  max-width: 520px;
  margin: 0 auto 28px;
}
.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.partner-strip {
  display: flex;
  justify-content: center;
  margin-bottom: 52px;
}
.partner-code {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 2px solid #F59E0B;
  border-radius: 40px;
  padding: 9px 22px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #92400E;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.partner-code span { font-size: 0.74rem; font-weight: 500; color: #92400E; opacity: .8; }

.section { margin-bottom: 64px; }
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-title { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; }
.section-subtitle { color: var(--fg-muted); font-size: 0.93rem; margin-top: 4px; }
.section-link { color: var(--accent); text-decoration: none; font-size: 0.88rem; font-weight: 500; }
.section-link:hover { text-decoration: underline; }

/* cards grid */
.instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.instruction-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px 44px;
  text-decoration: none;
  color: var(--fg);
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.instruction-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
  opacity: 0;
  transition: opacity .2s;
}
.instruction-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.instruction-card:hover::before { opacity: 1; }

.instruction-card .badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.instruction-card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 5px; }
.instruction-card p  { color: var(--fg-muted); font-size: 0.86rem; margin: 0; }
.instruction-card .arrow {
  position: absolute;
  right: 18px; bottom: 18px;
  font-size: 1.2rem;
  color: var(--fg-subtle);
  transition: transform .2s, color .2s;
}
.instruction-card:hover .arrow { transform: translateX(4px); color: var(--card-accent, var(--accent)); }

/* card accent colours */
.instruction-card.common     { --card-accent: #0EA5E9; }
.instruction-card.common     .badge { background: #E0F2FE; color: #0369A1; }
.instruction-card.atol       { --card-accent: #2563EB; }
.instruction-card.atol       .badge { background: #DBEAFE; color: #1E40AF; }
.instruction-card.shtrih     { --card-accent: #9333EA; }
.instruction-card.shtrih     .badge { background: #F3E8FF; color: #7C3AED; }
.instruction-card.apps       { --card-accent: #16A34A; }
.instruction-card.apps       .badge { background: #DCFCE7; color: #15803D; }
.instruction-card.saby       { --card-accent: #0078D4; }
.instruction-card.saby       .badge { background: #DBEAFE; color: #1D4ED8; }
.instruction-card.kontur     { --card-accent: #CC0000; }
.instruction-card.kontur     .badge { background: #FEE2E2; color: #991B1B; }
.instruction-card.moysklad   { --card-accent: #EB6020; }
.instruction-card.moysklad   .badge { background: #FFEDD5; color: #9A3412; }
.instruction-card.iiko       { --card-accent: #00A651; }
.instruction-card.iiko       .badge { background: #D1FAE5; color: #065F46; }
.instruction-card.kkmserver  { --card-accent: #4B5563; }
.instruction-card.kkmserver  .badge { background: #F3F4F6; color: #374151; }
.instruction-card.onec       { --card-accent: #CC0000; }
.instruction-card.onec       .badge { background: #FEE2E2; color: #991B1B; }
.instruction-card.evotor     { --card-accent: #007AFF; }
.instruction-card.evotor     .badge { background: #EFF6FF; color: #1D4ED8; }
.instruction-card.smartapteka { --card-accent: #16A34A; }
.instruction-card.smartapteka .badge { background: #DCFCE7; color: #15803D; }
.instruction-card.rkeeper    { --card-accent: #0072BC; }
.instruction-card.rkeeper    .badge { background: #DBEAFE; color: #0072BC; }

/* downloads */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.download-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: box-shadow .2s;
}
.download-card:hover { box-shadow: var(--shadow); }
.download-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.download-card h3 .icon { font-size: 1.2rem; }
.download-list { list-style: none; padding: 0; margin: 0; }
.download-list a {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--fg-muted);
  gap: 6px;
  transition: background .15s, color .15s;
}
.download-list a:hover { background: var(--accent-subtle); color: var(--accent); }
.download-list a::before { content: "↓ "; opacity: .5; }

/* FAQ */
.faq-grid { display: grid; gap: 10px; }
.faq-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s;
}
.faq-card:hover { box-shadow: var(--shadow-sm); }
.faq-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 12px;
}
.faq-card-header h4 { font-size: 0.93rem; font-weight: 600; line-height: 1.4; }
.toggle {
  font-size: 1.4rem;
  color: var(--fg-muted);
  line-height: 1;
  transition: transform .2s, color .2s;
  flex-shrink: 0;
}
.faq-card.open .toggle { transform: rotate(45deg); color: var(--accent); }
.faq-card-body { display: none; }
.faq-card.open .faq-card-body { display: block; }
.faq-card-body-inner { padding: 0 20px 16px; font-size: 0.9rem; color: var(--fg-muted); line-height: 1.65; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .4s ease-out forwards; }

/* ══════════════════════════════════════════════════════════════
   FORUM / Q&A (qa.php)
   ══════════════════════════════════════════════════════════════ */
.subhead { color: var(--fg-muted); font-size: 1rem; margin-bottom: 24px; }

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.list-count { font-size: 0.88rem; color: var(--fg-muted); }

.threads-list { display: grid; gap: 10px; }
.thread-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.thread-item:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.thread-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.solved-badge {
  background: #D1FAE5; color: #065F46;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.thread-item-title { font-size: 0.95rem; font-weight: 600; line-height: 1.4; }
.thread-item-preview { font-size: 0.85rem; color: var(--fg-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-bottom: 8px; }
.thread-item-meta { display: flex; gap: 16px; font-size: 0.8rem; color: var(--fg-subtle); }
.meta-replies { display: flex; align-items: center; gap: 4px; }
.meta-replies.has-replies { color: var(--accent); }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; }
.page-btn {
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--fg-muted);
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.page-btn:hover  { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: .4; cursor: default; }

.empty-state { text-align: center; padding: 48px 0; color: var(--fg-muted); font-size: 1rem; }
.empty-state p { margin-top: 8px; font-size: 0.9rem; }

#view-thread { display: none; }
.thread-header { margin-bottom: 20px; }
.thread-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.015em; margin-bottom: 8px; line-height: 1.3; }
.thread-meta-row { display: flex; gap: 16px; font-size: 0.83rem; color: var(--fg-subtle); margin-bottom: 24px; flex-wrap: wrap; }

.post-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
}
.post-card.best-answer {
  border-color: #10B981;
  background: #F0FDF4;
}
.post-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.post-author { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.post-card.best-answer .avatar { background: #D1FAE5; color: #065F46; }
.author-name { font-weight: 600; font-size: 0.9rem; }
.author-date { font-size: 0.79rem; color: var(--fg-subtle); }
.best-label { font-size: 0.78rem; color: #059669; font-weight: 600; }
.post-content { font-size: 0.9rem; line-height: 1.7; color: var(--fg); }
.post-images { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.post-images a { display: block; width: 90px; height: 68px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.post-images a img { width: 100%; height: 100%; object-fit: cover; transition: opacity .15s; }
.post-images a:hover img { opacity: .85; }

.replies-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.replies-heading::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.reply-form-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-top: 20px;
}
.reply-form-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; padding-left: 10px; border-left: 3px solid var(--accent); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--fg-muted); margin-bottom: 6px; }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--fg);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(3,105,161,.14); }
.form-group textarea { min-height: 110px; resize: vertical; }

.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.image-upload-area:hover { border-color: var(--accent); background: var(--accent-subtle); }
.image-upload-area input { display: none; }
.image-upload-area p { font-size: 0.85rem; color: var(--fg-muted); }
.image-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.image-preview-item {
  position: relative;
  width: 80px; height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.image-preview-item .remove-img {
  position: absolute;
  top: 2px; right: 2px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.alert { display: none; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px; font-size: 0.88rem; }
.alert.show { display: block; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.alert-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; justify-content: center; padding: 48px 0; }

/* new-thread inline form */
#view-new {
  display: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 22px;
}
#view-new .form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
#view-new .form-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

/* lightbox */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); }
#lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .main-area {
    margin-left: 0;
  }
  .mob-topbar {
    display: flex;
  }
  .page-content {
    padding: 20px 18px 60px;
  }
  footer {
    padding: 22px 18px;
  }
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.2rem; margin: 36px 0 16px; }
  .hero { padding: 40px 0 28px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ══════════════════════════════════════════════════════════════
   EFFECTS — scoped to what ui-reasoning.csv #43 "B2B Service"
   allows: "Section transitions + Feature reveals", plus styles.csv
   #26 Trust & Authority's "badge hover effects, metric pulse
   animations". Respects prefers-reduced-motion throughout.
   ══════════════════════════════════════════════════════════════ */

/* page-load fade so navigation feels intentional, not abrupt */
body { animation: pageIn .45s ease-out; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* scroll-reveal: elements get .reveal in markup, JS in footer.php
   flips .in-view via IntersectionObserver as they enter the viewport */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s cubic-bezier(.2,.7,.2,1), transform .55s cubic-bezier(.2,.7,.2,1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* stagger children of a revealed grid slightly for a wave feel */
.instructions-grid.reveal.in-view .instruction-card,
.downloads-grid.reveal.in-view .download-card {
  animation: cardRise .5s cubic-bezier(.2,.7,.2,1) backwards;
}
.instructions-grid .instruction-card:nth-child(1)  { animation-delay: .02s; }
.instructions-grid .instruction-card:nth-child(2)  { animation-delay: .06s; }
.instructions-grid .instruction-card:nth-child(3)  { animation-delay: .10s; }
.instructions-grid .instruction-card:nth-child(4)  { animation-delay: .14s; }
.instructions-grid .instruction-card:nth-child(5)  { animation-delay: .18s; }
.instructions-grid .instruction-card:nth-child(6)  { animation-delay: .22s; }
.instructions-grid .instruction-card:nth-child(7)  { animation-delay: .26s; }
.instructions-grid .instruction-card:nth-child(8)  { animation-delay: .30s; }
.instructions-grid .instruction-card:nth-child(9)  { animation-delay: .34s; }
.instructions-grid .instruction-card:nth-child(10) { animation-delay: .38s; }
.instructions-grid .instruction-card:nth-child(11) { animation-delay: .42s; }
.instructions-grid .instruction-card:nth-child(12) { animation-delay: .46s; }
@keyframes cardRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* hero — a static, low-opacity accent wash, not a looping animation:
   styles.csv #1 Minimalism flags "no unnecessary decorations" and
   "fast loading" as explicit requirements for this product category. */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%;
  width: 620px; height: 320px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(3,105,161,.08), rgba(3,105,161,0));
  z-index: -1;
}

/* buttons — a quiet light sweep on hover instead of a static color swap */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
  pointer-events: none;
}
.btn:hover::after { left: 130%; }
.btn-secondary::after, .btn-ghost::after { background: linear-gradient(120deg, transparent, rgba(3,105,161,.14), transparent); }

/* instruction cards — slightly more lift + accent-tinted shadow on hover */
.instruction-card { will-change: transform; }
.instruction-card:hover {
  box-shadow: 0 14px 30px -8px color-mix(in srgb, var(--card-accent, var(--accent)) 28%, transparent);
  transform: translateY(-4px);
}
.instruction-card .badge { transition: transform .2s; }
.instruction-card:hover .badge { transform: translateY(-1px); }

/* thread items — same lift language as instruction cards for consistency */
.thread-item { will-change: transform; }
.thread-item:hover { transform: translateY(-2px); }

/* sidebar nav — sliding active tick instead of a flat static border */
.sidebar-nav > a, .sidebar-sub { position: relative; }
.sidebar-nav > a.active::before, .sidebar-sub.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 0;
  background: var(--accent);
  transform: translateY(-50%);
  animation: tickGrow .25s ease-out forwards;
}
@keyframes tickGrow { to { height: 60%; } }

/* faq toggle body — animate open instead of a hard display switch */
.faq-card-body {
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
}
.faq-card.open .faq-card-body { max-height: 600px; }

/* focus visibility kept crisp for keyboard users amid the extra motion */
/* styles.csv #8 "Accessible & Ethical": clear focus rings 3-4px */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}