*{box-sizing:border-box}
:root{color-scheme:dark}
html,body{margin:0;min-height:100%;font-family:Arial,Helvetica,sans-serif;background:#080808;color:#fff}
a{color:inherit}
.topbar{height:70px;background:#0d0d0d;border-bottom:1px solid #222;padding:0 30px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.brand{font-size:24px;font-weight:800;letter-spacing:4px}
.top-actions{display:flex;align-items:center;gap:12px;color:#888;font-size:13px}
.btn,.top-actions a{display:inline-block;text-decoration:none;border:1px solid #333;background:#111;color:#fff;padding:10px 14px;border-radius:8px;cursor:pointer}
.btn-primary{background:#fff;color:#000;border-color:#fff;font-weight:700}
.btn-danger{border-color:#5b2525;color:#ffb4b4;background:#1c0d0d}
.page{max-width:1220px;margin:auto;padding:42px 30px 70px}
.back{display:inline-block;color:#888;text-decoration:none;font-size:13px;margin-bottom:26px}
h1{font-size:32px;margin:0}
.subtitle{color:#777;margin-top:8px;margin-bottom:30px}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:28px 0 38px}
.panel,.card,.stat{background:#111;border:1px solid #222;border-radius:12px;padding:22px}
.card{text-decoration:none;min-height:160px;transition:.15s}
.card:hover{border-color:#555;transform:translateY(-2px)}
.card h2,.panel h2{font-size:18px;margin:0 0 10px}
.card p,.muted{color:#777;line-height:1.5}
.stat-number{font-size:30px;font-weight:700}
.stat-label{margin-top:7px;color:#777;font-size:13px}
.layout{display:grid;grid-template-columns:350px minmax(0,1fr);gap:22px}
.field{margin-bottom:17px}
label{display:block;margin-bottom:7px;color:#aaa;font-size:13px}
input,select,textarea{width:100%;border:1px solid #333;background:#080808;color:#fff;border-radius:8px;padding:11px 12px;font:inherit}
input,select{height:44px}
textarea{min-height:110px;resize:vertical}
table{width:100%;border-collapse:collapse}
th{text-align:left;color:#777;font-size:12px;font-weight:500;border-bottom:1px solid #282828;padding:12px 10px}
td{padding:14px 10px;border-bottom:1px solid #1e1e1e;vertical-align:middle;font-size:14px}
tr:last-child td{border-bottom:0}
.message{padding:12px 14px;border-radius:8px;margin-bottom:20px;font-size:13px}
.message.success{background:#102318;border:1px solid #245a35;color:#9ce8b3}
.message.error{background:#2a1111;border:1px solid #5a2020;color:#ffb3b3}
.pill{display:inline-block;padding:5px 9px;border-radius:999px;border:1px solid #333;color:#bbb;font-size:11px;text-transform:capitalize}
.row-actions{display:flex;gap:8px;flex-wrap:wrap}
.checkbox-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.checkbox{display:flex;align-items:center;gap:10px;border:1px solid #292929;background:#0b0b0b;padding:12px;border-radius:8px}
.checkbox input{width:auto;height:auto;margin:0}
.section-title{font-size:18px;margin:40px 0 16px}
.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px}
.login-card{width:min(430px,100%);background:#111;border:1px solid #222;border-radius:14px;padding:32px}
.login-brand{text-align:center;margin-bottom:28px}
.login-logo{font-size:46px;font-weight:800;letter-spacing:7px}
.tagline{margin-top:8px;color:#777;font-size:12px;letter-spacing:2px;text-transform:uppercase}
.empty{padding:24px 0;color:#777}
@media(max-width:900px){.grid,.stats{grid-template-columns:1fr 1fr}.layout{grid-template-columns:1fr}}
@media(max-width:640px){.grid,.stats,.checkbox-grid{grid-template-columns:1fr}.topbar{height:auto;padding:16px 18px;align-items:flex-start}.top-actions{flex-wrap:wrap;justify-content:flex-end}.page{padding:30px 18px 60px}}


.mode-badge{
    display:inline-block;
    padding:5px 9px;
    border-radius:999px;
    font-size:10px;
    font-weight:800;
    letter-spacing:1px;
    border:1px solid #444;
}

.mode-badge.admin-mode{
    background:#171717;
    color:#fff;
}

.mode-badge.user-mode{
    background:#f2c94c;
    color:#111;
    border-color:#f2c94c;
}

.mode-switch-btn{
    border:1px solid #444;
    background:#181818;
    color:#fff;
    padding:9px 12px;
    border-radius:8px;
    cursor:pointer;
    font:inherit;
    font-size:12px;
}

.mode-switch-btn:hover{
    border-color:#777;
}

.user-mode-banner{
    background:#f2c94c;
    color:#111;
    padding:12px 24px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:14px;
    flex-wrap:wrap;
    border-bottom:1px solid #a98b21;
}

.user-mode-banner strong{
    letter-spacing:1px;
}

.user-mode-banner span{
    font-size:13px;
}

.user-mode-banner form{
    margin:0;
}

.user-mode-banner button{
    border:1px solid #111;
    background:#111;
    color:#fff;
    border-radius:7px;
    padding:8px 12px;
    font-weight:700;
    cursor:pointer;
}

@media(max-width:640px){
    .user-mode-banner{
        justify-content:flex-start;
        align-items:flex-start;
        flex-direction:column;
    }
}


/* Xevano worker: Kate */
.worker-chip{
    display:inline-block;
    border:1px solid #3b3b3b;
    border-radius:999px;
    padding:7px 10px;
    color:#ddd;
    font-size:10px;
    font-weight:800;
    letter-spacing:1px;
}
.worker-card{
    border-color:#332b24;
    background:linear-gradient(145deg,#12110f,#111);
}
.worker-card:hover{
    border-color:#a66b34;
}
.worker-kicker{
    color:#d8924f;
    text-transform:uppercase;
    letter-spacing:1.8px;
    font-size:10px;
    font-weight:800;
    margin-bottom:8px;
}
.worker-hero{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:24px;
    margin-bottom:30px;
}
.worker-status-card{
    min-width:250px;
    display:flex;
    align-items:center;
    gap:12px;
    padding:14px 16px;
    background:#111;
    border:1px solid #252525;
    border-radius:12px;
}
.status-dot{
    width:11px;
    height:11px;
    border-radius:50%;
    flex:0 0 auto;
}
.status-dot.online{
    background:#59d184;
    box-shadow:0 0 0 4px rgba(89,209,132,.11);
}
.status-dot.offline{
    background:#e45d5d;
    box-shadow:0 0 0 4px rgba(228,93,93,.10);
}
.kate-grid{
    display:grid;
    grid-template-columns:minmax(0,1.05fr) minmax(390px,.95fr);
    gap:22px;
}
.worker-schedule{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    border:1px solid #292929;
    background:#0a0a0a;
    border-radius:9px;
    padding:13px 14px;
}
.worker-schedule span{
    color:#777;
    font-size:12px;
}
.worker-divider{
    height:1px;
    background:#262626;
    margin:24px 0;
}
.schedule-grid{
    display:grid;
    grid-template-columns:1.2fr .8fr .8fr;
    gap:10px;
}
.panel-heading-row,
.report-title-row,
.draft-head,
.finding-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:16px;
}
.table-scroll{
    overflow:auto;
}
.job-error{
    margin-top:6px;
    color:#f09a9a;
    font-size:12px;
    max-width:700px;
}
.kate-status-completed{
    color:#95e4ad;
    border-color:#245a35;
    background:#102318;
}
.kate-status-failed{
    color:#ffb3b3;
    border-color:#5a2020;
    background:#2a1111;
}
.kate-status-running{
    color:#f6d68d;
    border-color:#634b19;
    background:#251c0b;
}
.kate-status-queued{
    color:#b9c9ff;
    border-color:#2d406e;
    background:#10182a;
}
.report-summary p{
    line-height:1.7;
    color:#c6c6c6;
    max-width:1000px;
}
.finding-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:15px;
    margin-top:18px;
}
.finding-card{
    background:#0a0a0a;
    border:1px solid #262626;
    border-radius:11px;
    padding:18px;
}
.finding-card h3{
    margin:14px 0 7px;
    font-size:18px;
}
.finding-card h4{
    color:#aaa;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:1px;
    margin:18px 0 7px;
}
.finding-card p{
    color:#aaa;
    line-height:1.55;
    margin:0;
}
.finding-score{
    color:#d8924f;
    font-weight:800;
    font-size:12px;
}
.finding-meta{
    color:#666;
    font-size:12px;
}
.xevano-opportunity{
    margin-top:18px;
    background:#17120e;
    border:1px solid #3d2b1d;
    border-radius:8px;
    padding:12px;
}
.xevano-opportunity strong{
    color:#e4a56c;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.8px;
}
.draft-card{
    background:#090909;
    border:1px solid #272727;
    border-radius:11px;
    padding:18px;
    margin-top:14px;
}
.draft-card h3{
    margin:18px 0 10px;
}
.draft-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}
.draft-body,
.raw-report pre{
    white-space:pre-wrap;
    word-wrap:break-word;
    font:14px/1.6 Arial,Helvetica,sans-serif;
    color:#c3c3c3;
    margin:0;
}
.source-list{
    display:grid;
    gap:9px;
}
.source-list a{
    display:block;
    text-decoration:none;
    border:1px solid #252525;
    background:#090909;
    border-radius:9px;
    padding:12px 14px;
}
.source-list a:hover{
    border-color:#555;
}
.source-list strong{
    display:block;
    font-size:13px;
}
.source-list span{
    display:block;
    margin-top:5px;
    color:#666;
    font-size:11px;
    word-break:break-all;
}
.raw-report summary{
    cursor:pointer;
    font-weight:700;
}
.raw-report pre{
    margin-top:18px;
}
@media(max-width:900px){
    .kate-grid,
    .finding-grid{
        grid-template-columns:1fr;
    }
}
@media(max-width:640px){
    .worker-hero,
    .panel-heading-row,
    .report-title-row,
    .draft-head{
        flex-direction:column;
        align-items:stretch;
    }
    .worker-status-card{
        min-width:0;
    }
    .schedule-grid{
        grid-template-columns:1fr;
    }
}


/* Kate V1.4.3 personality / learning / rewrite */
.kate-byline{
    margin:-2px 0 17px;
    color:#d8924f;
    font-size:12px;
    font-weight:700;
}
.kate-approve{
    border-color:#2b6940!important;
    color:#a9ebbc!important;
}
.kate-delete{
    border-color:#663333!important;
    color:#f0a5a5!important;
}
.kate-rewrite-box{
    margin-top:22px;
    padding-top:18px;
    border-top:1px solid #292929;
}
.kate-rewrite-box label{
    display:block;
    margin-bottom:8px;
    color:#ddd;
    font-weight:700;
    font-size:13px;
}
.kate-rewrite-box textarea{
    width:100%;
    min-height:100px;
    resize:vertical;
    border:1px solid #323232;
    border-radius:9px;
    background:#050505;
    color:#eee;
    padding:12px 13px;
}
.kate-rewrite-box textarea:focus{
    outline:none;
    border-color:#a66b34;
}
.kate-rewrite-actions{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin-top:10px;
}


/* Kate V1.4.4: overflow safety */
.page,
.panel,
.card,
.draft-card,
.finding-card,
.kate-grid,
.finding-grid,
.worker-hero,
.worker-status-card,
.kate-image-builder,
.kate-photo-card,
.kate-photo-top-grid {
    min-width:0;
    max-width:100%;
}
.draft-body,
.raw-report pre,
.finding-card p,
.source-list a,
.source-list strong,
.source-list span,
.message,
.field,
.field input,
.field textarea,
.field select,
.path-code,
td,
th {
    max-width:100%;
    overflow-wrap:anywhere;
    word-break:break-word;
}
.draft-body,
.raw-report pre {
    white-space:pre-wrap;
    overflow-x:auto;
}
.field input,
.field textarea,
.field select {
    width:100%;
    box-sizing:border-box;
}
.table-scroll {
    max-width:100%;
    overflow-x:auto;
}

/* Kate quick links */
.kate-quick-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin:-12px 0 26px;
}

/* Kate photo library */
.kate-photo-top-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:22px;
}
.path-code{
    display:block;
    background:#060606;
    border:1px solid #2b2b2b;
    border-radius:8px;
    padding:12px 13px;
    margin:12px 0;
    color:#e2aa73;
    white-space:pre-wrap;
}
.kate-photo-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
    margin-top:18px;
}
.kate-photo-card{
    background:#090909;
    border:1px solid #292929;
    border-radius:12px;
    overflow:hidden;
}
.kate-photo-frame{
    aspect-ratio:4/3;
    background:#030303;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}
.kate-photo-frame img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}
.kate-photo-meta{
    padding:12px 13px;
}
.kate-photo-meta strong,
.kate-photo-meta span{
    display:block;
    overflow-wrap:anywhere;
}
.kate-photo-meta span{
    margin-top:5px;
    color:#777;
    font-size:11px;
}
.kate-photo-card .draft-actions{
    padding:0 13px 13px;
}
.kate-photo-favorite{
    color:#f0bd6c!important;
    border-color:#5d4720!important;
}

/* Kate article image generator */
.kate-image-builder{
    margin-top:24px;
    padding:18px;
    background:#0b0b0b;
    border:1px solid #30291f;
    border-radius:11px;
}
.kate-image-builder-head{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-start;
}
.kate-image-builder h4{
    margin:0 0 4px;
    font-size:17px;
}
.kate-generated-image{
    margin:16px 0;
    border:1px solid #292929;
    border-radius:10px;
    overflow:hidden;
    background:#050505;
}
.kate-generated-image img{
    display:block;
    width:100%;
    height:auto;
    max-height:650px;
    object-fit:contain;
    background:#050505;
}
.kate-image-info{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:10px 12px;
}
.kate-image-info span{
    color:#777;
    font-size:11px;
}
.kate-image-form{
    margin-top:17px;
    padding-top:17px;
    border-top:1px solid #282828;
}
.kate-image-form textarea{
    min-height:90px;
}
.kate-use-kate{
    margin:10px 0 15px;
}
.kate-image-status{
    margin:14px 0;
}

@media(max-width:900px){
    .kate-photo-top-grid,
    .kate-photo-grid{
        grid-template-columns:1fr 1fr;
    }
}
@media(max-width:620px){
    .kate-photo-top-grid,
    .kate-photo-grid{
        grid-template-columns:1fr;
    }
    .kate-image-info,
    .kate-image-builder-head{
        flex-direction:column;
        align-items:stretch;
    }
}


/* Kate V1.4.5 — Approved Articles */
.kate-library-actions,
.kate-article-head-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.kate-article-stats{
    grid-template-columns:repeat(4,minmax(0,1fr));
}
.kate-approved-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:20px;
}
.kate-approved-card{
    min-width:0;
    overflow:hidden;
    background:#101010;
    border:1px solid #262626;
    border-radius:13px;
}
.kate-approved-card:hover{
    border-color:#4a3828;
}
.kate-approved-image{
    display:block;
    aspect-ratio:3/2;
    overflow:hidden;
    background:#050505;
    text-decoration:none;
}
.kate-approved-image img{
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
}
.kate-approved-image-empty{
    display:grid;
    place-items:center;
    padding:24px;
    color:#6f6f6f;
    background:
        linear-gradient(135deg,#0c0c0c,#17120e);
    text-align:center;
    font-size:13px;
}
.kate-approved-card-body{
    min-width:0;
    padding:18px;
}
.kate-approved-meta-row{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}
.kate-approved-card h2{
    margin:13px 0 7px;
    font-size:21px;
    line-height:1.18;
    overflow-wrap:anywhere;
}
.kate-approved-card h2 a{
    text-decoration:none;
}
.kate-approved-card p{
    color:#9a9a9a;
    line-height:1.55;
    overflow-wrap:anywhere;
}
.kate-approved-footer{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin-top:18px;
}
.kate-approved-footer .muted{
    min-width:0;
    overflow-wrap:anywhere;
}
.kate-article-page-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    margin-bottom:28px;
}
.kate-article-page-head > div:first-child{
    min-width:0;
}
.kate-article-page-head h1{
    overflow-wrap:anywhere;
}
.kate-article-workspace{
    display:grid;
    grid-template-columns:minmax(0,1.55fr) minmax(320px,.7fr);
    gap:22px;
    align-items:start;
}
.kate-article-main,
.kate-article-sidebar{
    display:grid;
    gap:20px;
    min-width:0;
}
.kate-article-hero-panel{
    padding:0;
    overflow:hidden;
}
.kate-article-hero-image{
    display:block;
    width:100%;
    height:auto;
    max-height:700px;
    object-fit:contain;
    background:#050505;
}
.kate-article-copy{
    min-width:0;
}
.kate-article-copy .draft-body{
    font-size:15px;
    line-height:1.7;
}
.kate-rewrite-panel textarea{
    min-height:120px;
}
.kate-image-control-panel{
    position:sticky;
    top:20px;
}
.kate-article-detail-list{
    display:grid;
    gap:0;
}
.kate-article-detail-list > div{
    display:flex;
    justify-content:space-between;
    gap:14px;
    padding:11px 0;
    border-bottom:1px solid #242424;
}
.kate-article-detail-list > div:last-child{
    border-bottom:0;
}
.kate-article-detail-list span{
    color:#777;
    font-size:12px;
}
.kate-article-detail-list strong{
    max-width:65%;
    text-align:right;
    overflow-wrap:anywhere;
    font-size:12px;
}
.inline-approve-form{
    margin-top:12px;
}
.kate-revision-history summary{
    cursor:pointer;
    font-weight:700;
}
.kate-revision-history article{
    margin-top:16px;
    padding-top:16px;
    border-top:1px solid #282828;
}
.kate-revision-history article:first-of-type{
    margin-top:18px;
}
.kate-revision-history pre{
    margin:12px 0 0;
    max-height:320px;
    overflow:auto;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
    color:#999;
    font:12px/1.55 Arial,Helvetica,sans-serif;
}
.kate-danger-zone{
    border-color:#3d2222;
}
@media(max-width:1000px){
    .kate-approved-grid{
        grid-template-columns:1fr;
    }
    .kate-article-workspace{
        grid-template-columns:1fr;
    }
    .kate-image-control-panel{
        position:static;
    }
    .kate-article-stats{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}
@media(max-width:640px){
    .kate-article-page-head,
    .kate-approved-footer{
        flex-direction:column;
        align-items:stretch;
    }
    .kate-article-stats{
        grid-template-columns:1fr;
    }
}
