/* ============================================================================
   UnivDash shared theme — pairs with theme.js
   - Theme style: html[data-ui-theme="mesh|apple|mono"] (the default 'Aurora' has no attribute)
   - Light mode: html[data-ui-theme-mode="light"]  (dark is the default, so only light is marked)
   - Templates use Tailwind utilities that assume dark (text-white/60 etc.), and
     light mode inverts the set of utilities actually in use here, all at once.
   ============================================================================ */

/* ── Base layout & glass panels ─────────────────────────────────────── */
html, body { min-height: 100%; }
body {
    font-family: 'Inter', 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
    color: #fff;
    background: radial-gradient(circle at 10% 10%, rgba(59,130,246,0.20), transparent 35%),
                radial-gradient(circle at 90% 0%, rgba(168,85,247,0.18), transparent 40%),
                radial-gradient(circle at 50% 100%, rgba(16,185,129,0.10), transparent 45%),
                #05070f;
    background-attachment: fixed;
}
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.09);
}
.glass-strong {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.glass-soft {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.glass-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 150ms, border-color 150ms, box-shadow 150ms;
}
.glass-input:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
    outline: none;
}
.btn-glow {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.30);
    transition: box-shadow 150ms, transform 150ms, opacity 150ms;
}
@media (hover: hover) { .btn-glow:hover { box-shadow: 0 10px 30px rgba(139, 92, 246, 0.40); transform: translateY(-1px); } }
.btn-glow:active { transform: translateY(0); }

