/* Liquid Glass Design System */
@font-face {
    font-family: "Pretendard EN";
    font-weight: 100 900;
    src: local("Pretendard Variable"), local("Pretendard"), url("https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/woff2/Pretendard-Regular.woff2") format("woff2");
    unicode-range: U+0020-007F;
}

@font-face {
    font-family: "Pretendard EN";
    font-weight: 400;
    src: local("Pretendard-Regular"), local("Pretendard"), url("https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/woff2/Pretendard-Regular.woff2") format("woff2");
    unicode-range: U+0020-007F;
}

@font-face {
    font-family: "Pretendard EN";
    font-weight: 500;
    src: local("Pretendard-Medium"), local("Pretendard"), url("https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/woff2/Pretendard-Medium.woff2") format("woff2");
    unicode-range: U+0020-007F;
}

@font-face {
    font-family: "Pretendard EN";
    font-weight: 600;
    src: local("Pretendard-SemiBold"), local("Pretendard"), url("https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/woff2/Pretendard-SemiBold.woff2") format("woff2");
    unicode-range: U+0020-007F;
}

@font-face {
    font-family: "Pretendard EN";
    font-weight: 700;
    src: local("Pretendard-Bold"), local("Pretendard"), url("https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/woff2/Pretendard-Bold.woff2") format("woff2");
    unicode-range: U+0020-007F;
}

@font-face {
    font-family: "Pretendard EN";
    font-weight: 800;
    src: local("Pretendard-ExtraBold"), local("Pretendard"), url("https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/woff2/Pretendard-ExtraBold.woff2") format("woff2");
    unicode-range: U+0020-007F;
}



:root {
    interpolate-size: allow-keywords;

    --bg-mesh-1: #f8f9fa;
    --bg-mesh-2: #e9ecef;
    --bg-mesh-3: #dee2e6;
    --bg-mesh-4: #f1f3f5;

    --glass-bg: rgba(255, 255, 255, 0.3);
    --glass-hover-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 15px 45px rgba(0, 0, 0, 0.08);
    --glass-hover-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
    --glass-blur: blur(40px);
    --glass-blur-reduced: blur(12px);


    --glass-overlay-bg: rgba(255, 255, 255, 0.4);
    --text-primary: rgba(0, 0, 0, 0.85);
    --text-secondary: rgba(0, 0, 0, 0.5);
    --bg-color: #ffffff;
    --bg-secondary: #ffffff;

    --modal-bg: rgba(255, 255, 255, 0.85);
    --sidebar-bg: rgba(235, 235, 235, 0.5);
    --main-bg: #ffffff;
    --item-hover: rgba(0, 0, 0, 0.05);
    --input-bg: rgba(0, 0, 0, 0.05);
    --border-color: rgba(0, 0, 0, 0.08);
    --separator-color: rgba(0, 0, 0, 0.05);

    --font-sf: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Inter", "San Francisco", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-pretendard: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    --font-jp: "Hiragino Sans", "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
    --font-sc: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-tc: "PingFang TC", "LIHEI Pro", "Microsoft JhengHei", "Noto Sans TC", sans-serif;

    /* Japanese Setup: Latin (SF Pro / Pretendard) + JP (Hiragino First) */
    --font-ja-combined: -apple-system, BlinkMacSystemFont, system-ui, "SF Pro Display", "Pretendard EN", "Hiragino Sans", "Noto Sans JP", sans-serif;

    /* Spring Physics Beziers */
    --spring-elastic: cubic-bezier(0.5, 1.5, 0.5, 1);
    --spring-smooth: cubic-bezier(0.16, 1, 0.3, 1);

    --bg-rgb: 255, 255, 255;
    --text-rgb: 0, 0, 0;
}

.dark-mode {
    --bg-mesh-1: #000000;
    --bg-mesh-2: #111111;
    --bg-mesh-3: #0a0a0a;
    --bg-mesh-4: #050505;

    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-hover-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 15px 45px rgba(0, 0, 0, 0.4);
    --glass-hover-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);

    --glass-overlay-bg: var(--glass-bg);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --bg-color: #000000;
    --bg-secondary: rgba(255, 255, 255, 0.22);

    --modal-bg: rgba(45, 45, 47, 0.85);
    --sidebar-bg: rgba(0, 0, 0, 0.4);
    --main-bg: rgba(28, 28, 30, 0.8);
    --item-hover: rgba(255, 255, 255, 0.15);
    --input-bg: rgba(255, 255, 255, 0.12);
    --border-color: rgba(255, 255, 255, 0.12);
    --separator-color: rgba(255, 255, 255, 0.08);

    --bg-rgb: 0, 0, 0;
    --text-rgb: 255, 255, 255;
}

body.dark-mode,
html.dark-mode {
    background: var(--bg-color);
}

body.has-custom-bg,
html.has-custom-bg {
    background: transparent !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    /* iOS feel */
}

html {
    background: var(--bg-color);
    height: 100%;
}

body {
    font-family: var(--font-sf);
    color: var(--text-primary);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: var(--bg-color);
    /* Clean background */
}

body.lang-ko {
    font-family: var(--font-pretendard), var(--font-sf);
}

body.lang-ja {
    font-family: var(--font-ja-combined);
}

body.lang-zh-cn {
    font-family: var(--font-sf), var(--font-pretendard), var(--font-sc);
}

body.lang-zh-tw {
    font-family: var(--font-sf), var(--font-pretendard), var(--font-tc);
}

/* Grainy Texture */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    /* Much more subtle on white */
    z-index: 999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

/* Background Mesh Animation - Kept but made very subtle for "Clean White" feel */
.background-mesh {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--bg-mesh-1), transparent 50%),
        radial-gradient(circle at 0% 0%, var(--bg-mesh-2), transparent 50%),
        radial-gradient(circle at 100% 100%, var(--bg-mesh-3), transparent 50%);
    background-size: 150% 150%;
    filter: blur(80px);
    /* Slightly reduced from 100px */
    animation: backgroundMove 25s ease-in-out infinite alternate;
    z-index: -4;
    opacity: 0.8;
    will-change: transform;
    transform: translateZ(0);
    /* Hardware acceleration */
}

.low-perf .background-mesh,
.low-perf .noise-overlay {
    display: none !important;
}

.low-perf .bg-image-layer {
    filter: none !important;
    transition: none !important;
}


@keyframes backgroundMove {
    0% {
        transform: rotate(0deg) scale(1);
    }

    100% {
        transform: rotate(15deg) scale(1.15);
    }
}

.glass-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: rgba(255, 255, 255, var(--bg-tint-opacity, 0.4));
    backdrop-filter: var(--glass-overlay-blur, var(--glass-blur));
    -webkit-backdrop-filter: var(--glass-overlay-blur, var(--glass-blur));
}

.dark-mode .glass-overlay {
    background: rgba(255, 255, 255, var(--bg-tint-opacity, 0.08));
}

/* Glass Panel Utility - Liquid Style */
.glass-panel {
    background: var(--glass-bg);
    box-shadow:
        var(--glass-shadow),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        /* Subtle default outline */
        inset 0 0 20px rgba(255, 255, 255, 0.03);
    /* Inner glow reduced for cleaner look */
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 32px;
    will-change: transform, opacity;
    transition: all 0.5s var(--spring-smooth);
    position: relative;
    overflow: hidden;
}

.low-perf .glass-panel,
.low-perf .liquid-dock,
.low-perf .dynamic-island,
.low-perf .search-widget,
.low-perf .glass-overlay,
.low-perf .settings-modal,
.low-perf .ai-chat-popup,
.low-perf .modal-content,
.low-perf .sidebar,
.low-perf .main-content-area {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(var(--bg-rgb), 0.95) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    transition: none !important;
    animation: none !important;
}

.low-perf * {
    transition: none !important;
    animation: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.glass-panel:not(.notification-icon-btn):not(.credit-mini-widget):not(.news-mini-widget):not(.calendar-mini-widget):not(.weather-mini-widget):hover {
    background: var(--glass-hover-bg);
    box-shadow:
        var(--glass-hover-shadow),
        inset 0 0 0 1px var(--glass-border);
    /* Outline appears on hover */
    transform: translateY(-2px) scale(1.01);
}

/* Smooth Color Transition Properties */
@property --glow-c1 {
    syntax: '<color>';
    inherits: true;
    initial-value: transparent;
}

@property --glow-c2 {
    syntax: '<color>';
    inherits: true;
    initial-value: transparent;
}

/* Promotional Modal Popup */
.promo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.promo-modal-overlay.visible {
    opacity: 1;
}

.promo-modal-content {
    width: 90%;
    max-width: 400px;
    padding: 40px 30px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.5s var(--spring-smooth);
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: rgba(var(--bg-rgb), 0.7) !important;
    /* ONLY THIS MODAL: Fine-tuned opacity */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.promo-modal-overlay.visible .promo-modal-content {
    transform: scale(1);
}

.promo-modal-emoji {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 10px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
}

.promo-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.promo-modal-body p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 500;
}

.promo-modal-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.ios-button.large-glow {
    height: 54px;
    font-size: 1.05rem;
    font-weight: 700;
    background: #AF52DE;
    color: white;
    border: none;
    box-shadow: none;
}

.promo-never-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.5;
    cursor: pointer;
    margin-top: 8px;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.promo-never-btn:hover {
    opacity: 1;
}

/* Dynamic Island */
.dynamic-island-container {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.dynamic-island {
    position: relative;
    background: transparent;
    border-radius: 100px;
    height: 38px;
    min-width: 125px;
    padding: 0 25px;
    /* Add padding to adapt to text length */
    max-width: 90vw;
    /* Prevent it from being too wide on small screens */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.6s var(--spring-smooth), --glow-c1 3s ease, --glow-c2 3s ease;
    color: white;
    font-size: 0.9rem;
    overflow: visible;
}

.island-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 100px;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.15), 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.25);
    z-index: 0;
    overflow: hidden;
    transition: all 0.6s var(--spring-smooth);
    background: rgba(0, 0, 0, 0.15);
    /* Soft dark base */
}

