:root {
    --bg: #f6f3ee;
    --card: rgba(255, 255, 255, 0.82);
    --card-solid: #ffffff;
    --ink: #171717;
    --muted: #6e6a64;
    --line: rgba(23, 23, 23, 0.10);
    --gold: #9c7a3c;
    --gold-dark: #765821;
    --danger: #9d2d28;
    --success: #2f6d45;
    --warning: #8a5a10;
    --purple: #7c3aed;
    --shadow: 0 24px 70px rgba(23, 23, 23, 0.10);
    --radius: 28px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 10%, rgba(156, 122, 60, 0.16), transparent 28%),
        radial-gradient(circle at 88% 0%, rgba(23, 23, 23, 0.07), transparent 24%),
        linear-gradient(135deg, #fbfaf7 0%, var(--bg) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px clamp(16px, 4vw, 42px);
    background: rgba(246, 243, 238, 0.74);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-size: clamp(18px, 2.4vw, 24px);
}

.logo img {
    width: auto;
    height: 38px;
    max-width: 150px;
    object-fit: contain;
}

.logo span {
    white-space: nowrap;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-link {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    font-weight: 650;
}

.nav-link.subtle {
    color: var(--muted);
}

.bot-page,
.login-shell,
.install-shell {
    min-height: calc(100vh - 78px);
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.login-body .login-shell,
.install-body .install-shell {
    min-height: 100vh;
}

.bot-card,
.login-card,
.install-card,
.panel,
.idea-item,
.vault-hero {
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.bot-card {
    width: min(100%, 660px);
    border-radius: 40px;
    padding: clamp(18px, 4vw, 34px);
    overflow: visible;
}

.bot-bubble-card {
    position: relative;
    margin-top: 18px;
    overflow: visible;
    animation: softPop 0.62s cubic-bezier(.16, 1, .3, 1) both;
}

.bot-bubble-card::before {
    content: "";
    position: absolute;
    inset: -42px -28px auto auto;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(156, 122, 60, 0.18), transparent 68%);
    pointer-events: none;
    z-index: -1;
}

.login-card,
.install-card {
    width: min(100%, 520px);
    border-radius: 34px;
    padding: clamp(24px, 5vw, 42px);
    animation: softPop 0.58s cubic-bezier(.16, 1, .3, 1) both;
}

.install-card {
    width: min(100%, 720px);
}

.brand-pill,
.eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(156, 122, 60, 0.11);
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 14px 0 8px;
    font-size: clamp(30px, 7vw, 48px);
    line-height: 0.96;
    letter-spacing: -0.07em;
}

h2 {
    margin: 0;
    letter-spacing: -0.04em;
}

.muted {
    color: var(--muted);
    line-height: 1.6;
}

.bot-image-wrap {
    position: static;
    z-index: auto;
    display: flex;
    justify-content: center;
    margin: 0 0 20px;
    pointer-events: none;
    animation: mascotNormalDrop 0.82s cubic-bezier(.16, 1, .3, 1) both 0.08s;
}

.bot-image {
    width: auto;
    max-width: min(100%, 340px);
    max-height: 250px;
    object-fit: contain;
    transform: none;
    transform-origin: center center;
    filter: drop-shadow(0 18px 28px rgba(23, 23, 23, 0.14));
}

.idea-form,
.form-grid,
.login-card form {
    display: grid;
    gap: 16px;
}

.idea-form {
    overflow: visible;
}

.bot-form-bubble {
    position: relative;
    margin-top: 0;
    padding: clamp(18px, 4vw, 30px);
    border-radius: 34px 34px 30px 30px;
    border: 1px solid rgba(23, 23, 23, 0.09);
    background:
        radial-gradient(circle at 100% 0%, rgba(156, 122, 60, 0.13), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.72));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 18px 44px rgba(23, 23, 23, 0.08);
    overflow: visible;
    animation: bubbleRise 0.68s cubic-bezier(.16, 1, .3, 1) both 0.04s;
}

.bot-form-bubble::after {
    content: "";
    position: absolute;
    right: 46px;
    top: -13px;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.9);
    border-left: 1px solid rgba(23, 23, 23, 0.08);
    border-top: 1px solid rgba(23, 23, 23, 0.08);
    transform: rotate(45deg);
    border-radius: 6px;
}

.bot-form-bubble .field-label,
.bot-form-bubble .voice-status,
.bot-form-bubble .button {
    animation: fieldFade 0.52s ease both;
}

.bot-form-bubble .field-label:nth-of-type(1) {
    z-index: 3000;
    animation-delay: 0.12s;
}

