:root{
    --bg:#f8fafc;
    --surface:#ffffff;
    --surface-soft:#f1f5f9;
    --text:#0f172a;
    --muted:#64748b;
    --line:#e2e8f0;
    --primary:#4f46e5;
    --primary2:#6366f1;
    --green:#16a34a;
    --blue:#2563eb;
    --purple:#7c3aed;
    --orange:#f97316;
    --red:#dc2626;
    --radius:16px;
    --shadow:0 1px 2px rgba(15,23,42,.04),0 18px 45px rgba(15,23,42,.07);
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
    margin:0;
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
    background:var(--bg);
    color:var(--text);
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
}

a{color:inherit;text-decoration:none}

button,input,textarea,select{font:inherit}

.app-shell{
    min-height:100vh;
    display:flex;
    flex-direction:column;
}

.topbar{
    position:sticky;
    top:0;
    z-index:50;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:14px clamp(14px,5vw,64px);
    background:rgba(255,255,255,.92);
    backdrop-filter:blur(18px);
    border-bottom:1px solid var(--line);
}

.brand{
    display:flex;
    align-items:center;
    gap:12px;
}

.brand-logo{
    width:46px;
    height:46px;
    border-radius:16px;
    display:grid;
    place-items:center;
    color:#fff;
    font-weight:950;
    background:linear-gradient(135deg,var(--primary),var(--blue));
    box-shadow:0 10px 24px rgba(79,70,229,.22);
}

.brand-text strong{
    display:block;
    font-size:17px;
}

.brand-text small{
    display:block;
    color:var(--muted);
    font-size:13px;
    margin-top:2px;
}

.main-nav{
    display:flex;
    align-items:center;
    gap:8px;
}

.main-nav a{
    padding:10px 14px;
    border-radius:999px;
    color:#475569;
    font-weight:800;
}

.main-nav a:hover,
.nav-strong{
    background:#fff;
    border:1px solid var(--line);
}

.nav-admin{
    color:var(--primary)!important;
    background:#eef2ff;
}

.wallet-pill{
    background:#ecfdf3!important;
    color:#047857!important;
    border:1px solid #bbf7d0;
}

.mobile-menu-btn{
    display:none;
    border:1px solid var(--line);
    background:#fff;
    border-radius:14px;
    padding:10px 13px;
    font-weight:900;
}

.page{
    width:min(1180px,calc(100% - 28px));
    margin:0 auto;
    flex:1;
    padding:28px 0 72px;
}

.btn{
    border:0;
    min-height:48px;
    border-radius:14px;
    padding:13px 18px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    font-weight:850;
    cursor:pointer;
    transition:.16s ease;
    text-align:center;
}

.btn:hover{
    transform:translateY(-1px);
}

.btn-primary{
    color:#fff;
    background:var(--primary);
    box-shadow:0 10px 24px rgba(79,70,229,.20);
}

.btn-soft,
.btn-small{
    background:#fff;
    border:1px solid var(--line);
    color:#172033;
}

.btn-small{
    min-height:auto;
    padding:9px 13px;
    border-radius:12px;
}

.bc-dashboard{
    display:grid;
    grid-template-columns:280px minmax(0,1fr);
    gap:24px;
    align-items:start;
}

.bc-side{
    position:sticky;
    top:92px;
    display:grid;
    gap:16px;
}

.bc-side-brand{
    display:flex;
    align-items:center;
    gap:12px;
    padding:18px;
    border-radius:var(--radius);
    background:#fff;
    border:1px solid var(--line);
    box-shadow:var(--shadow);
}

.bc-side-logo{
    width:42px;
    height:42px;
    border-radius:14px;
    display:grid;
    place-items:center;
    color:#fff;
    font-weight:950;
    background:var(--primary);
}

.bc-side-brand strong{
    display:block;
    font-size:16px;
}

.bc-side-brand small{
    display:block;
    color:var(--muted);
    margin-top:2px;
}

