/* Knowledge Taxonomy Continuum — Styles (v2.0.0) */

.ktc-wrap {
    max-width: 900px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    color: #1a1a2e;
    box-sizing: border-box;
}
.ktc-wrap.ktc-public-view {
    max-width: 1100px;
}
.ktc-wrap *, .ktc-wrap *::before, .ktc-wrap *::after {
    box-sizing: border-box;
    font-family: inherit !important;
}

/* ── Login notice ── */
.ktc-login-notice {
    text-align: center;
    padding: 40px 20px;
    background: #f6f6fa;
    border-radius: 10px;
}
.ktc-login-notice p { font-size: 16px; margin-bottom: 16px; }

/* ── Form shell ── */
.ktc-form {
    background: #f6f6fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 28px;
}
.ktc-form h2 { margin: 0 0 8px; font-size: 22px; }
.ktc-subtitle { margin: 0 0 16px; color: #555; font-size: 14px; }

.ktc-save-status {
    min-height: 18px;
    font-size: 12px;
    color: #6a6a80;
    margin-bottom: 12px;
}

.ktc-section-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6a6a80;
    margin: 22px 0 10px;
}

/* ── Field rows ── */
.ktc-field-row {
    display: grid;
    gap: 12px;
    margin-bottom: 10px;
}
.ktc-field-row.one-col { grid-template-columns: 1fr; }
.ktc-field-row.two-col { grid-template-columns: 1fr 1fr; }

.ktc-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #33334d;
}
.ktc-field input[type="text"],
.ktc-field textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d5d5e0;
    border-radius: 8px;
    background: #fff;
    min-height: 44px;
}
.ktc-field textarea {
    min-height: 90px;
    resize: vertical;
}

/* ── Level blocks ── */
.ktc-level-block {
    background: #ffffff;
    border: 1px solid #e2e2ec;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
}
.ktc-level-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
}
.ktc-level-title {
    font-weight: 700;
    font-size: 15px;
}

.ktc-points-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.ktc-point-field {
    background: #f9f9fc;
    border: 1px solid #e8e8f0;
    border-radius: 8px;
    padding: 10px;
}
.ktc-sub-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.ktc-badge-input {
    width: 44px !important;
    min-width: 44px;
    text-align: center;
    padding: 8px 4px !important;
}
.ktc-check-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
}
.ktc-check-label input { width: 18px; height: 18px; }

/* ── Buttons ── */
.ktc-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.ktc-actions-secondary { margin-top: 12px; }

.ktc-btn-generate,
.ktc-btn-download,
.ktc-btn-add-level,
.ktc-btn-add-point,
.ktc-btn-remove-level,
.ktc-btn-remove-point {
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    padding: 0 18px;
}

.ktc-btn-generate {
    background: #1a1a2e;
    color: #fff;
}
.ktc-btn-download {
    background: #fff;
    color: #1a1a2e;
    border: 1px solid #1a1a2e;
    display: none;
}
.ktc-btn-download.visible { display: inline-flex; align-items: center; }

.ktc-btn-add-level,
.ktc-btn-add-point {
    background: #e8e8f7;
    color: #1a1a2e;
    padding: 0 14px;
    min-height: 38px;
}

.ktc-btn-save {
    background: #fff;
    color: #1a1a2e;
    border: 1px solid #c7c7d6;
}

.ktc-btn-publish {
    background: #33334d;
    color: #fff;
}

.ktc-publish-panel:empty { display: none; }
.ktc-publish-panel {
    margin-top: 14px;
    font-size: 13px;
}
.ktc-publish-link a {
    color: #1a1a2e;
    font-weight: 600;
    word-break: break-all;
}
.ktc-publish-choice {
    background: #fff;
    border: 1px solid #e2e2ec;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ktc-publish-choice-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.ktc-btn-choice {
    border: none;
    border-radius: 8px;
    background: #e8e8f7;
    color: #1a1a2e;
    font-size: 13px;
    font-weight: 600;
    min-height: 38px;
    padding: 0 14px;
    cursor: pointer;
}
.ktc-btn-choice-cancel {
    background: transparent;
    color: #6a6a80;
}

.ktc-btn-remove-level {
    background: #fdeaea;
    color: #a12b2b;
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
    flex-shrink: 0;
}
.ktc-btn-remove-point {
    background: #fdeaea;
    color: #a12b2b;
    min-height: 32px;
    min-width: 32px;
    padding: 0;
    line-height: 1;
    font-size: 16px;
}

/* ── Output / diagram ── */
#ktc-output {
    display: none;
}
#ktc-output.visible { display: block; }

.ktc-diagram-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
}

.ktc-diagram {
    background: #ffffff;
    border: 2px solid #1a1a2e;
    border-radius: 10px;
    padding: 36px 40px 28px;
    min-width: 480px;
}

.ktc-diagram-title {
    text-align: center;
    font-size: 2.8rem !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    letter-spacing: 0;
    line-height: 1.15;
    color: #1a1a2e;
    margin-bottom: 32px;
}

.ktc-continuum-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 8px;
}
.ktc-row-gap { height: 22px; }

.ktc-axis-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1a1a2e;
    min-width: 24px;
    height: 110px;
    text-align: center;
    padding: 0 2px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ktc-axis-char { line-height: 1.25; }
.ktc-axis-label.left { margin-right: 2px; }
.ktc-axis-label.right { margin-left: 2px; }

.ktc-boxes-inner {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.ktc-point {
    flex: 1;
    min-width: 110px;
    height: 110px;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    font-size: clamp( 0.8rem, 1.6vw, 1.1rem );
    font-weight: 600;
    line-height: 1.15;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ktc-connector {
    width: 18px;
    flex-shrink: 0;
    align-self: center;
    height: 1.5px;
    background: #1a1a2e;
    margin: 0 -1px;
    position: relative;
}
.ktc-connector::before,
.ktc-connector::after {
    content: '';
    position: absolute;
    top: -4px;
    width: 1.5px;
    height: 10px;
    background: #1a1a2e;
}
.ktc-connector::before { left: 0; }
.ktc-connector::after { right: 0; }

.ktc-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #ffffff;
    color: #1a1a2e;
    border: 2px solid #1a1a2e;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.ktc-point-text {
    word-break: break-word;
}

.ktc-point.is-active .ktc-badge {
    border-color: #ffffff;
}

.ktc-track-label {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #1a1a2e;
    margin-top: 8px;
}

.ktc-description-block {
    background: #1a1a2e;
    color: #ffffff;
    padding: 18px 20px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 24px;
}

.ktc-copyright {
    text-align: center;
    font-size: 11px;
    color: #9a9ab0;
    margin-top: 16px;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .ktc-field-row.two-col { grid-template-columns: 1fr; }
    .ktc-form { padding: 16px; }
    .ktc-level-block { padding: 14px; }
    .ktc-points-row { grid-template-columns: 1fr 1fr; }
    .ktc-actions { flex-direction: column; }
    .ktc-actions .ktc-btn-generate,
    .ktc-actions .ktc-btn-download { width: 100%; justify-content: center; }
    .ktc-diagram { padding: 20px; min-width: 420px; }
    .ktc-diagram-title { font-size: 19px; }
    .ktc-point { height: 84px; font-size: 0.95rem; }
    .ktc-axis-label { height: 84px; }
}

@media (max-width: 400px) {
    .ktc-points-row { grid-template-columns: 1fr; }
}
