/* AnyPay Official Website — shared styles (matches system UI) */
:root {
  --primary: #D81E34;
  --primary-dark: #A8132A;
  --primary-light: #FDE9EC;
  --agent: #7c3aed;
  --agent-dark: #5b21b6;
  --agent-light: #f5f3ff;
  --text: #141414;
  --muted: #525252;
  --border: #e5e5e5;
  --bg: #fafafa;
  --white: #ffffff;
  --sidebar: #141414;
  --shadow: 0 4px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.1);
  --radius: 12px;
  --radius-lg: 16px;
  --max-w: 1200px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: Inter, "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  display: flex; align-items: center;
  width: 100%; max-width: none; margin: 0;
  height: var(--header-h); gap: 12px;
  padding: 0 clamp(16px, 4vw, 56px);
}
.brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.brand-logo { height: 36px; width: auto; }
.brand-divider { width: 1px; height: 28px; background: var(--border); }
.brand-xfa { font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.brand-xfa strong { display: block; color: var(--text); font-size: 12px; }

.nav-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 2px; min-width: 0;
}
.nav-main a {
  padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 500;
  color: var(--muted); transition: all .15s; white-space: nowrap;
}
.nav-main a:hover, .nav-main a.active {
  color: var(--primary-dark); background: var(--primary-light); font-weight: 700;
}

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.lang-switcher {
  display: flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border);
}
.lang-btn {
  border: none; background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 6px 10px; border-radius: 999px; line-height: 1; transition: all .15s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--white); color: var(--primary-dark); box-shadow: var(--shadow-sm); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600; border-radius: 999px; padding: 10px 22px;
  border: none; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 12px rgba(216,30,52,.25);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary {
  background: #fff; color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-agent { background: var(--agent); color: #fff; }
.btn-agent:hover { background: var(--agent-dark); }
.btn-ghost { background: transparent; color: var(--muted); padding: 10px 16px; }
.btn-ghost:hover { color: var(--primary); }

.nav-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #E63950 0%, var(--primary) 42%, var(--primary-dark) 100%);
  color: #fff; padding: 88px 0 96px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.12) 0%, transparent 50%);
}
.hero-inner { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 6px 16px; font-size: 13px; font-weight: 500;
  margin-bottom: 24px;
}
.hero h1 { font-size: clamp(36px, 5vw, 52px); font-weight: 800; line-height: 1.15; margin-bottom: 20px; letter-spacing: -.02em; }
.hero-lead { font-size: 18px; opacity: .9; max-width: 640px; margin-bottom: 36px; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 48px; }
.hero-actions .btn-primary { background: #fff; color: var(--primary); box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.hero-actions .btn-primary:hover { background: #f5f5f5; }
.hero-actions .btn-secondary { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
.hero-actions .btn-secondary:hover { background: rgba(255,255,255,.1); border-color: #fff; }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding-top: 36px; border-top: 1px solid rgba(255,255,255,.2);
}
.hero-stat strong { display: block; font-size: 32px; font-weight: 800; line-height: 1.1; }
.hero-stat span { font-size: 13px; opacity: .8; }

/* ── Hero with photo ── */
.hero--split { padding: 72px 0 80px; }
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  position: relative; z-index: 1;
}
.hero-grid--screenshot { align-items: start; }
.hero-visual { position: relative; }
.hero-visual img {
  width: 100%; height: 420px; object-fit: cover; border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
}
.hero-visual--screenshot img {
  height: auto; max-height: none; object-fit: contain; object-position: top center;
}
.hero-visual--screenshot .hero-visual-accent {
  position: static; margin-top: 16px; bottom: auto; left: auto; right: auto;
}
.hero-visual-accent {
  position: absolute; bottom: -16px; left: -16px; right: 16px;
  background: rgba(255,255,255,.12); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius);
  padding: 14px 18px; font-size: 13px; display: flex; align-items: center; gap: 10px;
}
.hero--photo-bg {
  background: linear-gradient(115deg, rgba(168,19,42,.94) 0%, rgba(216,30,52,.88) 45%, rgba(20,20,20,.82) 100%),
    url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
}
.hero--photo-bg::before { background: none; }

.page-hero--photo {
  background: linear-gradient(115deg, rgba(20,20,20,.88) 0%, rgba(20,20,20,.72) 100%),
    var(--hero-bg, url('https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?auto=format&fit=crop&w=1920&q=80')) center/cover no-repeat;
  color: #fff;
}
.page-hero--photo.agent-theme {
  background: linear-gradient(115deg, rgba(91,33,182,.9) 0%, rgba(124,58,237,.85) 100%),
    var(--hero-bg, url('https://images.unsplash.com/photo-1600880292203-757bb62b4baf?auto=format&fit=crop&w=1920&q=80')) center/cover no-repeat;
}

