/* =====================================================================
   VERTEX BRIDGE — Premium UI Stylesheet
   ===================================================================== */

/* ---------- Design Tokens ---------- */
:root {
    --bg:          #0b0c14;
    --bg-2:        #10121e;
    --bg-3:        #171929;
    --surface:     rgba(255,255,255,0.03);
    --surface-h:   rgba(255,255,255,0.06);
    --border:      rgba(255,255,255,0.07);
    --border-h:    rgba(255,255,255,0.14);

    --violet:      #7c3aed;
    --violet-l:    #9d5cf6;
    --cyan:        #06b6d4;
    --cyan-l:      #22d3ee;
    --grad:        linear-gradient(135deg, #7c3aed, #06b6d4);
    --grad-hover:  linear-gradient(135deg, #9d5cf6, #22d3ee);

    --green:       #10b981;
    --red:         #ef4444;
    --yellow:      #f59e0b;

    --text:        #f1f5f9;
    --text-2:      #94a3b8;
    --text-3:      #475569;

    --r-sm:  6px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 24px;

    --font:  'Inter', -apple-system, sans-serif;
    --font-d:'Plus Jakarta Sans', sans-serif;
    --font-m:'JetBrains Mono', monospace;

    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-pop: 0 20px 60px rgba(0,0,0,0.6);

    --sidebar-w: 220px;
    --transition: 0.2s cubic-bezier(0.16,1,0.3,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; cursor: pointer; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* =====================================================================
   LOCK SCREEN
   ===================================================================== */
.lock-screen {
    position: fixed; inset: 0;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.lock-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.lock-noise {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 150px;
}
.lock-glow {
    position: absolute; border-radius: 50%;
    filter: blur(100px); pointer-events: none; z-index: 0;
}
.lock-glow-1 {
    width: 500px; height: 500px;
    background: rgba(124,58,237,0.14);
    top: -100px; left: -100px;
    animation: lg-drift 14s infinite alternate ease-in-out;
}
.lock-glow-2 {
    width: 400px; height: 400px;
    background: rgba(6,182,212,0.10);
    bottom: -80px; right: -80px;
    animation: lg-drift 18s infinite alternate-reverse ease-in-out;
}
@keyframes lg-drift {
    from { transform: translate(0,0) scale(1); }
    to   { transform: translate(60px,40px) scale(1.15); }
}

.lock-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 400px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-pop);
    text-align: center;
    animation: card-in 0.5s var(--transition);
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lock-logo {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin-bottom: 32px;
    font-family: var(--font-d); font-weight: 700; font-size: 17px; color: var(--text);
}

.lock-icon-wrap {
    width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 20px;
    background: rgba(124,58,237,0.12);
    border: 1px solid rgba(124,58,237,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    background: radial-gradient(circle, rgba(124,58,237,0.15), transparent);
    color: var(--violet-l);
}

.lock-card h1 {
    font-family: var(--font-d); font-size: 22px; font-weight: 700;
    margin-bottom: 8px; color: var(--text);
}
.lock-card > p {
    color: var(--text-2); font-size: 13.5px; margin-bottom: 28px; line-height: 1.5;
}

.pin-input-wrap {
    position: relative; margin-bottom: 10px;
}
.pin-input {
    width: 100%;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 13px 18px;
    color: var(--text);
    font-size: 22px;
    letter-spacing: 6px;
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.pin-input::placeholder { letter-spacing: 0; color: var(--text-3); font-size: 14px; text-align: center; }
.pin-input:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
}
.pin-icon { display: none; }

.pin-error {
    color: var(--red); font-size: 12.5px; font-weight: 500;
    display: none; margin-bottom: 14px;
    animation: shake 0.3s ease;
}
.pin-error.show { display: block; }
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.lock-btn { width: 100%; margin-top: 4px; }

.lock-hint {
    margin-top: 20px; color: var(--text-3); font-size: 11.5px; line-height: 1.6;
}
.lock-hint code {
    font-family: var(--font-m); background: rgba(255,255,255,0.05);
    padding: 1px 6px; border-radius: 4px; font-size: 11px;
}

/* =====================================================================
   APP LAYOUT — Sidebar + Main
   ===================================================================== */
.app {
    display: flex; min-height: 100vh;
}

/* -------- Sidebar -------- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; height: 100vh;
    z-index: 100;
    padding: 20px 12px;
}

.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.sidebar-logo-text {
    display: flex; flex-direction: column; line-height: 1.25;
}
.logo-name {
    font-family: var(--font-d); font-weight: 700; font-size: 14.5px; color: var(--text);
}
.logo-sub {
    font-size: 11px; color: var(--text-3); font-weight: 400;
}

.sidebar-nav {
    display: flex; flex-direction: column; gap: 4px; flex: 1;
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--r-md);
    color: var(--text-2); font-size: 13.5px; font-weight: 500;
    transition: background var(--transition), color var(--transition);
    position: relative;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
    background: rgba(124,58,237,0.12);
    color: var(--violet-l);
}
.nav-item.active::before {
    content: '';
    position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%; background: var(--grad);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    width: 32px; height: 32px; border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
    background: var(--surface); transition: background var(--transition);
}
.nav-item:hover .nav-icon { background: var(--surface-h); }
.nav-item.active .nav-icon {
    background: rgba(124,58,237,0.18);
    color: var(--violet-l);
}

.sidebar-footer {
    padding-top: 16px; border-top: 1px solid var(--border);
}
.status-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: var(--r-md);
    background: var(--surface); font-size: 12px; color: var(--text-2);
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    background: var(--text-3);
}
.status-dot.connected { background: var(--green); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.status-dot.error     { background: var(--red);   box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.status-dot.pulsing {
    background: var(--yellow);
    animation: pulse-dot 1.2s infinite;
}
@keyframes pulse-dot {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.3; }
}
#statusText { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* -------- Main Content -------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 32px 36px;
    max-width: 1160px;
}

/* -------- Page system -------- */
.page { display: none; animation: page-in 0.3s ease; }
.page.active { display: block; }
@keyframes page-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 28px;
}
.page-header h2 {
    font-family: var(--font-d); font-size: 22px; font-weight: 700;
    color: var(--text); margin-bottom: 4px;
}
.page-sub { color: var(--text-2); font-size: 13px; }

.header-controls { display: flex; gap: 10px; align-items: center; }

/* =====================================================================
   CARDS
   ===================================================================== */
.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
}

.card-title {
    font-family: var(--font-d); font-weight: 600; font-size: 13.5px;
    color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em;
    display: flex; align-items: center; gap: 8px; margin-bottom: 20px;
}

.settings-grid {
    display: grid; grid-template-columns: 1fr 320px; gap: 20px;
}
.info-card { display: flex; flex-direction: column; }

/* =====================================================================
   FORM ELEMENTS
   ===================================================================== */
.field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-group label {
    font-size: 12.5px; font-weight: 600; color: var(--text-2);
    display: flex; align-items: center; gap: 8px;
}
.field-group:last-of-type { margin-bottom: 0; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type="text"],
input[type="password"],
select,
textarea {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    color: var(--text);
    font-size: 13.5px;
    outline: none;
    width: 100%;
    transition: border-color var(--transition), box-shadow var(--transition);
}
input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%2394a3b8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}
select option { background: var(--bg-3); }

.mono-input { font-family: var(--font-m); font-size: 12px; resize: vertical; }

.input-icon-wrap { position: relative; }
.input-prefix-icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--text-3); font-size: 13px; pointer-events: none;
}
.input-icon-wrap input { padding-left: 38px; }