.dynamic-island.expanded {
    height: auto;
    min-height: 80px;
    width: 380px;
    border-radius: 32px;
    padding: 22px 28px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: default;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.dynamic-island.expanded .island-bg {
    border-radius: 30px;
}

.dynamic-island:not(.expanded) {
    cursor: pointer;
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: all 0.3s ease;
}

.dynamic-island.expanded .content {
    white-space: normal;
}

.greeting {
    transition: all 0.5s var(--spring-smooth);
    font-weight: 700;
    white-space: nowrap;
    display: inline-block;
}

.dynamic-island.expanded .greeting {
    white-space: normal;
    font-size: 1rem;
    margin-bottom: 8px;
    opacity: 1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
}

.ai-briefing {
    font-size: 0.85rem;
    opacity: 0;
    max-height: 0;
    width: 0;
    /* Important: prevent it from stretching parent width when collapsed */
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    margin-top: 0;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    word-break: keep-all;
    white-space: nowrap;
    /* Prevent stretching during intermediate states */
    font-weight: 400;
}

.dynamic-island.expanded .ai-briefing {
    opacity: 1;
    max-height: 500px;
    width: 100%;
    /* Restore width when expanded */
    white-space: normal;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.ai-briefing.error {
    color: #ffcccc;
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Beautiful soft rotating gradient for Island background */
.island-bg::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    /* Oversized to prevent harsh corners */
    background: conic-gradient(from 0deg, var(--glow-c1), var(--glow-c2), var(--glow-c1), var(--glow-c2), var(--glow-c1));
    animation: spinSmooth 24s linear infinite;
    transform: translate(-50%, -50%);
    filter: blur(52px);
    /* Massive blur = no sharp lines */
    opacity: 0.18;
    transition: opacity 0.6s var(--spring-smooth);
    will-change: transform;
}

.low-perf .island-bg::before,
.low-perf .island-glow,
.low-perf .island-glow::before {
    display: none !important;
}

.low-perf .island-bg {
    background: #000 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}


.dynamic-island:hover:not(.expanded) {
    /* Keep it subtle, expansion is handled by JS for pro users */
    transform: scale(1.02);
}

.dynamic-island:hover .island-bg::before {
    opacity: 0.38;
}

.island-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 100px;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    /* Clips the spinning glow to the island's shape */
    filter: blur(8px);
    /* Blurs the clipped shape to create a clean outline glow */
    opacity: 0.15;
    transition: all 0.6s var(--spring-smooth);
}

/* Ambient circulating glow restricted to the outline */
.island-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    background: conic-gradient(from 0deg, var(--glow-c1), var(--glow-c2), var(--glow-c1), var(--glow-c2), var(--glow-c1));
    animation: spinSmooth 18s linear infinite;
    transform: translate(-50%, -50%);
    filter: blur(16px);
    /* Soften the sharp edges of the conic gradient */
}

.dynamic-island:hover .island-glow {
    opacity: 0;
}

@keyframes spinSmooth {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Time Themes */
.dynamic-island.theme-sunrise {
    --glow-c1: rgba(255, 149, 0, 0.4);
    --glow-c2: rgba(255, 204, 0, 0.4);
}

.dynamic-island.theme-morning {
    --glow-c1: rgba(52, 199, 89, 0.4);
    --glow-c2: rgba(90, 200, 250, 0.4);
}

.dynamic-island.theme-noon {
    --glow-c1: rgba(90, 200, 250, 0.4);
    --glow-c2: rgba(191, 230, 255, 0.4);
}

.dynamic-island.theme-sunset {
    --glow-c1: rgba(255, 204, 0, 0.4);
    --glow-c2: rgba(255, 149, 0, 0.4);
}

.dynamic-island.theme-twilight {
    --glow-c1: rgba(0, 122, 255, 0.4);
    --glow-c2: rgba(175, 82, 222, 0.4);
}

.dynamic-island.theme-night {
    --glow-c1: rgba(0, 122, 255, 0.3);
    --glow-c2: rgba(28, 28, 30, 0.4);
}



.content {
    opacity: 0.8;
    transition: opacity 0.3s;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.greeting.ai-loading {
    opacity: 0.5;
    animation: pulseGreeting 1.5s infinite;
}

/* Now Island AI Briefing Loading Dots */
.dynamic-island.expanded .ai-briefing.ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    color: transparent !important;
    /* Hide "Preparing" text while loading */
    text-shadow: none !important;
    /* Remove the blurry shadow residue */
    position: relative;
}

.dynamic-island.expanded .ai-briefing.ai-loading::after {
    content: "";
    width: 60px;
    /* Fixed width of the loading bar */
    height: 4px;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent),
        rgba(255, 255, 255, 0.12);
    background-size: 300% 100%, 100% 100%;
    background-repeat: no-repeat;
    border-radius: 100px;
    animation: aiThinking 1.0s infinite ease-in-out alternate;
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

@keyframes aiThinking {
    0% {
        background-position: -120px 0, 0 0;
    }

    100% {
        background-position: 0px 0, 0 0;
    }
}

@keyframes pulseGreeting {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 0.3;
    }
}

.dynamic-island:hover .content {
    opacity: 1;
}

/* Now Island Off Hover Notice */
.now-island-hover-notice {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background: rgba(0, 0, 0, 0.75);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s var(--spring-smooth);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 200;
}

.dark-mode .now-island-hover-notice {
    background: rgba(50, 50, 55, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.now-island-hover-notice.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* Main Clock */
.main-content {
    text-align: center;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through if needed */
}

.clock-widget {
    padding: 30px 50px;
    background: none;
    border-radius: 40px;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    text-align: center;
}

.time {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    line-height: 1;
    font-size: 8.5rem;
    font-weight: 800;
    font-family: var(--clock-number-font, var(--font-sf));
    letter-spacing: -4.5px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.05));
    font-variant-numeric: proportional-nums;
}

.dark-mode .time {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.7) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.2));
}

.seconds-time {
    position: absolute;
    left: calc(100% + 10px);
    bottom: 1rem;
    font-size: 2.8rem;
    font-weight: 700;
    opacity: 0.6;
    background: inherit;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums;
    /* Use padding to prevent clipping from background-clip: text */
    padding-right: 20px;
    white-space: nowrap;
}

.date {
    font-size: 1.8rem;
    color: var(--text-primary);
    opacity: 0.7;
    margin-top: 10px;
    font-weight: 600;
    text-shadow: none;
}

/* Search Widget */
.search-widget {
    margin: 30px auto 0 auto;
    width: fit-content;
    height: auto;
    min-height: 64px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-radius: 100px;
    /* Pill shape */
    transition: width 0.5s var(--spring-smooth),
        background 0.5s var(--spring-smooth),
        border-color 0.5s var(--spring-smooth),
        transform 0.5s var(--spring-smooth),
        border-radius 0.5s var(--spring-smooth);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    pointer-events: auto;
    position: relative;
    cursor: text;
    overflow: visible !important;
}

.search-widget-top-row {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 64px;
    width: 100%;
    padding: 0 24px;
    box-sizing: border-box;
    flex-shrink: 0;
    /* Prevent top row from squishing during animations */
}

.search-widget.has-suggestions {
    border-radius: 32px;
}

.search-widget:hover {
    background: var(--glass-hover-bg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(0) scale(1.01);
}

.search-widget:focus-within {
    width: 580px;
    background: var(--bg-color);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 4px rgba(99, 102, 241, 0.1);
    border-radius: 32px;
}


.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.search-widget:focus-within .search-icon {
    color: #6366f1;
}

.search-input-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: none;
    height: 100%;
}

.search-widget:focus-within .search-input-wrapper {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

#searchInput {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: none;
    border: none;
    outline: none;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
    font-family: var(--font-sf);
    letter-spacing: -0.01em;
    cursor: text;
    user-select: text;
    padding: 0;
    margin: 0;
}

.search-mirror {
    visibility: hidden;
    white-space: pre;
    font-size: 1.15rem;
    font-weight: 500;
    font-family: var(--font-sf);
    letter-spacing: -0.01em;
    pointer-events: none;
    padding-right: 8px;
    /* buffer for caret */
}

#searchInput::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Search Suggestions Dropdown */
.search-suggestions-dropdown {
    border-top: 1px solid transparent;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-bottom-left-radius: 31px;
    border-bottom-right-radius: 31px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden auto;
    z-index: 1000;
    padding: 0;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    margin-top: 0;
    pointer-events: none;

    /* Smooth height transition support */
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s var(--spring-smooth),
        opacity 0.25s ease,
        padding 0.35s var(--spring-smooth),
        border-color 0.25s ease;
}

.search-suggestions-dropdown.visible {
    border-top-color: var(--glass-border);
    opacity: 1;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: auto;
}

/* Custom Scrollbar for suggestions */
.search-suggestions-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.search-suggestions-dropdown::-webkit-scrollbar-thumb {
    background: rgba(var(--text-rgb), 0.15);
    border-radius: 10px;
}

.search-suggestions-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--text-rgb), 0.3);
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 0;
    border-radius: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    text-align: left;
    user-select: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background: var(--glass-hover-bg);
}

/* AI Specific Suggestion Item */
.search-suggestion-item.ai-suggest-item {
    background: transparent;
}

.search-suggestion-item.ai-suggest-item:hover,
.search-suggestion-item.ai-suggest-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08)) !important;
}

.ai-suggest-item .search-suggestion-text {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow: hidden;
}

.ai-suggest-item .user-query {
    font-weight: 600;
    max-width: 50%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.ai-suggest-item .ai-label {
    color: #6366f1;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

.ai-suggest-item .ai-arrow {
    color: rgba(99, 102, 241, 0.6);
    font-weight: bold;
    margin-left: auto;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.search-suggestion-item.ai-suggest-item:hover .ai-arrow,
.search-suggestion-item.ai-suggest-item.active .ai-arrow {
    color: #6366f1;
}

/* Engine Specific Suggestion Item */
.search-suggestion-item.engine-suggest-item {
    background: transparent;
}

.search-suggestion-item.engine-suggest-item:hover,
.search-suggestion-item.engine-suggest-item.active {
    background: rgba(var(--text-rgb), 0.05) !important;
}

.engine-suggest-item .search-suggestion-text {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow: hidden;
}

.engine-suggest-item .user-query {
    font-weight: 600;
    max-width: 50%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.engine-suggest-item .engine-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

.engine-suggest-item .engine-arrow {
    color: var(--text-secondary);
    opacity: 0.5;
    font-weight: bold;
    margin-left: auto;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.search-suggestion-item.engine-suggest-item:hover .engine-arrow,
.search-suggestion-item.engine-suggest-item.active .engine-arrow {
    opacity: 0.9;
}

.search-suggestion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0.6;
    flex-shrink: 0;
}

/* Recommended Badges & Item Highlighting */
.search-suggestion-item.recommended {
    background: rgba(var(--text-rgb), 0.02);
    border-left: 3px solid transparent;
}

.search-suggestion-item.ai-suggest-item.recommended {
    border-left-color: #6366f1;
}

.search-suggestion-item.engine-suggest-item.recommended {
    border-left-color: rgba(var(--text-rgb), 0.3);
}

.recommend-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    /* Completely rounded Capsule/Pill look */
    margin-left: 8px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-suggest-item .recommend-badge {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.engine-suggest-item .recommend-badge.search-badge {
    background: rgba(var(--text-rgb), 0.06);
    color: var(--text-secondary);
    border: 1px solid rgba(var(--text-rgb), 0.15);
}

.search-suggestion-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dock */
.dock-container {
    position: absolute;
    bottom: 40px;
    z-index: 100;
    display: flex;
    justify-content: center;
    width: 100%;
}

.liquid-dock {
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(50px) saturate(180%);
    -webkit-backdrop-filter: blur(50px) saturate(180%);
    border: 1px solid var(--glass-border);
    min-height: 74px;
    align-items: flex-end;
    margin-bottom: 0;
    overflow: visible !important;
}

.liquid-dock::before {
    display: none;
    /* Remove specular for dock to avoid clipping weirdness */
}

.dock-tooltip {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s var(--spring-smooth);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    z-index: 1000;
}

.dock-tooltip.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dock-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.85) transparent transparent transparent;
}

.dock-item {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--spring-smooth);
    cursor: pointer;
    position: relative;
    transform-origin: bottom center;
    z-index: 1;
    overflow: hidden;
    cursor: grab;
}

.dock-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
    pointer-events: none;
    z-index: 2;
    transition: all 0.3s var(--spring-smooth);
}

.dock-item:hover::after {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.5), 0 4px 10px rgba(0, 0, 0, 0.08);
}

.dock-item.dragging-icon {
    opacity: 0.4;
    cursor: grabbing;
}

.dock-item:hover {
    z-index: 10;
    /* Bring hovered item to front */
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.dock-item .icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-sf);
    font-size: 1.5rem;
    pointer-events: none;
}

.dock-item .icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 18px;
    /* contain is safer for brand shapes, but with no bg it looks full */
    display: block;
    /* Follow parent radius */
}

.dock-item .icon img.favicon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.favicon-icon {
    padding: 10px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.favicon-icon img {
    border-radius: 0 !important;
}

body.dark-mode .favicon-icon {
    background: rgba(255, 255, 255, 0.9);
}

/* Remove background and border if it's an image icon for 'full' maximized look */
.dock-item:has(img) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.dock-item:has(img):hover {
    background: transparent !important;
}

/* Widgets */
.widgets-container {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
    z-index: 100;
}

.left-widgets-container {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    z-index: 100;
}

.news-mini-widget {
    width: 320px;
    /* Wider */
    height: 500px;
    /* Slightly longer */
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.05);
    transition: all 0.3s var(--spring-smooth);
    user-select: none;
}

/* Refresh Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.refresh-icon.spinning {
    animation: spin 0.6s linear infinite;
}

.news-footer {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-top: auto;
    text-align: right;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .news-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dark-mode .news-mini-widget {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    opacity: 0.9;
}

.refresh-icon {
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s;
}

.refresh-icon:hover {
    transform: rotate(180deg);
    opacity: 1;
}

.news-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-left: 6px;
    padding-right: 6px;
    margin-left: -6px;
    margin-right: -6px;
}

.news-items::-webkit-scrollbar {
    width: 0;
}

.news-items-ja {
    font-family: var(--font-ja-combined) !important;
}

.news-item {
    display: flex;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    align-items: flex-start;
    padding: 4px 6px;
    border-radius: 16px;
    margin: 0 -6px;
}

.news-item:hover {
    background-color: var(--item-hover);
}

.news-item:active {
    transform: scale(0.98);
}

.news-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.news-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
    word-break: keep-all;
}


.news-item-meta {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-item-source {
    font-weight: 700;
}

.news-item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dark-mode .news-item-thumb {
    background: rgba(255, 255, 255, 0.05);
}

.news-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.news-item:hover .news-item-thumb img {
    transform: scale(1.1);
}

.news-item-source {
    font-weight: 700;
}

.mini-widget {
    width: 140px;
    height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    color: var(--text-primary);
    padding: 15px;
    text-align: center;
}

.weather-mini-widget {
    width: 150px;
    height: 150px;
}

.dark-mode .mini-widget {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-widget:active {
    transform: scale(0.95);
}

.widget-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.05));
    flex-shrink: 0;
}

.dark-mode .widget-icon {
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.15));
}

.widget-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    width: 100%;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: keep-all;
}

.setup-msg {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
    line-height: 1.3;
    margin-top: 4px;
    word-break: keep-all;
    padding: 0 5px;
}

.city-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    font-size: 0.8rem;
}

.temp-val {
    font-size: 1.2rem;
    font-weight: 800;
    margin-top: 2px;
}

/* Responsiveness */
@media (max-width: 768px) {
    .time {
        font-size: 4rem;
    }

    .mini-widget {
        width: 100px;
        height: 100px;
    }

    .weather-mini-widget {
        width: 110px;
        height: 110px;
    }

    .widgets-container {
        right: 20px;
    }
}