.bc-side-card{
    padding:18px;
    border-radius:var(--radius);
    background:#fff;
    border:1px solid var(--line);
    box-shadow:var(--shadow);
}

.bc-side-card h3{
    margin:8px 0;
    font-size:28px;
    letter-spacing:-.04em;
}

.bc-side-card p{
    margin:8px 0 0;
    color:var(--muted);
    line-height:1.55;
    font-size:14px;
}

.bc-label,
.bc-kicker{
    display:inline-flex;
    color:var(--primary);
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.11em;
    font-size:12px;
}

.bc-status-line{
    display:flex;
    align-items:center;
    gap:9px;
    margin-top:10px;
}

.bc-dot{
    width:10px;
    height:10px;
    border-radius:999px;
    display:inline-block;
}

.bc-dot-green{background:var(--green)}
.bc-dot-blue{background:var(--blue)}
.bc-dot-purple{background:var(--purple)}
.bc-dot-orange{background:var(--orange)}
.bc-dot-gray{background:#94a3b8}

.bc-side-nav{
    display:grid;
    gap:8px;
    padding:8px;
    border-radius:var(--radius);
    background:#fff;
    border:1px solid var(--line);
    box-shadow:var(--shadow);
}

.bc-side-nav a{
    padding:12px 14px;
    border-radius:12px;
    color:#475569;
    font-weight:800;
}

.bc-side-nav a.active,
.bc-side-nav a:hover{
    background:#eef2ff;
    color:var(--primary);
}

.bc-main{
    display:grid;
    gap:24px;
}

.bc-hero{
    display:grid;
    grid-template-columns:1.15fr .85fr;
    gap:24px;
    align-items:stretch;
}

.bc-hero > div:first-child,
.bc-hero-card,
.bc-card,
.bc-pricing article{
    background:#fff;
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

.bc-hero > div:first-child{
    padding:34px;
}

.bc-hero h1{
    margin:14px 0 18px;
    max-width:760px;
    font-size:clamp(40px,5.7vw,72px);
    line-height:.98;
    letter-spacing:-.06em;
    font-weight:900;
}

.bc-hero p{
    max-width:720px;
    margin:0;
    color:#475569;
    font-size:18px;
    line-height:1.75;
}

.bc-actions{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:26px;
}

.bc-hero-card{
    padding:28px;
    display:grid;
    align-content:space-between;
    gap:20px;
}

.bc-result-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.bc-result-head strong{
    font-size:18px;
}

.bc-hero-card p{
    color:var(--muted);
    line-height:1.65;
    margin:0;
}

.bc-badge{
    display:inline-flex;
    align-items:center;
    border-radius:999px;
    padding:7px 10px;
    font-size:12px;
    font-weight:900;
}

.bc-badge-green{
    background:#ecfdf3;
    color:#047857;
}

.bc-badge-blue{
    background:#eff6ff;
    color:#1d4ed8;
}

.bc-badge-purple{
    background:#f3e8ff;
    color:#6d28d9;
}

.bc-mini-prices{
    display:grid;
    gap:10px;
}

.bc-mini-prices div{
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:14px;
    border-radius:14px;
    background:var(--surface-soft);
    border:1px solid var(--line);
}

.bc-mini-prices span{
    color:var(--muted);
    font-weight:750;
}

.bc-mini-prices strong{
    color:var(--text);
}

.bc-card{
    padding:30px;
}

.bc-card-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    margin-bottom:22px;
}

.bc-card h2,
.bc-card-head h2{
    margin:8px 0;
    font-size:34px;
    line-height:1.05;
    letter-spacing:-.04em;
}

.bc-card p,
.bc-card-head p{
    color:var(--muted);
    line-height:1.65;
    margin:0;
}

.bc-quota{
    min-width:130px;
    padding:16px;
    text-align:center;
    border-radius:14px;
    background:#f8fafc;
    border:1px solid var(--line);
}

.bc-quota span{
    display:block;
    color:var(--muted);
    font-weight:800;
    font-size:13px;
}

.bc-quota strong{
    display:block;
    margin-top:5px;
    font-size:24px;
    letter-spacing:-.03em;
}

.bc-tags{
    display:flex;
    flex-wrap:wrap;
    gap:9px;
    margin-bottom:22px;
}

.bc-tags span{
    padding:8px 11px;
    border-radius:999px;
    background:#f8fafc;
    border:1px solid var(--line);
    color:#475569;
    font-size:13px;
    font-weight:800;
}

.bc-upload{
    display:grid;
    gap:18px;
}

.bc-dropzone{
    position:relative;
    min-height:220px;
    display:grid;
    place-items:center;
    gap:9px;
    text-align:center;
    padding:32px;
    border:2px dashed #c7d2fe;
    border-radius:16px;
    background:linear-gradient(180deg,#ffffff,#f8fafc);
    cursor:pointer;
    transition:.16s ease;
}

.bc-dropzone:hover,
.bc-dropzone.has-file{
    border-color:var(--primary);
    box-shadow:0 12px 30px rgba(79,70,229,.10);
}

.bc-dropzone input{
    position:absolute;
    inset:0;
    opacity:0;
    cursor:pointer;
}

.bc-upload-icon{
    width:64px;
    height:64px;
    display:grid;
    place-items:center;
    border-radius:16px;
    background:var(--primary);
    color:#fff;
    font-size:32px;
    font-weight:900;
}

.bc-dropzone strong{
    font-size:18px;
}

.bc-dropzone small{
    color:var(--muted);
}

.bc-field{
    display:grid;
    gap:9px;
}

.bc-field span{
    font-weight:850;
}

.bc-field textarea,
.field input,
.field textarea,
.letter-textarea,
select{
    width:100%;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
    padding:15px 16px;
    outline:none;
    color:var(--text);
}

.bc-field textarea:focus,
.field input:focus,
.field textarea:focus,
.letter-textarea:focus,
select:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 4px rgba(79,70,229,.10);
}

.bc-form-actions,
.form-actions{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:4px;
}

.bc-warning{
    padding:22px;
    border-radius:16px;
    background:#fffbeb;
    border:1px solid #fde68a;
}

.bc-warning h3{
    margin:0 0 8px;
}

.bc-pricing{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:18px;
}

.bc-pricing article{
    padding:26px;
}

.bc-pricing article.featured{
    border-color:#c7d2fe;
    outline:3px solid rgba(79,70,229,.08);
}

.bc-pricing h3{
    margin:14px 0 8px;
    font-size:26px;
    letter-spacing:-.03em;
}

.bc-pricing p{
    color:var(--muted);
    line-height:1.55;
    min-height:48px;
}

.bc-pricing strong{
    display:block;
    margin-top:16px;
    font-size:32px;
    letter-spacing:-.04em;
}

.analysis-loader{
    margin-top:20px;
    display:grid;
    grid-template-columns:auto 1fr;
    gap:16px;
    align-items:center;
    background:#eef2ff;
    border:1px solid #c7d2fe;
    border-radius:16px;
    padding:18px;
}

.loader-ring{
    width:44px;
    height:44px;
    border-radius:50%;
    border:5px solid #c7d2fe;
    border-top-color:var(--primary);
    animation:spin 1s linear infinite;
}

.loader-content p{
    margin:4px 0 12px;
    color:var(--muted);
}

.progressbar{
    height:10px;
    background:#c7d2fe;
    border-radius:999px;
    overflow:hidden;
}

.progressbar span{
    display:block;
    height:100%;
    width:8%;
    background:var(--primary);
    border-radius:999px;
    transition:.35s ease;
}

@keyframes spin{to{transform:rotate(360deg)}}

.notice{
    padding:14px 16px;
    border-radius:14px;
    margin-bottom:16px;
    font-weight:850;
}

.notice-error{
    background:#fef2f2;
    color:#991b1b;
    border:1px solid #fecaca;
}

.notice-success{
    background:#ecfdf3;
    color:#047857;
    border:1px solid #bbf7d0;
}

.notice-info{
    background:#eff6ff;
    color:#1d4ed8;
    border:1px solid #bfdbfe;
}

.auth-card,
.content-card,
.compose-card,
.ad-card{
    max-width:780px;
    margin:42px auto;
    padding:32px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

.auth-card h1,
.content-card h1,
.compose-card h1,
.ad-card h1{
    font-size:clamp(36px,5vw,58px);
    letter-spacing:-.06em;
    line-height:1;
    margin:12px 0;
}

.auth-card p,
.content-card p,
.compose-card p,
.ad-card p{
    color:var(--muted);
    line-height:1.55;
}

.dashboard-hero,
.wallet-hero{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    margin:34px 0 20px;
    padding:28px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

.dashboard-hero h1,
.wallet-hero h1{
    font-size:clamp(40px,5.5vw,68px);
    line-height:.95;
    letter-spacing:-.07em;
    margin:12px 0;
}

.dashboard-hero p,
.wallet-hero p{
    color:var(--muted);
    margin:0;
}

.stats-grid,
.admin-grid,
.wallet-actions{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:16px;
    margin-bottom:22px;
}

.stats-grid article,
.admin-tile,
.wallet-action,
.archive-item,
.table-card,
.empty-state{
    background:#fff;
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

.stats-grid article,
.admin-tile,
.wallet-action{
    padding:22px;
}

.stats-grid span,
.admin-tile span,
.wallet-action span{
    display:block;
    color:var(--muted);
    font-weight:850;
}

.stats-grid strong,
.admin-tile strong,
.wallet-action strong{
    display:block;
    font-size:30px;
    margin-top:8px;
}

.archive-list{
    display:grid;
    gap:13px;
}

.archive-item{
    display:grid;
    grid-template-columns:auto 1fr auto;
    gap:14px;
    align-items:center;
    padding:18px 20px;
}

.archive-item strong{
    display:block;
    font-size:17px;
}

.archive-item small{
    display:block;
    color:var(--muted);
    margin-top:4px;
}

.status-dot{
    width:15px;
    height:15px;
    border-radius:50%;
    background:var(--primary);
}

.status-warning{background:#f59e0b}
.status-success{background:var(--green)}
.status-info{background:var(--primary)}

.chevron{
    font-size:28px;
    color:var(--muted);
}

.empty-state{
    text-align:center;
    padding:36px;
}

.document-layout{
    display:grid;
    grid-template-columns:390px 1fr;
    gap:20px;
    align-items:start;
    margin-top:28px;
}

.recommend-card,
.analysis-card{
    background:#fff;
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

.recommend-card{
    padding:28px;
    position:sticky;
    top:92px;
}

.recommend-card h1{
    font-size:36px;
    line-height:1.02;
    letter-spacing:-.05em;
    margin:12px 0;
}

.recommend-card p{
    color:#344054;
    line-height:1.6;
}

.recommend-badge{
    display:inline-flex;
    border-radius:999px;
    padding:8px 12px;
    background:#eef2ff;
    color:var(--primary);
    font-weight:950;
    font-size:13px;
}

.recommend-warning{border-top:8px solid #f59e0b}
.recommend-info{border-top:8px solid var(--primary)}
.recommend-success{border-top:8px solid var(--green)}

.reason-list{
    display:grid;
    gap:10px;
    margin:18px 0;
}

.reason-list div{
    background:var(--surface-soft);
    border:1px solid var(--line);
    border-radius:14px;
    padding:12px;
    color:#344054;
    font-weight:750;
    line-height:1.45;
}

.deadline-pill{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
    border-radius:14px;
    background:#fffbeb;
    border:1px solid #fde68a;
    padding:14px 16px;
    margin:18px 0;
}

.decision-box{
    display:grid;
    gap:12px;
    margin-top:18px;
}

.analysis-card{
    overflow:hidden;
}

.analysis-head{
    padding:22px 24px;
    border-bottom:1px solid var(--line);
}

.analysis-head h2{
    font-size:28px;
    letter-spacing:-.03em;
    margin:6px 0;
}

.analysis-head p{
    color:var(--muted);
    margin:0;
}

.analysis-card pre{
    margin:0;
    padding:24px;
    background:#fff;
    white-space:pre-wrap;
    word-wrap:break-word;
    line-height:1.72;
    font-size:15px;
    font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
}

.letter-textarea{
    font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
    line-height:1.7;
    margin-top:18px;
}

.table-card{
    padding:24px;
    margin-top:28px;
}

.table-head{
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:center;
    margin-bottom:18px;
}

.table-head h1,
.table-head h2{
    font-size:38px;
    letter-spacing:-.05em;
    margin:0;
}

.table-head p{
    color:var(--muted);
    margin:6px 0 0;
}

.table-wrap{
    overflow:auto;
    border:1px solid var(--line);
    border-radius:14px;
}

table{
    width:100%;
    border-collapse:collapse;
    background:#fff;
}

th,td{
    padding:14px;
    border-bottom:1px solid var(--line);
    text-align:left;
    vertical-align:middle;
}

th{
    background:#f8fafc;
    color:#475569;
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:.06em;
}

td small{
    display:block;
    color:var(--muted);
    margin-top:4px;
}

.amount-plus{
    color:var(--green);
    font-weight:900;
}

.amount-minus{
    color:var(--red);
    font-weight:900;
}

.footer{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:center;
    padding:24px clamp(14px,5vw,64px);
    border-top:1px solid var(--line);
    color:var(--muted);
    background:#f8fafc;
}

.footer strong{
    color:var(--text);
    margin-right:8px;
}

.footer nav{
    display:flex;
    gap:16px;
}

.footer a{
    text-decoration:underline;
}

@media(max-width:1040px){
    .bc-dashboard{
        grid-template-columns:1fr;
    }

    .bc-side{
        position:static;
        grid-template-columns:1fr 1fr;
    }

    .bc-side-brand,
    .bc-side-nav{
        grid-column:1 / -1;
    }

    .bc-side-nav{
        display:flex;
        flex-wrap:wrap;
    }

    .bc-hero{
        grid-template-columns:1fr;
    }
}

@media(max-width:960px){
    .mobile-menu-btn{
        display:block;
    }

    .main-nav{
        display:none;
        position:absolute;
        top:76px;
        left:14px;
        right:14px;
        flex-direction:column;
        align-items:stretch;
        background:#fff;
        border:1px solid var(--line);
        border-radius:16px;
        padding:12px;
        box-shadow:var(--shadow);
    }

    .main-nav.open{
        display:flex;
    }

    .main-nav a{
        display:block;
        text-align:left;
    }

    .bc-pricing,
    .stats-grid,
    .admin-grid,
    .wallet-actions{
        grid-template-columns:1fr;
    }

    .document-layout{
        grid-template-columns:1fr;
    }

    .recommend-card{
        position:static;
    }

    .dashboard-hero,
    .wallet-hero,
    .table-head,
    .bc-card-head{
        flex-direction:column;
    }

    .bc-quota{
        width:100%;
    }
}

@media(max-width:640px){
    .page{
        width:min(100% - 18px,1180px);
        padding:18px 0 52px;
    }

    .topbar{
        padding:12px 14px;
    }

    .brand-logo{
        width:40px;
        height:40px;
        border-radius:14px;
        font-size:14px;
    }

    .brand-text strong{
        font-size:15px;
    }

    .brand-text small{
        display:none;
    }

    .bc-side{
        grid-template-columns:1fr;
    }

    .bc-side-nav{
        overflow:auto;
        flex-wrap:nowrap;
    }

    .bc-side-nav a{
        white-space:nowrap;
    }

    .bc-hero > div:first-child,
    .bc-hero-card,
    .bc-card{
        padding:20px;
    }

    .bc-hero h1{
        font-size:42px;
        line-height:1;
    }

    .bc-hero p{
        font-size:16px;
    }

    .bc-actions,
    .bc-form-actions,
    .form-actions{
        display:grid;
        grid-template-columns:1fr;
    }

    .btn{
        width:100%;
        min-height:52px;
    }

    .bc-dropzone{
        min-height:170px;
        padding:20px;
    }

    .bc-upload-icon{
        width:54px;
        height:54px;
        font-size:26px;
    }

    .bc-pricing article{
        padding:20px;
    }

    .analysis-loader{
        grid-template-columns:1fr;
        text-align:center;
    }

    .loader-ring{
        margin:auto;
    }

    .analysis-card pre{
        padding:16px;
        font-size:14px;
    }

    .footer{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }
}

@media print{
    body{
        background:#fff;
    }

    .topbar,
    .footer,
    .bc-side,
    .decision-box,
    .btn,
    .form-actions{
        display:none!important;
    }

    .page{
        width:100%;
        padding:0;
    }

    .bc-dashboard,
    .document-layout{
        display:block;
    }

    .recommend-card,
    .analysis-card,
    .compose-card{
        box-shadow:none;
        border:0;
        position:static;
    }
}

/* Legal Pages + Modern Footer */
.legal-wrap{
    padding:38px 0 70px;
}

.legal-panel{
    max-width:980px;
    margin:0 auto;
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:24px;
    box-shadow:0 1px 2px rgba(15,23,42,.04),0 18px 45px rgba(15,23,42,.07);
    padding:38px;
}

.legal-badge{
    display:inline-flex;
    padding:8px 12px;
    border-radius:999px;
    background:#eef2ff;
    color:#4f46e5;
    font-size:12px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.11em;
    margin-bottom:18px;
}

.legal-panel h1{
    margin:0 0 28px;
    font-size:clamp(2.4rem,5vw,4.2rem);
    line-height:1;
    letter-spacing:-.06em;
    color:#0f172a;
}

.legal-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    margin-bottom:22px;
}

.legal-box,
.legal-section{
    border:1px solid #e2e8f0;
    border-radius:18px;
    background:#f8fafc;
    padding:22px;
    margin-bottom:18px;
}

.legal-box h2,
.legal-section h2{
    margin:0 0 12px;
    font-size:1.25rem;
    letter-spacing:-.03em;
    color:#0f172a;
}

.legal-box p,
.legal-section p{
    margin:0 0 12px;
    color:#475569;
    line-height:1.7;
}

.legal-section p:last-child,
.legal-box p:last-child{
    margin-bottom:0;
}

.legal-panel a{
    color:#4f46e5;
    font-weight:800;
    text-decoration:underline;
    text-underline-offset:3px;
}

.site-footer{
    margin-top:auto;
    background:#fff;
    border-top:1px solid #e2e8f0;
}

.footer-inner{
    max-width:1180px;
    margin:0 auto;
    padding:28px 18px;
    display:flex;
    justify-content:space-between;
    gap:24px;
    align-items:center;
}

.footer-brand{
    display:flex;
    align-items:center;
    gap:14px;
}

.footer-logo{
    width:44px;
    height:44px;
    border-radius:14px;
    display:grid;
    place-items:center;
    background:#4f46e5;
    color:#fff;
    font-weight:950;
    box-shadow:0 10px 24px rgba(79,70,229,.18);
}

.footer-brand strong{
    display:block;
    color:#0f172a;
    font-size:1rem;
}

.footer-brand p{
    margin:4px 0 0;
    color:#64748b;
    line-height:1.45;
}

.footer-links{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    justify-content:flex-end;
}

.footer-links a{
    padding:10px 13px;
    border-radius:999px;
    background:#f8fafc;
    border:1px solid #e2e8f0;
    color:#475569;
    font-weight:800;
    text-decoration:none;
}

.footer-links a:hover{
    background:#eef2ff;
    color:#4f46e5;
}

.footer-bottom{
    max-width:1180px;
    margin:0 auto;
    padding:14px 18px 24px;
    display:flex;
    justify-content:space-between;
    gap:14px;
    color:#64748b;
    font-size:.92rem;
    border-top:1px solid #f1f5f9;
}

@media(max-width:760px){
    .legal-wrap{
        padding:22px 0 46px;
    }

    .legal-panel{
        padding:20px;
        border-radius:20px;
    }

    .legal-grid{
        grid-template-columns:1fr;
    }

    .legal-box,
    .legal-section{
        padding:18px;
        border-radius:16px;
    }

    .footer-inner{
        align-items:flex-start;
        flex-direction:column;
    }

    .footer-links{
        justify-content:flex-start;
    }

    .footer-links a{
        width:100%;
        text-align:center;
    }

    .footer-bottom{
        flex-direction:column;
    }
}

/* Dokument-Chat */
.document-main-stack{
    display:grid;
    gap:20px;
}

.ai-chat-card{
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:16px;
    box-shadow:0 1px 2px rgba(15,23,42,.04),0 18px 45px rgba(15,23,42,.07);
    overflow:hidden;
}

.ai-chat-head{
    padding:24px;
    border-bottom:1px solid #e2e8f0;
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:flex-start;
}

.ai-chat-head h2{
    margin:8px 0;
    font-size:30px;
    line-height:1.1;
    letter-spacing:-.04em;
    color:#0f172a;
}

.ai-chat-head p{
    margin:0;
    color:#64748b;
    line-height:1.6;
}

.ai-chat-badge{
    white-space:nowrap;
    padding:8px 12px;
    border-radius:999px;
    background:#eef2ff;
    color:#4f46e5;
    font-weight:900;
    font-size:13px;
}

.ai-chat-messages{
    display:grid;
    gap:14px;
    padding:24px;
    background:#f8fafc;
}

.ai-chat-empty{
    padding:20px;
    border-radius:16px;
    background:#fff;
    border:1px dashed #cbd5e1;
    color:#475569;
}

.ai-chat-empty strong{
    display:block;
    color:#0f172a;
    margin-bottom:8px;
}

.ai-chat-empty p{
    margin:0;
    line-height:1.6;
}

.chat-bubble{
    max-width:88%;
    padding:16px;
    border-radius:16px;
    border:1px solid #e2e8f0;
    background:#fff;
}

.chat-user{
    justify-self:end;
    background:#eef2ff;
    border-color:#c7d2fe;
}

.chat-assistant{
    justify-self:start;
    background:#fff;
}

.chat-meta{
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-bottom:8px;
    font-size:13px;
}

.chat-meta strong{
    color:#0f172a;
}

.chat-meta span{
    color:#64748b;
}

.chat-text{
    color:#334155;
    line-height:1.7;
}

.ai-chat-form{
    padding:24px;
    display:grid;
    gap:14px;
    border-top:1px solid #e2e8f0;
}

.ai-chat-form label{
    display:grid;
    gap:8px;
}

.ai-chat-form label span{
    font-weight:900;
    color:#0f172a;
}

.ai-chat-form textarea{
    width:100%;
    border:1px solid #e2e8f0;
    border-radius:14px;
    padding:15px 16px;
    resize:vertical;
    min-height:120px;
    outline:none;
    font:inherit;
}

.ai-chat-form textarea:focus{
    border-color:#4f46e5;
    box-shadow:0 0 0 4px rgba(79,70,229,.10);
}

.ai-chat-actions{
    display:flex;
    justify-content:flex-end;
}

@media(max-width:760px){
    .ai-chat-head{
        flex-direction:column;
    }

    .ai-chat-badge{
        white-space:normal;
    }

    .chat-bubble{
        max-width:100%;
    }

    .ai-chat-actions .btn{
        width:100%;
    }
}
