:root {
    --bg: #0b1020;
    --bg-soft: #121a31;
    --card: rgba(18, 26, 49, 0.86);
    --card-strong: #141d36;
    --border: rgba(255, 255, 255, 0.09);
    --text: #f5f7ff;
    --muted: #9ea9c7;
    --accent: #7c5cff;
    --accent-2: #33d1ff;
    --success: #33d17a;
    --warning: #f5c451;
    --danger: #ff6b81;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124, 92, 255, 0.24), transparent 30%),
        radial-gradient(circle at bottom right, rgba(51, 209, 255, 0.14), transparent 26%),
        var(--bg);
    color: var(--text);
    min-height: 100%;
}

body {
    min-height: 100vh;
}

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

.app-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 24px;
    background: rgba(10, 14, 28, 0.72);
    border: 1px solid var(--border);
    border-radius: 22px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

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

.brand strong {
    display: block;
    font-size: 1.05rem;
}

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

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 24px rgba(124, 92, 255, 0.35);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-links a {
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--muted);
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.btn-link {
    background: rgba(124, 92, 255, 0.14);
    color: var(--text) !important;
}

.page-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flash {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
}

.flash-success { border-left: 4px solid var(--success); }
.flash-warning { border-left: 4px solid var(--warning); }
.flash-error { border-left: 4px solid var(--danger); }

.flash-auto-dismiss {
    transition: opacity 0.38s ease, transform 0.38s ease, max-height 0.38s ease, margin 0.38s ease, padding 0.38s ease, border-width 0.38s ease;
    max-height: 120px;
    opacity: 1;
}

.flash-auto-dismiss.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    overflow: hidden;
}

.hero-card,
.auth-card,
.sidebar-card,
.chat-card,
.feature-card {
    border: 1px solid var(--border);
    background: var(--card);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.hero-card {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    padding: 34px;
    border-radius: 28px;
}

.hero-copy h1,
.section-heading h1,
.chat-header h1 {
    margin: 10px 0 12px;
    line-height: 1.1;
}

.hero-copy h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.hero-copy p,
.section-heading p,
.chat-header p,
.feature-card p,
.muted-text {
    color: var(--muted);
}

.hero-actions,
.form-grid,
.side-block,
.memory-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 18px;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--border);
}

.chip {
    display: inline-flex;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    color: #d8dfff;
    background: rgba(124, 92, 255, 0.16);
    border: 1px solid rgba(124, 92, 255, 0.24);
    font-size: 0.9rem;
}

.hero-panel {
    display: flex;
    align-items: center;
}

.hero-widget {
    width: 100%;
    border-radius: 24px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid var(--border);
}

.widget-header {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.widget-header span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.3);
}

.widget-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-preview,
.message-bubble {
    max-width: 82%;
    padding: 12px 14px;
    border-radius: 18px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.chat-preview.assistant,
.message.assistant .message-bubble {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}

.chat-preview.user,
.message.user .message-bubble {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.78), rgba(51, 209, 255, 0.64));
}


.message.assistant .message-bubble.quote-message-bubble {
    max-width: min(100%, 700px);
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.message.assistant .message-bubble.typing-bubble {
    display: inline-flex;
    align-items: center;
    min-height: 52px;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.typing-indicator-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

.typing-indicator-dots {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.typing-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.95), rgba(51, 209, 255, 0.78));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    animation: typingDotPulse 1.2s ease-in-out infinite;
}

.typing-indicator-dot:nth-child(2) {
    animation-delay: 0.18s;
}

.typing-indicator-dot:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes typingDotPulse {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: translateY(0) scale(0.92);
    }
    40% {
        opacity: 1;
        transform: translateY(-1px) scale(1);
    }
}

.quote-chat-card {
    width: min(100%, 700px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.035));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 18px 34px rgba(2, 7, 20, 0.25);
}

.quote-chat-card.positive {
    box-shadow: 0 18px 34px rgba(2, 7, 20, 0.25), inset 0 0 0 1px rgba(51, 209, 122, 0.12);
}

.quote-chat-card.negative {
    box-shadow: 0 18px 34px rgba(2, 7, 20, 0.25), inset 0 0 0 1px rgba(255, 107, 129, 0.12);
}

.quote-chat-card-top,
.quote-chat-card-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.quote-chat-card-top {
    flex-wrap: wrap;
}

.quote-chat-card-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.quote-chat-card-symbol {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    word-break: break-word;
}

.quote-chat-card-name {
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.quote-chat-card-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.14);
    border: 1px solid rgba(124, 92, 255, 0.22);
    color: #dfe3ff;
    font-size: 0.9rem;
    white-space: nowrap;
}

.quote-chat-card-body {
    flex-wrap: wrap;
    align-items: flex-end;
}

.quote-chat-card-price-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quote-chat-card-price-label {
    color: var(--muted);
    font-size: 0.88rem;
}

.quote-chat-card-price {
    margin: 0;
    font-size: clamp(1.65rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.05;
}

.quote-chat-card-change {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    font-weight: 700;
}

.quote-chat-card-change.positive {
    color: var(--success);
}

.quote-chat-card-change.negative {
    color: var(--danger);
}

.quote-chat-card-change.neutral {
    color: var(--muted);
}

.quote-chat-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quote-chat-card-meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--muted);
    font-size: 0.9rem;
}

.quote-chat-card-meta-chip strong {
    color: var(--text);
    font-weight: 700;
}


.weather-chat-card {
    position: relative;
    overflow: hidden;
    width: min(100%, 700px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 34%),
        linear-gradient(145deg, rgba(24, 35, 76, 0.96), rgba(11, 24, 56, 0.96));
    box-shadow: 0 20px 36px rgba(3, 8, 24, 0.28);
    isolation: isolate;
}

.weather-chat-card.theme-sunny {
    background:
        radial-gradient(circle at 82% 18%, rgba(255, 214, 102, 0.34), transparent 20%),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 35%),
        linear-gradient(145deg, rgba(39, 69, 128, 0.98), rgba(25, 41, 92, 0.98));
}

.weather-chat-card.theme-cloudy {
    background:
        radial-gradient(circle at 80% 16%, rgba(194, 213, 255, 0.22), transparent 22%),
        linear-gradient(145deg, rgba(33, 47, 87, 0.98), rgba(22, 31, 63, 0.98));
}

.weather-chat-card.theme-rainy,
.weather-chat-card.theme-storm,
.weather-chat-card.theme-mist {
    background:
        radial-gradient(circle at 84% 18%, rgba(114, 175, 255, 0.2), transparent 22%),
        linear-gradient(145deg, rgba(24, 36, 76, 0.98), rgba(10, 19, 48, 0.98));
}

.weather-chat-card.theme-night {
    background:
        radial-gradient(circle at 82% 18%, rgba(130, 139, 255, 0.18), transparent 20%),
        linear-gradient(145deg, rgba(19, 28, 60, 0.98), rgba(8, 14, 36, 0.98));
}