/* Settings Modal - macOS Style */
.settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 800px;
    height: 600px;
    z-index: 2000;
    transition: all 0.5s var(--spring-smooth);
    opacity: 0;
    pointer-events: none;
}

.settings-modal.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.modal-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: var(--modal-bg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border-color);
}

/* Sidebar */
.settings-sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 12px 0;
}

.sidebar-header {
    padding: 0 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.row-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

..row-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.row-icon img[src*="github_icon.png"],
.row-icon img[src*="linktree_icon.png"],
.row-icon img[src*="lemonsqueezy_icon.png"],
.row-icon img[src*="toonation_icon.png"] {
    width: 140%;
    height: 140%;
    margin: -20%;
    object-fit: cover;
}

.window-controls {
    display: flex;
    gap: 8px;
    padding: 4px 0;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.control.close {
    background: #ff5f57;
}

.sidebar-search input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    /* Absolute pill shape */
    padding: 8px 16px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.3s var(--spring-smooth);
    color: var(--text-primary);
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 4px 8px;
    border-radius: 16px;
    cursor: pointer;
}

.sidebar-profile:hover {
    background: var(--item-hover);
}

.dark-mode .sidebar-profile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    background: var(--input-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.profile-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-sub {
    font-size: 0.65rem;
    color: #666;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    border-radius: 999px;
    /* Absolute pill shape */
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.beta-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    color: #fff !important;
    /* Force override .setting-row span color */
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    padding: 2px 6px;
    border-radius: 8px;
    /* Original pill shape */
    letter-spacing: 0.5px !important;
    line-height: 1 !important;
}

.nav-item .beta-badge {
    margin-left: auto;
}

.dark-mode .beta-badge {
    background-color: rgba(255, 255, 255, 0.9);
    color: #000 !important;
    /* Force override */
}

.beta-badge.large {
    font-size: 0.75rem !important;
    padding: 3px 8px !important;
    border-radius: 10px !important;
    margin-left: 8px;
}

.pro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FF6B6B 0%, #a03bff 100%);
    color: #fff !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    padding: 2px 6px;
    border-radius: 8px;
    letter-spacing: 0.5px !important;
    line-height: 1 !important;
}

.nav-item .pro-badge {
    margin-left: auto;
}

.pro-badge.large {
    font-size: 0.75rem !important;
    padding: 3px 8px !important;
    border-radius: 10px !important;
    margin-left: 8px;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-item.active {
    background: #007aff;
    color: #fff;
    border-radius: 999px;
    /* Absolute pill shape */
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: default;
}

.nav-separator {
    height: 1px;
    background: var(--separator-color);
    margin: 8px 16px;
}

/* Donation Tab Styles */
.donation-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 20px;
    gap: 12px;
}

.row-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.row-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.row-icon img.smaller {
    transform: none;
}

.donation-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 84px;
    margin-bottom: 12px;
}

.license-key-img {
    border-radius: 20px;
    filter: drop-shadow(0 8px 16px rgba(255, 149, 0, 0.25));
}

@keyframes keyFloat {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-5px) rotate(-4deg);
        filter: drop-shadow(0 10px 18px rgba(255, 149, 0, 0.38));
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

.donation-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.donation-card p {
    font-size: 0.85rem;
    color: #666;
    max-width: 250px;
    line-height: 1.4;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.donate-btn {
    margin-top: 10px;
    padding: 10px 24px !important;
    text-decoration: none;
    font-weight: 600;
}

/* Active License UI */
.active-license-card {
    background: var(--glass-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 8px 24px;
}

body.dark-mode .active-license-card {
    border-color: rgba(255, 255, 255, 0.05);
}

.license-card-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.license-info {
    display: flex;
    flex-direction: column;
}

.license-to-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.license-key-display {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2px 0;
    letter-spacing: -0.3px;
}

.license-used-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.license-deact-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, box-shadow;
}

.license-deact-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.08);
}

.license-deact-btn:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
}

body.dark-mode .license-deact-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .license-deact-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        0 8px 20px rgba(0, 0, 0, 0.4);
}

.device-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.device-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1rem;
    flex-shrink: 0;
}

.device-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.device-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.device-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.device-del-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.5),
        0 4px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, box-shadow;
}

.device-del-btn:hover {
    background: rgba(0, 0, 0, 0.09);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.6),
        0 6px 14px rgba(0, 0, 0, 0.06);
}

.device-del-btn:active {
    transform: translateY(0) scale(0.92);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

body.dark-mode .device-del-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.25);
}

body.dark-mode .device-del-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        0 6px 14px rgba(0, 0, 0, 0.35);
}

/* About Developer Tab Styles */
.developer-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.developer-info {

    .developer-avatar {
        width: 80px;
        height: 80px;
        background: var(--sidebar-bg);
        border-radius: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border: 1px solid var(--border-color);
        overflow: hidden;
    }

    .developer-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    display: flex;
    align-items: center;
    gap: 20px;
}


.developer-details h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.developer-details p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 4px 0 0;
    font-weight: 500;
}

.company-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.company-icon svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.company-tag {
    color: var(--text-secondary);
}

.developer-bio {
    background: rgba(0, 0, 0, 0.03);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.dark-mode .developer-bio {
    background: rgba(255, 255, 255, 0.05);
}

.developer-bio p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    color: var(--text-primary);
}

.tab-pane .pane-subheader {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin: 14px 0 10px 16px;
    letter-spacing: 0.5px;
}

.nav-icon.about-dev {
    background: #8e8e93;
    color: white;
}

.nav-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--modal-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-icon.ai {
    background: transparent !important;
    box-shadow: none !important;
}

.nav-icon.ai img {
    width: 22px;
    /* Standardized to match the container and Now Island */
    height: 22px;
    object-fit: contain;
}

.nav-item.active .nav-icon {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.nav-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 8px 10px;
}

/* Main Content Area */
.settings-main {
    flex: 1;
    background: var(--main-bg);
    display: flex;
    flex-direction: column;
    padding: 0 32px;
    /* Slightly reduced padding */
    overflow-y: auto;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.content-header {
    padding: 24px 0 12px;
}

.pane-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.pane-icon {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pane-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 10px;
}

.pane-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

/* Segmented Control (Widgets & Dock) */
.seg-control {
    position: relative;
    display: flex;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 3px;
    margin-bottom: 12px;
    gap: 2px;
    overflow: hidden;
}

.seg-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    height: calc(100% - 6px);
    background: var(--bg-secondary, #ffffff);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.08s ease;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
}

.seg-thumb.moving {
    opacity: 0.5;
}

.seg-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 7px 12px;
    border: none;
    background: transparent;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease, font-weight 0.2s ease;
    white-space: nowrap;
}

.seg-btn.active {
    color: var(--text-primary);
    font-weight: 600;
}

.seg-panel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.seg-section {
    position: relative;
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.seg-section.seg-visible {
    display: block;
    visibility: visible;
}

.seg-section.seg-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.settings-group {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 24px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--separator-color);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row.no-border {
    border-bottom: none !important;
}

.setting-row span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}


.setting-row.link {
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
}

.setting-row.link:hover {
    background: var(--item-hover);
}

.setting-row.link:active {
    background: rgba(0, 0, 0, 0.1);
}

.dark-mode .setting-row.link:active {
    background: rgba(255, 255, 255, 0.1);
}

.setting-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.row-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.row-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.row-icon img.smaller {
    transform: none;
}


.row-icon.gray {
    background: #8e8e93;
}

