/* ═══════════════════════════════════════════════════════
   KeyTools Keyword — iOS 26 Glassmorphism
   Dark · Frosted Glass · Clean Typography
   ═══════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    --bg: #060a12;
    --surface: #0d1420;
    --card: #131b2e;
    --border: #1e2a42;
    --accent: #F5A623;
    --accent-glow: #FFD175;
    --success: #2ee6a8;
    --gold: #f5b942;
    --cyan: #56d7e5;
    --red: #ff5370;
    --text: #e8eaed;
    --text-dim: #8b8fa3;
    --text-muted: #5a5f73;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Nav ── */
.kt-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 10px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(20px);
    background: rgba(6, 10, 18, 0.92);
    border-bottom: 1px solid rgba(245, 166, 35, 0.08);
}

.kt-nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.kt-nav-logo img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.kt-nav-logo span {
    font-weight: 800;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #F5A623, #FFD175);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kt-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kt-nav-links a {
    color: #666;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all .3s;
}

.kt-nav-links a:hover {
    color: var(--accent);
    background: rgba(245, 166, 35, 0.08);
}

.kt-nav-links a.kt-active {
    color: var(--accent);
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.2);
}

/* ── Container ── */
.kk-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 68px 20px 40px;
}

/* ── Header / Tabs ── */
.kk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-bottom: 16px;
}

.kk-tabs {
    display: flex;
    gap: 4px;
}

.kk-tab {
    padding: 8px 20px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s ease;
}

.kk-tab:hover {
    color: var(--text-dim);
}

.kk-tab.active {
    color: var(--accent-glow);
    background: rgba(245, 166, 35, 0.1);
    border-color: rgba(245, 166, 35, 0.2);
}

.kk-tab-content {
    display: none;
}

.kk-tab-content.active {
    display: block;
}

/* ── Alerts ── */
#kk-alerts {
    position: fixed;
    top: 56px;
    right: 20px;
    z-index: 10000;
    max-width: 360px;
}

.kk-alert {
    padding: 12px 18px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    animation: fadeSlideIn 0.3s ease;
    backdrop-filter: blur(20px);
}

.kk-alert-success {
    background: rgba(46, 230, 168, 0.12);
    color: var(--success);
    border: 1px solid rgba(46, 230, 168, 0.2);
}

.kk-alert-error {
    background: rgba(255, 83, 112, 0.12);
    color: var(--red);
    border: 1px solid rgba(255, 83, 112, 0.2);
}

.kk-alert-info {
    background: rgba(245, 166, 35, 0.12);
    color: var(--accent-glow);
    border: 1px solid rgba(245, 166, 35, 0.2);
}

/* API Warning Banners */
.kk-api-warning {
    padding: 14px 18px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    animation: fadeSlideIn 0.3s ease;
    backdrop-filter: blur(20px);
    background: rgba(245, 166, 35, 0.15);
    color: #f5a623;
    border: 1px solid rgba(245, 166, 35, 0.3);
    max-width: 420px;
}

.kk-api-warning.kk-api-error {
    background: rgba(255, 83, 112, 0.15);
    color: var(--red);
    border: 1px solid rgba(255, 83, 112, 0.3);
}

.kk-api-warning-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kk-api-warning-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.kk-api-warning-close:hover {
    opacity: 1;
}

/* ═══════════════════════════════════════════════
   GLASSMORPHISM COMPONENTS
   ═══════════════════════════════════════════════ */

/* ── Glass Hero ── */
.glass-hero {
    position: relative;
    margin-bottom: 20px;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(245, 166, 35, 0.06), rgba(86, 215, 229, 0.04), rgba(245, 166, 35, 0.03));
}

.glass-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(13, 20, 32, 0.65);
    backdrop-filter: blur(60px) saturate(180%);
    -webkit-backdrop-filter: blur(60px) saturate(180%);
    z-index: 0;
}