.weather-chat-card.theme-snow {
    background:
        radial-gradient(circle at 82% 16%, rgba(226, 240, 255, 0.28), transparent 21%),
        linear-gradient(145deg, rgba(44, 65, 112, 0.98), rgba(23, 39, 76, 0.98));
}

.weather-chat-card-backdrop {
    position: absolute;
    inset: auto auto -36px -20px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 68%);
    pointer-events: none;
    z-index: -1;
}

.weather-chat-card-top,
.weather-chat-card-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.weather-chat-card-heading,
.weather-chat-card-temperature-block,
.weather-chat-card-summary {
    display: flex;
    flex-direction: column;
}

.weather-chat-card-heading {
    gap: 6px;
    min-width: 0;
}

.weather-chat-card-eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.weather-chat-card-location {
    margin: 0;
    font-size: clamp(1.05rem, 2.7vw, 1.3rem);
    font-weight: 800;
    line-height: 1.15;
}

.weather-chat-card-time {
    margin: 0;
    color: rgba(235, 240, 255, 0.72);
    font-size: 0.88rem;
}

.weather-chat-card-icon-wrap {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.weather-chat-card-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.weather-chat-card-main {
    align-items: flex-end;
    flex-wrap: wrap;
}

.weather-chat-card-temperature-block {
    gap: 6px;
}

.weather-chat-card-temperature {
    margin: 0;
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    line-height: 0.95;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.weather-chat-card-description {
    margin: 0;
    color: rgba(241, 245, 255, 0.88);
    font-size: 0.95rem;
    font-weight: 600;
}

.weather-chat-card-summary {
    gap: 8px;
    min-width: min(100%, 220px);
    max-width: 290px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.weather-chat-card-headline {
    font-size: 0.96rem;
    line-height: 1.4;
}

.weather-chat-card-feel {
    margin: 0;
    color: rgba(235, 240, 255, 0.72);
    font-size: 0.88rem;
    line-height: 1.35;
}

.weather-chat-card-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.weather-chat-card-metric {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.weather-chat-card-metric-label {
    color: rgba(235, 240, 255, 0.7);
    font-size: 0.78rem;
}

.weather-chat-card-metric-value {
    font-size: 0.95rem;
    font-weight: 800;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.feature-card,
.auth-card,
.sidebar-card,
.chat-card {
    border-radius: 24px;
    padding: 24px;
}

.auth-layout {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 180px);
}

.auth-card {
    width: min(100%, 520px);
}

.section-heading {
    margin-bottom: 18px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label span {
    color: #d7ddf4;
    font-size: 0.95rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 14px 15px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(5, 10, 22, 0.55);
    color: var(--text);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(124, 92, 255, 0.5);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
}

.chat-layout {
    --sidebar-width: 320px;
    position: relative;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    min-height: calc(100vh - 170px);
    transition: grid-template-columns 0.24s ease, gap 0.24s ease;
}

.chat-layout.sidebar-collapsed {
    --sidebar-width: 0px;
    gap: 0;
}

.sidebar-toggle-button {
    display: none;
}

.mobile-chat-focus-toggle,
.desktop-chat-focus-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(124, 92, 255, 0.24);
    background: linear-gradient(135deg, rgba(16, 23, 47, 0.96), rgba(11, 16, 32, 0.96));
    color: var(--text);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.24);
    max-width: calc(100vw - 32px);
}

.mobile-chat-focus-toggle {
    position: fixed;
    top: auto;
    right: auto;
    left: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 60;
    display: none;
}

.desktop-chat-focus-toggle {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    margin-left: auto;
}

.mobile-chat-focus-toggle:hover,
.desktop-chat-focus-toggle:hover {
    background: linear-gradient(135deg, rgba(31, 41, 78, 0.96), rgba(15, 22, 44, 0.98));
    border-color: rgba(124, 92, 255, 0.42);
}

.mobile-chat-focus-toggle:focus-visible,
.desktop-chat-focus-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.14), 0 18px 34px rgba(2, 6, 23, 0.32);
}

body.modal-open .mobile-chat-focus-toggle,
body.modal-open .desktop-chat-focus-toggle {
    opacity: 0;
    pointer-events: none;
}

.mobile-chat-focus-toggle-icon,
.desktop-chat-focus-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
}

.mobile-chat-focus-toggle-label,
.desktop-chat-focus-toggle-label {
    font-weight: 700;
}

.sidebar-toggle-icon {
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.24s ease;
}

.chat-layout.sidebar-collapsed .sidebar-toggle-icon {
    transform: rotate(180deg);
}

.sidebar-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease, padding 0.22s ease, border-color 0.22s ease;
}

.chat-layout.sidebar-collapsed .sidebar-card {
    opacity: 0;
    transform: translateX(-18px) scale(0.985);
    pointer-events: none;
    padding-left: 0;
    padding-right: 0;
    border-color: transparent;
}

.chat-card {
    min-width: 0;
    transition: transform 0.22s ease;
}

.chat-layout.sidebar-collapsed .chat-card {
    transform: translateX(0);
}

.sidebar-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.sidebar-menu-wrap {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}

.sidebar-menu-trigger {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(51, 209, 255, 0.10));
    border: 1px solid rgba(124, 92, 255, 0.24);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-menu-trigger:hover {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.24), rgba(51, 209, 255, 0.14));
}

.sidebar-menu-trigger-icon {
    font-size: 1rem;
    line-height: 1;
}

.sidebar-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 25;
    min-width: 250px;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(19, 27, 53, 0.98), rgba(12, 18, 36, 0.98));
    border: 1px solid rgba(124, 92, 255, 0.18);
    box-shadow: 0 22px 44px rgba(2, 6, 23, 0.32);
}

.sidebar-menu-wrap.is-open .sidebar-menu-panel {
    display: flex;
}

.sidebar-menu-item {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.sidebar-menu-item:hover {
    transform: translateY(-1px);
    background: rgba(124, 92, 255, 0.14);
    border-color: rgba(124, 92, 255, 0.26);
}

.sidebar-menu-item-icon {
    width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sidebar-menu-item-badge {
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.76);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar-menu-item.is-disabled,
.sidebar-menu-item:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    transform: none;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.82);
}

.sidebar-menu-item.is-disabled:hover,
.sidebar-menu-item:disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.sidebar-body {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-new-chat-button {
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(51, 209, 255, 0.10));
    border: 1px solid rgba(124, 92, 255, 0.24);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-new-chat-button:hover {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.24), rgba(51, 209, 255, 0.14));
}

.sidebar-new-chat-button:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.chat-session-list-wrap {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 12px;
}

.chat-session-list-wrap {
    max-height: calc((46px * 10) + (10px * 9) + 64px);
}

.chat-session-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-session-list-title {
    font-weight: 700;
    color: var(--text);
}