.row-icon.blue {
    background: linear-gradient(180deg, #0082FF 0%, #0070FF 100%);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.35),
        0 4px 10px rgba(0, 112, 255, 0.2);
    border: 1px solid rgba(51, 198, 255, 0.4);
    box-sizing: border-box;
}

.row-icon.green {
    background: linear-gradient(180deg, #34c759 0%, #28a745 100%);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.35),
        0 4px 10px rgba(52, 199, 89, 0.2);
    border: 1px solid rgba(80, 220, 100, 0.4);
    box-sizing: border-box;
}

.row-icon.purple {
    background: linear-gradient(180deg, #b76bf2 0%, #af52de 100%);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.35),
        0 4px 10px rgba(175, 82, 222, 0.2);
    border: 1px solid rgba(220, 160, 255, 0.4);
    box-sizing: border-box;
}

.row-icon.orange {
    background: linear-gradient(180deg, #ffaa33 0%, #ff9500 100%);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.35),
        0 4px 10px rgba(255, 149, 0, 0.2);
    border: 1px solid rgba(255, 210, 120, 0.4);
    box-sizing: border-box;
}

.row-icon.github-dark {
    background: linear-gradient(180deg, #444b54 0%, #24292e 100%);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.2),
        0 4px 10px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-sizing: border-box;
}

.row-icon.white {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.row-arrow {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.5;
}

.back-btn {
    background: none;
    border: none;
    color: #007aff;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    margin-right: 12px;
}

.back-btn:hover {
    opacity: 0.7;
}

.setting-row.vertical {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.row-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.row-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.row-icon img.smaller {
    transform: none;
}

/* Release Notes */
.release-notes-container {
    padding: 8px 16px;
}

.release-notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.release-notes-list li {
    font-size: 0.9rem;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.release-notes-list li:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.badge.bugfix {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

.badge.new {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
}

.dark-mode .badge.bugfix {
    background: rgba(255, 69, 58, 0.2);
    color: #ff453a;
}

.dark-mode .badge.new {
    background: rgba(48, 209, 88, 0.2);
    color: #30d158;
}

.badge.latest {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    margin-left: 6px;
}

.dark-mode .badge.latest {
    background: rgba(10, 132, 255, 0.2);
    color: #0a84ff;
}


/* Form Elements */
/* Consolidated iOS-style Select and Input */
.ios-select {
    background: transparent;
    border: none;
    font-size: 0.9rem;
    color: #007aff;
    cursor: pointer;
    text-align: right;
    text-align-last: right;
    outline: none;
    -webkit-appearance: auto;
    appearance: auto;
    min-width: 160px;
    width: auto;
    max-width: 240px;
    white-space: nowrap;
}

.ios-select:hover {
    opacity: 0.7;
}

.setting-row.vertical .ios-select {
    width: 100%;
    text-align: left;
    text-align-last: left;
    background: var(--input-bg);
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-color);
    border: 1px solid transparent;
}

.ios-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 999px !important;
    padding: 10px 24px !important;
    font-size: 0.9rem;
    outline: none;
    color: var(--text-primary);
    transition: all 0.3s var(--spring-smooth);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ios-input:focus {
    background: var(--bg-color);
    border-color: #007aff;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.02),
        0 0 0 4px rgba(0, 122, 255, 0.15);
}

.search-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.search-btn {
    background: var(--sidebar-bg);
    color: var(--text-primary);
    border: none;
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:hover {
    background: var(--item-hover);
}

.danger-btn {
    background: #ff4d4d;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.danger-btn:hover {
    background: #ff3333;
}

.search-btn.primary {
    background: #007aff;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.search-btn.primary:hover {
    background: #0062cc;
    box-shadow: 0 6px 15px rgba(0, 122, 255, 0.25);
}

.search-btn:active,
.danger-btn:active {
    transform: scale(0.98);
}

.city-results-list {
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    background: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.city-result-item {
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.city-result-item:hover {
    background: #007aff;
    color: #fff;
}

.api-credit {
    font-size: 0.7rem;
    color: #999;
    margin-top: 8px;
}

/* Restore minimal Welcome Guide styles if needed, or maintain them */

/* Consistently styled selects */

/* Consistently styled buttons */
.ios-button {
    border: none;
    border-radius: 999px !important;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    outline: none;
    text-decoration: none;
    will-change: transform, box-shadow;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Glow Button Style: Premium Gradient + Inner Glow + Soft Shadow */
.ios-button.primary {
    background: #0070FF;
    color: white !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(51, 198, 255, 0.4);
}

.ios-button.primary:hover {
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
    background: #0082FF;
}

.ios-button.primary:active {
    transform: translateY(0) scale(0.96);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* Purple Glow variant */
.ios-button.purple {
    background: #6366f1;
    color: white !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(129, 140, 248, 0.4);
}

.ios-button.purple:hover {
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
    background: #818cf8;
}

.ios-button.purple:active {
    transform: translateY(0) scale(0.96);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}


/* Standard iOS-style Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 24px;
    cursor: pointer;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.08);
    transition: 0.3s;
    border-radius: 20px;
}

.dark-mode .slider {
    background-color: rgba(255, 255, 255, 0.12);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 32px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 9px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background-color: #34c759;
}

input:checked+.slider:before {
    transform: translateX(16px);
}

/* Custom premium range slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #007aff var(--slider-progress, 40%), var(--border-color) var(--slider-progress, 40%));
    outline: none;
    transition: background 0.1s ease;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: transparent;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 18px;
    border-radius: 9px;
    /* Capsule/pill shape */
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    margin-top: -6px;
    /* Centers the thumb on the track */
    border: none;
    transition: transform 0.1s ease, opacity 0.1s ease;
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(0.95);
    opacity: 0.6;
    /* Semi-transparent white thumb when dragged */
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: transparent;
    border-radius: 3px;
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 18px;
    border: none;
    border-radius: 9px;
    /* Capsule/pill shape */
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.1s ease, opacity 0.1s ease;
    opacity: 1;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    opacity: 1;
}

input[type="range"]::-moz-range-thumb:active {
    transform: scale(0.95);
    opacity: 0.6;
    /* Semi-transparent white thumb when dragged */
}

/* Slider floating tooltip */
.slider-tooltip {
    position: absolute;
    top: -26px;
    background: var(--text-primary);
    color: var(--bg-color);
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 5px);
    transition: opacity 0.15s ease, transform 0.15s var(--spring-smooth);
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.slider-tooltip::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 3px 3px 0;
    border-style: solid;
    border-color: var(--text-primary) transparent;
    display: block;
    width: 0;
}

/* Show tooltip when slider input is hovered or actively being dragged */
.slider-wrapper:hover .slider-tooltip,
.slider-wrapper.dragging .slider-tooltip {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Welcome Guide */
.welcome-guide {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 1000;
    width: 360px;
    padding: 40px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.7s var(--spring-elastic);
    background: var(--modal-bg);
    /* Light mode guide */
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

/* Tutorial Highlight Spotlight */
.tutorial-spotlight {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    box-shadow: 0 0 0 5000px rgba(0, 0, 0, 0.45);
    /* Darker focus */
    z-index: 9999;
    pointer-events: none;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.tutorial-spotlight.visible {
    opacity: 1;
}

/* Tutorial Overlay Container */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.tutorial-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Fluid Tutorial Card / Update Modal */
.tutorial-card {
    width: 400px;
    background: rgba(var(--bg-rgb), 0.75);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 36px;
    padding: 40px;
    text-align: center;
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translateY(30px);
    transition: all 0.8s var(--spring-smooth);
    position: absolute;
    display: flex;
    flex-direction: column;
}

.dark-mode .tutorial-card {
    background: rgba(28, 28, 32, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 40px 120px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.update-modal {
    max-width: 95vw;
}

.update-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.update-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.update-app-icon-wrapper {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.update-app-icon {
    width: 60%;
    height: 60%;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

.update-icon-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: linear-gradient(135deg, #007AFF, #5856D6, #FF2D55);
    border-radius: 30px;
    filter: blur(25px);
    opacity: 0.35;
    animation: updatePulse 5s infinite;
}

@keyframes updatePulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.5;
    }
}

.update-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
    margin: 0;
}

.version-tag {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 4px;
    display: inline-block;
}

.update-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.update-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    word-break: keep-all;
    opacity: 0.9;
}

.update-actions {
    display: flex;
    gap: 16px;
    width: 100%;
    margin-top: 8px;
}

.update-actions .tutorial-btn {
    flex: 1;
    padding: 18px 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.update-actions .tutorial-btn.primary {
    background: #3E3BDE;
    color: white;
    box-shadow: 0 4px 15px rgba(62, 59, 222, 0.25);
}

.update-actions .tutorial-btn.primary:hover {
    box-shadow: 0 6px 20px rgba(62, 59, 222, 0.3);
}

.update-actions .tutorial-btn.secondary {
    background: rgba(var(--text-rgb), 0.04);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--text-rgb), 0.1);
}



.update-actions .tutorial-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.tutorial-pagination {
    display: none;
}

/* Feature Highlights */
.ui-highlight {
    display: none;
    /* Replaced by spotlight system */
}

.ui-highlight.visible {
    opacity: 1;
}

.highlight-label {
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: white;
    padding: 6px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(0, 122, 255, 0.3);
}

/* Specific Visual Previews (Optional/CSS-based) */
.tutorial-visual {
    width: 240px;
    height: 120px;
    margin-bottom: 24px;
    background: var(--sidebar-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.notes-preview::before {
    content: "📝";
    font-size: 2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: moveNotes 3s infinite;
}

@keyframes moveNotes {
    0% {
        transform: translate(-100px, -50%) scale(1);
        opacity: 0;
    }

    20% {
        transform: translate(-100px, -50%) scale(1);
        opacity: 1;
    }

    80% {
        transform: translate(0, 30px) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translate(0, 30px) scale(0.5);
        opacity: 0;
    }
}

.island-preview::before {
    content: "🏝️";
    font-size: 1.5rem;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.island-preview::after {
    content: "AI Briefing Summary...";
    font-size: 0.7rem;
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    width: 140px;
    text-align: left;
    opacity: 0;
    animation: islandHover 3s infinite;
}

@keyframes islandHover {

    0%,
    20% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    40%,
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

.clock-preview::before {
    content: "12:00";
    font-size: 2rem;
    font-weight: 800;
    position: absolute;
    top: 50%;
    left: 45%;
    transform: translate(-50%, -50%);
}

.clock-preview::after {
    content: "45";
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
    position: absolute;
    top: 55%;
    left: 65%;
    transform: translate(-50%, -50%);
    animation: blinkSeconds 1s infinite;
}

@keyframes blinkSeconds {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0.4;
    }
}

.nav-divider-vertical {
    width: 1px;
    height: 30px;
    background: var(--separator-color);
    align-self: center;
    margin: 0 4px;
}

/* AI Popup - Grande Overhaul 2.0 */
.ai-popup {
    position: fixed;
    bottom: 110px;
    right: 40px;
    width: 440px;
    height: 600px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    z-index: 9999;
    /* Ensure it stays above other widgets */
    transform: translateY(30px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 30px 80px rgba(0, 0, 0, 0.3));
}

/* Responsive adjustments for smaller screens */
@media (max-height: 780px) {
    .ai-popup {
        bottom: 90px;
        height: 520px;
    }
}

@media (max-height: 640px) {
    .ai-popup {
        bottom: 80px;
        height: 440px;
    }
}

@media (max-width: 520px) {
    .ai-popup {
        right: 20px;
        width: calc(100vw - 40px);
    }
}

.ai-popup.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.ai-popup-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

.ai-popup-wrapper.liquid-glass {
    backdrop-filter: blur(60px) saturate(210%) brightness(1.05);
    -webkit-backdrop-filter: blur(60px) saturate(210%) brightness(1.05);
    background: rgba(var(--bg-rgb), 0.85);
    border: 1px solid rgba(var(--text-rgb), 0.12);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.15),
        0 30px 100px rgba(0, 0, 0, 0.25);
}

.dark-mode .ai-popup-wrapper.liquid-glass {
    background: rgba(22, 22, 26, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 40px 120px rgba(0, 0, 0, 0.5);
}

.ai-dock-icon {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white !important;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ai-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(var(--text-rgb), 0.08);
    background: transparent;
    backdrop-filter: blur(20px);
    z-index: 10;
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ai-sparkle-bg {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ai-title-group {
    display: flex;
    flex-direction: column;
}

.ai-header-title {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    line-height: 1.2;
}

.ai-credit-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6366f1;
    opacity: 0.8;
    margin-top: 4px;
}

.ai-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-action-btn,
.ai-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    background: rgba(var(--text-rgb), 0.04);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-input-wrapper {
    padding: 12px 20px 16px;
}

.ai-input-area.modern-box.ai-input-capsule {
    display: block;
    background: rgba(var(--bg-rgb), 0.55);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(var(--text-rgb), 0.1);
    border-radius: 999px;
    padding: 6px 8px 6px 6px;
    min-height: 0;
    transition: border-color 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 0 24px rgba(255, 255, 255, 0.12),
        0 8px 28px rgba(0, 0, 0, 0.06);
    text-align: left !important;
    width: 100%;
    box-sizing: border-box;
}

.dark-mode .ai-input-area.modern-box.ai-input-capsule {
    background: rgba(28, 28, 32, 0.72);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 32px rgba(255, 255, 255, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.35);
}

.ai-input-area.modern-box.ai-input-capsule:focus-within {
    border-color: rgba(var(--text-rgb), 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 0 36px rgba(255, 255, 255, 0.2),
        0 0 64px rgba(255, 255, 255, 0.08),
        0 10px 36px rgba(0, 0, 0, 0.08);
}

.dark-mode .ai-input-area.modern-box.ai-input-capsule:focus-within {
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 0 40px rgba(255, 255, 255, 0.1),
        0 0 72px rgba(255, 255, 255, 0.04),
        0 10px 40px rgba(0, 0, 0, 0.4);
}

.ai-input-area.modern-box.ai-input-capsule.is-multiline {
    border-radius: 26px;
}

.ai-input-area.modern-box.ai-input-capsule.search-active {
    border-radius: 24px;
    padding: 10px 14px 10px 14px;
}

.ai-input-area.modern-box.ai-input-capsule.search-active .ai-input-capsule-row {
    display: grid;
    grid-template-areas:
        "input input input"
        "tools active send";
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.ai-input-area.modern-box.ai-input-capsule.search-active .ai-input-field-wrap {
    grid-area: input;
    width: 100%;
}

.ai-input-area.modern-box.ai-input-capsule.search-active .ai-tools-container {
    grid-area: tools;
}

.ai-input-area.modern-box.ai-input-capsule.search-active .ai-active-tools {
    grid-area: active;
    justify-self: start;
}

.ai-input-area.modern-box.ai-input-capsule.search-active .ai-send-round {
    grid-area: send;
    justify-self: end;
}

.ai-input-capsule-row {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-height: 44px;
}

.ai-input-field-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

#aiChatInput {
    width: 100% !important;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.45;
    resize: none;
    padding: 10px 4px;
    margin: 0;
    font-family: inherit;
    text-align: left !important;
    transition: opacity 0.3s ease;
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#aiChatInput::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#aiChatInput::placeholder {
    color: var(--text-secondary);
    opacity: 0.75;
}

#aiChatInput:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-input-area.modern-box.working {
    border-color: rgba(239, 68, 68, 0.35);
}

.ai-send-round {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff !important;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, color 0.2s ease;
    padding: 0;
}

.dark-mode .ai-send-round {
    background: #fff;
    color: #000 !important;
    border: none;
}

.ai-send-round:hover {
    background: #222;
}

.dark-mode .ai-send-round:hover {
    background: #e4e4e7;
}

.ai-send-round:active {
    transform: scale(0.95) translateY(0);
}

.ai-send-round svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    stroke: none;
}

#aiChatSend.stop-mode {
    background: linear-gradient(135deg, #ff453a 0%, #ff2d55 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 100, 130, 0.45) !important;
    box-shadow:
        inset 0 1px 1.5px rgba(255, 255, 255, 0.4),
        0 4px 12px rgba(255, 45, 85, 0.35) !important;
}

#aiChatSend.stop-mode:hover {
    background: linear-gradient(135deg, #ff5b52 0%, #ff3b30 100%) !important;
    box-shadow:
        inset 0 1px 1.5px rgba(255, 255, 255, 0.5),
        0 6px 20px rgba(255, 45, 85, 0.5),
        0 0 30px rgba(255, 45, 85, 0.3) !important;
}

#aiChatSend.stop-mode:active {
    transform: scale(0.95) translateY(0) !important;
    box-shadow:
        inset 0 1px 1px rgba(0, 0, 0, 0.1),
        0 2px 6px rgba(255, 45, 85, 0.4) !important;
}

#aiChatSend.stop-mode svg {
    margin-left: 0;
}

.ai-active-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    margin-bottom: 0;
    padding: 0 2px 0 4px;
    flex-shrink: 0;
}

.ai-active-tools:empty {
    display: none;
    margin-bottom: 0;
}

.ai-attach-btn,
.ai-send-btn,
.ai-action-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.ai-attach-btn:hover,
.ai-action-btn:hover {
    background: var(--item-hover);
    color: var(--text-primary);
}

.ai-action-btn:hover,
.ai-close-btn:hover {
    background: var(--item-hover);
    color: var(--text-primary);
}

.ai-action-btn.active {
    background: #6366f1;
    color: white;
}

.ai-action-btn.deep {
    background: #a855f7;
    color: white;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.ai-search-container,
.ai-tools-container {
    position: relative;
}

.ai-tools-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #3d4f6f;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.dark-mode .ai-tools-btn {
    color: #cbd5e1;
}

.ai-tools-btn:hover {
    background: rgba(61, 79, 111, 0.08);
    color: #2c3e55;
}

.dark-mode .ai-tools-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
}

.ai-tools-btn svg {
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.ai-tools-btn.active svg {
    transform: rotate(45deg);
}

.ai-tools-btn.active {
    background: rgba(var(--text-rgb), 0.1);
    color: var(--text-primary);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.12);
}

.ai-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 15px;
    border-radius: 100px;
    font-size: 0.88rem;
    font-weight: 600;
    background: rgba(0, 85, 255, 0.08);
    color: #0055ff;
    border: 1px solid rgba(0, 85, 255, 0.22);
    box-shadow: 0 2px 8px rgba(0, 85, 255, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    animation: toolChipEnter 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes toolChipEnter {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ai-tool-chip:hover {
    background: rgba(0, 85, 255, 0.14);
    border-color: rgba(0, 85, 255, 0.35);
    transform: translateY(-0.5px);
}

.ai-tool-chip.deep {
    background: rgba(168, 85, 247, 0.08);
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.25);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.06);
}

.ai-tool-chip.deep:hover {
    background: rgba(168, 85, 247, 0.14);
    border-color: rgba(168, 85, 247, 0.35);
}

.dark-mode .ai-tool-chip {
    background: rgba(0, 130, 255, 0.12);
    border-color: rgba(0, 130, 255, 0.3);
    color: #3fa9ff;
}

.dark-mode .ai-tool-chip:hover {
    background: rgba(0, 130, 255, 0.2);
    border-color: rgba(0, 130, 255, 0.45);
}

.dark-mode .ai-tool-chip.deep {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.35);
    color: #c084fc;
}

.dark-mode .ai-tool-chip.deep:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
}

.ai-tool-chip button {
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
}

.ai-tool-chip button:hover {
    opacity: 1;
}

.ai-tools-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: min(260px, calc(100vw - 32px));
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    padding: 8px;
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 1);
    display: none;
    flex-direction: column;
    z-index: 1000;
    animation: menuFadeInUp 0.2s ease;
}

.dark-mode .ai-tools-menu {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.ai-tools-menu.visible {
    display: flex;
}

.ai-tools-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-radius 0.2s ease;
}

.ai-tools-item:hover:not(:disabled) {
    background: var(--item-hover);
    border-radius: 999px;
}

.ai-tools-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.ai-tools-item.active {
    background: rgba(var(--text-rgb), 0.08);
    color: var(--text-primary);
    border-radius: 999px;
}

.ai-tools-item.active.deep {
    background: rgba(var(--text-rgb), 0.12);
    color: var(--text-primary);
    border-radius: 999px;
}

.ai-tools-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(var(--text-rgb), 0.06);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-tools-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ai-tools-label {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.3;
}

.ai-tools-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.ai-tools-cost {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0.7;
    flex-shrink: 0;
}

.ai-tools-divider {
    height: 1px;
    margin: 4px 8px;
    background: var(--border-color);
    opacity: 0.65;
}

.ai-tools-back {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.ai-tools-back:hover {
    background: var(--item-hover);
    color: var(--text-primary);
}

.ai-tools-connector-view .ai-connector-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.ai-tools-liquid-only.hidden {
    display: none !important;
}

.ai-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--modal-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    animation: menuFadeIn 0.2s ease;
}

.ai-dropdown-menu.visible {
    display: flex;
}

.ai-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-dropdown-item:hover {
    background: var(--item-hover);
    color: var(--text-primary);
}

.ai-dropdown-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    font-weight: 500;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-dropdown-menu.up {
    top: auto;
    bottom: calc(100% + 12px);
    right: auto;
    left: 0;
    animation: menuFadeInUp 0.2s ease;
}

@keyframes menuFadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-active-badge-container {
    display: none;
    /* Removed separate container */
}

.ai-action-btn.is-pill {
    width: auto;
    min-width: 80px;
    height: 38px;
    padding: 0 14px;
    gap: 8px;
    border-radius: 100px;
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    box-shadow: none;
}

.ai-action-btn.is-pill.deep {
    background: rgba(168, 85, 247, 0.1);
    color: #9333ea;
    border-color: rgba(168, 85, 247, 0.3);
}

.ai-action-btn.is-pill .pill-close {
    margin-left: 4px;
    font-size: 1.2rem;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ai-action-btn.is-pill .pill-close:hover {
    opacity: 1;
}

.ai-search-status.deep {
    border-left: none;
    background: none;
}

.ai-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.ai-chat-view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ai-search-status {
    align-self: flex-start;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: none;
    padding: 4px 0;
    margin: 4px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.ai-search-status strong {
    color: #6366f1;
    font-weight: 600;
}

.ai-search-status .search-icon {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.animated-glow-text {
    background: linear-gradient(120deg,
            rgba(0, 0, 0, 0.65) 35%,
            rgba(0, 0, 0, 0.35) 50%,
            rgba(0, 0, 0, 0.65) 65%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow-sweep-rtl 3.5s infinite linear;
    display: inline-block;
}

.dark-mode .animated-glow-text {
    background: linear-gradient(120deg,
            rgba(255, 255, 255, 0.55) 35%,
            rgba(255, 255, 255, 0.95) 50%,
            rgba(255, 255, 255, 0.55) 65%);
    background-size: 300% auto;
}

@keyframes glow-sweep-rtl {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Dynamic searching favicon card styles */
.search-status-cards {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}

.status-favicon-card {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: faviconSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        margin 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.status-favicon-card.slide-out {
    width: 0 !important;
    opacity: 0 !important;
    margin-right: -6px !important;
    border-width: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}

.dark-mode .status-favicon-card {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.1);
}

.status-favicon-card img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    border-radius: 2px;
}

@keyframes faviconSlideIn {
    0% {
        opacity: 0;
        transform: translateX(12px) scale(0.6);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}


.search-pulse {
    animation: searchPulse 1.5s ease-in-out infinite;
}

@keyframes searchPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Messages */
.ai-messages::-webkit-scrollbar {
    width: 5px;
}

.ai-messages::-webkit-scrollbar-thumb {
    background: rgba(var(--text-rgb), 0.1);
    border-radius: 10px;
}

.ai-welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 40px;
    padding: 0 20px;
}

.ai-welcome-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 20px rgba(99, 102, 241, 0.2));
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.ai-welcome-container h3 {
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), #6366f1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(99, 102, 241, 0.1);
}

.ai-welcome-container p {
    font-size: 1rem;
    color: var(--text-secondary);
    opacity: 0.7;
    max-width: 260px;
    margin: 0 auto;
    font-weight: 500;
}

.ai-message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 22px;
    font-size: 0.94rem;
    line-height: 1.55;
    position: relative;
    word-break: break-word;
    animation: messageAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.ai-message.ai {
    align-self: flex-start;
    background: var(--input-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
    border: 1px solid var(--border-color);
    padding-right: 40px;
    /* Space for copy button */
}

.ai-copy-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
}

.ai-message.ai:hover .ai-copy-btn {
    opacity: 1;
}

.ai-copy-btn:hover {
    background: var(--item-hover);
    color: var(--text-primary);
}

.dark-mode .ai-message.ai {
    background: rgba(255, 255, 255, 0.05);
}

.ai-thinking {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* AI Action Card - iOS Control Center Style */
.ai-action-card {
    margin-top: 12px;
    padding: 16px;
    background: rgba(var(--text-rgb), 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--text-rgb), 0.08);
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    animation: actionSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ai-action-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

.action-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #007aff;
    /* Default iOS Blue */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    flex-shrink: 0;
}

.action-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.action-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.action-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.7;
}

.dark-mode .ai-action-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes actionSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.thinking-dots {
    display: flex;
    align-items: center;
    width: 35px;
    /* Fixed width of the loading bar */
    height: 4px;
    background:
        linear-gradient(90deg, transparent, #AF52DE, transparent),
        rgba(175, 82, 222, 0.12);
    background-size: 300% 100%, 100% 100%;
    background-repeat: no-repeat;
    border-radius: 100px;
    animation: aiChatThinking 1.0s infinite ease-in-out alternate;
    position: relative;
    box-shadow: 0 0 10px rgba(175, 82, 222, 0.15);
}

.thinking-dots span {
    display: none;
}

@keyframes aiChatThinking {
    0% {
        background-position: -70px 0, 0 0;
    }

    100% {
        background-position: 0px 0, 0 0;
    }
}

.ai-input-wrapper {
    padding: 20px 24px 16px;
    background: transparent;
}

.ai-disclaimer {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.5;
    text-align: center;
    margin-top: 10px;
    font-weight: 400;
    line-height: 1.4;
}

/* Removed old styles */



.ai-send-btn {
    width: 36px;
    height: 36px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.ai-send-btn:hover {
    background: #4f46e5;
}

.ai-send-btn:active {
    transform: scale(0.95);
}

.ai-send-btn svg {
    transform: rotate(45deg) translate(-1px, 1px);
}

.ai-attachment-preview {
    margin-bottom: 12px;
    padding: 0 4px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 16px;
    max-width: 100%;
    animation: messageAppear 0.3s ease-out;
}

.attachment-thumb {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    overflow: hidden;
    flex-shrink: 0;
}

.dark-mode .attachment-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.attachment-remove {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(var(--text-rgb), 0.1);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.attachment-remove:hover {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
}


/* Danger Zone Styles */
.pane-subheader {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 24px 0 8px 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.6;
}

.pane-subheader#versionTextSub,
.pane-subheader.version-label {
    text-transform: none;
}

.settings-group {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    margin: 0 8px 24px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.setting-row {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.setting-row:last-child {
    border-bottom: none;
}

.pane-subheader.danger {
    color: #ff3b30;
}

.danger-zone {
    border-color: rgba(255, 59, 48, 0.2);
}

.setting-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-desc {
    font-size: 0.75rem !important;
    color: var(--text-secondary) !important;
    font-weight: 400 !important;
}

.connector-item {
    align-items: flex-start !important;
    padding: 16px !important;
}

.connector-info {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.connector-icon-box {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.dark-mode .connector-icon-box {
    background: rgba(255, 255, 255, 0.1);
}

/* Connector List Refinement */
.connectors-list {
    background: var(--input-bg);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.connector-wrapper {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
}

.connector-wrapper:last-child {
    border-bottom: none;
}

.connector-item {
    padding: 14px 16px !important;
    border-bottom: none !important;
    background: transparent !important;
}

.connector-sub-setting {
    padding: 0 16px 14px 60px;
    /* Align with text after icon (28px + 16px gap + small offset) */
    display: flex;
    flex-direction: column;
}

.ios-select.mini,
.ios-input.mini {
    width: 100%;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    height: 36px !important;
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.03) !important;
    border-radius: 10px !important;
    transition: all 0.2s;
}

.dark-mode .ios-select.mini,
.dark-mode .ios-input.mini {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.02) !important;
}

.ios-select.mini:focus,
.ios-input.mini:focus {
    background: var(--sidebar-bg) !important;
    border: 1px solid var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.connector-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.connector-meta span {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: var(--text-primary);
}

.connector-meta .setting-desc {
    margin-top: 2px !important;
    line-height: 1.3;
    opacity: 0.8;
}

.danger-btn {
    background: #ff3b30;
    color: #fff;
    border: none;
    border-radius: 999px;
    /* Absolute pill shape */
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.danger-btn:hover {
    background: #ff453a;
    transform: scale(1.05);
}

.search-btn.large {
    padding: 14px 24px;
    font-size: 1rem;
    width: 100%;
}

/* Dock Item Editor */
.dock-item-edit-row {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    gap: 12px;
}

.dock-item-inputs {
    display: grid;
    grid-template-columns: auto 1.6fr 1.4fr 80px auto;
    gap: 10px;
    align-items: center;
}

.dock-item-inputs input {
    width: 100%;
    border-radius: 999px !important;
    padding: 8px 16px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon svg.input-field-svg-icon {
    position: absolute;
    left: 14px;
    color: var(--text-color);
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s;
}

.input-with-icon input {
    padding-left: 34px !important;
}

.input-with-icon:focus-within svg.input-field-svg-icon {
    opacity: 0.85;
}

.row-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #000;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow: hidden;
}

.dock-editor-preview-icon {
    color: #000 !important;
}

.dark-mode .dock-editor-preview-icon {
    color: #fff !important;
}

.row-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.icon-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.icon-upload-pill-container {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--input-bg);
    width: 80px;
    height: 38px;
    box-sizing: border-box;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.1s;
}

.icon-upload-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-color);
    transition: background-color 0.2s;
    user-select: none;
    box-sizing: border-box;
}

.icon-upload-pill-container:not(.has-split) .upload-action {
    width: 100%;
}

.icon-upload-pill-container.has-split .upload-action {
    width: 50%;
}

.icon-upload-pill-container.has-split .delete-action {
    width: 50%;
}

.icon-upload-pill-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.icon-upload-pill-btn:active {
    background: rgba(255, 255, 255, 0.15);
}

.pill-text {
    font-weight: 500;
}

.pill-divider {
    width: 1px;
    height: 16px;
    background: var(--border-color);
    flex-shrink: 0;
}

.remove-dock-item {
    background: #ff3b30;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
    transition: all 0.2s;
}

.remove-dock-item:hover {
    background: #ff453a;
    transform: scale(1.1);
}

/* Show Iframe for AI */
.ai-iframe {
    display: block !important;
    width: 100%;
    height: 100%;
    border: none;
}

.ai-web-prompt {
    display: none !important;
    /* Hide fallback by default, only show if specifically needed? */
}

/* Notes Popup */
.notes-popup {
    position: fixed;
    bottom: 40px;
    right: 210px;
    /* Positioned relative to widgets */
    width: 350px;
    height: 450px;
    z-index: 2000;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s var(--spring-smooth);
}

.notes-popup.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Specific positioning for Notifications Center to expand from the top-left icon */
#notificationsPopup {
    position: absolute;
    /* Relative to #notificationGroup */
    top: 0;
    left: 0;
    display: none;
    transform-origin: 0 0;
    transform: scale(0.4) translate(0, 0);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s var(--spring-smooth);
    border-radius: 20px;
    width: 320px;
    height: 480px;
    z-index: 2002;
    background: transparent;
}

#notificationsPopup.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translate(0, 50px);
}


.notes-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--modal-bg) !important;
}

.notes-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.notes-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notes-title {
    font-weight: 700;
    color: var(--text-primary);
}

.notes-header-right {
    display: flex;
    gap: 12px;
}

.row-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.row-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.row-icon img.smaller {
    transform: none;
}

.note-action-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #007aff;
    transition: transform 0.2s;
}



.notes-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.notes-list {
    display: flex;
    flex-direction: column;
}

.noti-badge-pill {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #FF2D55;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    z-index: 5;
    box-shadow: 0 0 0 2px var(--modal-bg);
}

.unread-dot {
    width: 6px;
    height: 6px;
    background: #FF2D55;
    border-radius: 50%;
    position: absolute;
    top: 20px;
    left: 8px;
    box-shadow: 0 0 8px rgba(255, 45, 85, 0.4);
}

.note-item.unread {
    background: rgba(255, 45, 85, 0.05) !important;
}

.note-item.unread:hover {
    background: rgba(255, 45, 85, 0.08) !important;
}

.note-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.note-item:hover {
    background: var(--item-hover);
    transform: translateX(2px);
}

.note-item:active {
    background: rgba(var(--accent-rgb), 0.05);
    transform: scale(0.985);
}

.note-item-text {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
    color: var(--text-primary);
}

.note-delete-btn {
    opacity: 0;
    font-size: 1.2rem;
    color: #ff3b30;
    padding: 4px;
    transition: opacity 0.2s;
}

.note-item:hover .note-delete-btn {
    opacity: 1;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.note-editor-view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.note-textarea {
    flex: 1;
    width: 100%;
    border: none;
    background: transparent;
    padding: 16px;
    font-size: 1rem;
    line-height: 1.5;
    outline: none;
    resize: none;
    font-family: inherit;
    color: var(--text-primary);
}

.sidebar-profile {
    margin: 10px 12px;
    padding: 12px 18px;
    border-radius: 999px;
    /* Absolute pill shape */
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.sidebar-profile:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-profile.active {
    background: #007aff !important;
    color: white !important;
    border-radius: 999px !important;
}

.sidebar-profile.active .profile-name {
    color: white !important;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    background: #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Draggable State */
.manual-pos {
    position: fixed !important;
    transform: none !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 500;
}

.mini-widget,
.clock-widget,
.ai-popup,
.search-widget {
    cursor: grab;
    user-select: none;
}

/* Update Notification Styles */
.update-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    min-width: 450px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 18px 28px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.12);
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translate(-50%, 30px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.update-content {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}

.update-icon {
    font-size: 1.5rem;
}

#updateText {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1d1d1f;
}

.update-actions {
    display: flex;
    gap: 8px;
}

.update-btn-action {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    padding: 8px 18px;
    border-radius: 999px;
    /* Absolute pill shape */
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #1d1d1f;
}

.update-btn-action:hover {
    background: rgba(0, 0, 0, 0.1);
}

.update-btn-action.primary {
    background: #007aff;
    color: white;
}

.update-btn-action.primary:hover {
    background: #0062cc;
}

.mini-widget:active,
.clock-widget:active,
.ai-popup:active,
.search-widget:active:not(:focus-within) {
    cursor: grabbing;
    transform: scale(1.02);
    z-index: 1000;
}

.dragging {
    opacity: 0.8;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* Wallpaper Redesign */
.wallpaper-preview-section {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    /* Prevent breaking on narrow screens */
}

.current-wallpaper-preview {
    width: 200px;
    /* Further reduced */
    height: 112px;
    /* 16:9 */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background: #eee;
    position: relative;
    flex-shrink: 0;
}

.current-wallpaper-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.current-wallpaper-info {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.wallpaper-details h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.wallpaper-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
    margin: -4px 0 0 0;
    font-weight: 500;
}

.author-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
}

.author-link:hover {
    color: var(--text-primary);
    opacity: 1;
    text-decoration: underline;
}

/* Jamsil Color Picker Circles */
.color-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.color-circle[data-color="default"] {
    background: linear-gradient(135deg, #e5c9fc 0%, #9bc7fc 100%);
}

.color-circle[data-color="green"] {
    background: linear-gradient(135deg, #e0f7cc 0%, #a4e7b0 100%);
}

.color-circle[data-color="blue"] {
    background: linear-gradient(135deg, #cbe3fc 0%, #a2d2fc 100%);
}

.color-circle.active {
    outline: 2px solid #007aff;
    outline-offset: 2px;
}

.color-circle:hover {
    transform: scale(1.15);
}

.wallpaper-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.soft-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--spring-smooth);
    border: 1px solid var(--border-color);
}

.wallpaper-categories {
    margin-bottom: 20px;
}

.wallpaper-category {
    margin-bottom: 24px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.category-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.view-all {
    font-size: 0.75rem;
    color: #007aff;
    font-weight: 600;
    cursor: pointer;
}

.wallpaper-grid-scroll {
    overflow-x: auto;
    padding: 4px 4px 12px;
    margin: 0 -4px;
    scrollbar-width: thin;
}

.dark-mode .wallpaper-grid-scroll {
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.wallpaper-grid {
    display: flex;
    gap: 12px;
}

.wallpaper-item {
    flex: 0 0 100px;
    /* More compact */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.item-thumb {
    width: 100px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--input-bg);
    position: relative;
    border: 2px solid transparent;
    transition: all 0.25s var(--spring-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wallpaper-item.active .item-thumb {
    border-color: #007aff;
}

.wallpaper-item span {
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    width: 100%;
}

.item-thumb.add-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--input-bg);
    border: 1px dashed var(--border-color);
}

.add-photo .plus {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.add-photo span {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Custom Wallpaper Delete Btn */
.wallpaper-item {
    position: relative;
}

.remove-wp-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff3b30;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid var(--modal-bg);
    z-index: 10;
    line-height: 1;
}

.wallpaper-item:hover .remove-wp-btn {
    display: flex;
}

.remove-wp-btn:hover {
    background: #ff453a;
}

/* Wallpaper PRO Badge Position */
.item-thumb .pro-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.folder-thumb .pro-badge {
    z-index: 10;
}

.dark-mode .current-wallpaper-preview {
    background: #2c2c2e;
}

.coming-soon-banner {
    width: 100%;
    height: 60px;
    background: var(--input-bg);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.6;
}

/* Wallpaper Folders & Navigation styling */
.folder-thumb {
    background: none;
    border: none;
    box-shadow: none;
    position: relative;
    width: 100px;
    height: 60px;
    overflow: visible;
    perspective: 500px;
    /* Enable 3D tilt */
}

/* Back Plate of Folder */
.folder-back {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80%;
    /* 48px */
    background: linear-gradient(135deg, rgba(66, 147, 245, 0.8), rgba(30, 111, 222, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    z-index: 1;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Folder Tab */
.folder-back::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 6px;
    width: 32px;
    height: 8px;
    background: rgba(66, 147, 245, 0.8);
    border-radius: 4px 4px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 1;
}

.stacked-thumbs-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
    transition: transform 0.25s var(--spring-smooth);
}

.folder-thumb .stacked-thumb {
    position: absolute;
    width: 54px !important;
    height: 33px !important;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.25s var(--spring-smooth);
}

.stacked-0 {
    transform: rotate(-8deg) translate(-6px, -4px);
    z-index: 1;
}

.stacked-1 {
    transform: rotate(6deg) translate(6px, -6px);
    z-index: 2;
}

.stacked-2 {
    transform: rotate(-2deg) translate(0, -8px);
    z-index: 3;
}

/* Front Cover of Folder */
.folder-front {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    /* 36px */
    background: linear-gradient(135deg, rgba(90, 168, 255, 0.5), rgba(40, 122, 235, 0.4));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 0 8px 8px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.45);
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 5;
    box-shadow:
        0 -2px 6px rgba(0, 0, 0, 0.05),
        0 4px 10px rgba(0, 122, 255, 0.1);
    transition: transform 0.25s var(--spring-smooth), box-shadow 0.25s var(--spring-smooth);
    transform-origin: bottom;
}

/* Dark mode overrides for folders */
.dark-mode .folder-back {
    background: linear-gradient(135deg, rgba(30, 111, 222, 0.6), rgba(10, 70, 160, 0.5));
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.3);
}

.dark-mode .folder-back::before {
    background: rgba(30, 111, 222, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.dark-mode .folder-front {
    background: linear-gradient(135deg, rgba(60, 140, 240, 0.35), rgba(20, 90, 190, 0.25));
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 -2px 6px rgba(0, 0, 0, 0.2),
        0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Hover Animations */
.folder-item:hover .folder-front {
    transform: rotateX(-24deg);
    /* Tilts forward */
    box-shadow:
        0 -4px 10px rgba(0, 0, 0, 0.1),
        0 6px 16px rgba(0, 122, 255, 0.2);
}

.folder-item:hover .stacked-0 {
    transform: rotate(-14deg) translate(-10px, -14px) scale(1.08);
}

.folder-item:hover .stacked-1 {
    transform: rotate(12deg) translate(10px, -16px) scale(1.08);
}

.folder-item:hover .stacked-2 {
    transform: rotate(0deg) translate(0, -20px) scale(1.1);
}

/* Back button item styling */
.back-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: all 0.25s var(--spring-smooth);
}

.back-item:hover .back-thumb {
    background: var(--item-hover);
    color: var(--text-primary);
}

.back-arrow {
    display: inline-block;
    transition: transform 0.25s var(--spring-smooth);
}

.back-item:hover .back-arrow {
    transform: translateX(-4px);
}

.dark-mode .item-thumb.add-icon {
    background: rgba(255, 255, 255, 0.03);
}

.bg-image-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background-size: cover;
    background-position: center;
    display: none;
}

/* Confirm Modal */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-modal.visible {
    opacity: 1;
}

.confirm-wrapper {
    width: 300px;
    padding: 28px;
    text-align: center;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-color);
}

.dark-mode .confirm-wrapper,
.dark-mode .confirm-wrapper:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.confirm-modal.visible .confirm-wrapper {
    transform: scale(1);
}

#confirmMessage {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: keep-all;
    overflow-wrap: break-word;
}

#alertIcon {
    text-align: center;
}

#alertMessage {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 22px;
    color: var(--text-primary);
    line-height: 1.5;
    text-align: center;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
}

.row-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.row-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.row-icon img.smaller {
    transform: none;
}

.confirm-buttons button {
    flex: 1;
    padding: 12px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.ios-button.primary.danger {
    background: #FF3B30 !important;
    color: white !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 105, 97, 0.4);
}

.ios-button.primary.danger:hover {
    background: #FF453A !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.ios-button.primary.blue {
    background: #007AFF !important;
    color: white !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(100, 182, 255, 0.4);
}

.ios-button.primary.blue:hover {
    background: #0A84FF !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.ios-button.secondary {
    background: var(--item-hover, rgba(0, 0, 0, 0.05)) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.05);
}

.ios-button.secondary:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.08);
}

.dark-mode .ios-button.secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode .ios-button.secondary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.confirm-buttons button:active {
    transform: scale(0.97);
}

/* Disable glass-panel hover for modal */
.confirm-wrapper:hover {
    transform: scale(1) !important;
    background: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3) !important;
}

/* Toast Notification (iOS Style) */
.toast-notification {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 30000;
    transition: all 0.6s var(--spring-smooth);
    opacity: 0;
    pointer-events: none;
}

.dark-mode .toast-notification {
    background: rgba(45, 45, 47, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.toast-notification.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}


.toast-icon {
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

#toastMessage {
    font-weight: 500;
    font-size: 0.95rem;
}

/* Weather Search & Edition UI Refinements */
.weather-edit-row {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    margin: 4px 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .weather-edit-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.weather-city-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.weather-row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    border: none;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.3s var(--spring-smooth);
    flex-shrink: 0;
    padding: 0 !important;
    line-height: 0 !important;
}

.icon-btn svg {
    display: block;
    color: currentColor;
    margin: 0 !important;
}



.icon-btn.edit-weather {
    /* Uses ios-button secondary glow */
}

.icon-btn.remove-weather {
    /* Uses ios-button primary danger glow */
    font-weight: bold;
    font-size: 1.2rem;
}

#weatherSettingsContainer {
    padding: 4px 16px 16px;
}

.api-credit {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin: 12px 0 16px;
    text-align: center;
}

/* Weather Detail Popup */
.weather-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    /* Higher than widgets */
    width: 380px;
    max-width: 90vw;
}

.weather-detail-wrapper {
    padding: 0;
    overflow: hidden;
    animation: popupFadeIn 0.4s var(--spring-smooth);
    background: var(--modal-bg) !important;
}

.weather-detail-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--separator-color);
}

#detailCityName {
    font-size: 1.25rem;
    font-weight: 700;
}

.weather-detail-content {
    padding: 24px;
    min-height: 200px;
}

.detail-main {
    text-align: center;
    margin-bottom: 30px;
}

.detail-temp-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

#detailTemp {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.detail-unit {
    font-size: 2rem;
    font-weight: 500;
    opacity: 0.7;
    margin-bottom: 15px;
}

#detailIcon {
    font-size: 3.5rem;
}

#detailDesc {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.03);
    padding: 15px;
    border-radius: 16px;
}