.glass-hero-inner {
    position: relative;
    z-index: 1;
    padding: 40px 36px 32px;
}

.glass-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.8px;
    margin-bottom: 6px;
}

.glass-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    margin-bottom: 24px;
}

/* ── Search Bar ── */
.glass-search-wrap {
    display: flex;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.glass-search-wrap:focus-within {
    border-color: rgba(245, 166, 35, 0.4);
    box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.08), 0 8px 32px rgba(0, 0, 0, 0.2);
}

.glass-search {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    outline: none;
    font-family: var(--font);
    min-width: 0;
}

.glass-search::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.glass-search-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent), #E09500);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.glass-search-btn:hover {
    background: linear-gradient(135deg, #FFD175, #E09500);
    box-shadow: 0 4px 20px rgba(245, 166, 35, 0.4);
}

.glass-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Depth Pills ── */
.depth-pills {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.depth-pill {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.depth-pill input[type="radio"] {
    display: none;
}

.pill-label {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}

.pill-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    transition: color 0.2s;
}

.depth-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.depth-pill.active {
    background: rgba(245, 166, 35, 0.12);
    border-color: rgba(245, 166, 35, 0.35);
    box-shadow: 0 0 16px rgba(245, 166, 35, 0.1);
}

.depth-pill.active .pill-label {
    color: var(--accent-glow);
}

.depth-pill.active .pill-desc {
    color: rgba(255, 209, 117, 0.6);
}

/* ── Options ── */
.glass-options {
    margin-top: 16px;
    display: flex;
    gap: 16px;
}

.glass-option-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
}

.glass-option-input {
    width: 80px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.glass-option-input:focus {
    border-color: rgba(245, 166, 35, 0.4);
}

/* ── Status Bar ── */
.glass-status {
    margin-bottom: 16px;
    animation: fadeSlideIn 0.4s ease;
}

.glass-status-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 18px;
    background: rgba(13, 20, 32, 0.7);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(245, 166, 35, 0.15);
}

.status-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(245, 166, 35, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.status-content {
    flex: 1;
}

.status-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.status-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.status-bar-inner {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    border-radius: 2px;
    animation: shimmer 2s ease-in-out infinite;
    background-size: 200% 100%;
}

/* ── Stats Row ── */
.glass-stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeSlideIn 0.5s ease;
}

.glass-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 20px 16px;
    border-radius: 18px;
    background: rgba(13, 20, 32, 0.5);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.glass-stat:hover {
    border-color: rgba(245, 166, 35, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.glass-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-glow);
    letter-spacing: -1px;
    line-height: 1;
}

.glass-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-success {
    color: var(--success) !important;
}

.color-gold {
    color: var(--gold) !important;
}

.color-cyan {
    color: var(--cyan) !important;
}

/* ── Map Container ── */
.glass-map {
    margin-bottom: 20px;
    border-radius: 20px;
    background: rgba(13, 20, 32, 0.5);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    animation: fadeSlideIn 0.5s ease;
}

.glass-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.glass-map-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}

.glass-map-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.glass-map-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.glass-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 4px;
}

/* ── Small Buttons ── */
.glass-btn-sm {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.glass-btn-sm:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.glass-btn-sm.active {
    background: rgba(245, 166, 35, 0.15);
    border-color: rgba(245, 166, 35, 0.3);
    color: var(--accent-glow);
}

.glass-btn-primary {
    background: linear-gradient(135deg, var(--accent), #E09500) !important;
    border-color: transparent !important;
    color: #fff !important;
}

.glass-btn-primary:hover {
    box-shadow: 0 4px 16px rgba(245, 166, 35, 0.35);
    transform: translateY(-1px);
}

.glass-btn-export {
    text-transform: none;
}

/* ── View Panels ── */
.map-view-panel {
    padding: 24px;
    min-height: 200px;
}

/* ── Tree ── */
.tree-pillar {
    text-align: center;
    margin-bottom: 32px;
}

.tree-pillar-node {
    display: inline-block;
    padding: 16px 32px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.2), rgba(86, 215, 229, 0.1));
    border: 1.5px solid rgba(245, 166, 35, 0.3);
    backdrop-filter: blur(10px);
}