.bot-form-bubble .field-label:nth-of-type(2) {
    z-index: 20;
    animation-delay: 0.18s;
}

.bot-form-bubble .field-label:nth-of-type(3) {
    z-index: 10;
    animation-delay: 0.24s;
}

.bot-form-bubble .voice-status {
    animation-delay: 0.28s;
}

.bot-form-bubble .button {
    animation-delay: 0.32s;
}

label,
.field-label {
    position: relative;
    display: grid;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #34302b;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(23, 23, 23, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    padding: 14px 15px;
    font: inherit;
    font-weight: 500;
    outline: none;
    transition: border 0.18s, box-shadow 0.18s, background 0.18s;
}

textarea {
    resize: vertical;
    min-height: 150px;
    line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(156, 122, 60, 0.5);
    box-shadow: 0 0 0 4px rgba(156, 122, 60, 0.13);
    background: #ffffff;
}

.bot-form-bubble input,
.bot-form-bubble textarea {
    background: rgba(255, 255, 255, 0.86);
    border-radius: 20px;
}

.bot-form-bubble textarea {
    min-height: 190px;
}

.bot-form-bubble .button.big {
    border-radius: 22px;
}

.category-combo {
    position: relative;
    width: 100%;
    z-index: 4000;
}

.category-combo input {
    width: 100%;
    padding-right: 56px;
}

.category-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #171717;
    transition: background 0.2s ease, transform 0.2s ease;
}

.category-toggle:hover {
    background: rgba(17, 17, 17, 0.1);
}

.category-toggle:active {
    transform: translateY(-50%) scale(0.96);
}

.category-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.category-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 9999;
    max-height: 280px;
    overflow-y: auto;
    display: none;
    padding: 8px;
    border-radius: 20px;
    border: 1px solid rgba(17, 17, 17, 0.08);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.14);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.category-menu.is-open {
    display: block;
    animation: categoryDrop 0.18s ease both;
}

.category-option {
    width: 100%;
    border: 0;
    background: transparent;
    color: #171717;
    text-align: left;
    cursor: pointer;
    padding: 12px 14px;
    border-radius: 14px;
    font: inherit;
    font-size: 14px;
    line-height: 1.25;
    transition: background 0.16s ease, transform 0.16s ease;
}

.category-option:hover,
.category-option:focus {
    background: rgba(17, 17, 17, 0.06);
    outline: none;
}

.category-option:active {
    transform: scale(0.99);
}

.other-option {
    font-weight: 800;
    color: var(--purple);
    background: rgba(124, 58, 237, 0.08);
    margin-bottom: 6px;
}

.other-option:hover,
.other-option:focus {
    background: rgba(124, 58, 237, 0.13);
}

.input-with-action {
    position: relative;
    z-index: 1;
}

.input-with-action input {
    padding-right: 64px;
}

.input-with-action textarea {
    padding-right: 64px;
}

.mic-button {
    position: absolute;
    right: 10px;
    top: 50%;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.07);
    color: #171717;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0;
    line-height: 1;
    box-shadow: none;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.mic-button:hover {
    background: rgba(17, 17, 17, 0.12);
}

.mic-button:active {
    transform: translateY(-50%) scale(0.96);
}

.mic-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mic-button.is-listening,
.mic-button.listening {
    background: rgba(124, 58, 237, 0.14);
    color: var(--purple);
    animation: micPulse 1s infinite;
}

.textarea-action {
    position: relative;
    z-index: 1;
}

.textarea-action .mic-button,
.mic-button.floating {
    top: 18px;
    transform: none;
}

.textarea-action .mic-button:active,
.mic-button.floating:active {
    transform: scale(0.96);
}

.voice-status {
    min-height: 20px;
    font-size: 13px;
    color: var(--gold-dark);
    font-weight: 700;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 16px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    color: #ffffff;
    background: linear-gradient(135deg, #171717, #4d3a18);
    box-shadow: 0 16px 34px rgba(23, 23, 23, 0.20);
}

.button.ghost {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--line);
}

.button.plain {
    background: transparent;
    color: var(--muted);
    border-color: var(--line);
}

.button.full {
    width: 100%;
}

.button.big {
    min-height: 54px;
    border-radius: 18px;
    font-size: 15px;
}

.alert {
    padding: 13px 15px;
    border-radius: 18px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    line-height: 1.45;
    font-size: 14px;
    font-weight: 650;
}

.alert.success {
    color: var(--success);
    background: rgba(47, 109, 69, 0.10);
    border-color: rgba(47, 109, 69, 0.18);
}