.dark-mode .detail-stats {
    background: rgba(255, 255, 255, 0.05);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 700;
}

.forecast-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.forecast-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.forecast-day {
    flex: 1;
    font-weight: 500;
}

.forecast-icon {
    flex: 0.5;
    text-align: center;
}

.forecast-temps {
    flex: 1;
    text-align: right;
    font-weight: 600;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.temp-max {
    color: var(--text-primary);
}

.temp-min {
    opacity: 0.5;
}

.weather-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 150px;
}

.weather-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--separator-color);
    border-top-color: #007aff;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Notification Icon Button (Top Left) */
.notification-icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 1001;
    border-radius: 14px;
    transition: all 0.5s var(--spring-smooth);
    color: var(--text-primary);
}

.notification-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.credit-mini-widget {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 44px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.5s var(--spring-smooth);
    color: var(--text-primary);
}

.credit-mini-widget:hover {
    background: rgba(255, 255, 255, 0.12);
}

.credit-mini-widget:active {
    transform: scale(0.98);
}

.credit-icon {
    font-size: 1.1rem;
}

.credit-value {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Info Icon & Tooltip */
.setting-title-with-info {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.info-icon-wrapper {
    position: relative;
    display: inline-flex;
    cursor: help;
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-style: italic;
    font-family: serif;
}

.info-tooltip {
    position: absolute;
    bottom: 125%;
    right: 0;
    transform: translateY(10px);
    background: rgba(30, 30, 30, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 4px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(30, 30, 30, 0.95) transparent transparent transparent;
}

.info-icon-wrapper:hover .info-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.no-results-msg {
    padding: 12px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.8;
}

.notification-icon-btn:active {
    transform: scale(0.92);
}

.notification-icon-btn svg {
    opacity: 0.85;
}

.dark-mode .notification-icon-btn svg {
    opacity: 0.95;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.1));
}

/* --- Note Color Picker --- */
#noteColorPicker .preset-color-btn {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#noteColorPicker .preset-color-btn:hover {
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.4);
}