.tree-pillar-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 4px;
}

.tree-pillar-name {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.tree-connector {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.tree-connector-line {
    width: 2px;
    height: 32px;
    background: linear-gradient(to bottom, rgba(245, 166, 35, 0.4), rgba(245, 166, 35, 0.1));
}

.tree-clusters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.tree-cluster {
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.tree-cluster:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.tree-cluster-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tree-cluster-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-cluster-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tree-cluster-count {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.tree-cluster-body {
    padding: 12px 16px;
    max-height: 300px;
    overflow-y: auto;
}

.tree-kw {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 12px;
    transition: background 0.15s;
}

.tree-kw:last-child {
    border-bottom: none;
}

.tree-kw:hover {
    background: rgba(245, 166, 35, 0.04);
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 6px;
}

.tree-kw-name {
    flex: 1;
    color: var(--text-dim);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-kw-intent {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: rgba(245, 166, 35, 0.08);
    color: var(--accent);
    flex-shrink: 0;
}

.tree-kw-priority {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Results Header ── */
.glass-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    background: rgba(13, 20, 32, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.glass-results-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.glass-results-actions {
    display: flex;
    gap: 6px;
}

/* ── Category Cards ── */
.glass-category {
    margin-bottom: 12px;
    border-radius: var(--radius);
    background: rgba(13, 20, 32, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
    animation: fadeSlideIn 0.4s ease;
}

.glass-category-header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.glass-category-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.glass-category-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.glass-category-toggle {
    font-size: 11px;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.glass-category-body {
    padding: 8px 20px 16px;
}

.glass-kw-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.glass-kw-item:last-child {
    border-bottom: none;
}

.glass-kw-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.glass-kw-item label {
    flex: 1;
    font-size: 12px;
    color: var(--text-dim);
    cursor: pointer;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Table ── */
.kk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.kk-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kk-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-dim);
}

.kk-table tr:hover td {
    background: rgba(245, 166, 35, 0.03);
}

/* ── Writer Tab ── */
.kk-main {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
}

.glass-card {
    padding: 28px;
    border-radius: 20px;
    background: rgba(13, 20, 32, 0.5);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 20px;
}

.kk-form-group {
    margin-bottom: 16px;
}

.kk-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.glass-input,
.glass-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.glass-input:focus,
.glass-textarea:focus {
    border-color: rgba(245, 166, 35, 0.4);
}

.glass-textarea {
    resize: vertical;
    min-height: 120px;
}

.kk-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.glass-btn-full {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 8px;
}

.glass-btn-green {
    background: linear-gradient(135deg, #059669, #22c55e);
    color: #fff;
}

.glass-btn-green:hover {
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.35);
}

.glass-btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
}

.glass-btn-outline:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ── Log ── */
.kk-log {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.3);
    max-height: 200px;
    overflow-y: auto;
    font-size: 11px;
    font-family: 'Cascadia Code', monospace;
}

.kk-log-line {
    padding: 2px 0;
    color: var(--text-dim);
}

.kk-log-line.success {
    color: var(--success);
}

.kk-log-line.error {
    color: var(--red);
}

.kk-log-line.info {
    color: var(--accent-glow);
}

/* ── Empty State ── */
.kk-empty {
    text-align: center;
    padding: 60px 20px;
}

.kk-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.kk-empty-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Article Card ── */
.kk-article-card {
    padding: 20px;
    border-radius: var(--radius);
    background: rgba(13, 20, 32, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 12px;
    animation: fadeSlideIn 0.4s ease;
}

.kk-article-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.kk-article-content {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.8;
}

.kk-article-content h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-glow);
    margin: 16px 0 8px;
}

.kk-article-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 12px 0 6px;
}

.kk-article-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

/* ── Animations ── */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .kk-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .glass-hero-inner {
        padding: 24px 20px;
    }

    .glass-title {
        font-size: 22px;
    }

    .depth-pills {
        flex-direction: column;
    }

    .glass-stats-row {
        flex-wrap: wrap;
    }

    .glass-stat {
        min-width: calc(50% - 8px);
    }

    .glass-map-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .glass-map-actions {
        flex-wrap: wrap;
    }

    .tree-clusters {
        grid-template-columns: 1fr;
    }

    .glass-results-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .glass-results-actions {
        flex-wrap: wrap;
    }

    .kt-nav-links {
        display: none;
    }
}

/* ═══════════════════════════════════════════════
   ARTICLE CARDS — Writer Tab
   ═══════════════════════════════════════════════ */

.kk-article-card {
    margin-bottom: 16px;
    border-radius: var(--radius);
    background: rgba(13, 20, 32, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    animation: fadeSlideIn 0.4s ease;
    transition: border-color 0.3s;
}

.kk-article-card:hover {
    border-color: rgba(245, 166, 35, 0.15);
}

.kk-article-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.kk-article-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.kk-article-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kk-article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.kk-article-wc {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(46, 230, 168, 0.1);
    color: var(--success);
}

.kk-article-expand {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.kk-article-card.expanded .kk-article-expand {
    transform: rotate(180deg);
}

/* Article body — hidden by default, shown when expanded */
.kk-article-body {
    display: none;
}

.kk-article-card.expanded .kk-article-body {
    display: block;
}

/* Article content — rendered HTML */
.kk-article-content {
    padding: 24px;
    max-height: 600px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-dim);
}

.kk-article-content::-webkit-scrollbar {
    width: 4px;
}

.kk-article-content::-webkit-scrollbar-track {
    background: transparent;
}

.kk-article-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.kk-article-content h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-glow);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(245, 166, 35, 0.15);
}

.kk-article-content h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 28px 0 12px;
}

.kk-article-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 20px 0 10px;
}