.alert.danger {
    color: var(--danger);
    background: rgba(157, 45, 40, 0.10);
    border-color: rgba(157, 45, 40, 0.18);
}

.alert.warning {
    color: var(--warning);
    background: rgba(138, 90, 16, 0.10);
    border-color: rgba(138, 90, 16, 0.18);
}

.small-alert {
    margin-top: -4px;
}

.codebox {
    min-height: 240px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.vault-shell {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 60px;
}

.vault-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    padding: clamp(22px, 4vw, 34px);
    border-radius: 32px;
    margin-bottom: 18px;
}

.export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.panel {
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 16px;
}

.filters {
    display: grid;
    grid-template-columns: 1fr minmax(180px, 260px) auto auto;
    gap: 10px;
    align-items: center;
}

.import-panel summary {
    cursor: pointer;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.import-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.import-form input[type="file"] {
    max-width: 420px;
}

.ideas-list {
    display: grid;
    gap: 14px;
}

.idea-item {
    border-radius: 26px;
    padding: clamp(18px, 3vw, 24px);
    box-shadow: 0 14px 38px rgba(23, 23, 23, 0.07);
}

.idea-topline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.idea-item h2 {
    font-size: clamp(19px, 3vw, 26px);
}

.idea-item p {
    color: #35322d;
    line-height: 1.7;
    margin: 14px 0;
    white-space: normal;
}

.category-chip {
    flex: 0 0 auto;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    color: var(--gold-dark);
    background: rgba(156, 122, 60, 0.12);
    border: 1px solid rgba(156, 122, 60, 0.14);
}

.idea-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 46px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px dashed var(--line);
    color: var(--muted);
    font-weight: 800;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
    color: var(--muted);
    font-weight: 800;
}

@keyframes softPop {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
        filter: blur(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes bubbleRise {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fieldFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mascotNormalDrop {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(0.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes categoryDrop {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes micPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.25);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(124, 58, 237, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 760px) {
    .topbar {
        align-items: center;
        gap: 12px;
    }

    .logo img {
        height: 34px;
        max-width: 120px;
    }

    .logo span {
        font-size: 16px;
    }

    .top-actions {
        gap: 8px;
    }

    .nav-link {
        padding: 9px 11px;
        font-size: 13px;
    }

    .bot-page {
        padding: 16px 12px 28px;
        align-items: start;
    }

    .bot-card {
        border-radius: 28px;
    }

    .bot-bubble-card {
        margin-top: 18px;
    }

    .bot-image {
        max-width: min(100%, 260px);
        max-height: 220px;
        transform: none;
    }

    .bot-form-bubble {
        margin-top: 0;
        border-radius: 30px;
    }

    .bot-form-bubble .field-label:nth-of-type(1) {
        z-index: 3000;
        margin-bottom: 12px;
    }

    .bot-form-bubble textarea {
        min-height: 180px;
    }

    .category-combo input {
        padding-right: 58px;
    }

    .category-toggle {
        right: 9px;
        width: 38px;
        height: 38px;
    }

    .category-menu {
        max-height: 240px;
        border-radius: 18px;
    }

    .input-with-action input {
        padding-right: 62px;
    }

    .input-with-action textarea {
        padding-right: 60px;
        min-height: 170px;
    }

    .mic-button {
        right: 9px;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .mic-button svg {
        width: 23px;
        height: 23px;
    }

    .textarea-action .mic-button,
    .mic-button.floating {
        top: 14px;
    }

    .vault-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .export-actions {
        justify-content: stretch;
    }

    .export-actions .button {
        flex: 1 1 100%;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .idea-topline {
        flex-direction: column;
    }

    .category-chip {
        align-self: flex-start;
    }

    .import-form {
        display: grid;
    }
}

/* Final header logo size fix for Ideas Vault page */

.topbar .logo {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
    max-width: 60vw !important;
    overflow: hidden !important;
}

.topbar .logo img,
.topbar img[src*="logo"] {
    width: auto !important;
    height: 38px !important;
    max-width: 150px !important;
    max-height: 38px !important;
    object-fit: contain !important;
    flex: 0 0 auto !important;
}

.topbar .logo span {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

@media (max-width: 760px) {
    .topbar .logo {
        max-width: 52vw !important;
    }

    .topbar .logo img,
    .topbar img[src*="logo"] {
        height: 32px !important;
        max-height: 32px !important;
        max-width: 110px !important;
    }

    .topbar .logo span {
        font-size: 15px !important;
    }
}