.chat-session-list-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-session-list {
    --chat-session-row-height: 46px;
    --chat-session-row-gap: 10px;
    display: flex;
    flex: 0 1 auto;
    min-height: 0;
    max-height: calc((var(--chat-session-row-height) * 10) + (var(--chat-session-row-gap) * 9) + 12px);
    flex-direction: column;
    gap: var(--chat-session-row-gap);
    overflow-y: auto;
    padding-right: 10px;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(124, 92, 255, 0.78) rgba(255, 255, 255, 0.06);
    scrollbar-gutter: stable;
}

.chat-session-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.settings-panel::-webkit-scrollbar,
.market-results-grid::-webkit-scrollbar,
.market-sidebar-list::-webkit-scrollbar {
    width: 12px;
}

.chat-session-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.settings-panel::-webkit-scrollbar-track,
.market-results-grid::-webkit-scrollbar-track,
.market-sidebar-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.chat-session-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.chat-session-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.settings-panel::-webkit-scrollbar-thumb,
.market-results-grid::-webkit-scrollbar-thumb,
.market-sidebar-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(124, 92, 255, 0.82), rgba(51, 209, 255, 0.68));
    border-radius: 999px;
    border: 2px solid rgba(11, 16, 32, 0.82);
}

.chat-session-list::-webkit-scrollbar-thumb {
    border: 2px solid rgba(12, 18, 36, 0.92);
}

.chat-session-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.settings-panel::-webkit-scrollbar-thumb:hover,
.market-results-grid::-webkit-scrollbar-thumb:hover,
.market-sidebar-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(146, 118, 255, 0.92), rgba(84, 220, 255, 0.82));
}


.chat-session-item {
    position: relative;
    display: block;
}

.chat-session-button {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 46px;
    padding: 12px 56px 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.chat-session-button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(124, 92, 255, 0.20);
}

.chat-session-button.is-active {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(51, 209, 255, 0.10));
    border-color: rgba(124, 92, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.chat-session-item.is-active .chat-session-actions-button {
    border-color: rgba(124, 92, 255, 0.28);
    background: rgba(124, 92, 255, 0.10);
}

.chat-session-button:disabled {
    opacity: 0.8;
    cursor: wait;
}

.chat-session-button-name {
    display: block;
    width: 100%;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-session-actions {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    z-index: 6;
    display: flex;
    align-items: center;
}

.chat-session-actions-button {
    min-width: 34px;
    min-height: 34px;
    padding: 0 9px;
    border-radius: 10px;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.03);
}

.chat-session-empty {
    margin: 0;
    padding: 12px 4px 0;
}

.new-chat-panel {
    width: min(100%, 620px);
}

.new-chat-form-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.icon-button:hover {
    transform: translateY(-1px);
    background: rgba(124, 92, 255, 0.14);
    border-color: rgba(124, 92, 255, 0.28);
}

.icon-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
    border-color: rgba(124, 92, 255, 0.45);
}

.prompt-list {
    padding-left: 18px;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}

.sidebar-mini-tip {
    margin-top: 22px;
}

.sidebar-mini-tip p {
    margin: 0;
    line-height: 1.6;
}

.sidebar-mini-tip strong {
    color: var(--text);
}

.help-panel {
    width: min(100%, 980px);
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.help-section {
    min-height: 100%;
}

.help-example-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.help-bullet-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--muted);
    line-height: 1.55;
}

.help-bullet-list strong {
    color: var(--text);
}

.assistant-name-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.assistant-name-form .btn {
    width: 100%;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: rgba(255, 107, 107, 0.12);
    color: #ffd7d7;
    border: 1px solid rgba(255, 107, 107, 0.22);
}

.memory-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
}

.memory-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.memory-item strong {
    font-size: 0.95rem;
    text-transform: capitalize;
}

.memory-item span {
    color: var(--muted);
}

.memory-actions {
    position: relative;
    flex-shrink: 0;
}

.profile-item .memory-tag-list {
    min-height: 38px;
}

.profile-editor-panel {
    width: min(100%, 560px);
}

.memory-actions-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.memory-actions-button:hover,
.memory-actions-button:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.memory-actions-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 15;
    min-width: 150px;
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(8, 15, 44, 0.96);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.memory-actions.is-open .memory-actions-menu {
    display: flex;
}

.memory-action-option {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 40px;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.memory-action-option:hover,
.memory-action-option:focus-visible {
    background: rgba(255,255,255,0.08);
}

.memory-action-option:disabled {
    opacity: 0.6;
    cursor: default;
    background: rgba(255,255,255,0.03);
}

.memory-action-option.danger {
    color: #ffd0d0;
}

.memory-manager-tip {
    margin-bottom: 6px;
}

.memory-editor-panel {
    max-width: min(760px, 92vw);
}

.memory-editor-form {
    gap: 16px;
}

.memory-editor-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.memory-editor-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 12px;
    align-items: end;
}

.memory-editor-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.memory-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.memory-editor-primary-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}


.memory-tag-list.is-commitment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.memory-commitment-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.memory-commitment-card strong {
    font-size: 0.96rem;
    color: var(--text);
}

.memory-commitment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.memory-commitment-meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.88rem;
}

.memory-commitment-meta-chip.priority-alta {
    color: #ffd6d6;
    border-color: rgba(255, 107, 107, 0.28);
    background: rgba(255, 107, 107, 0.10);
}

.memory-commitment-meta-chip.priority-baixa {
    color: #d7fbe6;
    border-color: rgba(51, 209, 122, 0.25);
    background: rgba(51, 209, 122, 0.10);
}

.memory-commitment-meta-chip.priority-média,
.memory-commitment-meta-chip.priority-media {
    color: #ffe7ba;
    border-color: rgba(245, 196, 81, 0.26);
    background: rgba(245, 196, 81, 0.10);
}

.memory-editor-row-commitment {
    grid-template-columns: 1fr;
}

.memory-editor-commitment-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.memory-editor-label-wide {
    grid-column: span 1;
}

.memory-editor-row-commitment .memory-remove-row-button {
    justify-self: flex-start;
}

.chat-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 18px;
    min-height: 0;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.desktop-chat-focus-toggle {
    align-self: center;
}

.chat-focus-frame-header {
    display: none;
    align-items: center;
    min-height: 52px;
    padding: 0 16px;
    margin: -6px -6px 4px;
    border: 1px solid rgba(124, 92, 255, 0.18);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(18, 27, 52, 0.92), rgba(12, 19, 38, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 1;
}

.chat-focus-frame-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #eef2ff;
    line-height: 1.2;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 420px;
    max-height: calc(100vh - 370px);
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-right: 6px;
}

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

.message.user {
    align-items: flex-end;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.78rem;
    line-height: 1;
}

.message.user .message-meta {
    align-self: flex-end;
}

.message.assistant .message-meta {
    align-self: flex-start;
}

.message-time {
    letter-spacing: 0.02em;
}


.chat-form {
    display: block;
}

.chat-composer-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.chat-form textarea {
    min-height: 62px;
    resize: vertical;
}