.field-hint { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

.badge-optional {
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
    background: rgba(124,58,237,0.15); color: var(--violet-l);
    padding: 2px 7px; border-radius: 99px;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* -------- Radio Cards -------- */
.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card { cursor: pointer; }
.radio-card input[type="radio"] { display: none; }
.radio-inner {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px; border-radius: var(--r-md);
    background: var(--bg-3); border: 1px solid var(--border);
    transition: border-color var(--transition), background var(--transition);
}
.radio-inner i { font-size: 18px; color: var(--text-3); flex-shrink: 0; }
.radio-inner strong { display: block; font-size: 13px; color: var(--text); margin-bottom: 1px; }
.radio-inner small  { font-size: 11px; color: var(--text-3); }

.radio-card input:checked + .radio-inner {
    border-color: var(--violet);
    background: rgba(124,58,237,0.08);
    box-shadow: 0 0 0 2px rgba(124,58,237,0.12);
}
.radio-card input:checked + .radio-inner i { color: var(--violet-l); }

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--grad);
    color: #fff; font-weight: 600; font-size: 13.5px;
    padding: 10px 20px; border-radius: var(--r-md);
    border: none; transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px rgba(124,58,237,0.3);
    white-space: nowrap;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,58,237,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; pointer-events: none; }

.full-btn { width: 100%; justify-content: center; margin-top: 8px; }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface); color: var(--text-2);
    font-weight: 500; font-size: 13.5px; padding: 10px 18px;
    border-radius: var(--r-md); border: 1px solid var(--border);
    transition: background var(--transition), color var(--transition);
}
.btn-ghost:hover { background: var(--surface-h); color: var(--text); }