.kk-article-content p {
    margin-bottom: 12px;
}

.kk-article-content ul,
.kk-article-content ol {
    padding-left: 24px;
    margin-bottom: 12px;
}

.kk-article-content li {
    margin-bottom: 6px;
}

.kk-article-content strong {
    color: var(--text);
    font-weight: 600;
}

.kk-article-content em {
    color: var(--accent);
}

.kk-article-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
    background: rgba(245, 166, 35, 0.05);
    color: var(--text-dim);
    font-style: italic;
}

.kk-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13px;
}

.kk-article-content th,
.kk-article-content td {
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px;
    text-align: left;
}

.kk-article-content th {
    background: rgba(245, 166, 35, 0.08);
    color: var(--accent-glow);
    font-weight: 600;
}

.kk-article-content a {
    color: var(--cyan);
    text-decoration: none;
}

.kk-article-content a:hover {
    text-decoration: underline;
}

/* Article actions bar */
.kk-article-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
}

/* Empty state */
.kk-empty {
    text-align: center;
    padding: 60px 20px;
}

.kk-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.kk-empty-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   IMAGE TOOLS — GEO Tag & Compression
   ═══════════════════════════════════════════════ */

/* Mode toggles */
.img-mode-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.img-mode-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.25s;
}

.img-mode-toggle:has(input:checked) {
    background: rgba(245, 166, 35, 0.1);
    border-color: rgba(245, 166, 35, 0.3);
}

.img-mode-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.img-mode-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
    transition: color 0.2s;
}

.img-mode-toggle:has(input:checked) .img-mode-label {
    color: var(--accent-glow);
}

/* Settings groups */
.img-settings-group {
    margin-bottom: 20px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.img-settings-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.img-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Quality slider */
.img-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    outline: none;
    margin-top: 8px;
}