.chat-composer-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 12px;
    align-items: stretch;
}

.chat-form-actions {
    display: flex;
    align-items: stretch;
}

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

.chat-voice-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.chat-voice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.chat-voice-button,
.chat-voice-send,
.chat-voice-toggle,
.chat-voice-clear {
    min-height: 44px;
    padding-inline: 16px;
}

.chat-voice-button {
    position: relative;
    user-select: none;
    touch-action: none;
}

.chat-voice-button-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.chat-voice-recording-dot {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 102, 146, 0.95);
    box-shadow: 0 0 0 0 rgba(255, 102, 146, 0.28);
    opacity: 0;
    transform: scale(0.72);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-voice-button.is-listening {
    border-color: rgba(255, 102, 146, 0.42);
    background: rgba(255, 102, 146, 0.16);
    color: #fff1f6;
}

.chat-voice-button.is-listening .chat-voice-recording-dot {
    opacity: 1;
    transform: scale(1);
    animation: voiceRecordingPulse 1.15s ease-in-out infinite;
}

.chat-voice-send {
    border-color: rgba(90, 214, 156, 0.32);
    background: rgba(90, 214, 156, 0.10);
    color: #e7fff2;
}

.chat-voice-clear {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.chat-voice-toggle.is-enabled {
    border-color: rgba(51, 209, 255, 0.34);
    color: #e5fbff;
    background: rgba(51, 209, 255, 0.10);
}

.chat-voice-button:disabled,
.chat-voice-send:disabled,
.chat-voice-toggle:disabled,
.chat-voice-clear:disabled {
    opacity: 0.7;
}

.chat-voice-status {
    margin: 0;
    min-width: 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.82rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-voice-status.is-error {
    color: #ffb8c8;
    background: rgba(255, 102, 146, 0.10);
}

.chat-voice-status.is-success {
    color: #c8ffe3;
    background: rgba(90, 214, 156, 0.10);
}

.chat-voice-status.is-active {
    color: #cfe9ff;
    background: rgba(51, 209, 255, 0.10);
}

@keyframes voiceRecordingPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 102, 146, 0.34);
        transform: scale(0.9);
    }
    70% {
        box-shadow: 0 0 0 9px rgba(255, 102, 146, 0);
        transform: scale(1.04);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 102, 146, 0);
        transform: scale(0.92);
    }
}