#noteColorPicker .color-picker-popup {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

#noteColorPicker .color-picker-popup.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* For smooth background transition */
.notes-popup .notes-wrapper {
    transition: background-color 0.5s ease;
}

.notes-popup .notes-wrapper {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    transition: background-color 0.5s ease, opacity 0.3s;
}

.dark-mode .notes-popup .notes-wrapper {
    background-color: rgba(28, 28, 30, 0.85);
}

/* AI / Apple Intelligence Style */
@keyframes ai-glow {
    0% {
        filter: drop-shadow(0 0 2px rgba(90, 200, 250, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 6px rgba(175, 82, 222, 0.6));
    }

    100% {
        filter: drop-shadow(0 0 2px rgba(90, 200, 250, 0.4));
    }
}

.ai-sparkle-icon {
    animation: ai-glow 3s infinite ease-in-out;
}

.ai-gradient-text {
    background: linear-gradient(135deg, #5AC8FA, #AF52DE, #FF2D55, #FF9500);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* AI Thinking Block */
.ai-think-block {
    background: rgba(0, 0, 0, 0.03);
    border-left: 3px solid #af52de;
    border-radius: 4px 8px 8px 4px;
    margin-bottom: 12px;
    padding: 10px 14px;
    font-size: 0.85rem;
}

.dark-mode .ai-think-block {
    background: rgba(255, 255, 255, 0.05);
}

.think-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #af52de;
    cursor: pointer;
    user-select: none;
}

.ai-think-block[open] .think-header {
    margin-bottom: 8px;
}

.think-content {
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.5;
}

/* --- Dark Mode Dock Item Border --- */
.dark-mode .dock-item {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* --- Dark Mode Dock Item Border Fixed --- */
.dark-mode .dock-item::after {
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25) !important;
}

.dark-mode .dock-item:hover::after {
    border-color: rgba(255, 255, 255, 0.25) !important;
    box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.4) !important, 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Custom Checkbox for Modals */
.custom-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    margin: 8px 0 20px 0;
    /* 제목과는 가깝게(8px), 버튼과는 멀게(20px) */
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(var(--text-rgb), 0.04);
    /* 아주 은은한 배경 */
    border: none;
    transition: all 0.2s ease;
}

.custom-checkbox-wrapper:hover {
    background: rgba(var(--text-rgb), 0.08);
}

.custom-checkbox-wrapper input {
    display: none;
}

.custom-checkmark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--border-color);
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.custom-checkbox-wrapper input:checked+.custom-checkmark {
    background: #007AFF;
    /* 요청하신 파란색 (네이티브 블루) */
    border-color: #007AFF;
}

