:root {
    --ai-violet: #a78bfa;
    --ai-violet-soft: rgba(167, 139, 250, .12);
    --ai-cyan: #67e8f9;
    --ai-panel: rgba(9, 17, 31, .82);
    --ai-line: rgba(167, 139, 250, .24);
}

.ai-hero,
.ai-detail-hero {
    position: relative;
    overflow: hidden;
    color: #eef4ff;
    background:
        linear-gradient(rgba(148, 163, 184, .032) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .032) 1px, transparent 1px),
        radial-gradient(circle at 82% 20%, rgba(124, 58, 237, .2), transparent 30%),
        linear-gradient(135deg, #070d18, #0b1424 56%, #080c16);
    background-size: 34px 34px, 34px 34px, auto, auto;
}

.ai-hero { padding: 72px 0; }
.ai-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 34px;
    align-items: stretch;
}
.ai-hero h1,
.ai-detail-hero h1 {
    max-width: 900px;
    margin: 0 0 20px;
    color: #fff;
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1.04;
    letter-spacing: -.045em;
}
.ai-hero__lead,
.ai-detail-hero__lead {
    max-width: 800px;
    margin: 0;
    color: #c8d5e8;
    font-size: 19px;
    line-height: 1.7;
}
.ai-hero__status {
    padding: 22px;
    border: 1px solid var(--ai-line);
    border-radius: 20px;
    background: rgba(7, 13, 24, .78);
}
.ai-hero__status-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, .16);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    text-transform: uppercase;
}
.ai-hero__status-head span { color: #8fa0b8; }
.ai-hero__status-head strong { color: var(--ai-cyan); }
.ai-hero__metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.ai-hero__metrics div {
    min-height: 90px;
    padding: 15px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 13px;
    background: rgba(15, 23, 42, .58);
}
.ai-hero__metrics strong,
.ai-hero__metrics span { display: block; }
.ai-hero__metrics strong { color: #fff; font-size: 22px; }
.ai-hero__metrics span { margin-top: 5px; color: #95a5bb; font-size: 14px; }
.ai-hero__status > p { margin: 16px 0 0; color: #9dacbf; font-size: 14px; }

.ai-status-section { padding-top: 28px; padding-bottom: 22px; }
.ai-disclosure {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    padding: 24px;
    border: 1px solid var(--ai-line);
    border-left: 4px solid var(--ai-violet);
    border-radius: 18px;
    background: var(--ai-panel);
}
.ai-disclosure__mark,
.ai-badge,
.ai-code,
.ai-not-implemented {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 7px;
    font: 800 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: .045em;
}
.ai-disclosure__mark,
.ai-badge {
    border: 1px solid rgba(167, 139, 250, .35);
    background: var(--ai-violet-soft);
    color: #ddd6fe;
}
.ai-disclosure h2 { margin: 0 0 8px; color: #fff; }
.ai-disclosure p { margin: 0; color: #aebcd0; line-height: 1.65; }

.ai-catalog-section { padding-top: 34px; }
#ai-concepts { scroll-margin-top: 90px; }
.ai-concept-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.ai-concept-card {
    display: flex;
    flex-direction: column;
    min-height: 560px;
    padding: 26px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(12, 21, 36, .94), rgba(8, 15, 27, .8));
}
.ai-concept-card__top,
.ai-detail-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.ai-code {
    border: 1px solid rgba(103, 232, 249, .22);
    background: rgba(103, 232, 249, .07);
    color: var(--ai-cyan);
}
.ai-concept-card__question {
    margin: 22px 0 9px;
    color: #fcd34d !important;
    font-size: 14px;
    font-weight: 800;
}
.ai-concept-card h3 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -.025em;
}
.ai-concept-card > p:not(.ai-concept-card__question) { color: #adbbcf; line-height: 1.65; }
.ai-card-flow {
    display: grid;
    gap: 8px;
    margin: 18px 0;
    padding: 0;
    list-style: none;
}
.ai-card-flow li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 10px;
    color: #d7e2f2;
    background: rgba(7, 13, 22, .52);
    font-size: 14px;
    font-weight: 700;
}
.ai-card-flow span { color: var(--ai-violet); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ai-system-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.ai-system-tags span {
    padding: 6px 9px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 7px;
    background: rgba(15, 23, 42, .6);
    color: #b9c7da;
    font: 700 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.ai-concept-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: auto;
    padding-top: 24px;
}
.ai-text-link { color: #c4b5fd; font-weight: 800; }
.ai-text-link:hover { color: #ede9fe; }

.ai-loop-section { padding-top: 26px; }
.ai-loop {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 18px;
    background: rgba(7, 13, 22, .72);
}
.ai-loop article { min-height: 205px; padding: 22px; border-right: 1px solid rgba(148, 163, 184, .18); }
.ai-loop article:last-child { border-right: 0; }
.ai-loop strong,
.ai-pilot-grid strong { color: var(--ai-violet); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ai-loop h3,
.ai-pilot-grid h3 { margin: 22px 0 8px; color: #fff; }
.ai-loop p,
.ai-pilot-grid p { margin: 0; color: #9eadc2; }

.ai-final-card { border-color: var(--ai-line); }
.ai-detail-hero { padding: 62px 0 68px; }
.ai-back-link { display: inline-flex; margin-bottom: 28px; color: #a5b4fc; font-weight: 800; }
.ai-detail-hero__meta { justify-content: flex-start; margin-bottom: 28px; }
.ai-not-implemented { border: 1px solid rgba(251, 191, 36, .24); background: rgba(251, 191, 36, .07); color: #fde68a; }
.ai-detail-hero__question { max-width: 760px; margin: 0 0 12px; color: #fcd34d; font-size: 15px; font-weight: 800; }
.ai-detail-hero h1 { max-width: 980px; font-size: clamp(36px, 5vw, 58px); }

.ai-detail-intro { padding-bottom: 24px; }
.ai-detail-intro__grid,
.ai-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.ai-detail-panel,
.ai-list-panel,
.ai-effect-panel {
    padding: 26px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 18px;
    background: var(--ai-panel);
}
.ai-detail-panel--accent { border-color: var(--ai-line); }
.ai-detail-panel h2,
.ai-list-panel h2,
.ai-effect-panel h2 { margin: 0 0 12px; color: #fff; }
.ai-detail-panel p:last-child,
.ai-effect-panel p { margin-bottom: 0; color: #adbbcf; font-size: 17px; line-height: 1.7; }

#architecture { scroll-margin-top: 90px; }
.ai-architecture-section { padding-top: 28px; }
.ai-workflow {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 18px;
    list-style: none;
    background: rgba(7, 13, 22, .72);
}
.ai-workflow li { min-height: 270px; padding: 22px; border-right: 1px solid rgba(148, 163, 184, .18); }
.ai-workflow li:last-child { border-right: 0; }
.ai-workflow li > span { color: var(--ai-cyan); font: 800 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ai-workflow h3 { margin: 28px 0 10px; color: #fff; font-size: 20px; }
.ai-workflow p { margin: 0; color: #9faec3; line-height: 1.6; }

.ai-data-section { padding-top: 22px; }
.ai-list-panel ul,
.ai-effect-panel ul { display: grid; gap: 11px; margin: 18px 0 0; padding-left: 20px; color: #c6d2e4; }
.ai-list-panel li,
.ai-effect-panel li { padding-left: 3px; line-height: 1.55; }
.ai-system-tags--detail { margin-top: 16px; }
.ai-list-panel--safe { border-left: 4px solid rgba(52, 211, 153, .65); }
.ai-list-panel--limit { border-left: 4px solid rgba(251, 191, 36, .65); }
.ai-effect-panel { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; }
.ai-effect-panel ul { margin-top: 0; }

.ai-pilot-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.ai-pilot-grid article {
    min-height: 210px;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 16px;
    background: rgba(7, 13, 22, .72);
}
.ai-final-section { padding-top: 24px; }

@media (max-width: 1040px) {
    .ai-hero__grid,
    .ai-effect-panel { grid-template-columns: 1fr; }
    .ai-loop,
    .ai-workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-loop article,
    .ai-workflow li { border-bottom: 1px solid rgba(148, 163, 184, .18); }
    .ai-loop article:nth-child(2n),
    .ai-workflow li:nth-child(2n) { border-right: 0; }
    .ai-loop article:last-child,
    .ai-workflow li:last-child { border-bottom: 0; }
    .ai-pilot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .ai-hero,
    .ai-detail-hero { padding: 40px 0; }
    .ai-hero h1,
    .ai-detail-hero h1 { font-size: 34px; }
    .ai-hero__lead,
    .ai-detail-hero__lead { font-size: 16px; }
    .ai-disclosure,
    .ai-concept-grid,
    .ai-detail-intro__grid,
    .ai-two-column,
    .ai-loop,
    .ai-workflow,
    .ai-pilot-grid { grid-template-columns: 1fr; }
    .ai-disclosure,
    .ai-concept-card,
    .ai-detail-panel,
    .ai-list-panel,
    .ai-effect-panel { padding: 18px; }
    .ai-concept-card { min-height: 0; }
    .ai-concept-card h3 { font-size: 25px; }
    .ai-loop article,
    .ai-workflow li,
    .ai-loop article:nth-child(2n),
    .ai-workflow li:nth-child(2n) { min-height: 0; border-right: 0; border-bottom: 1px solid rgba(148, 163, 184, .18); }
    .ai-loop article:last-child,
    .ai-workflow li:last-child { border-bottom: 0; }
    .ai-workflow h3 { margin-top: 16px; }
    .ai-concept-card__actions { align-items: stretch; flex-direction: column; }
    .ai-concept-card__actions .button { width: 100%; }
}