@media (max-width: 860px) {
    .chat-composer-footer {
        grid-template-columns: 1fr;
    }

    .chat-voice-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-voice-actions {
        width: 100%;
    }

    .chat-voice-button,
    .chat-voice-send,
    .chat-voice-toggle,
    .chat-voice-clear {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }

    .chat-voice-status {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 980px) {
    .sidebar-toggle-button {
        display: none;
    }

    .desktop-chat-focus-toggle {
        display: none;
    }

    .mobile-chat-focus-toggle {
        display: inline-flex;
    }

    body.mobile-chat-focus {
        height: 100dvh;
        overflow: hidden;
    }

    body.mobile-chat-focus .topbar,
    body.mobile-chat-focus #chat-sidebar,
    body.mobile-chat-focus .chat-header {
        display: none;
    }

    body.mobile-chat-focus .chat-focus-frame-header {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 3;
        margin-bottom: 2px;
    }

    body.mobile-menu-focus .chat-card {
        display: none;
    }

    body.mobile-menu-focus .chat-layout,
    body.mobile-menu-focus .chat-layout.sidebar-collapsed {
        grid-template-columns: 1fr;
        gap: 0;
        min-height: auto;
    }

    body.mobile-menu-focus .sidebar-card {
        min-height: calc(100dvh - 152px);
    }

    body.mobile-menu-focus .mobile-chat-focus-toggle {
        left: 12px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    }

    body.mobile-chat-focus .app-shell {
        width: min(100% - 12px, 1200px);
        height: 100dvh;
        padding-top: 8px;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
        overflow: hidden;
    }

    body.mobile-chat-focus .page-content {
        height: 100%;
        gap: 12px;
        overflow: hidden;
    }

    body.mobile-chat-focus .chat-layout,
    body.mobile-chat-focus .chat-layout.sidebar-collapsed {
        grid-template-columns: 1fr;
        gap: 0;
        min-height: 100%;
        height: 100%;
    }

    body.mobile-chat-focus .chat-card {
        min-height: 100%;
        height: 100%;
        gap: 14px;
        padding-top: 20px;
        padding-bottom: 14px;
    }

    body.mobile-chat-focus .chat-messages {
        min-height: 0;
        height: 100%;
        max-height: none;
        padding-right: 2px;
        padding-bottom: 4px;
    }

    body.mobile-chat-focus .chat-form {
        margin-top: 0;
    }

    body.mobile-chat-focus .chat-form textarea {
        min-height: 54px;
    }

    body.mobile-chat-focus .mobile-chat-focus-toggle {
        left: 12px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    }

    .chat-layout,
    .chat-layout.sidebar-collapsed {
        --sidebar-width: 1fr;
        gap: 20px;
    }

    .chat-layout.sidebar-collapsed .sidebar-card {
        opacity: 1;
        transform: none;
        pointer-events: auto;
        padding-left: 18px;
        padding-right: 18px;
        border-color: var(--border);
    }

    .hero-card,
    .chat-layout,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .chat-layout {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .app-shell {
        width: min(100% - 18px, 1200px);
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links {
        justify-content: space-between;
    }

    .hero-card,
    .feature-card,
    .auth-card,
    .sidebar-card,
    .chat-card {
        padding: 18px;
    }

    .chat-form {
        grid-template-columns: 1fr;
    }

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


@media (max-width: 720px) {
    .quote-chat-card {
        width: 100%;
        padding: 16px;
        border-radius: 20px;
    }

    .quote-chat-card-top,
    .quote-chat-card-body {
        flex-direction: column;
        align-items: stretch;
    }

    .quote-chat-card-category,
    .quote-chat-card-change {
        width: fit-content;
        max-width: 100%;
    }
}


@media (max-width: 720px) {
    .weather-chat-card {
        width: 100%;
        padding: 15px;
        border-radius: 20px;
        gap: 14px;
    }

    .weather-chat-card-top,
    .weather-chat-card-main {
        flex-direction: column;
        align-items: stretch;
    }

    .weather-chat-card-icon-wrap {
        width: 56px;
        height: 56px;
    }

    .weather-chat-card-summary {
        min-width: 0;
        max-width: none;
    }

    .weather-chat-card-metrics {
        grid-template-columns: 1fr;
    }
}


body.modal-open {
    overflow: hidden;
}

.settings-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.settings-modal.is-open {
    display: flex;
}

.settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 18, 0.7);
    backdrop-filter: blur(8px);
}

.settings-panel {
    position: relative;
    width: min(100%, 620px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: rgba(11, 16, 32, 0.96);
    box-shadow: var(--shadow);
}

.settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.settings-header h2,
.settings-section h3 {
    margin: 10px 0 8px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-form {
    margin-top: 4px;
}

.close-settings-button {
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .help-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .settings-modal {
        padding: 12px;
    }

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

@media (max-width: 720px) {
    .memory-editor-row {
        grid-template-columns: 1fr;
    }

    .memory-editor-commitment-grid {
        grid-template-columns: 1fr;
    }

    .memory-editor-actions,
    .memory-editor-primary-actions {
        width: 100%;
    }

    .memory-editor-actions .btn,
    .memory-editor-primary-actions .btn,
    .memory-editor-row-commitment .memory-remove-row-button {
        width: 100%;
    }
}


.memory-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.memory-tag {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
}

.quote-search-form,
.quote-search-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quote-search-row {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 12px;
    align-items: end;
}

.quote-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quote-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    cursor: pointer;
}

.quote-chip:hover {
    background: rgba(124, 92, 255, 0.14);
    border-color: rgba(124, 92, 255, 0.28);
}

.quotes-panel {
    width: min(100%, 980px);
}

.quote-empty-state {
    color: var(--muted);
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.quote-detail-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.quote-detail-card.positive {
    box-shadow: inset 0 0 0 1px rgba(51, 209, 122, 0.14);
}

.quote-detail-card.negative {
    box-shadow: inset 0 0 0 1px rgba(255, 107, 129, 0.14);
}

.quote-detail-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.quote-detail-top h4 {
    margin: 0 0 6px;
    font-size: 1.3rem;
}

.quote-detail-price-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-end;
}

.quote-main-price {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.quote-variation {
    display: inline-flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    font-weight: 700;
}

.quote-variation.positive,
.quote-card-change.positive {
    color: var(--success);
}

.quote-variation.negative,
.quote-card-change.negative {
    color: var(--danger);
}

.quote-variation.neutral,
.quote-card-change.neutral {
    color: var(--muted);
}

.quote-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quote-metric {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
}

.quote-metric span,
.quote-source-note,
.quote-card-name,
.quote-result-card p,
.quote-result-meta small {
    color: var(--muted);
}

.quote-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.quote-card,
.quote-result-card {
    width: 100%;
    text-align: left;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    cursor: pointer;
}

.quote-card:hover,
.quote-result-card:hover {
    border-color: rgba(124, 92, 255, 0.28);
    background: rgba(124, 92, 255, 0.08);
}

.quote-card-top,
.quote-result-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.quote-card-top span,
.quote-result-meta span {
    color: var(--muted);
    font-size: 0.85rem;
}

.quote-card-price {
    margin: 12px 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
}

.quote-result-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quote-result-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.quote-state-chip {
    white-space: nowrap;
}

@media (max-width: 980px) {
    .quote-grid,
    .quote-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .quote-search-row,
    .quote-grid,
    .quote-metrics-grid {
        grid-template-columns: 1fr;
    }
}


.market-two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.small-text {
    font-size: 0.88rem;
}

.text-button {
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
}

.quote-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mini-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.04);
}

.mini-card-top,
.mini-card-bottom {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.mini-card p,
.mini-card span,
.alert-line {
    color: var(--muted);
}

.small-icon-button {
    min-width: 36px;
    min-height: 36px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.alert-form-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 12px;
}

.alert-status {
    display: inline-flex;
    align-self: flex-start;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    font-weight: 700;
}

.alert-triggered {
    box-shadow: inset 0 0 0 1px rgba(51, 209, 122, 0.18);
}

@media (max-width: 980px) {
    .market-two-columns,
    .alert-form-grid {
        grid-template-columns: 1fr;
    }
}


.chat-inline-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(100%, 620px);
    max-width: 100%;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.message.user .chat-inline-panel {
    align-self: flex-end;
}

.message.assistant .chat-inline-panel {
    align-self: flex-start;
}

.quote-inline-panel {
    gap: 14px;
}

.commitment-inline-panel {
    gap: 14px;
}

.task-inline-panel {
    gap: 14px;
}

.shopping-inline-panel {
    gap: 12px;
}

.shopping-inline-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.shopping-inline-panel-head-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.shopping-card-actions {
    margin-left: auto;
}

.shopping-card-actions-button {
    min-width: 34px;
    min-height: 34px;
    padding: 0 9px;
    border-radius: 10px;
    letter-spacing: 1px;
}

.shopping-card-actions-menu {
    min-width: 170px;
}

.shopping-inline-panel-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.shopping-inline-panel-count.is-error {
    color: #ffcdc6;
    border-color: rgba(255, 123, 98, 0.28);
    background: rgba(255, 123, 98, 0.10);
}

.commitment-quick-add-panel,
.shopping-quick-add-panel {
    gap: 14px;
}

.commitment-quick-add-form,
.shopping-quick-add-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.commitment-quick-add-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.commitment-quick-add-title {
    grid-column: span 1;
}

.shopping-quick-add-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(170px, 0.95fr) minmax(150px, 0.8fr) minmax(170px, 0.95fr);
    gap: 12px;
    align-items: end;
}

.shopping-quick-add-title {
    grid-column: span 1;
}

.shopping-field-item,
.shopping-field-list,
.shopping-field-quantity,
.shopping-field-section {
    min-width: 0;
}

.shopping-quick-add-quantity-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 78px;
    gap: 8px;
    align-items: center;
}

.shopping-quick-add-quantity-row input,
.shopping-quick-add-quantity-row select {
    min-height: 48px;
}

.commitment-quick-picks,
.shopping-quick-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.commitment-quick-add-actions,
.shopping-quick-add-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.shopping-quick-add-actions-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

.shopping-quick-add-actions-grid .btn {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.95rem;
}

.commitment-quick-add-feedback,
.shopping-quick-add-feedback,
.chat-inline-panel-status {
    margin: 0;
    color: var(--muted);
}

.chat-inline-panel-status {
    font-size: 0.92rem;
}


.commitment-inline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shopping-inline-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: min(42vh, 360px);
    overflow-y: auto;
    padding: 2px 2px 2px 0;
    scrollbar-width: thin;
}

.task-inline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-commitment-card,
.chat-task-card,
.chat-shopping-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-shopping-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-shopping-row:last-child {
    border-bottom: 0;
}

.chat-shopping-row-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    flex-wrap: wrap;
}

.chat-shopping-row-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    text-transform: lowercase;
    min-width: 0;
}

.chat-shopping-row-title::first-letter {
    text-transform: uppercase;
}

.chat-shopping-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chat-shopping-row .shopping-chip {
    padding: 5px 9px;
    font-size: 0.74rem;
}

.chat-shopping-row-index {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}


.chat-commitment-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.commitment-card-actions {
    margin-left: auto;
}

.commitment-card-actions .memory-actions-button {
    min-width: 34px;
    min-height: 34px;
    padding: 0 9px;
    border-radius: 10px;
}

.commitment-card-actions .memory-actions-menu {
    min-width: 166px;
}