.select-sm {
    background: var(--bg-3); border: 1px solid var(--border);
    border-radius: var(--r-sm); padding: 8px 30px 8px 12px;
    color: var(--text); font-size: 12.5px; outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%2394a3b8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    cursor: pointer;
    transition: border-color var(--transition);
}
.select-sm:focus { border-color: var(--violet); }
.select-sm option { background: var(--bg-3); }

/* =====================================================================
   INFO CARD
   ===================================================================== */
.info-block { display: flex; flex-direction: column; gap: 10px; }
.info-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12.5px; color: var(--text-2);
}
.mono-badge {
    font-family: var(--font-m); font-size: 11px;
    background: var(--bg-3); border: 1px solid var(--border);
    padding: 3px 8px; border-radius: var(--r-sm); color: var(--cyan-l);
    white-space: nowrap;
}
.model-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip {
    font-family: var(--font-m); font-size: 11px;
    padding: 4px 10px; border-radius: 99px;
}
.chip-violet { background: rgba(124,58,237,0.12); color: var(--violet-l); border: 1px solid rgba(124,58,237,0.2); }
.chip-cyan   { background: rgba(6,182,212,0.10);  color: var(--cyan-l);   border: 1px solid rgba(6,182,212,0.2); }
.chip-gray   { background: var(--surface); color: var(--text-3); border: 1px solid var(--border); }

/* =====================================================================
   API KEYS PAGE
   ===================================================================== */
.keys-list { display: flex; flex-direction: column; gap: 10px; }

.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-3);
}
.empty-state i { font-size: 36px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 13px; line-height: 1.6; }
.empty-state strong { color: var(--text-2); }

.key-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: var(--r-md);
    background: var(--bg-3); border: 1px solid var(--border);
    transition: border-color var(--transition);
}
.key-row:hover { border-color: var(--border-h); }

.key-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green); box-shadow: 0 0 6px rgba(16,185,129,0.5); flex-shrink: 0;
}
.key-info { flex: 1; min-width: 0; }
.key-label { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.key-masked {
    font-family: var(--font-m); font-size: 11px; color: var(--text-3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.key-date { font-size: 11px; color: var(--text-3); margin-left: auto; white-space: nowrap; flex-shrink: 0; }

.key-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
    width: 30px; height: 30px; border-radius: var(--r-sm);
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-2); font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--surface-h); color: var(--text); }
.icon-btn.danger:hover { background: rgba(239,68,68,0.1); color: var(--red); border-color: rgba(239,68,68,0.25); }

/* =====================================================================
   PLAYGROUND
   ===================================================================== */