.img-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(245, 166, 35, 0.4);
}

.img-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

/* Upload zone */
.img-upload-zone {
    margin-top: 16px;
    padding: 40px 24px;
    border: 2px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
}

.img-upload-zone:hover,
.img-upload-zone.dragover {
    border-color: rgba(245, 166, 35, 0.4);
    background: rgba(245, 166, 35, 0.04);
}

.img-upload-icon {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.img-upload-text {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.img-upload-link {
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
}

.img-upload-link:hover {
    text-decoration: underline;
}

.img-upload-info {
    font-size: 11px;
    color: var(--text-muted);
}

/* File list */
.img-file-list {
    margin-top: 16px;
}

.img-files-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.img-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.img-file-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(13, 20, 32, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    animation: fadeSlideIn 0.3s ease;
}

.img-file-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.img-file-info {
    flex: 1;
    min-width: 0;
}

.img-file-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.img-file-size {
    font-size: 10px;
    color: var(--text-muted);
}

.img-file-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 83, 112, 0.1);
    color: var(--red);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s;
    flex-shrink: 0;
}

.img-file-remove:hover {
    background: rgba(255, 83, 112, 0.25);
}

/* Results */
.img-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 10px;
    background: rgba(13, 20, 32, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
}

.img-savings {
    font-weight: 700;
    font-size: 12px;
}

.img-savings.positive {
    color: var(--success);
}

.img-savings.negative {
    color: var(--red);
}

.img-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.img-result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(13, 20, 32, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    animation: fadeSlideIn 0.4s ease;
    transition: border-color 0.3s;
}

.img-result-card:hover {
    border-color: rgba(245, 166, 35, 0.15);
}

.img-result-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.img-result-info {
    flex: 1;
    min-width: 0;
}

.img-result-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.img-result-sizes {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.img-result-badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.img-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.img-badge.geo {
    background: rgba(86, 215, 229, 0.12);
    color: var(--cyan);
}

.img-badge.compress {
    background: rgba(46, 230, 168, 0.12);
    color: var(--success);
}

.img-badge.error {
    background: rgba(255, 83, 112, 0.12);
    color: var(--red);
}

/* Responsive */
@media (max-width: 600px) {
    .img-mode-row {
        flex-direction: column;
    }

    .img-form-grid {
        grid-template-columns: 1fr;
    }

    .img-form-grid .kk-form-group[style*="grid-column"] {
        grid-column: 1 !important;
    }

    .img-files-grid {
        grid-template-columns: 1fr;
    }

    .img-results-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════
   SERP ANALYSIS PANEL
   ═══════════════════════════════════════════════ */

.serp-panel {
    margin-bottom: 20px;
    border-radius: 20px;
    background: rgba(13, 20, 32, 0.55);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(86, 215, 229, 0.12);
    overflow: hidden;
    animation: fadeSlideIn 0.5s ease;
}

.serp-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(86, 215, 229, 0.08);
    background: rgba(86, 215, 229, 0.03);
}

.serp-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.serp-icon {
    font-size: 18px;
}

.serp-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.serp-panel-body {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.serp-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 16px;
    transition: border-color 0.3s;
}

.serp-section:hover {
    border-color: rgba(86, 215, 229, 0.12);
}

.serp-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 12px;
    letter-spacing: 0.2px;
}

/* Top Results */
.serp-top-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.serp-top-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 0.2s;
}

.serp-top-item:hover {
    background: rgba(86, 215, 229, 0.04);
}

