.ki-overview p, #matrix-note {
    max-width: 78ch;
    color: var(--muted);
    line-height: 1.6;
}
.ki-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}
.ki-flow li {
    position: relative;
    padding: 18px 24px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.ki-flow li + li::before {
    content: "→";
    position: absolute;
    top: 50%;
    left: -8px;
    transform: translate(-50%, -50%);
    padding: 0 3px;
    color: var(--muted);
    background: var(--paper);
}
.ki-flow span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.45;
}
.matrix-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.matrix-scroll:focus-visible {
    outline: 3px solid #568a5b;
    outline-offset: 4px;
}
.repository-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}
.repository-matrix th, .repository-matrix td {
    padding: 11px clamp(12px, 2vw, 24px);
    border-bottom: 1px solid var(--line);
}
.repository-matrix thead th {
    background: #e9efe2;
    color: var(--ink);
}
.repository-matrix tbody th {
    font-weight: 500;
}
.repository-matrix th:first-child {
    width: 44%;
    text-align: left;
}
.repository-matrix th:not(:first-child), .repository-matrix td {
    text-align: center;
}
.repository-matrix tr:last-child > * {
    border-bottom: 0;
}
.repository-matrix tbody tr:nth-child(even) {
    background: #f8faf5;
}
.repository-matrix code {
    white-space: nowrap;
}
.matrix-check {
    color: #236044;
    font-weight: 750;
    font-size: 1.15rem;
}
@media (max-width: 570px) {
    .ki-flow {
        grid-template-columns: 1fr;
    }
    .ki-flow li + li::before {
        content: "↓";
        top: -8px;
        left: 24px;
    }
}

.schema-trigger {
    max-width: 100%;
    padding: 4px 0;
    border: 0;
    color: #245d43;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.schema-trigger:hover {
    color: var(--ink);
}
.schema-dialog {
    width: min(700px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    padding: clamp(18px, 4vw, 30px);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    background: #fff;
}
.schema-dialog::backdrop {
    background: #103a2d90;
}
.schema-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.schema-header h2 {
    margin: 0;
    font-size: clamp(1.2rem, 3vw, 1.55rem);
    overflow-wrap: anywhere;
}
.schema-header button {
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: #e9efe2;
    cursor: pointer;
}
.schema-fields td:first-child {
    text-align: left;
}

#schema-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
#schema-upload input {
    max-width: 100%;
    font: inherit;
}
#schema-upload button {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: #e9efe2;
    cursor: pointer;
}
#schema-status:empty {
    display: none;
}
.schema-download {
    display: inline-block;
    margin-top: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
    gap: 14px;
}
.prompt-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.prompt-card h3 {
    margin: 0;
    font-size: 1.08rem;
}
.prompt-card p {
    flex: 1;
    margin: 12px 0 18px;
    color: var(--muted);
    line-height: 1.55;
}
.prompt-card button {
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: #e9efe2;
    cursor: pointer;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.ki-history-list {
    --timeline-offset: 36px;
    position: relative;
    display: grid;
    gap: 20px;
    margin: 0;
    padding: 0 0 0 var(--timeline-offset);
    list-style: none;
}
.ki-history-list::before {
    content: "";
    position: absolute;
    inset: 22px auto 0 7px;
    width: 2px;
    background: #c4d4c4;
}
.ki-history-list li {
    position: relative;
}
.ki-history-list li::before {
    content: "";
    position: absolute;
    top: 24px;
    left: calc(8px - var(--timeline-offset));
    width: 16px;
    height: 16px;
    border: 3px solid var(--paper);
    border-radius: 50%;
    background: #245d43;
    transform: translateX(-50%);
}
.ki-history-entry {
    padding: clamp(16px, 3vw, 26px);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.ki-history-entry time {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    color: #245d43;
    background: #e9efe2;
    font-size: .875rem;
    font-weight: 650;
}
.ki-history-entry h3 {
    margin: 12px 0 8px;
    font-size: clamp(1.15rem, 2vw, 1.38rem);
    line-height: 1.3;
}
.ki-history-entry p {
    max-width: 72ch;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}
.ki-history-entry p + p {
    margin-top: 8px;
}
.ki-history-entry a {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.landing [id] {
    scroll-margin-top: calc(var(--header-height) + 16px);
}
@media (max-width: 570px) {
    .ki-history-list {
        --timeline-offset: 26px;
    }
}

.repository-matrix {
    --bs-table-color: var(--ink);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--line);
    --bs-table-hover-bg: #eaf1e6;
}
.repository-matrix th {
    vertical-align: middle;
}
.repository-matrix tbody tr:hover {
    background: #eaf1e6;
}
.repository-matrix thead th {
    font-weight: 700;
}
.repository-matrix code {
    color: inherit;
}
.wiki-button {
    --bs-btn-color: #15392d;
    --bs-btn-bg: #e9efe2;
    --bs-btn-border-color: #dce4d8;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #103a2d;
    --bs-btn-hover-border-color: #103a2d;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #103a2d;
    --bs-btn-active-border-color: #103a2d;
}