.chat-commitment-card-title,
.chat-task-card-title,
.chat-shopping-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
}

.chat-commitment-card-meta,
.chat-task-card-meta,
.chat-shopping-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-chip {
    background: rgba(125, 102, 255, 0.16);
    border-color: rgba(125, 102, 255, 0.35);
    color: var(--text);
}


.shopping-list-quick-create-panel {
    gap: 14px;
}

.shopping-list-quick-create-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.shopping-list-quick-create-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.shopping-lists-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.chat-shopping-list-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-shopping-list-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.shopping-list-card-top-aside {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.shopping-overview-card-actions {
    margin-left: 0;
}

.shopping-overview-card-actions .memory-actions-button {
    min-width: 34px;
    min-height: 34px;
    padding: 0 9px;
    border-radius: 10px;
}

.shopping-overview-card-actions .memory-actions-menu {
    min-width: 182px;
}

.chat-shopping-list-card-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text);
}

.chat-shopping-list-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-shopping-list-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-shopping-list-preview-item {
    font-size: 0.88rem;
    color: var(--muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
}

.chat-shopping-list-preview-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.shopping-list-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}


.shopping-hub-panel {
    gap: 14px;
    width: min(100%, 700px);
}

.shopping-hub-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shopping-hub-toolbar-button {
    min-height: 40px;
}

.shopping-hub-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.shopping-hub-section.is-hidden {
    display: none;
}

.shopping-hub-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.shopping-hub-section-head-aside {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.shopping-hub-current-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(124, 92, 255, 0.08);
    border: 1px solid rgba(124, 92, 255, 0.16);
}

.shopping-hub-current-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.shopping-hub-current-heading {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
}

.shopping-hub-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shopping-hub-create-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.8fr) minmax(0, 1.2fr);
}

.shopping-hub-add-grid {
    grid-template-columns: minmax(170px, 0.95fr) minmax(0, 1.35fr) minmax(170px, 0.8fr) minmax(160px, 0.9fr);
}

.shopping-hub-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shopping-hub-inline-actions--compact .btn,
.shopping-hub-inline-actions .btn {
    min-height: 42px;
}

.shopping-hub-overview-grid {
    align-items: stretch;
}

.shopping-hub-list-card {
    min-height: 100%;
}

.shopping-hub-list-card.is-active {
    box-shadow: inset 0 0 0 1px rgba(86, 184, 255, 0.18);
}

@media (max-width: 980px) {
    .shopping-hub-create-grid,
    .shopping-hub-add-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .shopping-hub-create-grid,
    .shopping-hub-add-grid {
        grid-template-columns: 1fr;
    }

    .shopping-hub-toolbar,
    .shopping-hub-inline-actions {
        width: 100%;
    }

    .shopping-hub-toolbar .btn,
    .shopping-hub-inline-actions .btn {
        width: 100%;
    }
}

.shopping-chip {
    background: rgba(86, 184, 255, 0.12);
    border-color: rgba(86, 184, 255, 0.24);
    color: var(--text);
}

.shopping-chip.is-section {
    background: rgba(124, 92, 255, 0.12);
    border-color: rgba(124, 92, 255, 0.26);
}

.quote-inline-panel-intro {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quote-inline-panel-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.quote-inline-panel-actions-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.chat-inline-panel-title {
    font-size: 1rem;
    line-height: 1.5;
}

.chat-inline-panel-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.region-quick-set-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.region-quick-set-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
    gap: 12px;
}

.region-quick-set-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.memory-editor-region-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
    gap: 12px;
    width: 100%;
}

.memory-region-card {
    width: 100%;
}


.chat-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.chat-quick-action-button {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    justify-content: center;
    text-align: center;
    border: 1px solid rgba(124, 92, 255, 0.28);
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.12);
    color: var(--text);
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.chat-quick-action-button:hover {
    transform: translateY(-1px);
    background: rgba(124, 92, 255, 0.2);
    border-color: rgba(124, 92, 255, 0.44);
}

.chat-quick-action-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
}

@media (max-width: 900px) {
    .chat-inline-panel {
        width: min(100%, 560px);
    }
}

@media (max-width: 720px) {
    .chat-inline-panel {
        width: 100%;
        max-width: 100%;
        padding: 14px;
    }

    .quote-inline-panel-actions {
        padding: 12px;
    }

    .commitment-quick-add-grid {
        grid-template-columns: 1fr;
    }

    .chat-quick-actions {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 560px) {
    .chat-session-list {
        max-height: calc((var(--chat-session-row-height) * 10) + (var(--chat-session-row-gap) * 9) + 8px);
        padding-right: 6px;
        padding-bottom: 8px;
    }

    .chat-session-actions {
        right: 8px;
    }

    .chat-session-actions-button {
        width: 24px;
        min-width: 24px;
        height: 24px;
        min-height: 24px;
        padding: 0;
    }
}


/* v1.32 - ações integradas no chip do chat e lista limitada a 10 itens visíveis */
.chat-session-item {
    min-height: var(--chat-session-row-height);
}

.chat-session-item .chat-session-button {
    padding-right: 44px;
}

.chat-session-item .chat-session-actions {
    position: absolute;
    top: 50%;
    right: 12px;
    left: auto;
    bottom: auto;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
}

.chat-session-item .chat-session-actions-button {
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: rgba(245, 247, 255, 0.78);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
}

.chat-session-item .chat-session-actions-button:hover,
.chat-session-item .chat-session-actions-button:focus-visible {
    background: transparent;
    color: var(--text);
    transform: none;
}

.chat-session-item.is-active .chat-session-actions-button {
    border: none;
    background: transparent;
    color: rgba(245, 247, 255, 0.9);
}

@media (max-width: 560px) {
    .chat-session-item .chat-session-button {
        padding-right: 40px;
    }

    .chat-session-item .chat-session-actions {
        right: 10px;
    }

    .chat-session-item .chat-session-actions-button {
        width: 22px;
        min-width: 22px;
        height: 22px;
        min-height: 22px;
        font-size: 1.2rem;
    }
}


.memory-shopping-card {
    gap: 12px;
}

.memory-editor-shopping-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

@media (max-width: 1440px) {
    .shopping-quick-add-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shopping-field-item,
    .shopping-field-section {
        grid-column: span 2;
    }

    .shopping-quick-add-actions-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .shopping-quick-add-grid,
    .memory-editor-shopping-grid,
    .shopping-list-quick-create-grid {
        grid-template-columns: 1fr;
    }

    .shopping-field-item,
    .shopping-field-section {
        grid-column: span 1;
    }

    .shopping-quick-add-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 720px) {
    .sidebar-menu-wrap {
        width: 100%;
    }

    .sidebar-menu-trigger {
        width: 100%;
        justify-content: center;
    }

    .sidebar-menu-panel {
        width: min(100%, 260px);
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .shopping-inline-list {
        max-height: min(38vh, 300px);
    }

    .chat-shopping-row {
        align-items: flex-start;
        gap: 8px;
    }

    .chat-shopping-row-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .chat-shopping-row-index {
        align-self: flex-start;
    }

    .shopping-quick-add-actions-grid {
        grid-template-columns: 1fr;
    }
}

.finance-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0 18px;
}

.finance-summary-card {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.finance-summary-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.finance-summary-card strong {
    font-size: 1.08rem;
}

.finance-entry-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.finance-entry-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 16px;
}

.finance-entry-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.finance-entry-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.finance-kind-chip.kind-gasto {
    border-color: rgba(255, 107, 129, 0.35);
    color: #ffd6dc;
    background: rgba(255, 107, 129, 0.12);
}

.finance-kind-chip.kind-salario {
    border-color: rgba(51, 209, 122, 0.35);
    color: #d9ffeb;
    background: rgba(51, 209, 122, 0.12);
}

.finance-kind-chip.kind-investimento {
    border-color: rgba(124, 92, 255, 0.35);
    color: #ece1ff;
    background: rgba(124, 92, 255, 0.16);
}

.finance-amount-chip {
    font-weight: 700;
}

.finance-entrypoint-panel {
    width: min(100%, 520px);
}

.finance-entrypoint-status {
    margin: 0;
}

.finance-entrypoint-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.finance-screen-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.finance-screen-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.finance-screen-panel {
    width: 100%;
    max-width: 100%;
    padding: 22px;
    gap: 18px;
}

.finance-screen-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.finance-screen-list-title {
    font-size: 1rem;
    color: var(--text);
}

.finance-screen-empty {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.035);
}