.chat-shell {
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--r-lg); display: flex; flex-direction: column;
    height: calc(100vh - 180px); overflow: hidden;
}
.chat-messages {
    flex: 1; overflow-y: auto;
    padding: 28px; display: flex; flex-direction: column; gap: 20px;
}
.chat-bubble {
    display: flex; gap: 14px; max-width: 80%; align-items: flex-start;
}
.chat-bubble.user { align-self: flex-end; flex-direction: row-reverse; }
.bubble-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.assistant .bubble-avatar { background: rgba(124,58,237,0.12); color: var(--violet-l); }
.user .bubble-avatar       { background: rgba(6,182,212,0.12);  color: var(--cyan-l); }

.bubble-text {
    padding: 13px 16px; border-radius: 4px 16px 16px 16px;
    background: var(--bg-3); border: 1px solid var(--border);
    font-size: 13.5px; line-height: 1.65; color: var(--text);
}
.user .bubble-text {
    background: rgba(124,58,237,0.08);
    border-color: rgba(124,58,237,0.18);
    border-radius: 16px 4px 16px 16px;
}

.chat-composer {
    display: flex; gap: 10px;
    padding: 16px 20px; border-top: 1px solid var(--border);
    background: var(--bg-3);
}
.chat-composer input {
    flex: 1; background: var(--bg-2); border-radius: var(--r-md);
    border: 1px solid var(--border); padding: 11px 16px;
    color: var(--text); font-size: 13.5px; outline: none;
    transition: border-color var(--transition);
}
.chat-composer input:focus { border-color: var(--violet); }

.send-btn {
    width: 42px; height: 42px; border-radius: var(--r-md);
    background: var(--grad); color: #fff;
    border: none; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    transition: opacity var(--transition);
    flex-shrink: 0;
}
.send-btn:hover { opacity: 0.85; }

/* =====================================================================
   LOGS
   ===================================================================== */
.badge-count {
    font-size: 12px; font-weight: 600;
    background: rgba(124,58,237,0.12); color: var(--violet-l);
    border: 1px solid rgba(124,58,237,0.2);
    padding: 4px 12px; border-radius: 99px;
}