.custom-checkmark::after {
    content: "";
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-0.5px, -1px);
    display: none;
}

.custom-checkbox-wrapper input:checked+.custom-checkmark::after {
    display: block;
}

.custom-checkbox-label {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.8;
    letter-spacing: -0.01em;
}

/* --- Peeking Mascot (Glassy) --- */
.peeking-mascot {
    position: absolute;
    top: 50%;
    right: -240px;
    /* Stays partially hidden off-screen */
    width: 440px;
    height: 440px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(-50%) rotate(-15deg);
    display: flex;
    align-items: center;
}

.peeking-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(-16px 16px 36px rgba(0, 122, 255, 0.1));
    transition: transform 0.6s ease;
}

.peeking-bubble {
    position: absolute;
    right: 250px;
    top: 100px;
    /* Offset to align with Glassy's head height */
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(24px) saturate(1.8) brightness(1.05);
    -webkit-backdrop-filter: blur(24px) saturate(1.8) brightness(1.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 14px 24px;
    border-radius: 28px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    opacity: 0.85;
    /* Slightly subtle initially */
    transform: scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    animation: peeking-bubble-float 3s ease-in-out infinite;
}

.peeking-tip {
    display: inline-block;
}

.peeking-greet {
    display: none;
}

.peeking-bubble::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.75);
    border-right: 1px solid rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
}

/* Hover Interaction */
.peeking-mascot:hover {
    right: -100px;
    /* Slides out further */
    transform: translateY(-50%) rotate(-5deg) scale(1.12);
}

.peeking-mascot:hover .peeking-img {
    filter: drop-shadow(-20px 20px 48px rgba(0, 122, 255, 0.22));
}

.peeking-mascot:hover .peeking-bubble {
    opacity: 1;
    transform: scale(1.02) translateY(0);
    animation: none;
}

.peeking-mascot:hover .peeking-tip {
    display: none;
}

.peeking-mascot:hover .peeking-greet {
    display: inline-block;
}

@keyframes peeking-bubble-float {

    0%,
    100% {
        transform: scale(0.95) translateY(0);
    }

    50% {
        transform: scale(0.95) translateY(-6px);
    }
}

/* Hide on mobile/tablets to avoid layout overlapping */
@media (max-width: 1024px) {
    .peeking-mascot {
        display: none !important;
    }
}

/* --- AI Intelligence Chat Markdown Styles --- */
.ai-msg-text p {
    margin: 0 0 10px 0;
}

.ai-msg-text p:last-child {
    margin-bottom: 0;
}

.ai-paragraph-space {
    height: 12px;
}

