/* ============================================================
   Morvixa — Components
   ============================================================ */

/* ---------- Page header ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.ph-title { font-size: 22px; font-weight: 800; }
.ph-desc { color: var(--muted); font-size: 14px; margin-top: 4px; }
@media (max-width: 560px) {
    .ph { align-items: flex-start; gap: 10px; margin-bottom: 16px; }
    .ph > div { min-width: 0; }
    .ph-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .ph-desc { font-size: 12px; }
    .ph .btn { padding: 9px 12px; font-size: 13px; }
}

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; }
.label { display:block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.input, .select, .textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 13px 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
/* Custom select: reset native chrome + draw our own arrow */
.select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-inline-end: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23898f9c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    color: var(--text);
}
[dir="rtl"] .select { background-position: left 14px center; }
[dir="ltr"] .select { background-position: right 14px center; }
.select:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
.select option {
    background: #1c1f27;
    color: var(--text);
}
.textarea { resize: vertical; min-height: 84px; }
.input-prefix { position: relative; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Kill white autofill background on panel inputs */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.select:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
    caret-color: var(--text);
    transition: background-color 5000s ease-in-out 0s;
}

/* ---------- Segmented control ---------- */
.segment { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.segment button {
    border: none; background: transparent; color: var(--text-dim);
    font-family: inherit; font-size: 13px; font-weight: 600;
    padding: 8px 16px; border-radius: 9px; cursor: pointer;
    transition: background .2s, color .2s;
}
.segment button.active { background: var(--accent-grad); color: var(--on-accent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
table.tbl th, table.tbl td { padding: 14px 16px; text-align: start; font-size: 14px; }
table.tbl thead th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface); }
table.tbl tbody tr { border-top: 1px solid var(--border); transition: background .15s; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl td.num { font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */
.badge { display:inline-flex; align-items:center; gap:6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: rgba(251,191,36,.12); color: var(--warning); }
.badge-muted   { background: var(--surface-2); color: var(--text-dim); }
.badge-info    { background: rgba(56,189,248,.12); color: #38bdf8; }

/* ---------- Progress bar ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i {
    display: block; height: 100%; border-radius: 999px;
    background: var(--accent-grad);
    width: 0; transition: width .9s cubic-bezier(.22,.61,.36,1);
}
.progress.warn > i { background: linear-gradient(90deg,#fbbf24,#f59e0b); }
.progress.danger > i { background: linear-gradient(90deg,#f87171,#ef4444); }

/* ---------- Icon button variants ---------- */
.iconbtn {
    width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text-dim);
    display: grid; place-items: center; cursor: pointer;
    transition: background .2s, color .2s, transform .15s;
}
.iconbtn:hover { background: var(--surface-3); color: var(--text); transform: translateY(-1px); }
.iconbtn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.iconbtn.success:hover { background: var(--success-soft); color: var(--success); }

/* ---------- Plan cards (create page) ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.cat-note { display: flex; align-items: flex-start; gap: 9px; background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--text); border-radius: 12px; padding: 11px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.7; }
.cat-note svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }.plan-card {
    position: relative; cursor: pointer;
    background: var(--surface); border: 2px solid var(--border);
    border-radius: var(--radius); padding: 18px;
    transition: border-color .2s, transform .2s, background .2s;
}
.plan-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.plan-card.selected { border-color: var(--accent); background: linear-gradient(160deg, var(--accent-soft), transparent); }
.plan-card .pc-check {
    position: absolute; inset-inline-end: 14px; top: 14px;
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid var(--border-strong); display: grid; place-items: center;
    color: var(--on-accent); transition: all .2s;
}
.plan-card.selected .pc-check { background: var(--accent); border-color: var(--accent); }
.plan-card.selected .pc-check svg { display: block; }
.plan-card .pc-check svg { display: none; width: 14px; height: 14px; }
.pc-name { font-weight: 700; font-size: 15px; }
.pc-meta { color: var(--muted); font-size: 13px; margin-top: 8px; display:flex; gap: 12px; flex-wrap: wrap; }
.pc-price { font-size: 20px; font-weight: 800; margin-top: 14px; color: var(--accent); }

/* Mobile: keep plan cards two-per-row (like the dashboard stat cards). */
@media (max-width: 560px) {
    .plan-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .plan-card { padding: 14px; }
    .plan-card .pc-check { inset-inline-end: 10px; top: 10px; width: 19px; height: 19px; }
    .pc-name { font-size: 13.5px; }
    .pc-meta { font-size: 12px; gap: 8px; margin-top: 6px; }
    .pc-price { font-size: 17px; margin-top: 10px; }
}

/* ---------- Featured plan + discount ---------- */
/* Gold theme — intentionally different from the green "selected" state. */
.plan-card.is-featured {
    border-color: rgba(251, 191, 36, 0.45);
    background: linear-gradient(160deg, rgba(251, 191, 36, 0.10), transparent 72%);
}
.plan-card.is-featured:hover { transform: translateY(-4px); border-color: rgba(251, 191, 36, 0.7); }
/* When a featured card is actually selected, the green selection wins to avoid confusion. */
.plan-card.is-featured.selected {
    border-color: var(--accent);
    background: linear-gradient(160deg, var(--accent-soft), transparent);
}
.pc-ribbon {
    position: absolute; inset-inline-start: 14px; top: -11px;
    display: inline-flex; align-items: center; gap: 5px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #3a2900;
    font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
    padding: 4px 11px; border-radius: 999px; box-shadow: 0 6px 16px rgba(251, 191, 36, 0.3);
}
.pc-ribbon svg { width: 12px; height: 12px; }
.pc-price .pcp-old { font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: line-through; margin-inline-end: 7px; }
.pc-price .pcp-now { font-size: 20px; font-weight: 800; color: var(--accent); }
.pc-price .pcp-off {
    display: inline-block; margin-inline-start: 8px; vertical-align: middle;
    font-size: 11px; font-weight: 800; color: var(--danger);
    background: var(--danger-soft); padding: 2px 8px; border-radius: 7px;
}

/* featured + discount badges in the admin plans table */
.badge-featured {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10.5px; font-weight: 700; color: #f59e0b;
    background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 2px 8px; border-radius: 999px; margin-inline-start: 8px; vertical-align: middle;
}
.badge-featured svg { width: 12px; height: 12px; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 12px; margin-inline-end: 6px; }
.price-now { color: var(--accent); font-weight: 800; }

/* ---------- Account cards ---------- */
.acc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display:flex; flex-direction: column; gap: 12px; transition: border-color .2s, transform .2s; }
.acc-card:hover { border-color: var(--border-strong); }
.acc-top { display:flex; align-items:center; gap: 12px; }
.acc-name { font-weight: 700; }
.acc-sub { color: var(--muted); font-size: 12px; }
.acc-foot { display:flex; align-items:center; gap: 8px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ico { width: 58px; height: 58px; border-radius: 18px; background: var(--surface-2); display:grid; place-items:center; margin: 0 auto 14px; color: var(--text-dim); }

/* ---------- Modal ---------- */
.modal-host { position: fixed; inset: 0; z-index: 200; display: none; }
.modal-host.open { display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s; }
.modal-host.open .modal-backdrop { opacity: 1; }
.modal {
    position: relative;
    width: min(440px, 100%);
    margin: auto;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg); padding: 24px; overflow: hidden;
    box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(12px) scale(.96);
    transition: opacity .25s, transform .3s cubic-bezier(.22,.61,.36,1);
}
.modal-host.open .modal { opacity: 1; transform: translateY(0) scale(1); }
.modal-x {
    position: absolute; top: 12px; inset-inline-end: 12px; z-index: 3;
    width: 32px; height: 32px; border-radius: 9px; border: none;
    background: var(--surface-2); color: var(--muted); cursor: pointer;
    display: grid; place-items: center; transition: all .15s;
}
.modal-x:hover { background: var(--danger-soft); color: var(--danger); }
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }.modal-desc { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.modal-actions { display:flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; }
.modal-close { position:absolute; inset-inline-end: 16px; top: 16px; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; inset-block-end: 22px; inset-inline-end: 22px; z-index: 300; display:flex; flex-direction: column; gap: 10px; }
.toast {
    display:flex; align-items:center; gap: 10px;
    background: var(--surface-3); border: 1px solid var(--border-strong);
    color: var(--text); padding: 13px 16px; border-radius: 12px;
    box-shadow: var(--shadow); font-size: 14px; min-width: 240px; max-width: 360px;
    animation: toast-in .35s cubic-bezier(.22,.61,.36,1);
}
.toast.out { animation: toast-out .3s forwards; }
.toast .ti { width: 28px; height: 28px; border-radius: 8px; display:grid; place-items:center; flex-shrink:0; }
.toast.success .ti { background: var(--success-soft); color: var(--success); }
.toast.error .ti { background: var(--danger-soft); color: var(--danger); }
.toast.info .ti { background: var(--accent-soft); color: var(--accent); }
@keyframes toast-in { from { opacity:0; transform: translateY(20px) scale(.95);} to {opacity:1; transform:none;} }
@keyframes toast-out { to { opacity:0; transform: translateX(40px); } }
@media (max-width:600px){ .toast-host{ inset-inline:12px; } .toast{max-width:none;} }

/* ---------- QR ---------- */
.qr-box { background:#fff; padding: 14px; border-radius: 14px; width: max-content; margin: 0 auto; }
.qr-box canvas, .qr-box img { display:block; }

/* Framed QR (account sheet) */
.qr-frame {
    background: #fff; padding: 14px; border-radius: 18px; width: max-content; margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.06);
    position: relative;
}
.qr-frame canvas, .qr-frame img { display:block; border-radius: 6px; }
.qr-cap {
    display:flex; align-items:center; justify-content:center; gap:6px;
    margin-top: 10px; font-size: 12px; color: var(--muted);
}
.qr-cap svg { width:14px; height:14px; }

/* ---------- Copy field ---------- */
.copyfield { display:flex; align-items:center; gap: 8px; background: var(--surface-2); border:1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.copyfield input { flex:1; border:none; background:transparent; color: var(--text-dim); font-family: inherit; font-size: 13px; outline:none; }

/* ---------- App banner (coming soon) ---------- */
.app-banner {
    position: relative; overflow: hidden;
    background:
        radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 55%),
        linear-gradient(135deg, var(--surface), var(--surface-2));
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-lg); padding: 22px 24px;
    display:flex; align-items:center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.app-banner .ab-glow {
    position: absolute; inset-inline-end: -60px; top: -60px;
    width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft), transparent 70%);
    pointer-events: none;
}
.app-banner .ab-main { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.app-banner .ab-icon {
    width: 52px; height: 52px; flex-shrink: 0;
    border-radius: 15px; display: grid; place-items: center;
    background: var(--accent-grad); color: var(--on-accent);
    box-shadow: 0 8px 22px var(--accent-shadow);
}
.app-banner .ab-title { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.app-banner .ab-pill {
    font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
    background: var(--accent-soft); color: var(--accent);
    padding: 3px 9px; border-radius: 999px; border: 1px solid var(--accent-border);
}
.app-banner .ab-desc { color: var(--text-dim); font-size: 13px; margin-top: 5px; }
.app-banner .ab-actions { display:flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.store-btn {
    display:inline-flex; align-items:center; gap: 8px;
    background: var(--surface); border:1px solid var(--border-strong);
    border-radius: 12px; padding: 10px 16px; font-size: 13px; font-weight: 700;
    transition: border-color .18s ease, transform .18s ease;
}
.store-btn:hover { border-color: var(--accent-border); transform: translateY(-1px); }
.store-btn svg { color: var(--accent); }

/* ---------- Skeleton ---------- */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0%{background-position:100% 50%} 100%{background-position:0 50%} }

/* spinner */
.spinner { width:18px;height:18px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;display:inline-block;}
.btn-primary .spinner { border-color: rgba(4,36,26,.3); border-top-color: var(--on-accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* small helpers */
.flex { display:flex; } .items-center{align-items:center;} .gap-2{gap:8px;} .gap-3{gap:12px;}
.between{justify-content:space-between;} .mt-2{margin-top:8px;} .mt-4{margin-top:16px;} .mb-4{margin-bottom:16px;}
.text-accent{color:var(--accent);} .text-success{color:var(--success);} .text-danger{color:var(--danger);}
.fw-700{font-weight:700;} .fs-13{font-size:13px;} .fs-12{font-size:12px;}
.w-full{width:100%;}

/* ============================================================
   Animated result popup
   ============================================================ */
.result-pop { text-align: center; }
.result-icon {
    width: 92px; height: 92px; margin: 4px auto 18px;
    border-radius: 50%; display: grid; place-items: center;
    position: relative;
}
.result-icon::before {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    animation: ring-pop .5s cubic-bezier(.22,.61,.36,1) both;
}
.result-icon.success::before { background: var(--success-soft); }
.result-icon.error::before   { background: var(--danger-soft); }
.result-icon.info::before    { background: var(--accent-soft); }

.result-icon svg { position: relative; width: 52px; height: 52px; }
.result-icon.success svg { color: var(--success); }
.result-icon.error svg   { color: var(--danger); }
.result-icon.info svg    { color: var(--accent); }

/* draw stroke */
.result-icon .draw {
    stroke-dasharray: 60; stroke-dashoffset: 60;
    animation: draw .5s .25s cubic-bezier(.65,0,.45,1) forwards;
}
.result-icon .draw.d2 { animation-delay: .4s; }

/* pulsing glow rings */
.result-icon .pulse {
    position: absolute; inset: -6px; border-radius: 50%;
    border: 2px solid currentColor; opacity: 0;
    animation: pulse-ring 1.4s ease-out infinite;
}
.result-icon.success { color: var(--success); }
.result-icon.error { color: var(--danger); }

@keyframes ring-pop { 0% { transform: scale(0); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse-ring { 0% { transform: scale(.8); opacity: .5; } 100% { transform: scale(1.5); opacity: 0; } }

.result-title { font-size: 20px; font-weight: 800; animation: rise-in .4s .15s both; }
.result-msg { color: var(--muted); font-size: 14px; margin-top: 6px; animation: rise-in .4s .22s both; }
.result-body { margin-top: 18px; animation: rise-in .4s .3s both; text-align: start; }

.cred-row { display:flex; align-items:center; justify-content:space-between; gap:10px; background: var(--surface-2); border:1px solid var(--border); border-radius: 12px; padding: 11px 14px; margin-bottom: 8px; }
.cred-row .k { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.cred-row .v { font-weight: 700; font-size: 14px; word-break: break-all; font-family: ui-monospace, monospace; flex: 1; text-align: end; }

/* password input with generate */
.pwd-wrap { display:flex; gap: 8px; }
.pwd-wrap .input { flex: 1; }

/* ============================================================
   Accounts — compact list
   ============================================================ */
.acc-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.acc-item {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
}
.acc-item:last-child { border-bottom: none; }
.acc-item:hover { background: var(--surface-2); }
.acc-item .ava {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 700; font-size: 15px;
    background: var(--accent-soft); color: var(--accent);
}
.acc-item .info { min-width: 0; flex: 1; }
.acc-item .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-item .meta { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-item .mini-usage { width: 110px; flex-shrink: 0; }
.acc-item .mini-usage .progress { height: 6px; }
.acc-item .mini-usage .ut { font-size: 11px; color: var(--muted); margin-bottom: 4px; text-align: end; }
.acc-item .chev { color: var(--muted); flex-shrink: 0; transition: transform .2s; }
.acc-item:hover .chev { transform: translateX(-3px); }
[dir="ltr"] .acc-item:hover .chev { transform: translateX(3px); }

@media (max-width: 760px) {
    .acc-item .mini-usage { display: none; }
}

/* Detail drawer/modal (legacy) */
.acc-detail .dt-head { display:flex; align-items:center; gap:12px; margin-bottom:6px; }
.acc-detail .dt-ava { width:46px;height:46px;border-radius:13px;display:grid;place-items:center;font-weight:700;font-size:18px;background:var(--accent-soft);color:var(--accent); }
.acc-detail .dt-actions { display:flex; gap:8px; margin-top:18px; }
.acc-detail .dt-actions .btn { flex:1; }
.acc-detail .sect-label { font-size:12px; color:var(--muted); margin:16px 0 8px; }

/* ============================================================
   Account detail sheet (reworked)
   ============================================================ */
.acc-sheet .sect-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }

.acc-sheet .as-hero {
    display: flex; align-items: center; gap: 13px;
    margin: -24px -24px 18px; padding: 22px 24px;
    padding-inline-end: 52px;
    background:
        radial-gradient(420px 160px at 85% -40%, var(--accent-soft), transparent 70%),
        linear-gradient(160deg, var(--surface-2), var(--surface));
    border-bottom: 1px solid var(--border);
}
.acc-sheet .as-ava {
    width: 50px; height: 50px; border-radius: 15px; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 800; font-size: 20px;
    background: var(--accent-grad); color: var(--on-accent);
    box-shadow: 0 6px 18px var(--accent-soft);
}
.acc-sheet .as-htxt { flex: 1; min-width: 0; }
.acc-sheet .as-name { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-sheet .as-plan { font-size: 12px; color: var(--muted); margin-top: 2px; }

.acc-sheet .as-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px;
}
.acc-sheet .as-stat {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 13px; padding: 11px 12px; text-align: center;
}
.acc-sheet .as-stat .k { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.acc-sheet .as-stat .v { font-size: 13px; font-weight: 700; }

.acc-sheet .as-usage { margin-top: 16px; }
.acc-sheet .as-usage-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-bottom: 7px; }
.acc-sheet .as-usage .progress { height: 9px; }

.acc-sheet .as-qr { margin: 18px 0 4px; }

.acc-sheet .cred-row { display:flex; align-items:center; gap:10px; background: var(--surface-2); border:1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.acc-sheet .cred-row .k { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.acc-sheet .cred-row .v { font-weight: 700; font-size: 13px; word-break: break-all; font-family: ui-monospace, monospace; flex: 1; text-align: end; }
.iconbtn.sm { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; }

.acc-sheet .as-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }
.acc-sheet .as-actions .btn { width: 100%; }
.acc-sheet .as-actions .btn svg { width: 16px; height: 16px; }

/* ---------- Stepper (quantity +/-) ---------- */
.stepper { display: flex; align-items: stretch; gap: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; height: 46px; }
.stepper .step-btn {
    width: 46px; flex-shrink: 0; display: grid; place-items: center;
    background: transparent; border: none; color: var(--text); cursor: pointer;
    transition: background .15s, color .15s;
}
.stepper .step-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--accent); }
.stepper .step-btn:disabled { opacity: .35; cursor: default; }
.stepper .step-btn svg { width: 16px; height: 16px; }
.stepper .step-val {
    flex: 1; min-width: 0; text-align: center; background: transparent; border: none; outline: none;
    color: var(--text); font-weight: 700; font-size: 15px; font-family: inherit;
    border-inline: 1px solid var(--border);
    -moz-appearance: textfield;
}
.stepper .step-val::-webkit-outer-spin-button,
.stepper .step-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ============================================================
   Tickets
   ============================================================ */
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-item {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 15px 16px; cursor: pointer;
    transition: border-color .2s, transform .15s, background .15s;
}
.ticket-item:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.ticket-item .tk-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.ticket-item .tk-info { min-width: 0; flex: 1; }
.ticket-item .tk-subj { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-item .tk-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* conversation — full page */
.conv-head {
    display: flex; align-items: center; gap: 14px;
    padding-bottom: 16px; margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.conv-back {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    background: var(--surface-2); color: var(--text-dim);
    display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s;
}
.conv-back:hover { background: var(--surface-3); color: var(--text); }
.conv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.conv-body {
    display: flex; flex-direction: column; gap: 16px;
    padding: 8px 4px; min-height: 320px;
    max-height: calc(100vh - 360px); overflow-y: auto;
}
.cmsg { display: flex; gap: 10px; max-width: 80%; align-items: flex-end; animation: rise-in .35s ease both; }
.cmsg.me { align-self: flex-end; flex-direction: row-reverse; }
.cmsg.them { align-self: flex-start; }
.cmsg .cav { width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.cmsg.me .cav { background: var(--accent-grad); color: var(--on-accent); }
.cmsg.them .cav { background: var(--surface-3); color: var(--text-dim); }
.cmsg.them.support .cav { background: var(--accent-soft); color: var(--accent); }
.cbubble { padding: 12px 15px; border-radius: 18px; font-size: 14px; line-height: 1.75; }
.cmsg.me .cbubble { background: var(--accent-grad); color: var(--on-accent); border-end-end-radius: 6px; }
.cmsg.them .cbubble { background: var(--surface-2); color: var(--text); border-end-start-radius: 6px; }
.cwho { font-size: 11px; font-weight: 700; opacity: .8; margin-bottom: 4px; }
.ctime { font-size: 10px; opacity: .55; margin-top: 6px; }
.composer { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.composer .textarea { min-height: 50px; max-height: 140px; }
.composer .send-btn { height: 50px; width: 50px; flex-shrink: 0; padding: 0; }
.composer-attach {
    height: 50px; width: 50px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
    color: var(--muted); cursor: pointer; transition: all .18s;
}
.composer-attach:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.composer-attach.has-file { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* Selected-image preview chip (clear, with thumbnail + remove) */
.composer-file {
    margin-top: 10px; display: flex; align-items: center; gap: 12px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
    padding: 8px 10px;
}
.composer-file .cf-thumb {
    width: 42px; height: 42px; border-radius: 9px; object-fit: cover; flex-shrink: 0;
    border: 1px solid var(--border); background: var(--surface-3);
}
.composer-file .cf-info { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.composer-file .cf-name { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.composer-file .cf-size { font-size: 11px; color: var(--muted); }
.composer-file .cf-remove {
    margin-inline-start: auto; flex-shrink: 0;
    width: 30px; height: 30px; border-radius: 8px; border: none; cursor: pointer;
    background: transparent; color: var(--muted);
    display: grid; place-items: center; transition: all .18s;
}
.composer-file .cf-remove:hover { background: var(--danger-soft); color: var(--danger); }
.conv-closed { text-align: center; color: var(--muted); font-size: 13px; padding: 14px; background: var(--surface-2); border-radius: 12px; margin-top: 14px; }

/* ticket attachment image */
.cimg { display: inline-block; margin-top: 8px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); max-width: 240px; }
.cimg img { display: block; width: 100%; height: auto; }

/* ticket rating */
.ticket-rate { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; }
.ticket-rate .tr-label { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.ticket-rate .tr-stars { display: inline-flex; gap: 4px; }
.ticket-rate .tr-star { background: none; border: none; cursor: pointer; color: var(--muted); padding: 2px; transition: color .12s, transform .12s; display: grid; place-items: center; }
.ticket-rate .tr-star:hover { transform: scale(1.12); }
.ticket-rate .tr-star.hot svg { fill: #fbbf24; }
.ticket-rate .tr-star.hot { color: #fbbf24; }
.ticket-rate.is-done .tr-star { cursor: default; }
.ticket-rate .tr-star.filled { color: #fbbf24; }
.ticket-close-x { flex-shrink: 0; }

/* Account row quick actions */
.acc-item .row-actions { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 480px) { .acc-item { gap: 10px; padding: 12px; } .acc-item .row-actions .iconbtn { width: 32px; height: 32px; } }

/* Refund / delete confirm popup */
.rf-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-top: 6px; text-align: start; }
.rf-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 5px 0; color: var(--text-dim); }
.rf-row .v { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.consume-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 10px 0 4px; }
.consume-bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg,#fbbf24,#f87171); transition: width .8s cubic-bezier(.22,.61,.36,1); }
.rf-refund { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.rf-refund span { color: var(--text-dim); font-size: 13px; }
.rf-refund b { color: var(--success); font-size: 19px; font-weight: 800; }

/* Animated danger (trash) icon */
.result-icon.error svg.trash { animation: trash-wobble .6s ease .15s; transform-origin: 50% 30%; }
@keyframes trash-wobble { 0%,100%{transform:rotate(0)} 20%{transform:rotate(-12deg)} 45%{transform:rotate(10deg)} 70%{transform:rotate(-5deg)} }

/* Add-GB cost preview */
.cost-preview { display: flex; justify-content: space-between; align-items: center; background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 12px; padding: 13px 16px; margin-top: 4px; }
.cost-preview .lbl { color: var(--text-dim); font-size: 13px; }
.cost-preview b { color: var(--accent); font-size: 19px; font-weight: 800; }
.gb-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.gb-quick button { flex: 1; min-width: 56px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); border-radius: 10px; padding: 9px 0; font-family: inherit; font-weight: 600; cursor: pointer; transition: all .15s; }
.gb-quick button:hover, .gb-quick button.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }

/* ============================================================
   Tabs + settings layout
   ============================================================ */
.tabs {
    display: flex; gap: 4px; background: var(--surface-2);
    padding: 5px; border-radius: 14px; margin-bottom: 20px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { height: 0; }
.tabs button {
    border: none; background: transparent; color: var(--text-dim);
    font-family: inherit; font-weight: 600; font-size: 13px;
    padding: 10px 16px; border-radius: 10px; cursor: pointer;
    white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
    transition: background .2s, color .2s;
}
.tabs button svg { width: 16px; height: 16px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--accent-grad); color: var(--on-accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: rise-in .35s cubic-bezier(.22,.61,.36,1) both; }

/* Settings building blocks */
.set-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.set-card + .set-card { margin-top: 16px; }
.set-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.set-head .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.set-head .tt { font-size: 15px; font-weight: 700; }
.set-head .ds { font-size: 12px; color: var(--muted); margin-top: 2px; }

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); }
.set-row:first-of-type { border-top: none; }
.set-row .k { font-size: 13px; color: var(--text-dim); }
.set-row .v { font-weight: 600; font-size: 14px; }

/* Profile header */
.profile-hero { display: flex; align-items: center; gap: 16px; }
.profile-hero .pa { width: 64px; height: 64px; border-radius: 20px; background: var(--accent-grad); color: var(--on-accent); display: grid; place-items: center; font-size: 26px; font-weight: 800; flex-shrink: 0; }
.profile-hero .pn { font-size: 18px; font-weight: 800; }
.profile-hero .pr { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl { position: absolute; inset: 0; background: var(--surface-3); border-radius: 999px; transition: .25s; cursor: pointer; }
.switch .sl::before { content: ''; position: absolute; height: 19px; width: 19px; inset-inline-start: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s; }
.switch input:checked + .sl { background: var(--accent-2); }
.switch input:checked + .sl::before { transform: translateX(19px); }
[dir="rtl"] .switch input:checked + .sl::before { transform: translateX(-19px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.toggle-row:first-child { border-top: none; }
.toggle-row .tl { font-size: 14px; }

/* Status pill */
.bot-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.bot-status.on { background: var(--success-soft); color: var(--success); }
.bot-status.off { background: var(--danger-soft); color: var(--danger); }

/* ============================================================
   Pagination
   ============================================================ */
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 38px; height: 38px; padding: 0 11px;
    border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-dim); transition: border-color .2s, color .2s, transform .15s;
}
.pager a:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.pager .cur { background: var(--accent-grad); color: var(--on-accent); border-color: transparent; }
.pager .disabled { opacity: .35; }
.pager .dots { border: none; background: transparent; }
[dir="rtl"] .pager { direction: ltr; }

/* ============================================================
   Setup guide steps
   ============================================================ */
.guide { display: flex; flex-direction: column; gap: 14px; }
.guide-step { display: flex; gap: 14px; align-items: flex-start; }
.guide-step .gn {
    width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
    background: var(--accent-grad); color: var(--on-accent);
    display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.guide-step .gt { font-size: 14px; line-height: 1.8; padding-top: 3px; }
.guide-step .gt b { color: var(--accent); }
.guide-step code { background: var(--surface-2); padding: 1px 7px; border-radius: 6px; font-size: 13px; }
.guide-note { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ============================================================
   Settings & bot panels — responsive card grid (fills full width)
   ============================================================ */
.tab-panel .set-card { max-width: none !important; }

/* By default a tab panel lays its cards out in a responsive grid that
   fills the available width: many columns on desktop, one on mobile.
   A single card stretches to full width (auto-fit collapses empty tracks). */
.tab-panel.active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    align-items: start;
    animation: rise-in .35s cubic-bezier(.22,.61,.36,1) both;
}
.tab-panel.active > .set-card + .set-card { margin-top: 0; }

/* Panels that contain a header + table (or one long readable card) must
   keep normal block flow so their inner elements don't get gridded. */
.tab-panel.active[data-panel="plans"],
.tab-panel.active[data-panel="guide"],
.tab-panel.active[data-panel="setup"],
.tab-panel.active.is-plain { display: block; }
.tab-panel.active[data-panel="guide"] .set-card { max-width: 760px !important; }

@media (max-width: 720px) {
    .tab-panel.active { grid-template-columns: 1fr; }
}

/* ============================================================
   Top-up page
   ============================================================ */
.topup-hero {
    flex-direction: row; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 18px; padding: 28px; margin-bottom: 16px;
}
.topup-hero .th-amount { font-size: 40px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.topup-card { display: flex; flex-direction: column; gap: 18px; padding: 22px; }
.topup-card .set-head { margin-bottom: 0; }
.topup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 720px) { .topup-grid { grid-template-columns: 1fr; } }
.amount-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.amount-quick button {
    flex: 1; min-width: 70px; background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-dim); border-radius: 10px; padding: 9px 0; font-family: inherit;
    font-weight: 600; font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s;
}
.amount-quick button:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   Accounts filter bar
   ============================================================ */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-bar .search-box { flex: 1; min-width: 220px; margin: 0; }
@media (max-width: 560px) {
    .filter-bar { gap: 8px; }
    .filter-bar .select { max-width: none !important; flex: 1; }
}

/* ============================================================
   Transaction history filter (wallet)
   ============================================================ */
.tx-filter {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px;
    display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px;
}
.tx-filter .txf-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.txf-search {
    flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
    padding: 0 12px 0 14px; height: 44px; transition: border-color .15s, box-shadow .15s;
}
.txf-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.txf-search svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.txf-search input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; color: var(--text); font-family: inherit; font-size: 14px; }
.txf-clearq {
    width: 26px; height: 26px; flex-shrink: 0; border: none; cursor: pointer;
    background: transparent; color: var(--muted); border-radius: 7px;
    display: grid; place-items: center; transition: all .15s;
}
.txf-clearq:hover { background: var(--surface-3); color: var(--text); }
.txf-typewrap { flex-shrink: 0; }
.txf-select { width: auto; min-width: 180px; height: 44px; margin: 0; }
.txf-statusrow { gap: 10px; }
.txf-lbl { font-size: 12.5px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.txf-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.txf-chip {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
    border-radius: 10px; padding: 8px 13px; font-family: inherit;
    font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.txf-chip:hover { border-color: var(--border-strong); color: var(--text); }
.txf-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.txf-chip .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.txf-reset {
    margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px;
    color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none;
    padding: 7px 11px; border-radius: 9px; transition: all .15s;
}
.txf-reset:hover { color: var(--danger); background: var(--danger-soft); }
@media (max-width: 560px) {
    .txf-typewrap, .txf-select { width: 100%; }
    .txf-statusrow { align-items: flex-start; }
    .txf-reset { margin-inline-start: 0; }
}

/* ============================================================
   Per-user custom pricing modal
   ============================================================ */
.price-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0; border-top: 1px solid var(--border);
}
.price-row:first-of-type { border-top: none; }
.price-row .pr-info { flex: 1; min-width: 0; }
.price-row .pr-name { font-weight: 600; font-size: 14px; }
.price-row .pr-def { font-size: 12px; color: var(--muted); margin-top: 2px; }
.price-row .pr-input { width: 130px; flex-shrink: 0; }
.pr-autofill { font-size: 12px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 10px; padding: 9px 12px; margin-bottom: 4px; }

/* ============================================================
   API docs
   ============================================================ */
.sect-label {
    font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); font-weight: 600; margin: 0 0 10px;
}
.api-docs .set-head { margin-bottom: 4px; }
.api-docs .api-sec { padding: 18px 0; }
.api-docs .api-sec + .api-sec { border-top: 1px solid var(--border); }
.api-docs .api-sec:last-child { padding-bottom: 2px; }
.api-keys-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.api-code {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 12px; padding: 16px 18px; margin: 0;
    font-family: ui-monospace, 'Cascadia Code', monospace; font-size: 12.5px;
    line-height: 1.85; color: var(--text); overflow-x: auto; white-space: pre;
    direction: ltr; text-align: left;
}
.api-note { font-size: 13px; color: var(--text-dim); margin: 0 0 12px; line-height: 1.8; }
.api-ep-list { display: flex; flex-direction: column; gap: 4px; }
.api-endpoint {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 14px; border-radius: 12px; background: var(--surface-2);
    border: 1px solid var(--border);
}
.api-endpoint .api-path { font-family: ui-monospace, monospace; font-size: 13px; color: var(--text); direction: ltr; }
.api-endpoint .api-edesc { font-size: 12.5px; color: var(--muted); flex: 1; min-width: 150px; text-align: end; }

/* API key cards */
.api-key-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.api-key-row { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.akr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.akr-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.akr-label svg { color: var(--accent); width: 15px; height: 15px; }
.akr-meta { margin-top: 8px; }
.akr-method { min-width: 64px; justify-content: center; }
.api-key-row .copyfield input[type="password"] { letter-spacing: 2px; }

/* ============================================================
   404 page
   ============================================================ */
.nf-wrap {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 10px; min-height: 60vh; padding: 24px;
}
.nf-art { position: relative; margin-bottom: 8px; }
.nf-art svg {
    width: 120px; height: 120px; color: var(--accent);
    filter: drop-shadow(0 10px 30px var(--accent-soft));
    animation: nf-float 3s ease-in-out infinite;
}
.nf-code {
    position: absolute; inset-inline-end: -10px; bottom: -6px;
    font-size: 30px; font-weight: 900; letter-spacing: -.02em;
    background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nf-title { font-size: 24px; font-weight: 800; }
.nf-desc { color: var(--muted); font-size: 14px; max-width: 380px; line-height: 1.8; }
.nf-wrap .btn { margin-top: 12px; }
@keyframes nf-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ============================================================
   Notification bell
   ============================================================ */
.bell-wrap { position: relative; }
.bell-btn { position: relative; }
.bell-badge {
    position: absolute; top: -3px; inset-inline-end: -3px;
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
    background: var(--danger); color: #fff; font-size: 10px; font-weight: 800;
    display: grid; place-items: center; line-height: 1; border: 2px solid var(--bg);
}
.bell-badge[hidden] { display: none; }
.bell-pop {
    position: absolute; top: calc(100% + 10px); inset-inline-end: 0;
    width: min(340px, 86vw); background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 80; overflow: hidden;
    animation: rise-in .2s ease both;
}
.bell-head { padding: 14px 16px; font-weight: 800; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bell-compose { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--accent); display: grid; place-items: center; cursor: pointer; }
.bell-compose:hover { background: var(--accent-soft); border-color: var(--accent-border); }
.bell-list { max-height: 60vh; overflow-y: auto; }
.bell-empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.bell-item { padding: 12px 16px; border-top: 1px solid var(--border); cursor: pointer; transition: background .15s; position: relative; }
.bell-item:first-child { border-top: none; }
.bell-item:hover { background: var(--surface-2); }
.bell-item.unread { background: var(--accent-soft); }
.bell-item.unread:hover { background: var(--accent-soft); }
.bell-item .bi-title { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-inline-end: 26px; }
.bell-item .bi-body { color: var(--text-dim); font-size: 12.5px; margin-top: 3px; line-height: 1.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell-item .bi-date { color: var(--muted); font-size: 11px; margin-top: 5px; }
.bell-item .bi-del {
    position: absolute; top: 10px; inset-inline-end: 12px;
    width: 24px; height: 24px; border-radius: 7px; border: none;
    background: transparent; color: var(--muted); cursor: pointer;
    display: grid; place-items: center; opacity: .6; transition: all .15s;
}
.bell-item .bi-del:hover { background: var(--danger-soft); color: var(--danger); opacity: 1; }
.notif-full { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.9; white-space: pre-wrap; max-height: 50vh; overflow-y: auto; }

/* Muted text stays readable on accent/active backgrounds */
.btn-primary .dim,
.tabs button.active .dim,
.segment button.active .dim,
.nav-item.is-active .dim,
.badge .dim { color: inherit; opacity: .72; }

/* ===== Sales closed screen ===== */
.sales-closed {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 24px;
    animation: scFade .5s ease both;
}
@keyframes scFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.sc-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    text-align: center;
    padding: 46px 34px 34px;
    border-radius: 24px;
    background: linear-gradient(180deg, var(--surface), var(--surface-2));
    border: 1px solid var(--border);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}
.sc-glow {
    position: absolute;
    top: -120px; left: 50%;
    width: 360px; height: 240px;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, rgba(248,113,113,0.16), transparent 70%);
    pointer-events: none;
}
.sc-badge {
    position: relative;
    width: 104px; height: 104px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sc-ico {
    position: relative;
    z-index: 2;
    width: 78px; height: 78px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid rgba(248,113,113,0.28);
}
.sc-ring {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 2px solid rgba(248,113,113,0.30);
    animation: scPulse 2.4s ease-out infinite;
}
.sc-ring2 { animation-delay: 1.2s; }
@keyframes scPulse {
    0%   { transform: scale(0.7); opacity: 0.9; }
    100% { transform: scale(1.5); opacity: 0; }
}
.sc-title {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}
.sc-desc {
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-dim);
    max-width: 360px;
    margin: 0 auto 22px;
}
.sc-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid rgba(248,113,113,0.22);
}
.sc-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 0 rgba(248,113,113,0.6);
    animation: scDot 1.6s ease-out infinite;
}
@keyframes scDot {
    0%   { box-shadow: 0 0 0 0 rgba(248,113,113,0.5); }
    100% { box-shadow: 0 0 0 9px rgba(248,113,113,0); }
}

/* ===== Bot activation banner ===== */
.bot-activate {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color .2s ease, background .2s ease;
}
.bot-activate.is-on {
    border-color: var(--accent-border);
    background: linear-gradient(180deg, var(--accent-soft), var(--surface));
}
.bot-activate.is-off {
    border-color: rgba(251,191,36,0.28);
    background: linear-gradient(180deg, rgba(251,191,36,0.08), var(--surface));
}
.bot-activate .ba-ico { font-size: 26px; line-height: 1; }
.bot-activate .ba-title { font-size: 15px; font-weight: 800; }
.bot-activate .ba-desc { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.7; }
.bot-activate .btn { white-space: nowrap; }

/* ===== Bot plan pricing list ===== */
.bp-list { display: flex; flex-direction: column; gap: 10px; }
.bp-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    transition: border-color .2s ease, background .2s ease, opacity .2s ease;
    opacity: .62;
}
.bp-item.is-on {
    opacity: 1;
    border-color: var(--accent-border);
    background: linear-gradient(180deg, var(--accent-soft), var(--surface-2));
}
.bp-main { display: flex; align-items: center; gap: 14px; min-width: 200px; }
.bp-info .bp-name { font-weight: 700; font-size: 14px; }
.bp-info .bp-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.bp-info .bp-meta svg { opacity: .8; }
.bp-pricing { display: flex; align-items: flex-end; gap: 18px; }
.bp-cost { display: flex; flex-direction: column; align-items: flex-start; }
.bp-cost span { font-size: 10.5px; color: var(--muted); }
.bp-cost b { font-size: 13px; color: var(--text-dim); }
.bp-price { display: flex; flex-direction: column; gap: 4px; }
.bp-price label { font-size: 10.5px; color: var(--muted); }
.bp-price .bp-val { width: 130px; height: 38px; }
@media (max-width: 560px) {
    .bp-pricing { width: 100%; justify-content: space-between; }
    .bp-price .bp-val { width: 110px; }
}

/* ===== Bot header (redesigned) ===== */
.bot-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 6px 0 18px;
}
.bot-head .bh-avatar {
    width: 50px; height: 50px;
    flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 15px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
}
.bot-head .bh-name { font-size: 18px; font-weight: 800; }
.bot-head .bh-stats { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.bh-pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.bh-pill .d { width: 7px; height: 7px; border-radius: 50%; }
.bh-pill.on  { color: var(--success); background: var(--success-soft); }
.bh-pill.on .d  { background: var(--success); box-shadow: 0 0 8px var(--success); }
.bh-pill.off { color: var(--muted); background: var(--surface-2); }
.bh-pill.off .d { background: var(--muted); }
.bh-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 600; color: var(--text-dim);
    padding: 4px 10px; border-radius: 999px; background: var(--surface-2);
}

/* ===== Setup-needed hero ===== */
.setup-hero {
    position: relative; overflow: hidden;
    text-align: center;
    padding: 40px 28px;
    border-radius: 22px;
    border: 1px solid var(--accent-border);
    background: linear-gradient(180deg, var(--accent-soft), var(--surface));
    margin-bottom: 16px;
    animation: scFade .45s ease both;
}
.setup-hero .sh-glow {
    position: absolute; top: -120px; left: 50%; width: 380px; height: 240px;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
}
.setup-hero .sh-ico { font-size: 44px; }
.setup-hero .sh-title { font-size: 20px; font-weight: 800; margin-top: 10px; }
.setup-hero .sh-desc { font-size: 13.5px; color: var(--text-dim); max-width: 460px; margin: 8px auto 20px; line-height: 1.9; }
.setup-hero .sh-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 13px; }

/* ===== Wizard ===== */
.wz { margin-bottom: 16px; animation: scFade .35s ease both; }
.wz-card {
    max-width: 640px;
    padding: 22px 24px 18px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.wz-top { display: flex; align-items: center; gap: 12px; }
.wz-progress { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.wz-bar { height: 100%; width: 16%; border-radius: 999px; background: var(--accent-grad); transition: width .35s cubic-bezier(.4,0,.2,1); }
.wz-close { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px; }
.wz-close:hover { color: var(--text); }
.wz-stepno { font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.wz-stepno b { color: var(--accent); }
.wz-step { display: none; animation: wzIn .3s ease both; }
.wz-step.active { display: block; }
@keyframes wzIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.wz-h { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.wz-emoji { font-size: 30px; line-height: 1; }
.wz-h .wz-t { font-size: 17px; font-weight: 800; }
.wz-h .wz-d { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.7; }
.wz-step .label { display:block; }
.wz-step .mt-2 { margin-top: 8px; }
.wz-step .mt-3 { margin-top: 14px; }
.wz-finish { text-align: center; padding: 16px 0 6px; }
.wz-finish .wf-ico { font-size: 52px; }
.wz-finish .wz-t { font-size: 19px; font-weight: 800; margin-top: 8px; }
.wz-finish .wz-d { font-size: 13px; color: var(--text-dim); max-width: 420px; margin: 8px auto 0; line-height: 1.9; }
.wz-actions { display: flex; gap: 10px; margin-top: 22px; }
.wz-actions .btn-ghost { min-width: 96px; }