.logs-terminal {
    background: #060810; border: 1px solid var(--border);
    border-radius: var(--r-lg); overflow: hidden;
    height: calc(100vh - 180px);
    display: flex; flex-direction: column;
}
.logs-header-bar {
    display: flex; align-items: center; gap: 6px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    background: var(--bg-2); flex-shrink: 0;
}
.terminal-dot {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green  { background: #28c840; }
.terminal-title { flex: 1; text-align: center; font-size: 12px; color: var(--text-3); font-family: var(--font-m); }

.logs-body {
    flex: 1; overflow-y: auto;
    padding: 16px; font-family: var(--font-m);
    font-size: 12px; display: flex; flex-direction: column; gap: 4px;
}
.log-placeholder { color: var(--text-3); padding: 40px 0; text-align: center; }

.log-line {
    display: grid;
    grid-template-columns: 85px 46px 1fr auto auto 70px;
    gap: 12px; align-items: center;
    padding: 5px 8px; border-radius: var(--r-sm);
    transition: background 0.1s ease;
}
.log-line:hover { background: rgba(255,255,255,0.02); }
.log-time  { color: var(--text-3); }
.log-method{ color: var(--cyan); font-weight: 600; }
.log-path  { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-key   { 
    color: var(--violet-l); font-size: 10.5px;
    background: rgba(124,58,237,0.1); padding: 2px 7px; border-radius: 99px;
    white-space: nowrap;
}
.log-status { font-weight: 700; }
.s2xx { color: var(--green); }
.s4xx { color: var(--yellow); }
.s5xx { color: var(--red); }
.log-latency { color: var(--text-3); text-align: right; }

/* =====================================================================
   INTEGRATE PAGE — Code Blocks & Tabs
   ===================================================================== */
.tabs-bar {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin-bottom: 16px;
    background: var(--bg-2); border: 1px solid var(--border);
    padding: 6px; border-radius: var(--r-md);
}
.tab-btn {
    background: none; border: none;
    color: var(--text-2); font-size: 12.5px; font-weight: 500;
    padding: 7px 14px; border-radius: var(--r-sm);
    transition: background var(--transition), color var(--transition);
}
.tab-btn:hover { color: var(--text); background: var(--surface); }
.tab-btn.active {
    background: rgba(124,58,237,0.15); color: var(--violet-l);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.code-block {
    position: relative;
    background: #060810; border: 1px solid var(--border);
    border-radius: var(--r-lg); overflow: hidden;
}
.code-block pre { padding: 24px; overflow-x: auto; }
.code-block code {
    font-family: var(--font-m); font-size: 12.5px;
    color: #c9d1d9; line-height: 1.7; display: block;
}
.snip-key { color: #f472b6; font-weight: 600; }

.copy-btn {
    position: absolute; top: 12px; right: 12px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    color: var(--text-2); font-size: 12px; font-weight: 500;
    padding: 6px 12px; border-radius: var(--r-sm);
    display: flex; align-items: center; gap: 6px;
    transition: background var(--transition), color var(--transition);
}
.copy-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.copy-btn.copied { background: rgba(16,185,129,0.15); color: var(--green); border-color: rgba(16,185,129,0.3); }

/* =====================================================================
   MODAL
   ===================================================================== */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }

.modal-box {
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--r-lg); width: 100%; max-width: 440px;
    box-shadow: var(--shadow-pop);
    animation: card-in 0.3s var(--transition);
}
.modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
    font-family: var(--font-d); font-weight: 600; font-size: 15px;
}
.modal-head i { margin-right: 8px; color: var(--violet-l); }
.modal-close {
    background: none; border: none; color: var(--text-2);
    font-size: 18px; width: 28px; height: 28px;
    border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
    transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--surface); color: var(--text); }

.modal-body { padding: 20px; }
.modal-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 20px; border-top: 1px solid var(--border);
}

/* =====================================================================
   TOAST
   ===================================================================== */
.toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 999;
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-3); border: 1px solid var(--border);
    padding: 13px 20px; border-radius: var(--r-md);
    box-shadow: var(--shadow); font-size: 13px; font-weight: 500;
    transform: translateY(20px); opacity: 0;
    transition: transform 0.35s var(--transition), opacity 0.35s ease;
    pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.success i { color: var(--green); }
.toast.error   { border-color: rgba(239,68,68,0.3); }
.toast.error   i { color: var(--red); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
    :root { --sidebar-w: 64px; }
    .sidebar-logo-text, .nav-item span, .logo-sub, #statusText { display: none; }
    .sidebar { padding: 16px 10px; align-items: center; }
    .sidebar-logo { justify-content: center; padding: 0 0 16px; }
    .nav-item { justify-content: center; padding: 10px; }
    .nav-item.active::before { display: none; }
    .status-pill { justify-content: center; padding: 8px; }
    .main-content { padding: 24px 20px; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .field-row { grid-template-columns: 1fr; }
    .radio-row { grid-template-columns: 1fr; }
    .log-line { grid-template-columns: 1fr 1fr; }
    .log-time, .log-key, .log-latency { display: none; }
}

/* PIN active badge & remove button */
.pin-active-badge {
    font-size: 11px; font-weight: 600;
    background: rgba(16,185,129,0.12); color: var(--green);
    border: 1px solid rgba(16,185,129,0.25);
    padding: 2px 8px; border-radius: 99px;
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: 4px;
}
.pin-actions {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-top: 6px;
}
.btn-remove-pin {
    background: rgba(239,68,68,0.08); color: var(--red);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--r-sm); padding: 5px 12px;
    font-size: 12px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap; flex-shrink: 0;
    transition: background var(--transition);
}
.btn-remove-pin:hover { background: rgba(239,68,68,0.16); }