.ai-code-block {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 10px 0;
    overflow-x: auto;
    font-family: Menlo, Monaco, Consolas, 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.dark-mode .ai-code-block {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-code-block code {
    font-family: inherit;
    color: inherit;
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
}

.ai-inline-code {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: #4f46e5;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: Menlo, Monaco, Consolas, 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 500;
}

.dark-mode .ai-inline-code {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

.ai-msg-text h1,
.ai-msg-text h2,
.ai-msg-text h3 {
    margin: 18px 0 8px 0;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.ai-msg-text h1 {
    font-size: 1.25rem;
}

.ai-msg-text h2 {
    font-size: 1.15rem;
}

.ai-msg-text h3 {
    font-size: 1.05rem;
}

.ai-msg-text h1:first-child,
.ai-msg-text h2:first-child,
.ai-msg-text h3:first-child {
    margin-top: 0;
}

.ai-msg-text ul,
.ai-msg-text ol {
    margin: 8px 0 12px 0;
    padding-left: 22px;
}

.ai-msg-text li {
    margin-bottom: 6px;
    color: var(--text-primary);
}

.ai-msg-text li:last-child {
    margin-bottom: 0;
}

.ai-msg-text blockquote {
    margin: 14px 0;
    padding: 8px 16px;
    border-left: 4px solid #6366f1;
    color: var(--text-secondary);
    background: rgba(99, 102, 241, 0.04);
    border-radius: 0 12px 12px 0;
    font-style: italic;
}

.dark-mode .ai-msg-text blockquote {
    background: rgba(99, 102, 241, 0.08);
}

/* AI Table Styles */
.ai-table-container {
    width: 100%;
    overflow-x: auto;
    margin: 14px 0;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur-reduced);
    -webkit-backdrop-filter: var(--glass-blur-reduced);
}

.dark-mode .ai-table-container {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ai-msg-text table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.ai-msg-text th {
    font-weight: 600;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.04);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.dark-mode .ai-msg-text th {
    background: rgba(255, 255, 255, 0.04);
}

.ai-msg-text td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.ai-msg-text tr:last-child td {
    border-bottom: none;
}

.ai-msg-text tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

.dark-mode .ai-msg-text tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

/* AI Credit Deduction Tag */
.ai-credit-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.03);
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: 10px;
    width: fit-content;
    border: 1px solid var(--border-color);
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.dark-mode .ai-credit-tag {
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ai-credit-icon {
    color: #eab308;
    /* Yellow tone for credit star */
    font-size: 0.8rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Refill Stats Card (Premium Vibe) */
.refill-stats-card {
    display: flex;
    margin: 0 8px 24px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 14px 18px;
    gap: 16px;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.refill-visual-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    flex-shrink: 0;
}

.refill-visual-badge.free-theme {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.refill-visual-badge.pro-theme {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #d97706;
}

.refill-amount {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.refill-badge-label {
    font-size: 0.6rem;
    font-weight: 700;
    opacity: 0.85;
    margin-top: 2px;
}

.refill-stats-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.refill-stats-card .stats-title {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.refill-timer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 30px;
    background: var(--card-bg, rgba(255, 255, 255, 0.6));
    border: 1px solid var(--border-color);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    min-width: 145px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.refill-timer-badge .timer-svg {
    flex-shrink: 0;
    opacity: 0.75;
}

.refill-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.45;
}

/* Weather Widgets Container */
#weatherWidgetsContainer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
}

.widgets-container.calendar-active #weatherWidgetsContainer {
    flex-direction: row-reverse;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 320px;
}

/* Google Calendar Widget */
.calendar-mini-widget {
    width: 320px;
    min-height: 175px;
    height: auto;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    cursor: default;
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: 28px;
    box-sizing: border-box;
    transition: all 0.3s var(--spring-smooth);
    user-select: none;
    gap: 8px;
}

.dark-mode .calendar-mini-widget {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.calendar-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-shrink: 0;
    opacity: 0.85;
}

.calendar-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-widget-body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.calendar-left {
    width: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calendar-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.cal-nav-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.6rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
}

.cal-nav-btn:hover {
    opacity: 1;
    background: rgba(var(--text-rgb), 0.05);
}

.cal-month-title {
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-grid-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.52rem;
    font-weight: 700;
    opacity: 0.5;
    margin-bottom: 2px;
}

.calendar-grid-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 1px;
    flex: 1;
}

.cal-day-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 50%;
    aspect-ratio: 1;
    transition: all 0.2s ease;
    position: relative;
}

.cal-day-cell:hover {
    background: rgba(var(--text-rgb), 0.08);
}

.cal-day-cell.empty {
    pointer-events: none;
}

.cal-day-cell.today {
    border: 1px solid var(--border-color);
    font-weight: 700;
}

.cal-day-cell.selected {
    background: #007aff !important;
    color: #fff !important;
    font-weight: 700;
}

.cal-day-dots {
    position: absolute;
    bottom: 2px;
    display: flex;
    gap: 1.5px;
    justify-content: center;
    width: 100%;
}

.cal-day-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
}

.cal-day-cell.selected .cal-day-dot {
    opacity: 0.8;
}

.calendar-divider {
    width: 1px;
    background: var(--border-color);
    margin: 0 10px;
    opacity: 0.3;
}

.calendar-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.calendar-right-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    height: 18px;
    flex-shrink: 0;
}

.calendar-date-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Premium Google Login Button */
.google-login-btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 0.52rem;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s var(--spring-smooth);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.google-login-btn-mini:hover {
    background: #ffffff;
}

.dark-mode .google-login-btn-mini {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.dark-mode .google-login-btn-mini:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Premium Google Logout Button */
.google-logout-btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #555;
    font-size: 0.52rem;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s var(--spring-smooth);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.google-logout-btn-mini:hover {
    background: #ffffff;
    color: #ff4d4f;
    border-color: rgba(255, 77, 79, 0.2);
}

.dark-mode .google-logout-btn-mini {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.dark-mode .google-logout-btn-mini:hover {
    background: rgba(255, 77, 79, 0.2);
    color: #ff7875;
    border-color: rgba(255, 120, 117, 0.3);
}

.google-logout-btn-mini span {
    color: inherit;
    transition: color 0.2s var(--spring-smooth);
}

/* Events List */
.calendar-events-mini {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 4px;
    overflow-y: auto;
    padding-right: 2px;
}

.calendar-events-mini::-webkit-scrollbar {
    width: 3px;
}

.calendar-events-mini::-webkit-scrollbar-thumb {
    background: rgba(var(--text-rgb), 0.15);
    border-radius: 99px;
}

/* Event Item */
.calendar-event-mini-item {
    width: 100%;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark-mode .calendar-event-mini-item {
    background: rgba(255, 255, 255, 0.03);
}

.calendar-event-mini-item:hover {
    background: rgba(0, 0, 0, 0.04);
    transform: translateX(2px);
}

.dark-mode .calendar-event-mini-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.calendar-event-mini-summary {
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event-mini-time {
    font-size: 0.55rem;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
}

/* Status States */
.calendar-status-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.65rem;
    line-height: 1.3;
    opacity: 0.8;
    padding: 5px;
}

/* Custom Context Menu */
/* Custom Context Menu */
.custom-context-menu {
    position: fixed;
    z-index: 999999;
    min-width: 250px;
    padding: 5px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(30px) saturate(1.9) brightness(1.02) !important;
    -webkit-backdrop-filter: blur(30px) saturate(1.9) brightness(1.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.25) !important;
    animation: menuFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top left;
    transition: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

.dark-mode .custom-context-menu {
    background: rgba(36, 36, 36, 0.55) !important;
    backdrop-filter: blur(30px) saturate(1.8) brightness(0.9) !important;
    -webkit-backdrop-filter: blur(30px) saturate(1.8) brightness(0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.32),
        0 4px 10px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.custom-context-menu:hover {
    transform: none !important;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.25) !important;
}

.dark-mode .custom-context-menu:hover {
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.32),
        0 4px 10px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

.context-menu-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 5px 8px !important;
    margin: 2px 3px !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #1d1d1f !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
    line-height: 1.3 !important;
    user-select: none !important;
}

.dark-mode .context-menu-item {
    color: #f5f5f7 !important;
}

.context-menu-item:hover {
    background: #007aff !important;
    color: #ffffff !important;
    transform: none !important;
}

.context-menu-item:hover .mac-ctx-icon,
.context-menu-item:hover .mac-ctx-arrow,
.context-menu-item:hover .mac-check-svg,
.context-menu-item:hover .mac-submenu-arrow svg {
    color: #ffffff !important;
}

.menu-item-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.mac-check-container {
    width: 14px !important;
    height: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.mac-check-svg {
    width: 11px !important;
    height: 11px !important;
    color: #1d1d1f !important;
    visibility: hidden;
}

.dark-mode .mac-check-svg {
    color: #f5f5f7 !important;
}

.mac-icon-container {
    width: 16px !important;
    height: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.mac-ctx-icon {
    width: 15px !important;
    height: 15px !important;
    color: #515154 !important;
}

.dark-mode .mac-ctx-icon {
    color: #a1a1a5 !important;
}

.menu-item-label {
    white-space: nowrap !important;
}

/* All context menu items are now structurally aligned, no special padding offsets needed */

.mac-submenu-arrow {
    width: 14px !important;
    height: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: 12px !important;
    opacity: 0.6 !important;
}

.mac-submenu-arrow svg {
    width: 12px !important;
    height: 12px !important;
    color: #515154 !important;
}

.dark-mode .mac-submenu-arrow svg {
    color: #a1a1a5 !important;
}

.context-menu-separator {
    height: 1px !important;
    background: rgba(0, 0, 0, 0.08) !important;
    margin: 4px 5px !important;
}

.dark-mode .context-menu-separator {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================================
   Liquid AI Search Animations and Container Styles
   ========================================================================== */

/* Main layout transition during active search */
.main-content {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.clock-widget {
    transition: opacity 0.5s ease, transform 0.5s ease, max-height 0.5s ease, padding 0.5s ease, margin 0.5s ease;
}

body.ai-search-active .main-content {
    z-index: auto !important;
}

body.ai-search-active #searchWidget {
    transform: var(--ai-search-transform, none) !important;
    z-index: 1000000 !important;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.ai-search-active .clock-widget {
    opacity: 0.2;
    transform: scale(0.95);
    pointer-events: none;
}

/* AI Search Container */
.ai-search-container {
    width: 680px;
    max-width: 90vw;
    padding: 24px;
    border-radius: 32px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.5s ease, top 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
    max-height: calc(100vh - 200px);
}

body.ai-search-active .ai-search-container {
    position: fixed !important;
    left: 50% !important;
    top: var(--ai-container-top, 136px) !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    z-index: 1000000 !important;
}

.ai-search-container.visible {
    opacity: 1;
}

.ai-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 12px;
    flex-shrink: 0;
}

.dark-mode .ai-search-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.ai-search-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.ai-search-sparkle {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.ai-search-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.ai-search-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.dark-mode .ai-search-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ai-search-close-btn svg {
    display: block;
}

/* Status Bar */
.ai-search-status-bar {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
    flex-shrink: 0;
}

.ai-search-status-bar .search-pulse {
    animation: searchPulseAnim 1.5s infinite ease-in-out;
}

@keyframes searchPulseAnim {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Inner Scrollable area wrapping body elements to prevent viewport cutoff */
.ai-search-scroll-area {
    position: relative;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 6px;
}

.ai-search-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.ai-search-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.ai-search-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.dark-mode .ai-search-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

/* Answer Area */
.ai-search-answer {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Sources Area */
.ai-search-sources {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dark-mode .ai-search-sources {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.ai-search-sources-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-search-sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-search-source-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.dark-mode .ai-search-source-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.ai-search-source-item:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

.ai-search-source-favicon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    object-fit: contain;
}

/* Full screen glassmorphism backdrop blur */
.ai-search-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    opacity: 0;
    pointer-events: none;
    z-index: 999998;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark-mode .ai-search-backdrop {
    background: rgba(0, 0, 0, 0.45);
}

body.ai-search-active .ai-search-backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* AI Search Thread Conversation Styles */
.ai-search-user-turn {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    margin-top: 24px;
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 12px;
}

.ai-search-user-turn:first-child {
    margin-top: 0;
}

.dark-mode .ai-search-user-turn {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.ai-search-user-q {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
    flex-shrink: 0;
}

.ai-search-ai-turn {
    margin-bottom: 24px;
}

.ai-search-ai-turn:last-child {
    margin-bottom: 0;
}

/* Follow-up input bar styles */
.ai-search-followup-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 4px 4px 16px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 8px;
    pointer-events: auto;
}

.dark-mode .ai-search-followup-input-wrapper {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.ai-search-followup-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

.ai-search-followup-input-wrapper input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.ai-search-followup-send-btn {
    background: #000;
    color: #fff;
    border: none;
    outline: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.ai-search-followup-send-btn:hover {
    background: #222;
    transform: scale(1.05);
}

.ai-search-followup-send-btn:active {
    transform: scale(0.95);
}

.dark-mode .ai-search-followup-send-btn {
    background: #fff;
    color: #000;
}

.dark-mode .ai-search-followup-send-btn:hover {
    background: #e4e4e7;
}

.ai-search-followup-send-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    stroke: none;
}

/* Disable editing of main search widget when active */
body.ai-search-active #searchWidget {
    pointer-events: none;
    opacity: 0.85;
    cursor: default;
}

/* AI Markdown Link Styles */
.ai-msg-text a,
.ai-search-ai-text a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease, border-bottom 0.15s ease;
    border-bottom: 1px dotted transparent;
}

.ai-msg-text a:hover,
.ai-search-ai-text a:hover {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.dark-mode .ai-msg-text a,
.dark-mode .ai-search-ai-text a {
    color: #60a5fa;
}

.dark-mode .ai-msg-text a:hover,
.dark-mode .ai-search-ai-text a:hover {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}

/* AI Shortcut Button Styles */
.ai-shortcut-button {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 10px;
    padding: 6px 16px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    font-weight: normal;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 4px 0;
    cursor: pointer;
    text-align: left;
    max-width: 100%;
    box-sizing: border-box;
}

.ai-shortcut-button:hover {
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.dark-mode .ai-shortcut-button {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

.dark-mode .ai-shortcut-button:hover {
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.ai-shortcut-favicon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}

.ai-shortcut-text-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.ai-shortcut-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.ai-shortcut-url {
    font-size: 0.68rem;
    color: var(--text-secondary);
    opacity: 0.75;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Hide bullet points for shortcut button list items */
.ai-msg-text ul li:has(.ai-shortcut-button),
.ai-search-ai-text ul li:has(.ai-shortcut-button),
.ai-msg-text ol li:has(.ai-shortcut-button),
.ai-search-ai-text ol li:has(.ai-shortcut-button) {
    list-style: none !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Theme Selector Cards */
.theme-selector-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px !important;
    min-height: 90px;
}

.theme-options {
    display: flex;
    gap: 12px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.theme-option-preview {
    width: 90px;
    height: 55px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(var(--text-rgb), 0.08);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    background: #f0f0f0;
}

.theme-option.active .theme-option-preview {
    border-color: #007aff;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35);
}

.theme-option-label {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s;
}

.theme-option.active .theme-option-label {
    color: #007aff;
}

/* Light Preview Mockup */
.preview-light .mock-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #e4eefb, #c3dafb);
}

.preview-light .mock-card {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 70px;
    height: 42px;
    background: #ffffff;
    border-top-left-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: -2px -2px 8px rgba(0, 0, 0, 0.05);
    padding: 4px;
    box-sizing: border-box;
}

/* Dark Preview Mockup */
.preview-dark .mock-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1f2a3d, #0d131f);
}

.preview-dark .mock-card {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 70px;
    height: 42px;
    background: #1c1c1e;
    border-top-left-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -2px -2px 8px rgba(0, 0, 0, 0.3);
    padding: 4px;
    box-sizing: border-box;
}

/* System/Split Preview Mockup */
.preview-system .mock-bg-left {
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, #e4eefb, #c3dafb);
}

.preview-system .mock-bg-right {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, #1f2a3d, #0d131f);
}

.preview-system .mock-card-left {
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 35px;
    height: 42px;
    background: #ffffff;
    border-top-left-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 4px;
    box-sizing: border-box;
    overflow: hidden;
}

.preview-system .mock-card-right {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 35px;
    height: 42px;
    background: #1c1c1e;
    border-top-left-radius: 0px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Inside Mock Elements (Dots & Lines) */
.mock-dots {
    display: flex;
    gap: 3px;
    margin-bottom: 4px;
}

.mock-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    display: inline-block;
}

.mock-dot.red { background: #ff5f56; }
.mock-dot.yellow { background: #ffbd2e; }
.mock-dot.green { background: #27c93f; }

.mock-line-main {
    width: 80%;
    height: 3px;
    background: #007aff;
    border-radius: 1.5px;
    margin-bottom: 3px;
}

.preview-dark .mock-line-main,
.preview-system .mock-card-right .mock-line-main {
    background: #0a84ff;
}

.mock-line-sub {
    width: 50%;
    height: 2px;
    background: rgba(var(--text-rgb), 0.15);
    border-radius: 1px;
}

.preview-dark .mock-line-sub,
.preview-system .mock-card-right .mock-line-sub {
    background: rgba(255, 255, 255, 0.15);
}