.shopping-screen-panel {
    gap: 20px;
}

.shopping-screen-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.shopping-screen-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.shopping-screen-card {
    min-height: 100%;
}

.commitments-screen-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.help-screen-grid {
    align-items: stretch;
}

.help-screen-checklist {
    padding-left: 18px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-screen-checklist li::marker {
    color: var(--primary-2);
}

.help-screen-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.help-screen-shortcut-card {
    min-height: 100%;
}

@media (max-width: 820px) {
    .help-screen-shortcuts {
        grid-template-columns: 1fr;
    }
}

.commitments-screen-card {
    min-height: 100%;
}

.commitments-screen-empty {
    grid-column: 1 / -1;
}

.shopping-screen-empty {
    grid-column: 1 / -1;
}

.finance-quick-add-grid,
.memory-editor-finance-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.finance-field-kind {
    grid-column: span 2;
}

.finance-field-title {
    grid-column: span 4;
}

.finance-field-amount {
    grid-column: span 2;
}

.finance-field-date {
    grid-column: span 2;
}

.finance-field-category {
    grid-column: span 2;
}

.finance-field-notes {
    grid-column: 1 / -1;
}

.finance-quick-add-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.memory-finance-card {
    border-color: rgba(51, 209, 255, 0.16);
}

@media (max-width: 720px) {
    .finance-screen-panel {
        padding: 18px;
    }

    .shopping-screen-summary-grid,
    .shopping-screen-grid {
        grid-template-columns: 1fr;
    }

    .finance-entrypoint-actions .btn,
    .finance-screen-toolbar .btn {
        width: 100%;
    }
}

@media (max-width: 1180px) {
    .finance-summary-grid,
    .shopping-screen-summary-grid,
    .shopping-screen-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-quick-add-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .finance-field-kind,
    .finance-field-amount,
    .finance-field-date,
    .finance-field-category {
        grid-column: span 2;
    }

    .finance-field-title,
    .finance-field-notes {
        grid-column: 1 / -1;
    }

    .memory-editor-finance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .finance-summary-grid,
    .memory-editor-finance-grid {
        grid-template-columns: 1fr;
    }

    .finance-quick-add-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-field-kind,
    .finance-field-amount,
    .finance-field-date,
    .finance-field-category {
        grid-column: span 1;
    }

    .finance-field-title,
    .finance-field-notes {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .finance-summary-grid,
    .finance-quick-add-grid,
    .memory-editor-finance-grid {
        grid-template-columns: 1fr;
    }

    .finance-field-kind,
    .finance-field-title,
    .finance-field-amount,
    .finance-field-date,
    .finance-field-category,
    .finance-field-notes {
        grid-column: auto;
    }

    .finance-quick-add-actions .btn {
        width: 100%;
    }
}


.home-version-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px 24px;
    width: 100%;
    margin: 10px auto 2px;
    padding: 12px 8px;
    color: var(--muted);
    font-size: 0.96rem;
}

.home-version-footer-left {
    text-align: left;
}

.home-version-footer-right {
    text-align: right;
}

.home-version-footer strong {
    color: var(--text);
}

@media (max-width: 720px) {
    .home-version-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .home-version-footer-left,
    .home-version-footer-right {
        width: 100%;
        text-align: center;
    }
}


.quotes-page-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quote-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.quote-price {
    margin: 12px 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
}

.quote-change {
    font-weight: 700;
    margin-bottom: 10px;
}

.quote-change.positive {
    color: #45d483;
}

.quote-change.negative {
    color: #ff7b8f;
}

.quote-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quote-list-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.035);
}

.quote-inline-price {
    font-weight: 700;
    color: var(--text);
}


.calculator-entrypoint-panel {
    border-color: rgba(255, 169, 91, 0.16);
}

.sweets-calc-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.sweets-calc-heading-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.sweets-calc-toolbar {
    gap: 10px;
    align-items: center;
}

#sweets-save-status {
    margin-left: auto;
}

.sweets-calc-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 448px);
    gap: 18px;
    align-items: start;
}

.sweets-calc-panel,
.sweets-results-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.sweets-results-panel {
    position: sticky;
    top: 92px;
}

.sweets-panel-head {
    gap: 12px;
    align-items: flex-start;
}

.sweets-panel-head p {
    margin: 6px 0 0;
    max-width: 58ch;
}

.sweets-calc-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.sweets-surface-card {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.026);
    border: 1px solid rgba(255, 255, 255, 0.055);
}

.sweets-calc-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.sweets-calc-section-head p {
    margin: 6px 0 0;
}

.sweets-section-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-left: auto;
    flex: 0 0 auto;
}

.sweets-section-head-actions .btn-inline-auto {
    width: auto;
}

#sweets-ingredients-body[hidden],
#sweets-extras-body[hidden],
#print3d-materials-body[hidden],
#print3d-production-body[hidden] {
    display: none !important;
}

#finance-form-body[hidden],
#finance-list-body[hidden],
#finance-summary-body-page[hidden],
#finance-breakdown-body[hidden] {
    display: none !important;
}

.finance-editor-shell {
    align-items: start;
}

.finance-editor-panel,
.finance-results-panel {
    min-width: 0;
}

.finance-page-notes-field textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 10, 30, 0.72);
    color: var(--text);
    padding: 12px 14px;
    font: inherit;
}

.finance-page-feedback {
    margin: 0;
}