.serp-top-pos {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(86, 215, 229, 0.1);
    color: var(--cyan);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.serp-top-info {
    flex: 1;
    min-width: 0;
}

.serp-top-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.serp-top-url {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Competitor Headings */
.serp-comp-block {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.serp-comp-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.serp-comp-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.serp-comp-wc {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(245, 166, 35, 0.1);
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.serp-comp-headings {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.serp-heading {
    font-size: 11px;
    color: var(--text-dim);
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.serp-heading-tag {
    font-size: 8px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

.serp-heading-h1 .serp-heading-tag {
    background: rgba(245, 166, 35, 0.15);
    color: var(--accent);
}

.serp-heading-h2 .serp-heading-tag {
    background: rgba(86, 215, 229, 0.12);
    color: var(--cyan);
}

.serp-heading-h3 .serp-heading-tag {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

/* PAA Questions */
.serp-paa-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.serp-paa-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
    transition: background 0.2s;
}

.serp-paa-item:hover {
    background: rgba(245, 166, 35, 0.04);
    color: var(--text);
}

.serp-paa-icon {
    flex-shrink: 0;
    font-size: 11px;
}

/* LSI Keywords */
.serp-lsi-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.serp-lsi-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(46, 230, 168, 0.06);
    color: var(--success);
    border: 1px solid rgba(46, 230, 168, 0.12);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    cursor: default;
}

.serp-lsi-tag:hover {
    background: rgba(46, 230, 168, 0.12);
    border-color: rgba(46, 230, 168, 0.25);
    transform: translateY(-1px);
}

.serp-lsi-count {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    background: rgba(46, 230, 168, 0.15);
    color: var(--success);
}

/* SERP Features */
.serp-features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.serp-feature-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(245, 166, 35, 0.08);
    color: var(--accent-glow);
    border: 1px solid rgba(245, 166, 35, 0.15);
}

/* SERP Responsive */
@media (max-width: 768px) {
    .serp-panel-body {
        grid-template-columns: 1fr;
    }
}

/* Full-width sections */
#kk-serp-top,
#kk-serp-headings {
    grid-column: 1 / -1;
}

#kk-serp-top .serp-top-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

#kk-serp-headings .serp-headings-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* Competitor URL Keywords */
.serp-urlkw-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 6px;
}

.serp-urlkw-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s;
    flex-wrap: wrap;
}

.serp-urlkw-item:hover {
    background: rgba(86, 215, 229, 0.04);
}

.serp-urlkw-keyword {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.serp-urlkw-slug {
    font-size: 9px;
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    font-family: monospace;
}

.serp-urlkw-anchor {
    font-size: 10px;
    color: var(--cyan);
    font-style: italic;
}

/* ═══════════════════════════════════════════════
   CLAUDE AI BADGE & BANNER
   ═══════════════════════════════════════════════ */

/* AI Provider Badge — shown next to Topical Map title */
.ai-provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
    background: rgba(139, 143, 163, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(139, 143, 163, 0.15);
    vertical-align: middle;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.claude-badge {
    background: linear-gradient(135deg, rgba(210, 168, 80, 0.2), rgba(245, 166, 35, 0.15));
    color: #ffd175;
    border-color: rgba(245, 166, 35, 0.35);
    box-shadow: 0 0 12px rgba(245, 166, 35, 0.15);
    animation: claudePulse 3s ease-in-out infinite;
}

@keyframes claudePulse {
    0%, 100% { box-shadow: 0 0 12px rgba(245, 166, 35, 0.15); }
    50% { box-shadow: 0 0 20px rgba(245, 166, 35, 0.3); }
}

/* Claude Banner Notification */
.kk-claude-badge-banner {
    padding: 12px 18px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    animation: fadeSlideIn 0.4s ease;
    backdrop-filter: blur(20px);
    background: linear-gradient(135deg, rgba(210, 168, 80, 0.12), rgba(86, 215, 229, 0.06));
    color: #ffd175;
    border: 1px solid rgba(245, 166, 35, 0.25);
    max-width: 420px;
}

.kk-claude-badge-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kk-claude-badge-content strong {
    color: #ffd175;
    background: linear-gradient(135deg, #ffd175, #f5a623);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kk-claude-icon {
    font-size: 18px;
    flex-shrink: 0;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(5deg); }
    50% { transform: scale(1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(3deg); }
}