.media-banner {
  border-radius: var(--radius-lg); overflow: hidden; margin: 0 0 56px;
  box-shadow: var(--shadow-lg); position: relative; min-height: 280px;
}
.media-banner img { width: 100%; height: 320px; object-fit: cover; display: block; }
.media-banner-overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  background: linear-gradient(to top, rgba(20,20,20,.75) 0%, transparent 55%);
  padding: 32px;
}
.media-banner-overlay p { color: #fff; font-size: 18px; font-weight: 600; max-width: 560px; line-height: 1.5; }

.card--photo { padding: 0; overflow: hidden; }
.card--photo .card-img {
  width: 100%; height: 168px; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.card--photo:hover .card-img { transform: scale(1.04); }
.card--photo .card-img-wrap { overflow: hidden; }
.card--photo .card-body { padding: 24px 28px 28px; }

.scenario-card--photo { display: grid; grid-template-columns: 280px 1fr; overflow: hidden; padding: 0; }
.scenario-card--photo .scenario-photo { min-height: 100%; }
.scenario-card--photo .scenario-photo img {
  width: 100%; height: 100%; min-height: 220px; object-fit: cover; display: block;
}
.scenario-card--photo .scenario-content { padding: 0; }
.scenario-card--photo .scenario-header { border-bottom: 1px solid var(--border); }
.scenario-card--photo .scenario-body { padding: 24px; }

.split-media {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; margin: 48px 0;
}
.split-media img {
  width: 100%; height: 360px; object-fit: cover; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.split-media.reverse { direction: rtl; }
.split-media.reverse > * { direction: ltr; }

.photo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px;
}
.photo-grid img {
  width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.img-credit {
  font-size: 11px; color: var(--muted); margin-top: 8px; text-align: right;
}
.img-credit a { color: var(--muted); text-decoration: underline; }
.hero .img-credit { color: rgba(255,255,255,.5); text-align: left; margin-top: 12px; }
.hero .img-credit a { color: rgba(255,255,255,.65); }
.page-hero .img-credit { color: rgba(255,255,255,.45); margin-top: 16px; }
.page-hero .img-credit a { color: rgba(255,255,255,.6); }

.trust-photo-row {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; margin-bottom: 40px;
}
.trust-photo-row img {
  width: 100%; height: 340px; object-fit: cover; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ── Sections ── */
.section { padding: 80px 0; }
.section-alt { background: var(--white); }
.section-dark { background: var(--sidebar); color: #fff; }
.section-agent { background: linear-gradient(180deg, var(--agent-light) 0%, var(--white) 100%); }

.section-header { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section-tag {
  display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--primary); margin-bottom: 12px;
}
.section-tag.agent { color: var(--agent); }
.section-header h2 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; margin-bottom: 16px; letter-spacing: -.02em; }
.section-header p { color: var(--muted); font-size: 17px; line-height: 1.65; }
.section-dark .section-header p { color: rgba(255,255,255,.7); }
.section-dark .section-tag { color: #f87171; }

/* ── Cards ── */
.card-grid { display: grid; gap: 24px; }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; transition: all .2s; box-shadow: var(--shadow);
}
.card:hover { border-color: rgba(216,30,52,.25); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-icon {
  width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary); font-size: 20px; margin-bottom: 18px;
}
.card-icon.agent { background: var(--agent-light); color: var(--agent); }
.card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.card p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.card ul { margin-top: 14px; list-style: none; }
.card ul li {
  font-size: 13px; color: var(--muted); padding: 5px 0 5px 20px; position: relative;
}
.card ul li::before {
  content: '✓'; position: absolute; left: 0; color: var(--primary); font-weight: 700; font-size: 12px;
}

.xfa-service-list { list-style: none; margin: 0; }
.xfa-service-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; color: var(--muted); line-height: 1.5;
}
.xfa-service-list li:last-child { border-bottom: none; }
.xfa-service-list li::before { content: none; }
.xfa-service-list .svc-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.xfa-service-list li.active { color: var(--text); font-weight: 600; }
.xfa-service-list li.active .svc-num { background: var(--primary); color: #fff; }
.xfa-service-list li.active strong { color: var(--primary); }

.feature-card { display: flex; gap: 20px; align-items: flex-start; }
.feature-card .card-icon { flex-shrink: 0; margin-bottom: 0; }

/* ── Flow / Steps ── */
.flow-steps { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.flow-step {
  flex: 1; min-width: 140px; text-align: center; padding: 24px 16px; position: relative;
}
.flow-step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
  margin: 0 auto 14px;
}
.flow-step.agent .flow-step-num { background: var(--agent); }
.flow-step h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.flow-step p { font-size: 13px; color: var(--muted); }
.flow-step:not(:last-child)::after {
  content: '→'; position: absolute; right: -8px; top: 38px; color: var(--border); font-size: 20px; font-weight: 300;
}

/* ── Comparison table ── */
.compare-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.compare-table th, .compare-table td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.compare-table th { background: #f5f5f5; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table .yes { color: #16a34a; font-weight: 600; }
.compare-table .no { color: #a3a3a3; }
.compare-table .highlight { background: var(--primary-light); }

/* ── Agent mode cards ── */
.mode-card {
  border-radius: var(--radius-lg); padding: 32px; border: 2px solid var(--border);
  background: var(--white); height: 100%;
}
.mode-card.commission { border-color: var(--agent); background: linear-gradient(180deg, var(--agent-light) 0%, var(--white) 40%); }
.mode-card.no-commission { border-color: #d4d4d4; }
.mode-card h3 { font-size: 22px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.mode-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .05em;
}
.mode-badge.on { background: var(--agent); color: #fff; }
.mode-badge.off { background: #e5e5e5; color: var(--muted); }

/* ── Architecture diagram ── */
.arch-diagram {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow);
}
.arch-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.arch-box {
  padding: 16px 24px; border-radius: var(--radius); font-weight: 700; font-size: 14px;
  text-align: center; min-width: 140px;
}
.arch-box.platform { background: var(--primary); color: #fff; }
.arch-box.agent { background: var(--agent); color: #fff; }
.arch-box.merchant { background: #f5f5f5; border: 1px solid var(--border); }
.arch-box.admin { background: var(--sidebar); color: #fff; }
.arch-arrow { color: var(--muted); font-size: 24px; }

/* ── Partners ── */
.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.partner-item {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 16px; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all .15s;
}
.partner-item:hover { border-color: var(--primary); color: var(--primary); }

/* ── Payment rail coverage grid ── */
.rail-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
.rail-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 14px 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rail-card:hover {
  border-color: rgba(216, 30, 52, .25); box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.rail-card-logo {
  width: 100%; height: 52px; display: flex; align-items: center; justify-content: center;
  padding: 0 8px;
}
.rail-card-logo img {
  max-width: 100%; max-height: 48px; width: auto; height: auto;
  object-fit: contain; display: block;
}
.rail-card-label {
  font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.35;
}

@media (max-width: 1024px) {
  .rail-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .rail-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Partners page (X Trust style logo grid) ── */
.partners-banking {
  background: var(--sidebar); color: rgba(255,255,255,.85); padding: 80px 0;
}
.partners-banking .section-header { margin-bottom: 48px; }
.partners-banking .section-tag {
  color: #d4a853; display: inline-flex; align-items: center; gap: 10px;
}
.partners-banking .section-tag::before {
  content: ''; width: 28px; height: 2px; background: #d4a853; border-radius: 1px;
}
.partners-banking .section-header h2 { color: #fff; }
.partners-banking .section-header p { color: rgba(255,255,255,.55); }

.partner-logo-group { margin-bottom: 48px; }
.partner-logo-group:last-child { margin-bottom: 0; }
.partner-logo-group h3 {
  font-size: 15px; font-weight: 600; color: rgba(255,255,255,.75);
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.08);
}

.partner-logo-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px;
}
.partner-logo-grid.banks { grid-template-columns: repeat(4, 1fr); }

.partner-logo-card { text-align: center; }
.partner-logo-card .logo-box {
  background: #fff; border-radius: var(--radius); padding: 20px 16px;
  height: 88px; display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
.partner-logo-card .logo-box:hover {
  transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.partner-logo-card .logo-box img {
  max-height: 40px; max-width: 100%; width: auto; object-fit: contain;
}
.partner-logo-card .logo-label {
  display: block; margin-top: 10px; font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,.65); line-height: 1.4;
}

@media (max-width: 1024px) {
  .partner-logo-grid { grid-template-columns: repeat(3, 1fr); }
  .partner-logo-grid.banks { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .partner-logo-grid, .partner-logo-grid.banks { grid-template-columns: repeat(2, 1fr); }
}

/* ── Features landing page ── */
.feat-value-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feat-value-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px 24px; text-align: center; transition: all .2s;
}
.feat-value-card:hover { border-color: rgba(216,30,52,.25); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.feat-value-card .num {
  font-size: 36px; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 8px;
}
.feat-value-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feat-value-card p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }

.feat-module {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  padding: 64px 0; border-bottom: 1px solid var(--border);
}
.feat-module:last-child { border-bottom: none; }
.feat-module.reverse { direction: rtl; }
.feat-module.reverse > * { direction: ltr; }
.feat-module-tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--primary); background: var(--primary-light);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.feat-module h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; margin-bottom: 14px; letter-spacing: -.02em; }
.feat-module .feat-lead { font-size: 16px; color: var(--muted); line-height: 1.65; margin-bottom: 24px; }
.feat-module ul { list-style: none; margin-bottom: 24px; }
.feat-module ul li {
  padding: 8px 0 8px 28px; position: relative; font-size: 14px; color: var(--muted); line-height: 1.55;
}
.feat-module ul li::before {
  content: '✓'; position: absolute; left: 0; color: var(--primary); font-weight: 800;
}
.feat-module-visual {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 60%);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px;
  box-shadow: var(--shadow);
}
.feat-module-visual img {
  width: 100%; height: 260px; object-fit: cover; border-radius: var(--radius); margin-bottom: 20px;
}
.feat-mini-flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.feat-mini-node {
  padding: 10px 14px; border-radius: var(--radius); font-size: 12px; font-weight: 600;
  background: var(--white); border: 1px solid var(--border); text-align: center;
}
.feat-mini-node.highlight { background: var(--primary); color: #fff; border-color: var(--primary); }
.feat-mini-arrow { color: var(--muted); font-size: 14px; }

.feat-audience { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feat-audience-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px 22px; text-align: center;
}
.feat-audience-card i {
  width: 48px; height: 48px; border-radius: 12px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--primary-light); color: var(--primary);
}
.feat-audience-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.feat-audience-card p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }
.section-dark .feat-audience-card { color: var(--text); }

@media (max-width: 1024px) {
  .feat-value-grid, .feat-audience { grid-template-columns: repeat(2, 1fr); }
  .feat-module, .feat-module.reverse { grid-template-columns: 1fr; direction: ltr; }
}

@media (max-width: 768px) {
  .feat-value-grid, .feat-audience { grid-template-columns: 1fr; }
}

.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 32px; }
.timeline-item::before {
  content: ''; position: absolute; left: -32px; top: 6px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--primary); border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.timeline-item p { font-size: 14px; color: var(--muted); }

/* ── CTA ── */
.cta-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff; border-radius: var(--radius-lg); padding: 56px; text-align: center;
}
.cta-banner h2 { font-size: 32px; font-weight: 800; margin-bottom: 14px; }
.cta-banner p { opacity: .88; margin-bottom: 28px; font-size: 17px; }
.cta-banner .btn-primary { background: #fff; color: var(--primary); }

/* ── Footer ── */
.site-footer {
  background: var(--sidebar); color: rgba(255,255,255,.75); padding: 64px 0 32px; font-size: 14px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 32px 40px; margin-bottom: 48px; }
.footer-brand p { margin-top: 16px; line-height: 1.65; max-width: 300px; }
.footer-brand a { color: rgba(255,255,255,.9); text-decoration: underline; text-underline-offset: 2px; }
.footer-brand a:hover { color: #fff; }
.footer-logo { height: 32px; filter: brightness(0) invert(1); display: block; }
.footer-col h4 { color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.footer-col a { display: block; padding: 5px 0; color: rgba(255,255,255,.65); transition: color .15s; }
.footer-col a:hover { color: #fff; }
.footer-note { display: block; padding-top: 8px; font-size: 12px; color: rgba(255,255,255,.45); line-height: 1.5; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 24px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 13px;
}
.footer-bottom a { color: rgba(255,255,255,.55); }
.footer-bottom a:hover { color: #fff; }

/* ── Page hero (inner pages) ── */
.page-hero {
  background: linear-gradient(135deg, #1f1f1f 0%, var(--sidebar) 100%);
  color: #fff; padding: 64px 0 72px;
}
.page-hero.agent-theme { background: linear-gradient(135deg, var(--agent-dark) 0%, var(--agent) 100%); }
.page-hero h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 800; margin-bottom: 14px; }
.page-hero p { font-size: 17px; opacity: .85; max-width: 640px; line-height: 1.65; }
.breadcrumb { font-size: 13px; opacity: .6; margin-bottom: 20px; }
.breadcrumb a:hover { opacity: 1; text-decoration: underline; }

/* ── Detail blocks ── */
.detail-block { margin-bottom: 48px; }
.detail-block h3 { font-size: 24px; font-weight: 800; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--primary-light); }
.detail-block p { color: var(--muted); margin-bottom: 16px; line-height: 1.7; }
.detail-block ul { margin: 16px 0 16px 24px; color: var(--muted); }
.detail-block li { margin-bottom: 8px; line-height: 1.6; }

.webhook-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px;
}
.webhook-event {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; transition: border-color .15s, box-shadow .15s;
}
.webhook-event:hover { border-color: rgba(216, 30, 52, .2); box-shadow: var(--shadow); }
.webhook-event code {
  flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--primary);
  background: var(--primary-light); padding: 4px 8px; border-radius: 6px;
  font-family: ui-monospace, monospace; line-height: 1.4; max-width: 48%;
  word-break: break-all;
}
.webhook-event span { font-size: 13px; color: var(--muted); line-height: 1.5; padding-top: 2px; }
.webhook-docs {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .webhook-grid { grid-template-columns: 1fr; }
}

.callout {
  background: var(--primary-light); border-left: 4px solid var(--primary);
  padding: 20px 24px; border-radius: 0 var(--radius) var(--radius) 0; margin: 24px 0;
}
.callout.agent { background: var(--agent-light); border-color: var(--agent); }
.callout strong { color: var(--text); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }

.contact-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--shadow);
}
.contact-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.contact-row { display: flex; gap: 14px; margin-bottom: 18px; align-items: flex-start; }
.contact-row i { color: var(--primary); margin-top: 3px; width: 20px; text-align: center; }

/* ── Contact page ── */
.contact-page-header {
  background: var(--white); border-bottom: 1px solid var(--border); padding: 40px 0 36px;
}
.contact-page-header h1 { font-size: clamp(28px, 4vw, 36px); font-weight: 800; margin-bottom: 10px; letter-spacing: -.02em; }
.contact-page-header .lead { font-size: 16px; color: var(--muted); max-width: 560px; line-height: 1.65; }

.contact-quick-bar {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px;
}
.contact-quick-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; transition: border-color .15s, box-shadow .15s;
}
.contact-quick-item:hover { border-color: rgba(216,30,52,.25); box-shadow: var(--shadow); }
.contact-quick-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary); font-size: 18px;
}
.contact-quick-item strong { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.contact-quick-item a, .contact-quick-item span { font-size: 14px; font-weight: 600; color: var(--text); }
.contact-quick-item a:hover { color: var(--primary); }

.contact-layout {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 32px; align-items: start;
}
.contact-form-panel {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 36px 40px; box-shadow: var(--shadow);
}
.contact-form-panel h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.contact-form-panel .form-note { font-size: 14px; color: var(--muted); margin-bottom: 28px; }

.contact-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text);
}
.contact-form label .req { color: var(--primary); margin-left: 2px; }
.contact-form .field { margin-bottom: 20px; }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: #a3a3a3; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form .btn-submit { width: 100%; padding: 14px 24px; font-size: 15px; margin-top: 4px; }
.contact-form .btn-submit:disabled { opacity: .7; cursor: not-allowed; transform: none; }

.form-feedback {
  margin-top: 16px; padding: 14px 16px; border-radius: 8px; font-size: 14px; line-height: 1.6;
}
.form-feedback--success {
  background: #dcfce7; border: 1px solid #bbf7d0; color: #166534;
}
.form-feedback--error {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
}

.contact-sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--header-h) + 24px); }

.contact-info-card {
  background: var(--sidebar); color: rgba(255,255,255,.85); border-radius: var(--radius-lg);
  padding: 28px 28px 24px; overflow: hidden; position: relative;
}
.contact-info-card::before {
  content: ''; position: absolute; top: 0; right: 0; width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(216,30,52,.35) 0%, transparent 70%);
  pointer-events: none;
}
.contact-info-card h3 { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 18px; position: relative; }
.contact-info-list { list-style: none; position: relative; }
.contact-info-list li {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 14px; line-height: 1.5;
}
.contact-info-list li:last-child { border-bottom: none; padding-bottom: 0; }
.contact-info-list i { color: #f87171; width: 18px; text-align: center; margin-top: 2px; flex-shrink: 0; }
.contact-info-list a { color: #fff; font-weight: 600; }
.contact-info-list a:hover { color: #fca5a5; }
.contact-info-list .sub { display: block; font-size: 12px; color: rgba(255,255,255,.5); margin-top: 2px; }

.contact-offices { display: flex; flex-direction: column; gap: 12px; }
.contact-office {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start;
  transition: border-color .15s;
}
.contact-office:hover { border-color: rgba(216,30,52,.2); }
.contact-office-pin {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800;
}
.contact-office h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.contact-office p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }

.contact-social {
  display: flex; align-items: center; gap: 10px; padding-top: 4px;
}
.contact-social a {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px; transition: all .15s;
}
.contact-social a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.contact-social .ext-link {
  width: auto; padding: 0 14px; font-size: 13px; font-weight: 600; gap: 6px;
}

.contact-process {
  background: var(--white); border-top: 1px solid var(--border); padding: 56px 0;
}
.contact-process-inner {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.contact-process-step { text-align: center; padding: 0 16px; }
.contact-process-num {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--primary-light); color: var(--primary); font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.contact-process-step h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.contact-process-step p { font-size: 13px; color: var(--muted); line-height: 1.55; }

@media (max-width: 1024px) {
  .contact-layout { grid-template-columns: 1fr; }
  .contact-sidebar { position: static; }
  .contact-quick-bar { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .contact-form-panel { padding: 28px 22px; }
  .contact-form .form-row { grid-template-columns: 1fr; }
  .contact-process-inner { grid-template-columns: 1fr; gap: 24px; }
}

/* ── Responsive ── */
@media (max-width: 1280px) {
  .nav-main a { padding: 8px 10px; font-size: 13px; }
}

@media (max-width: 1024px) {
  .card-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; max-width: 480px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 16px; gap: 8px; }
  .nav-main, .header-actions .btn-ghost { display: none; }
  .nav-toggle { display: block; }
  .header-actions { margin-left: auto; }
  .lang-switcher { margin-right: 0; }
  .nav-main.open {
    display: flex; flex-direction: column; position: absolute;
    top: var(--header-h); left: 0; right: 0; background: var(--white);
    border-bottom: 1px solid var(--border); padding: 16px; box-shadow: var(--shadow-lg);
  }
  .nav-main.open a { border-radius: 8px; }
  .card-grid.cols-2, .card-grid.cols-3, .card-grid.cols-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 64px; }
  .section { padding: 56px 0; }
  .flow-step:not(:last-child)::after { display: none; }
  .compare-table { font-size: 12px; }
  .compare-table th, .compare-table td { padding: 12px; }
  .page-with-toc { grid-template-columns: 1fr; }
  .toc-sidebar { position: static; margin-bottom: 32px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual img { height: 280px; }
  .hero-visual--screenshot img { height: auto; }
  .hero-visual-accent { display: none; }
  .hero-visual--screenshot .hero-visual-accent { display: flex; }
  .scenario-card--photo { grid-template-columns: 1fr; }
  .split-media, .split-media.reverse { grid-template-columns: 1fr; direction: ltr; }
  .trust-photo-row { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
  .media-banner img { height: 220px; }
}

/* ── Extended components ── */
.page-with-toc {
  display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: start;
}
.toc-sidebar {
  position: sticky; top: calc(var(--header-h) + 24px);
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow);
}
.toc-sidebar h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 12px;
}
.toc-sidebar a {
  display: block; font-size: 13px; font-weight: 500; color: var(--muted);
  padding: 7px 10px; border-radius: 6px; margin-bottom: 2px; transition: all .15s;
}
.toc-sidebar a:hover, .toc-sidebar a.active { color: var(--primary); background: var(--primary-light); }

.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 24px 0; }
.spec-item {
  background: #f5f5f5; border-radius: var(--radius); padding: 16px 18px;
  border-left: 3px solid var(--primary);
}
.spec-item h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.spec-item p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }

.status-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  background: #f5f5f5; color: var(--muted); border: 1px solid var(--border);
}
.pill.pending { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.pill.active { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.pill.review { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.pill.agent { background: var(--agent-light); color: var(--agent-dark); border-color: #ddd6fe; }

.example-box {
  background: var(--sidebar); color: #e5e5e5; border-radius: var(--radius-lg);
  padding: 28px 32px; margin: 24px 0; font-size: 14px; line-height: 1.7;
}
.example-box .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #737373; margin-bottom: 12px; }
.example-box .highlight { color: #f87171; font-weight: 700; }
.example-box .result { color: #86efac; font-weight: 700; }
.example-box table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.example-box th, .example-box td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #363636; }
.example-box th { color: #a3a3a3; font-weight: 600; }

.scenario-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px;
}
.scenario-header {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.scenario-header.agent { background: linear-gradient(135deg, var(--agent-light) 0%, var(--white) 100%); }
.scenario-header h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.scenario-header p { font-size: 14px; color: var(--muted); margin: 0; }
.scenario-body { padding: 24px; background: var(--white); }
.scenario-steps { counter-reset: step; list-style: none; }
.scenario-steps li {
  counter-increment: step; position: relative; padding: 12px 0 12px 44px;
  border-bottom: 1px dashed var(--border); font-size: 14px; color: var(--muted); line-height: 1.6;
}
.scenario-steps li:last-child { border-bottom: none; }
.scenario-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 12px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.scenario-steps.agent li::before { background: var(--agent); }

.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px; overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.faq-item.open {
  border-color: rgba(216, 30, 52, .25);
  box-shadow: 0 4px 16px rgba(216, 30, 52, .06);
}
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 18px 22px; font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-family: inherit;
}
.faq-q-text { flex: 1; }
.faq-q i { color: var(--primary); transition: transform .25s ease; flex-shrink: 0; font-size: 13px; }
.faq-item.open .faq-q i { transform: rotate(180deg); }
.faq-a {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease;
}
.faq-a-inner { overflow: hidden; min-height: 0; }
.faq-a-inner p {
  margin: 0; padding: 0 22px 18px; font-size: 14px; color: var(--muted); line-height: 1.75;
}
.faq-a-inner strong { color: var(--text); font-weight: 700; }
.faq-item.open .faq-a { grid-template-rows: 1fr; }

.fund-chain {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
  padding: 32px; background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: var(--shadow); margin: 24px 0;
}
.fund-node {
  padding: 12px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  text-align: center; min-width: 100px;
}
.fund-node.start { background: var(--primary-light); color: var(--primary-dark); border: 1px solid rgba(216,30,52,.2); }
.fund-node.mid { background: #f5f5f5; border: 1px solid var(--border); }
.fund-node.end { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.fund-arrow { color: var(--muted); font-size: 18px; }

.module-section {
  padding: 48px 0; border-bottom: 1px solid var(--border);
}
.module-section:last-child { border-bottom: none; }
.module-section h2 {
  font-size: 26px; font-weight: 800; margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px;
}
.module-section h2 i { color: var(--primary); font-size: 22px; }
.module-lead { font-size: 16px; color: var(--muted); margin-bottom: 28px; max-width: 720px; line-height: 1.65; }

.sub-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 16px 0; }
.sub-table th, .sub-table td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.sub-table th { background: #f5f5f5; font-weight: 700; }

/* ── Product doc layout (features reference) ── */
.doc-header {
  background: var(--white); border-bottom: 1px solid var(--border); padding: 36px 0 32px;
}
.doc-header h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.02em; }
.doc-header .doc-lead { font-size: 15px; color: var(--muted); line-height: 1.65; max-width: 680px; }
.doc-meta {
  display: flex; flex-wrap: wrap; gap: 20px; margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--border); font-size: 13px; color: var(--muted);
}
.doc-meta strong { color: var(--text); font-weight: 600; }

.doc-intro {
  background: #f5f5f5; border-bottom: 1px solid var(--border); padding: 28px 0;
}
.doc-intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.doc-panel {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px;
}
.doc-panel h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }

.doc-module { padding: 36px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 96px; }
.doc-module:last-child { border-bottom: none; }
.doc-module .mod-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 6px;
}
.doc-module h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.doc-module .mod-desc { font-size: 14px; color: var(--muted); line-height: 1.65; margin-bottom: 20px; }

.cap-table {
  width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0 20px;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.cap-table th {
  width: 128px; background: #fafafa; text-align: left; vertical-align: top;
  padding: 11px 14px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.cap-table td {
  padding: 11px 14px; color: var(--muted); line-height: 1.6; border-bottom: 1px solid var(--border);
}
.cap-table tr:last-child th, .cap-table tr:last-child td { border-bottom: none; }

.doc-h4 { font-size: 13px; font-weight: 700; margin: 20px 0 8px; color: var(--text); }
.doc-foot {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 14px; color: var(--muted);
}
.doc-foot a { color: var(--primary); font-weight: 500; margin-right: 20px; }
.toc-sidebar.doc-toc { background: #fafafa; box-shadow: none; }

@media (max-width: 768px) {
  .doc-intro-grid { grid-template-columns: 1fr; }
}

/* ── Agent ecosystem diagram ── */
.agent-ecosystem {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.agent-eco-header {
  padding: 16px 24px; background: #fafafa; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.agent-eco-header i { color: var(--agent); }

.agent-eco-lanes {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}
.agent-eco-lane {
  padding: 20px 18px 18px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 100%;
}
.agent-eco-lane:last-child { border-right: none; }
.agent-eco-lane-head {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px;
}
.agent-eco-lane-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.agent-eco-lane.admin .agent-eco-lane-icon { background: var(--sidebar); color: #fff; }
.agent-eco-lane.platform .agent-eco-lane-icon { background: var(--primary); color: #fff; }
.agent-eco-lane.agent-portal .agent-eco-lane-icon { background: var(--agent); color: #fff; }
.agent-eco-lane.merchant .agent-eco-lane-icon { background: #f5f5f5; color: var(--text); border: 1px solid var(--border); }
.agent-eco-lane-head h4 { font-size: 14px; font-weight: 700; line-height: 1.3; }
.agent-eco-lane-head .role-tag {
  display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 2px;
}
.agent-eco-lane ul {
  list-style: none; flex: 1; font-size: 12px; color: var(--muted); line-height: 1.5;
}
.agent-eco-lane ul li {
  padding: 5px 0 5px 14px; position: relative; border-bottom: 1px dashed rgba(0,0,0,.06);
}
.agent-eco-lane ul li:last-child { border-bottom: none; }
.agent-eco-lane ul li::before {
  content: ''; position: absolute; left: 0; top: 11px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--border);
}
.agent-eco-lane.admin ul li::before { background: var(--sidebar); }
.agent-eco-lane.platform ul li::before { background: var(--primary); }
.agent-eco-lane.agent-portal ul li::before { background: var(--agent); }
.agent-eco-lane.merchant ul li::before { background: #a3a3a3; }
.agent-eco-lane-foot {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 11px; font-weight: 600; line-height: 1.45;
}
.agent-eco-lane.admin .agent-eco-lane-foot { color: var(--sidebar); }
.agent-eco-lane.platform .agent-eco-lane-foot { color: var(--primary-dark); }
.agent-eco-lane.agent-portal .agent-eco-lane-foot { color: var(--agent-dark); }
.agent-eco-lane.merchant .agent-eco-lane-foot { color: var(--muted); }

.agent-eco-connectors {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
  padding: 12px 24px; background: #fafafa; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.agent-eco-connectors .arrow { color: var(--agent); font-weight: 700; }
.agent-eco-connectors .sep { color: var(--border); margin: 0 4px; }

.agent-eco-pipeline { padding: 24px 24px 28px; }
.agent-eco-pipeline-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 16px;
}
.agent-eco-steps {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; position: relative;
}
.agent-eco-steps::before {
  content: ''; position: absolute; top: 18px; left: 8%; right: 8%; height: 2px;
  background: linear-gradient(90deg, #e5e5e5 0%, var(--agent) 50%, #e5e5e5 100%);
  z-index: 0;
}
.agent-eco-step {
  position: relative; z-index: 1; text-align: center; padding: 0 4px;
}
.agent-eco-step-num {
  width: 36px; height: 36px; border-radius: 50%; margin: 0 auto 8px;
  background: var(--white); border: 2px solid var(--agent); color: var(--agent-dark);
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.agent-eco-step:first-child .agent-eco-step-num { border-color: var(--primary); color: var(--primary); }
.agent-eco-step:last-child .agent-eco-step-num { background: var(--agent); color: #fff; border-color: var(--agent); }
.agent-eco-step h5 { font-size: 12px; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.agent-eco-step p { font-size: 11px; color: var(--muted); line-height: 1.45; }
.agent-eco-step code {
  display: block; font-size: 10px; background: var(--agent-light); color: var(--agent-dark);
  padding: 2px 6px; border-radius: 4px; margin-top: 4px; font-family: ui-monospace, monospace;
}

.agent-eco-forbidden {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.agent-eco-forbidden span {
  font-size: 11px; font-weight: 600; color: #991b1b; background: #fef2f2;
  border: 1px solid #fecaca; border-radius: 999px; padding: 4px 12px;
}

@media (max-width: 1024px) {
  .agent-eco-lanes { grid-template-columns: repeat(2, 1fr); }
  .agent-eco-lane:nth-child(2) { border-right: none; }
  .agent-eco-lane:nth-child(1), .agent-eco-lane:nth-child(2) { border-bottom: 1px solid var(--border); }
  .agent-eco-steps { grid-template-columns: repeat(3, 1fr); row-gap: 20px; }
  .agent-eco-steps::before { display: none; }
}

@media (max-width: 768px) {
  .agent-eco-lanes { grid-template-columns: 1fr; }
  .agent-eco-lane { border-right: none; border-bottom: 1px solid var(--border); }
  .agent-eco-lane:last-child { border-bottom: none; }
  .agent-eco-steps { grid-template-columns: 1fr 1fr; }
}

/* ── Platform hub (homepage overview) ── */
.platform-hub {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px 32px; margin-bottom: 40px; box-shadow: var(--shadow);
}
.platform-hub-top {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: center;
  margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--border);
}
.platform-hub-account {
  text-align: center; padding: 20px 24px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
  border: 2px solid rgba(216,30,52,.15); border-radius: var(--radius-lg);
}
.platform-hub-account .hub-label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 8px;
}
.platform-hub-account h3 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.platform-hub-account p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }
.platform-hub-layers {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px;
}
.platform-hub-layers span {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--border); color: var(--muted);
}
.platform-hub-arrow {
  font-size: 22px; color: var(--border); text-align: center;
}
.platform-hub-ends { display: flex; flex-direction: column; gap: 10px; }
.platform-hub-end {
  display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600;
  padding: 10px 14px; background: #fafafa; border-radius: var(--radius); border: 1px solid var(--border);
}
.platform-hub-end i { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.platform-hub-end.merchant i { background: var(--primary-light); color: var(--primary); }
.platform-hub-end.admin i { background: var(--sidebar); color: #fff; }
.platform-hub-end.agent i { background: var(--agent-light); color: var(--agent); }

.platform-hub-flow { display: flex; align-items: stretch; flex-wrap: wrap; gap: 0; justify-content: center; }
.platform-hub-node {
  flex: 1; min-width: 100px; max-width: 140px; text-align: center; padding: 16px 10px;
  position: relative;
}
.platform-hub-node-icon {
  width: 44px; height: 44px; border-radius: 10px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: var(--primary-light); color: var(--primary);
}
.platform-hub-node h4 { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.platform-hub-node p { font-size: 11px; color: var(--muted); line-height: 1.45; margin: 0; }
.platform-hub-node:not(:last-child)::after {
  content: '→'; position: absolute; right: -6px; top: 28px;
  color: var(--border); font-size: 16px; font-weight: 300;
}
.platform-hub-node.hub-center .platform-hub-node-icon {
  background: var(--primary); color: #fff; width: 52px; height: 52px; font-size: 20px;
}
.platform-hub-node.hub-center { max-width: 120px; }

.cap-card { display: flex; gap: 16px; align-items: flex-start; }
.cap-card .card-icon { flex-shrink: 0; margin-bottom: 0; }

@media (max-width: 768px) {
  .platform-hub-top { grid-template-columns: 1fr; }
  .platform-hub-arrow { transform: rotate(90deg); }
  .platform-hub-node:not(:last-child)::after { display: none; }
  .platform-hub-flow { flex-direction: column; align-items: center; }
  .platform-hub-node { max-width: 100%; width: 100%; }
}

/* ── Fund pipeline (end-to-end overview) ── */
.fund-pipeline {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.fund-pipeline-track {
  display: grid; grid-template-columns: repeat(7, 1fr); position: relative;
}
.fund-pipeline-track::before {
  content: ''; position: absolute; top: 36px; left: 7%; right: 7%; height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary) 70%, #22c55e 100%);
  z-index: 0;
}
.fund-pipeline-step {
  position: relative; z-index: 1; padding: 24px 14px 20px; text-align: center;
  border-right: 1px solid var(--border);
}
.fund-pipeline-step:last-child { border-right: none; }
.fund-pipeline-step-num {
  width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--white); border: 2px solid var(--primary); color: var(--primary);
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.fund-pipeline-step.done .fund-pipeline-step-num,
.fund-pipeline-step:last-child .fund-pipeline-step-num {
  background: #22c55e; border-color: #22c55e; color: #fff;
}
.fund-pipeline-step.active .fund-pipeline-step-num {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 0 0 4px var(--primary-light);
}
.fund-pipeline-step h4 { font-size: 13px; font-weight: 700; margin-bottom: 6px; line-height: 1.35; }
.fund-pipeline-step p { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 0; }
.fund-pipeline-step .step-tag {
  display: inline-block; margin-top: 8px; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: #f5f5f5; color: var(--muted);
}
.fund-pipeline-step.active .step-tag { background: var(--primary-light); color: var(--primary-dark); }

.fund-pipeline-note {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  padding: 20px 24px; background: #fafafa; border-top: 1px solid var(--border);
}
.fund-pipeline-note-item {
  display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.55;
}
.fund-pipeline-note-item i {
  width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.fund-pipeline-note-item.warn i { background: #fef3c7; color: #92400e; }
.fund-pipeline-note-item.info i { background: var(--primary-light); color: var(--primary); }
.fund-pipeline-note-item strong { display: block; font-size: 13px; margin-bottom: 2px; }
.fund-pipeline-note-item span { color: var(--muted); font-size: 12px; }

@media (max-width: 1024px) {
  .fund-pipeline-track { grid-template-columns: repeat(4, 1fr); }
  .fund-pipeline-track::before { display: none; }
  .fund-pipeline-step:nth-child(4) { border-right: none; }
  .fund-pipeline-step:nth-child(1),
  .fund-pipeline-step:nth-child(2),
  .fund-pipeline-step:nth-child(3),
  .fund-pipeline-step:nth-child(4) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 768px) {
  .fund-pipeline-track { grid-template-columns: 1fr 1fr; }
  .fund-pipeline-step { border-right: none; border-bottom: 1px solid var(--border); }
  .fund-pipeline-step:nth-child(odd) { border-right: 1px solid var(--border); }
  .fund-pipeline-note { grid-template-columns: 1fr; }
}

/* ── Agent layer compare (single vs multi) ── */
.agent-layer-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch;
}
.agent-layer-panel {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.agent-layer-panel.multi { border-color: rgba(124,58,237,.25); }
.agent-layer-panel-head {
  padding: 22px 24px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafafa 0%, var(--white) 100%);
}
.agent-layer-panel.multi .agent-layer-panel-head {
  background: linear-gradient(180deg, var(--agent-light) 0%, var(--white) 100%);
}
.agent-layer-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
  background: #f5f5f5; color: var(--muted);
}
.agent-layer-panel.multi .agent-layer-badge { background: var(--agent); color: #fff; }
.agent-layer-panel-head h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.agent-layer-panel-head p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }

.agent-layer-tree-wrap {
  flex: 1; padding: 28px 24px 24px; display: flex; align-items: center; justify-content: center;
  background: #fafafa; min-height: 320px;
}
.agent-layer-panel.multi .agent-layer-tree-wrap { background: linear-gradient(180deg, #faf5ff 0%, #fafafa 100%); }

.layer-tree { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 280px; }
.layer-vline {
  width: 2px; height: 20px; background: linear-gradient(to bottom, #d4d4d4, #a3a3a3);
}
.layer-node {
  padding: 10px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 700;
  text-align: center; line-height: 1.35; min-width: 140px; position: relative;
}
.layer-node small { display: block; font-size: 10px; font-weight: 600; opacity: .75; margin-top: 2px; }
.layer-node.platform {
  background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(216,30,52,.2);
}
.layer-node.agent {
  background: var(--agent); color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,.25);
}
.layer-node.agent.muted-agent {
  background: rgba(124,58,237,.75); border: 2px dashed rgba(255,255,255,.4);
}
.layer-node.merchant {
  background: var(--white); color: var(--text); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; min-width: 72px; padding: 8px 12px;
}

.layer-merchants {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.layer-fork {
  display: flex; gap: 32px; justify-content: center; width: 100%; position: relative;
  padding-top: 8px;
}
.layer-fork::before {
  content: ''; position: absolute; top: 0; left: 25%; right: 25%; height: 2px;
  background: #d4d4d4;
}
.layer-fork-col {
  display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 120px;
}
.layer-fork-col .layer-vline:first-child { height: 16px; }

.agent-layer-foot {
  padding: 18px 24px 22px; border-top: 1px solid var(--border); background: var(--white);
}
.agent-layer-foot ul { list-style: none; margin: 0; }
.agent-layer-foot li {
  font-size: 13px; color: var(--muted); padding: 5px 0 5px 22px; position: relative; line-height: 1.5;
}
.agent-layer-foot li::before {
  content: '✓'; position: absolute; left: 0; color: var(--agent); font-weight: 800; font-size: 12px;
}

.agent-layer-mix {
  margin-top: 24px; padding: 20px 24px; border-radius: var(--radius-lg);
  background: var(--agent-light); border: 1px solid #ddd6fe;
  display: flex; gap: 16px; align-items: flex-start;
}
.agent-layer-mix i {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: var(--agent); color: #fff; display: flex; align-items: center; justify-content: center;
}
.agent-layer-mix strong { display: block; font-size: 14px; margin-bottom: 4px; color: var(--agent-dark); }
.agent-layer-mix p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }

@media (max-width: 768px) {
  .agent-layer-grid { grid-template-columns: 1fr; }
  .layer-fork { gap: 16px; }
}

/* ── Three-terminal system (homepage) ── */
.terminal-system {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.terminal-system-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.terminal-card {
  padding: 28px 24px 22px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.terminal-card:last-child { border-right: none; }
.terminal-card-head {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px;
}
.terminal-card-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.terminal-card--merchant .terminal-card-icon { background: #f5f5f5; color: var(--text); border: 1px solid var(--border); }
.terminal-card--admin .terminal-card-icon { background: var(--sidebar); color: #fff; }
.terminal-card--agent .terminal-card-icon { background: var(--agent); color: #fff; }
.terminal-card-head h3 { font-size: 17px; font-weight: 800; line-height: 1.3; margin-bottom: 4px; }
.terminal-role { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.terminal-duties {
  list-style: none; flex: 1; margin: 0 0 16px;
  font-size: 13px; color: var(--muted); line-height: 1.55;
}
.terminal-duties li {
  padding: 7px 0 7px 16px; position: relative; border-bottom: 1px dashed rgba(0,0,0,.06);
}
.terminal-duties li:last-child { border-bottom: none; }
.terminal-duties li::before {
  content: ''; position: absolute; left: 0; top: 14px; width: 5px; height: 5px;
  border-radius: 50%;
}
.terminal-card--merchant .terminal-duties li::before { background: #a3a3a3; }
.terminal-card--admin .terminal-duties li::before { background: var(--sidebar); }
.terminal-card--agent .terminal-duties li::before { background: var(--agent); }
.terminal-card-foot {
  font-size: 11px; font-weight: 700; padding-top: 14px; border-top: 1px solid var(--border);
  letter-spacing: .01em;
}
.terminal-card--merchant .terminal-card-foot { color: var(--muted); }
.terminal-card--admin .terminal-card-foot { color: var(--sidebar); }
.terminal-card--agent .terminal-card-foot { color: var(--agent-dark); }

.terminal-flow-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px;
  padding: 14px 24px; background: #fafafa; border-top: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.terminal-flow-bar i { color: var(--primary); font-size: 10px; }
.terminal-flow-sep { color: var(--border); margin: 0 4px; }

.terminal-api {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 24px; border-top: 1px solid var(--border); background: var(--white);
}
.terminal-api-icon {
  width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
  background: rgba(216, 30, 52, .08); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.terminal-api-body { flex: 1; min-width: 200px; }
.terminal-api-body strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.terminal-api-body p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.terminal-api-link {
  font-size: 13px; font-weight: 700; color: var(--primary); white-space: nowrap;
}
.terminal-api-link:hover { text-decoration: underline; }

.terminal-forbidden {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 24px; background: #fef2f2; border-top: 1px solid #fecaca;
  font-size: 13px; color: #991b1b; line-height: 1.6;
}
.terminal-forbidden i { margin-top: 2px; flex-shrink: 0; color: var(--primary); }

@media (max-width: 900px) {
  .terminal-system-grid { grid-template-columns: 1fr; }
  .terminal-card { border-right: none; border-bottom: 1px solid var(--border); }
  .terminal-card:last-child { border-bottom: none; }
}

/* ── Module architecture (features page) ── */
.mod-arch {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.mod-arch-gateway {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
}
.mod-arch-gateway-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.mod-arch-gateway-body { flex: 1; min-width: 200px; }
.mod-arch-gateway-body strong { display: block; font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.mod-arch-gateway-body p { margin: 0; font-size: 13px; opacity: .88; line-height: 1.5; }
.mod-arch-gateway-link {
  font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap;
  padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35);
  transition: background .15s;
}
.mod-arch-gateway-link:hover { background: rgba(255,255,255,.12); }
.mod-arch-gateway-link i { font-size: 11px; margin-left: 4px; }

.mod-arch-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.mod-arch-tile {
  padding: 22px 14px 20px; text-align: center; border-right: 1px solid var(--border);
  transition: background .15s;
}
.mod-arch-tile:last-child { border-right: none; }
.mod-arch-tile:hover { background: #fafafa; }
.mod-arch-tile-icon {
  width: 40px; height: 40px; border-radius: 10px; margin: 0 auto 12px;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.mod-arch-tile--agent .mod-arch-tile-icon { background: var(--agent-light); color: var(--agent); }
.mod-arch-tile h4 { font-size: 13px; font-weight: 800; margin-bottom: 4px; letter-spacing: .02em; }
.mod-arch-tile p { font-size: 11px; color: var(--muted); line-height: 1.45; margin: 0; }

.mod-arch-note {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 28px; background: #fafafa; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--muted); line-height: 1.6;
}
.mod-arch-note i { color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.mod-arch-note strong { color: var(--text); font-weight: 700; }

.mod-arch-portals {
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.mod-arch-portal {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 24px; border-right: 1px solid var(--border);
}
.mod-arch-portal:last-child { border-right: none; }
.mod-arch-portal-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.mod-arch-portal--admin .mod-arch-portal-icon { background: var(--sidebar); color: #fff; }
.mod-arch-portal--merchant .mod-arch-portal-icon { background: #f5f5f5; color: var(--text); border: 1px solid var(--border); }
.mod-arch-portal--agent .mod-arch-portal-icon { background: var(--agent); color: #fff; }
.mod-arch-portal h5 { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.mod-arch-portal p { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0; }

@media (max-width: 1024px) {
  .mod-arch-grid { grid-template-columns: repeat(4, 1fr); }
  .mod-arch-tile:nth-child(4) { border-right: none; }
  .mod-arch-tile:nth-child(n+5) { border-top: 1px solid var(--border); }
  .mod-arch-tile:nth-child(7) { border-right: none; }
}
@media (max-width: 640px) {
  .mod-arch-grid { grid-template-columns: repeat(2, 1fr); }
  .mod-arch-tile { border-right: none; border-bottom: 1px solid var(--border); }
  .mod-arch-tile:nth-child(odd) { border-right: 1px solid var(--border); }
  .mod-arch-tile:nth-child(even) { border-right: none; }
  .mod-arch-tile:nth-child(n+5) { border-top: none; }
  .mod-arch-tile:last-child { border-bottom: none; }
  .mod-arch-portals { grid-template-columns: 1fr; }
  .mod-arch-portal { border-right: none; border-bottom: 1px solid var(--border); }
  .mod-arch-portal:last-child { border-bottom: none; }
  .mod-arch-gateway { padding: 20px; }
}