.finance-page-feedback.is-error,
#finance-save-status.is-error {
    color: #ffb6c4;
}

.finance-page-entry-list {
    gap: 14px;
    max-height: 690px;
    overflow-y: auto;
    padding-right: 6px;
}

.finance-page-entry-list::-webkit-scrollbar {
    width: 10px;
}

.finance-page-entry-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.finance-page-entry-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(124, 92, 255, 0.88), rgba(51, 209, 255, 0.78));
    border-radius: 999px;
    border: 2px solid rgba(7, 12, 28, 0.55);
}

.finance-page-entry-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(124, 92, 255, 0.98), rgba(51, 209, 255, 0.9));
}

.finance-page-entry-card {
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px;
}

.finance-page-entry-head {
    gap: 14px;
}

.finance-entry-card-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.finance-entry-notes {
    margin: 6px 0 0;
    max-width: 62ch;
}

.finance-page-empty[hidden] {
    display: none !important;
}

.finance-page-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.finance-detail-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid rgba(255, 255, 255, 0.055);
}

.finance-detail-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.finance-detail-card strong {
    color: var(--text);
    font-size: 1.04rem;
}

.finance-detail-card p {
    margin: 0;
}

.finance-page-actions-row {
    margin-top: 18px;
}

@media (max-width: 980px) {
    .finance-detail-grid {
        grid-template-columns: 1fr;
    }
}


.sweets-preset-save-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.sweets-preset-name-field {
    min-width: 0;
}

.sweets-preset-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sweets-preset-empty {
    margin: 0;
}

.sweets-preset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid rgba(255, 255, 255, 0.055);
}

.sweets-preset-meta {
    min-width: 0;
}

.sweets-preset-meta p {
    margin: 6px 0 0;
}

.sweets-preset-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-sm {
    padding: 10px 14px;
    min-height: 40px;
    font-size: 0.95rem;
}

.sweets-ingredient-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sweets-ingredient-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 0;
}

.sweets-ingredient-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sweets-ingredient-card-head p {
    margin: 4px 0 0;
}

.sweets-ingredient-title {
    display: block;
    font-size: 1rem;
}

.sweets-ingredient-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.sweets-field-name {
    grid-column: span 4;
}

.sweets-field-price,
.sweets-field-base,
.sweets-field-amount,
.sweets-field-unit {
    grid-column: span 2;
}

.sweets-ingredient-actions {
    display: flex;
    align-items: end;
}

.sweets-extra-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sweets-toggle-card {
    justify-content: space-between;
}

.sweets-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.sweets-converter-card {
    gap: 16px;
}

.sweets-converter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.sweets-converter-result {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.9fr);
    gap: 12px;
    align-items: stretch;
}

.sweets-converter-result-main {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sweets-converter-result-main strong {
    display: block;
    font-size: 2rem;
    line-height: 1.05;
    margin: 8px 0 10px;
}

.sweets-converter-result-main p {
    margin: 0;
}

.sweets-converter-result-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sweets-converter-mini {
    min-height: 100%;
}

.sweets-converter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}


.sweets-collapsible-head {
    align-items: flex-start;
    flex-wrap: nowrap;
}

.sweets-collapsible-head > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.sweets-collapse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.sweets-collapse-toggle:hover {
    border-color: rgba(82, 204, 255, 0.22);
    background: rgba(82, 204, 255, 0.08);
    box-shadow: 0 10px 22px rgba(5, 12, 28, 0.26);
}

.sweets-collapse-toggle:focus-visible {
    outline: 2px solid rgba(82, 204, 255, 0.3);
    outline-offset: 2px;
}

.sweets-collapse-toggle-symbol {
    font-size: 1.4rem;
    line-height: 1;
    font-weight: 700;
}

.sweets-collapsible-section.is-collapsed {
    gap: 0;
}

.sweets-collapsible-section.is-collapsed .sweets-calc-section-head {
    margin-bottom: 0;
}

.sweets-summary-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.sweets-summary-head-actions .shopping-inline-panel-count {
    white-space: nowrap;
}

.sweets-summary-head-actions {
    margin-left: auto;
    flex: 0 0 auto;
}

.sweets-summary-header .sweets-summary-head-actions {
    min-width: auto;
}


.sweets-summary-header {
    margin-bottom: 0;
}

#sweets-summary-body {
    margin-top: 16px;
}

#sweets-summary-body[hidden] {
    display: none !important;
}


.sweets-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sweets-summary-featured {
    border-color: rgba(51, 209, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(51, 209, 255, 0.08);
}

.sweets-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sweets-breakdown-list[hidden] {
    display: none !important;
}

.sweets-breakdown-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid rgba(255, 255, 255, 0.055);
}

.sweets-breakdown-card p {
    margin: 6px 0 0;
}

.sweets-breakdown-card span {
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.sweets-summary-text {
    width: 100%;
    min-height: 132px;
    resize: vertical;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 10, 30, 0.72);
    color: var(--text);
    padding: 14px 16px;
    font: inherit;
    line-height: 1.6;
}

@media (max-width: 1440px) {
    .sweets-calc-shell {
        grid-template-columns: 1fr;
    }

    .sweets-results-panel {
        position: static;
    }
}

@media (max-width: 1180px) {
    .sweets-extra-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sweets-converter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sweets-converter-result {
        grid-template-columns: 1fr;
    }

    .sweets-ingredient-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sweets-field-name,
    .sweets-field-price,
    .sweets-field-base,
    .sweets-field-amount,
    .sweets-field-unit {
        grid-column: span 1;
    }
}

@media (max-width: 720px) {
    .sweets-calc-heading,
    .sweets-panel-head,
    .sweets-ingredient-card-head {
        flex-direction: column;
    }

    .sweets-calc-heading-chips {
        justify-content: flex-start;
    }

    .sweets-surface-card {
        padding: 14px;
    }

    .sweets-extra-grid,
    .sweets-summary-grid,
    .sweets-ingredient-grid,
    .sweets-converter-grid,
    .sweets-converter-result-side,
    .sweets-preset-save-row {
        grid-template-columns: 1fr;
    }

    .sweets-calc-section-head .btn,
    .sweets-ingredient-card-head .btn,
    .finance-screen-toolbar .btn,
    .sweets-converter-actions .btn,
    .sweets-preset-actions .btn,
    .sweets-preset-save-row .btn {
        width: 100%;
    }

    .sweets-breakdown-card,
    .sweets-preset-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .finance-entry-card-actions {
        width: 100%;
        justify-content: stretch;
    }

    .finance-entry-card-actions .btn,
    .finance-page-actions-row .btn {
        width: 100%;
    }

    .finance-page-summary-grid,
    .finance-detail-grid {
        grid-template-columns: 1fr;
    }
}



.auth-links-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
}

.auth-links-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.text-link {
    color: #bcd0ff;
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}

.support-card {
    margin-top: 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-card-soft {
    margin-bottom: 18px;
}

.link-preview {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-all;
}

.support-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