.nav-link.active {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

/* The terminal (log/console) always keeps a dark screen regardless of theme */
.terminal { background: #05070c; color: #cbd5e1; border-color: rgba(255,255,255,0.08); }
.terminal-head { border-color: rgba(255,255,255,0.08); color: #64748b; }
.terminal-line { border-left: 1px solid rgba(255,255,255,0.08); }
@media (hover: hover) { .terminal-line:hover { background: rgba(255,255,255,0.04); } }
.terminal-muted { color: #64748b; }

.scale-up-animation { animation: scaleUp 0.2s ease-out; }
@keyframes scaleUp { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.35); border-radius: 3px; }
@media (hover: hover) { ::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.55); } }

/* ── Theme settings button ─────────────────────────────────────────────── */
.theme-settings-btn {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background 150ms, color 150ms, transform 150ms;
    flex-shrink: 0;
}
@media (hover: hover) { .theme-settings-btn:hover { background: rgba(255,255,255,0.12); color: #fff; transform: rotate(15deg); } }
html[data-ui-theme-mode="light"] .theme-settings-btn {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.05);
    color: #47536e;
}
@media (hover: hover) { html[data-ui-theme-mode="light"] .theme-settings-btn:hover { background: rgba(15,23,42,0.1); color: #101828; } }

/* ── Theme settings modal ─────────────────────────────────────────────── */
.pmd-theme-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(5, 7, 15, 0.55);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.pmd-theme-overlay[hidden] { display: none; }
.pmd-theme-modal {
    width: 100%; max-width: 380px;
    border-radius: 18px;
    background: rgba(20, 25, 40, 0.92);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: #e8e9ee;
    font-family: inherit;
}
html[data-ui-theme-mode="light"] .pmd-theme-modal {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(15, 23, 42, 0.1);
    color: #1e2233;
    box-shadow: 0 20px 60px rgba(30, 41, 59, 0.25);
}
.pmd-theme-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
    padding: 18px 20px 10px;
}
.pmd-theme-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.pmd-theme-head p { margin: 4px 0 0; font-size: 11.5px; opacity: 0.6; line-height: 1.5; }
.pmd-theme-close {
    background: none; border: none; font-size: 22px; line-height: 1;
    color: inherit; opacity: 0.5; cursor: pointer; flex-shrink: 0; padding: 0;
}
@media (hover: hover) { .pmd-theme-close:hover { opacity: 1; } }
.pmd-theme-body { padding: 8px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pmd-theme-option {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: inherit; font-family: inherit; font-size: 12px; font-weight: 700;
    cursor: pointer; transition: border-color 150ms, background 150ms;
}
html[data-ui-theme-mode="light"] .pmd-theme-option {
    border-color: rgba(15, 23, 42, 0.1);
    background: rgba(15, 23, 42, 0.03);
}
@media (hover: hover) { .pmd-theme-option:hover { border-color: rgba(96, 165, 250, 0.5); } }
.pmd-theme-option.selected { border-color: #60a5fa; background: rgba(59, 130, 246, 0.12); }
.pmd-theme-check { display: none; margin-right: 4px; color: #60a5fa; }
.pmd-theme-option.selected .pmd-theme-check { display: inline; }
.pmd-theme-swatch {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.pmd-swatch-default {
    background: radial-gradient(circle at 25% 25%, rgba(59,130,246,0.9), transparent 60%),
                radial-gradient(circle at 75% 30%, rgba(168,85,247,0.8), transparent 60%),
                #05070f;
}
.pmd-swatch-mesh {
    background: radial-gradient(circle at 25% 30%, hsl(190 70% 55% / .9), transparent 55%),
                radial-gradient(circle at 75% 25%, hsl(310 60% 60% / .8), transparent 55%),
                radial-gradient(circle at 50% 80%, hsl(45 70% 55% / .7), transparent 55%),
                #14151f;
}
.pmd-swatch-apple {
    background: radial-gradient(circle at 30% 25%, rgba(38,92,190,0.95), transparent 60%),
                radial-gradient(circle at 75% 70%, rgba(118,48,140,0.8), transparent 60%),
                #0a0a0d;
}
.pmd-swatch-mono { background: linear-gradient(135deg, #12151d 0%, #1d2230 100%); }
.pmd-theme-mode-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px 18px; font-size: 12.5px; font-weight: 700;
}
.pmd-mode-switch {
    width: 42px; height: 24px; border-radius: 999px;
    border: none; cursor: pointer; position: relative;
    background: rgba(148, 163, 184, 0.35);
    transition: background 150ms;
}
.pmd-mode-switch::before {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; transition: transform 150ms;
}
.pmd-mode-switch.on { background: #3b82f6; }
.pmd-mode-switch.on::before { transform: translateX(18px); }
.pmd-lite-row { padding-top: 0; gap: 12px; }
.pmd-lite-row small { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 500; opacity: 0.6; }
.pmd-lite-row .pmd-mode-switch { flex-shrink: 0; }

/* ============================================================================
   Lite mode (html[data-ui-lite]) — off by default. Keeps the look almost unchanged and removes only the expensive effects.
   1) backdrop-filter blur: the GPU recomputes the blur whenever the screen behind changes → turned off (the translucent background colour stays)
   2) Continuously running glow (box-shadow) · mesh hue rotation (filter) animations → stopped (state is still visible by colour)
   3) Off-screen chat items are not rendered (content-visibility) → saves CPU · memory in long conversations
   The in-progress indicator (spinning icon) and the terminal cursor are left as they are.
   ============================================================================ */
html[data-ui-lite] *, html[data-ui-lite] *::before, html[data-ui-lite] *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
html[data-ui-lite] body::before { animation: none !important; }
/* Without blur the background shows through and text gets less crisp, so only floating surfaces (modal · sheet · menu) are made a little more opaque */
html[data-ui-lite] .glass-strong.shadow-2xl { background: rgba(22, 27, 40, 0.96); }
html[data-ui-lite][data-ui-theme-mode="light"] .glass-strong.shadow-2xl { background: rgba(255, 255, 255, 0.97); }
html[data-ui-lite] .pmd-theme-modal { background: rgb(20, 25, 40); }
html[data-ui-lite][data-ui-theme-mode="light"] .pmd-theme-modal { background: #fff; }
/* Status dot: colour only, no glow. Working is static; needs answer (attention) keeps only a slow blink */
html[data-ui-lite] .status-dot.busy, html[data-ui-lite] .status-dot.waiting { box-shadow: none; }
html[data-ui-lite] .status-dot.busy { animation: none !important; }
html[data-ui-lite] .status-dot.waiting { animation: tdxBlink 2s steps(2, jump-none) infinite !important; }
html[data-ui-lite] .st-waiting { animation: none !important; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3); }
html[data-ui-lite] .sysmon .sm-dot { animation: none !important; box-shadow: none; }
html[data-ui-lite] .cu-dot.run { animation: none !important; }
/* Off-screen chat items · long lists are rendered only when visible (the size from the first render is remembered) */
html[data-ui-lite] .chat-list > *, html[data-ui-lite] .tp-log .chat-list > * {
    content-visibility: auto;
    contain-intrinsic-size: auto 64px;
}
html[data-ui-lite] .win-item { content-visibility: auto; contain-intrinsic-size: auto 52px; }

/* ============================================================================
   Light mode — inverts the dark-assuming utilities all at once
   (the list below is the set of classes actually used in templates/scripts)
   ============================================================================ */
html[data-ui-theme-mode="light"] body { color: #101828; }

/* Text */
html[data-ui-theme-mode="light"] .text-white { color: #101828 !important; }
html[data-ui-theme-mode="light"] .text-white\/90 { color: #1a2233 !important; }
html[data-ui-theme-mode="light"] .text-white\/80 { color: #253046 !important; }
html[data-ui-theme-mode="light"] .text-white\/70 { color: #34405c !important; }
html[data-ui-theme-mode="light"] .text-white\/60 { color: #47536e !important; }
html[data-ui-theme-mode="light"] .text-white\/50 { color: #5a6781 !important; }
html[data-ui-theme-mode="light"] .text-white\/40 { color: #6b7490 !important; }
html[data-ui-theme-mode="light"] .text-white\/35 { color: #77809a !important; }
html[data-ui-theme-mode="light"] .text-white\/30 { color: #8a92aa !important; }
@media (hover: hover) { html[data-ui-theme-mode="light"] .hover\:text-white:hover { color: #101828 !important; } }
html[data-ui-theme-mode="light"] .placeholder-white\/30::placeholder { color: #94a3b8 !important; }
html[data-ui-theme-mode="light"] .nav-link.active { color: #1d4ed8; background: rgba(59,130,246,0.10); border-color: rgba(37,99,235,0.22); }

/* White text on coloured backgrounds (gradient/solid buttons) stays white in light mode too */
html[data-ui-theme-mode="light"] .bg-gradient-to-r.text-white, html[data-ui-theme-mode="light"] .bg-gradient-to-br.text-white, html[data-ui-theme-mode="light"] .btn-glow {
    color: #ffffff !important;
}
@media (hover: hover) { html[data-ui-theme-mode="light"] .hover\:bg-blue-600:hover, html[data-ui-theme-mode="light"] .hover\:bg-red-600:hover, html[data-ui-theme-mode="light"] .hover\:bg-orange-600:hover {
    color: #ffffff !important;
} }
html[data-ui-theme-mode="light"] .bg-gradient-to-r [class*="text-white"],
html[data-ui-theme-mode="light"] .bg-gradient-to-br [class*="text-white"] {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Borders */
html[data-ui-theme-mode="light"] .border-white\/5 { border-color: rgba(15, 23, 42, 0.06) !important; }
html[data-ui-theme-mode="light"] .border-white\/10 { border-color: rgba(15, 23, 42, 0.10) !important; }
html[data-ui-theme-mode="light"] .border-white\/15 { border-color: rgba(15, 23, 42, 0.14) !important; }
html[data-ui-theme-mode="light"] .border-white\/20 { border-color: rgba(15, 23, 42, 0.18) !important; }
@media (hover: hover) { html[data-ui-theme-mode="light"] .hover\:border-white\/20:hover { border-color: rgba(15, 23, 42, 0.2) !important; } }
html[data-ui-theme-mode="light"] .divide-white\/5 > :not([hidden]) ~ :not([hidden]) { border-color: rgba(15, 23, 42, 0.07) !important; }

/* Backgrounds */
html[data-ui-theme-mode="light"] .bg-white\/5 { background-color: rgba(15, 23, 42, 0.04) !important; }
html[data-ui-theme-mode="light"] .bg-white\/10 { background-color: rgba(15, 23, 42, 0.07) !important; }
html[data-ui-theme-mode="light"] .bg-white\/20 { background-color: rgba(15, 23, 42, 0.12) !important; }
@media (hover: hover) { html[data-ui-theme-mode="light"] .hover\:bg-white\/5:hover { background-color: rgba(15, 23, 42, 0.05) !important; } }
@media (hover: hover) { html[data-ui-theme-mode="light"] .hover\:bg-white\/10:hover { background-color: rgba(15, 23, 42, 0.08) !important; } }
html[data-ui-theme-mode="light"] .bg-black\/60 { background-color: rgba(15, 23, 42, 0.35) !important; }

/* Accents — darker so they contrast on a light background */
html[data-ui-theme-mode="light"] .text-blue-300 { color: #1d4ed8 !important; }
html[data-ui-theme-mode="light"] .text-blue-400 { color: #2563eb !important; }
@media (hover: hover) { html[data-ui-theme-mode="light"] .hover\:text-blue-300:hover { color: #1d4ed8 !important; } }
html[data-ui-theme-mode="light"] .text-purple-300,
html[data-ui-theme-mode="light"] .text-purple-400 { color: #7c3aed !important; }
html[data-ui-theme-mode="light"] .text-violet-300 { color: #6d28d9 !important; }
html[data-ui-theme-mode="light"] .text-cyan-300,
html[data-ui-theme-mode="light"] .text-cyan-400 { color: #0e7490 !important; }
@media (hover: hover) { html[data-ui-theme-mode="light"] .hover\:text-cyan-300:hover { color: #155e75 !important; } }
html[data-ui-theme-mode="light"] .text-red-300,
html[data-ui-theme-mode="light"] .text-red-400 { color: #dc2626 !important; }
@media (hover: hover) { html[data-ui-theme-mode="light"] .hover\:text-red-300:hover { color: #b91c1c !important; } }
html[data-ui-theme-mode="light"] .text-emerald-300 { color: #059669 !important; }
html[data-ui-theme-mode="light"] .text-emerald-400 { color: #047857 !important; }
html[data-ui-theme-mode="light"] .text-amber-300,
html[data-ui-theme-mode="light"] .text-amber-400 { color: #b45309 !important; }
html[data-ui-theme-mode="light"] .text-orange-300,
html[data-ui-theme-mode="light"] .text-orange-400 { color: #c2410c !important; }

/* Glass panels */
html[data-ui-theme-mode="light"] .glass {
    background: rgba(255, 255, 255, 0.60);
    border-color: rgba(15, 23, 42, 0.08);
}
html[data-ui-theme-mode="light"] .glass-strong {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(15, 23, 42, 0.10);
}
html[data-ui-theme-mode="light"] .glass-soft {
    background: rgba(255, 255, 255, 0.45);
    border-color: rgba(15, 23, 42, 0.07);
}
html[data-ui-theme-mode="light"] .glass-input {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(15, 23, 42, 0.12);
    color: #101828;
}

/* Scrollbar */
html[data-ui-theme-mode="light"] ::-webkit-scrollbar-thumb { background: rgba(71, 85, 105, 0.35); }
@media (hover: hover) { html[data-ui-theme-mode="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(71, 85, 105, 0.55); } }

/* ============================================================================
   Per-theme backgrounds (the default 'Aurora' dark uses the body defaults above as they are)
   ============================================================================ */

/* Default (Aurora) — light */
html[data-ui-theme-mode="light"]:not([data-ui-theme]) body {
    background: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.14), transparent 35%),
                radial-gradient(circle at 90% 0%, rgba(236, 72, 153, 0.10), transparent 40%),
                radial-gradient(circle at 50% 100%, rgba(16, 185, 129, 0.10), transparent 45%),
                #eef0f9;
    background-attachment: fixed;
}

/* Gradient mesh — a background with subtly shifting colours (dark/light) */
html[data-ui-theme="mesh"] body { background: var(--pmd-mesh-base, #14151f); position: relative; }
html[data-ui-theme="mesh"] body::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background: radial-gradient(at 18% 20%, var(--pmd-mesh-1) 0, transparent 52%),
                radial-gradient(at 82% 15%, var(--pmd-mesh-2) 0, transparent 52%),
                radial-gradient(at 15% 82%, var(--pmd-mesh-3) 0, transparent 52%),
                radial-gradient(at 85% 85%, var(--pmd-mesh-4) 0, transparent 52%),
                var(--pmd-mesh-base, #14151f);
    animation: pmdMeshHue 30s linear infinite;
}
@keyframes pmdMeshHue { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
html[data-ui-theme="mesh"]:not([data-ui-theme-mode="light"]) body {
    --pmd-mesh-base: #14151f;
    --pmd-mesh-1: hsl(190 70% 55% / .26);
    --pmd-mesh-2: hsl(310 60% 60% / .22);
    --pmd-mesh-3: hsl(45 70% 55% / .18);
    --pmd-mesh-4: hsl(260 60% 62% / .22);
}
html[data-ui-theme="mesh"][data-ui-theme-mode="light"] body {
    --pmd-mesh-base: #eef0f4;
    --pmd-mesh-1: hsl(200 60% 65% / .20);
    --pmd-mesh-2: hsl(300 45% 68% / .16);
    --pmd-mesh-3: hsl(40 65% 68% / .15);
    --pmd-mesh-4: hsl(255 45% 68% / .15);
}
@media (prefers-reduced-motion: reduce) {
    html[data-ui-theme="mesh"] body::before { animation: none; }
    .scale-up-animation { animation: none; }
}

/* Apple glass — glass over a wallpaper (dark/light) */
html[data-ui-theme="apple"]:not([data-ui-theme-mode="light"]) body {
    background: radial-gradient(62% 55% at 14% 2%, rgba(38, 92, 190, .42) 0, transparent 62%),
                radial-gradient(52% 48% at 90% 8%, rgba(118, 48, 140, .34) 0, transparent 62%),
                radial-gradient(58% 52% at 78% 96%, rgba(18, 96, 148, .38) 0, transparent 62%),
                radial-gradient(46% 42% at 6% 92%, rgba(72, 52, 150, .3) 0, transparent 62%),
                #0a0a0d;
    background-attachment: fixed;
}
html[data-ui-theme="apple"][data-ui-theme-mode="light"] body {
    background: radial-gradient(62% 55% at 14% 2%, rgba(118, 170, 255, .38) 0, transparent 62%),
                radial-gradient(52% 48% at 88% 8%, rgba(255, 170, 198, .32) 0, transparent 62%),
                radial-gradient(58% 52% at 78% 96%, rgba(140, 205, 255, .34) 0, transparent 62%),
                radial-gradient(46% 42% at 6% 92%, rgba(198, 180, 255, .3) 0, transparent 62%),
                #eef0f5;
    background-attachment: fixed;
}
html[data-ui-theme="apple"] .glass,
html[data-ui-theme="apple"] .glass-strong,
html[data-ui-theme="apple"] .glass-soft {
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
}

/* Minimal flat — solid surfaces with glass/blur removed (dark/light) */
html[data-ui-theme="mono"]:not([data-ui-theme-mode="light"]) body { background: #0b0e14; }
html[data-ui-theme="mono"][data-ui-theme-mode="light"] body { background: #f3f4f6; }
html[data-ui-theme="mono"] .glass,
html[data-ui-theme="mono"] .glass-strong,
html[data-ui-theme="mono"] .glass-soft {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
html[data-ui-theme="mono"]:not([data-ui-theme-mode="light"]) .glass { background: #12151d; border-color: rgba(255,255,255,0.08); }
html[data-ui-theme="mono"]:not([data-ui-theme-mode="light"]) .glass-strong { background: #151924; border-color: rgba(255,255,255,0.10); }
html[data-ui-theme="mono"]:not([data-ui-theme-mode="light"]) .glass-soft { background: #10131b; border-color: rgba(255,255,255,0.06); }
html[data-ui-theme="mono"][data-ui-theme-mode="light"] .glass,
html[data-ui-theme="mono"][data-ui-theme-mode="light"] .glass-strong { background: #ffffff; border-color: rgba(15,23,42,0.10); }
html[data-ui-theme="mono"][data-ui-theme-mode="light"] .glass-soft { background: #f8fafc; border-color: rgba(15,23,42,0.07); }

/* ============================================================================
   Git management screen
   ============================================================================ */
.git-icon-btn {
    width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px; border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.45); transition: color 150ms, background 150ms, border-color 150ms;
}
.git-icon-btn[aria-pressed="true"] { color: #67e8f9; border-color: rgba(34,211,238,0.35); background: rgba(34,211,238,0.10); }
@media (hover: hover) { .git-icon-btn:hover { color: #67e8f9; border-color: rgba(34,211,238,0.35); background: rgba(34,211,238,0.10); } }
html[data-ui-theme-mode="light"] .git-icon-btn { border-color: rgba(15,23,42,0.12); background: rgba(15,23,42,0.04); color: #5a6781; }
html[data-ui-theme-mode="light"] .git-icon-btn[aria-pressed="true"] { color: #0e7490; border-color: rgba(14,116,144,0.35); background: rgba(14,116,144,0.08); }
@media (hover: hover) { html[data-ui-theme-mode="light"] .git-icon-btn:hover { color: #0e7490; border-color: rgba(14,116,144,0.35); background: rgba(14,116,144,0.08); } }

.git-menu {
    position: absolute; z-index: 200; padding: 4px; border-radius: 12px;
    background: rgba(20, 25, 40, 0.97); border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 16px 40px rgba(0,0,0,0.45); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.git-menu.fixed { position: fixed; }
.git-menu button, .git-menu .git-menu-label {
    display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.8); text-align: left;
}
.git-menu button i { width: 14px; text-align: center; color: rgba(255,255,255,0.45); }
@media (hover: hover) { .git-menu button:hover { background: rgba(255,255,255,0.08); color: #fff; } }
.git-menu button.danger { color: #fca5a5; }
.git-menu .git-menu-label { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,0.35); padding-bottom: 2px; }
.git-menu hr { border: 0; border-top: 1px solid rgba(255,255,255,0.08); margin: 4px 2px; }
html[data-ui-theme-mode="light"] .git-menu { background: rgba(255,255,255,0.98); border-color: rgba(15,23,42,0.12); box-shadow: 0 16px 40px rgba(30,41,59,0.18); }
html[data-ui-theme-mode="light"] .git-menu button, html[data-ui-theme-mode="light"] .git-menu .git-menu-label { color: #253046; }
html[data-ui-theme-mode="light"] .git-menu button i { color: #6b7490; }
@media (hover: hover) { html[data-ui-theme-mode="light"] .git-menu button:hover { background: rgba(15,23,42,0.06); } }
html[data-ui-theme-mode="light"] .git-menu button.danger { color: #dc2626; }
html[data-ui-theme-mode="light"] .git-menu .git-menu-label { color: #8a92aa; }
html[data-ui-theme-mode="light"] .git-menu hr { border-top-color: rgba(15,23,42,0.08); }

.git-repo-item.dragging { opacity: 0.4; }
.git-repo-item.drop-before { box-shadow: inset 0 2px 0 #22d3ee; }
.git-repo-item.drop-after { box-shadow: inset 0 -2px 0 #22d3ee; }
.git-folder.drop-into > .git-folder-head { background: rgba(34,211,238,0.12); border-color: rgba(34,211,238,0.4); }
.git-repo-item .git-row-actions { opacity: 0; transition: opacity 120ms; }
.git-repo-item:focus-within .git-row-actions { opacity: 1; }
@media (hover: hover) { .git-repo-item:hover .git-row-actions { opacity: 1; } }
.git-file-row .git-row-actions { opacity: 0; transition: opacity 120ms; }
.git-file-row:focus-within .git-row-actions, .git-file-row.selected .git-row-actions { opacity: 1; }
@media (hover: hover) { .git-file-row:hover .git-row-actions { opacity: 1; } }
.git-file-row.selected { background: rgba(34,211,238,0.10); }
html[data-ui-theme-mode="light"] .git-file-row.selected { background: rgba(14,116,144,0.08); }
@media (hover: none) {
    .git-repo-item .git-row-actions, .git-file-row .git-row-actions { opacity: 1; }
}

/* diff viewer — always a dark terminal background */
.git-diff .dl { display: flex; white-space: pre; min-width: max-content; }
.git-diff .dl > .ln { flex: none; width: 3.2em; padding-right: .6em; text-align: right; color: #475569; user-select: none; }
.git-diff .dl > .tx { flex: 1; padding: 0 .75em; }
.git-diff .add { background: rgba(16,185,129,0.12); color: #a7f3d0; }
.git-diff .del { background: rgba(239,68,68,0.12); color: #fecaca; }
.git-diff .hunk { background: rgba(56,189,248,0.10); color: #7dd3fc; }
.git-diff .meta { color: #64748b; }
.git-diff .ctx { color: #cbd5e1; }
.git-diff .file { color: #f0abfc; font-weight: 700; background: rgba(255,255,255,0.03); }
.git-diff .note { padding: 1rem; color: #64748b; white-space: normal; }
