@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #0b0d11;
    --muted: #636770;
    --accent: #1d5cff;
    --border: #e2e5ec;
    --display-font: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}
*, *::before, *::after {
    box-sizing: border-box;
    border-radius: 0;
}
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}
[hidden] {
    display: none !important;
}
body.authenticated {
    overflow: hidden;
}

.brand-select {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 0 80px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.brand-select-hero-card {
    display: flex;
    gap: 20px;
    align-items: stretch;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, #fef6ef, #f4f7ff);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.brand-select-hero-copy {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brand-select-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0;
}

.brand-select-hero-copy h1 {
    margin: 0;
    font-size: 1.6rem;
}

.brand-select-hero-text {
    margin: 0;
    max-width: 560px;
    color: rgba(10, 14, 25, 0.75);
}

.brand-select-hero-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.brand-select-hero-meta li {
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.45);
    font-weight: 600;
    color: rgba(7, 10, 22, 0.8);
}

.brand-select-hero-actions {
    flex: 0 0 260px;
    border-radius: 18px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(12, 17, 35, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-self: flex-start;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.brand-select-hero-actions p {
    margin: 0;
    color: var(--muted);
}

.brand-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.brand-select-card {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
}

.brand-select-button {
    width: 100%;
    border: 1px solid rgba(12, 17, 35, 0.08);
    border-radius: 18px;
    padding: 16px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    min-height: 170px;
}

.brand-select-button:hover {
    border-color: var(--accent);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
    transform: translateY(-3px);
}

.brand-select-button.is-active {
    border-color: var(--accent);
    box-shadow: 0 16px 40px rgba(29, 92, 255, 0.18);
}

.brand-select-card-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}

.brand-select-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(12, 17, 35, 0.08);
    background: rgba(244, 247, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-select-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-select-placeholder {
    font-weight: 700;
    font-size: 1.1rem;
    color: rgba(12, 17, 35, 0.55);
}

.brand-select-card-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.brand-select-name {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-select-description {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brand-select-active-chip {
    font-size: 0.78rem;
    font-weight: 700;
    color: #045b3d;
    background: #e2f9f0;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(4, 91, 61, 0.18);
}

.brand-select-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: auto;
}

.brand-select-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(29, 92, 255, 0.08);
    color: var(--accent);
    font-size: 1.1rem;
}

.brand-select-card--add {
    border: 2px dashed rgba(12, 17, 35, 0.15);
    border-radius: 22px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    gap: 18px;
    align-items: center;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.brand-select-card--add:hover {
    border-color: var(--accent);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    transform: translateY(-3px);
}

.brand-select-add-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: rgba(29, 92, 255, 0.08);
    color: var(--accent);
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.brand-select-empty {
    margin: 0;
    text-align: center;
    color: var(--muted);
}

.brand-select-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 12, 20, 0.45);
    z-index: 1400;
}

.brand-select-modal:not(.is-visible) {
    visibility: hidden;
    opacity: 0;
}

.brand-select-modal.is-visible {
    visibility: visible;
    opacity: 1;
}

.brand-select-modal-panel {
    width: min(460px, 100%);
    border-radius: 24px;
    background: var(--surface);
    padding: 28px;
    border: 1px solid rgba(12, 17, 35, 0.08);
    box-shadow: 0 30px 60px rgba(11, 15, 30, 0.25);
}

.metrics-search {
    margin: 16px 0 28px;
    display: flex;
    justify-content: flex-end;
}

.metrics-search .form-field {
    margin: 0;
}

.metrics-search-input {
    width: min(360px, 100%);
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background-color: #fff;
    padding: 0 14px 0 36px;
    font-size: 0.85rem;
    color: var(--text);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2399a1ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

.metrics-search-input::placeholder {
    color: #9aa3af;
}

.metrics-search-input:focus {
    outline: none;
    border-color: rgba(29, 92, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(29, 92, 255, 0.15), 0 8px 20px rgba(15, 23, 42, 0.12);
}

.brand-select-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.brand-select-modal-head h2 {
    margin: 0;
}

.brand-create-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.brand-create-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.brand-create-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 900px) {
    .brand-select-hero-card {
        flex-direction: column;
        padding: 28px;
    }
    .brand-select-hero-actions {
        width: 100%;
        flex: 0 0 auto;
    }
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.page-header--split {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.ship-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.ideas-page-header {
    gap: 10px;
    margin-bottom: 12px;
}

.brand-page-header {
    margin-bottom: 16px;
}

.trend-page-header {
    margin-bottom: 12px;
}

.idea-command-card {
    display: flex;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 4px;
    align-items: flex-start;
    padding: 0;
    border: none;
    background: transparent;
}

.idea-command-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.idea-command-card--center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.idea-command-card--center .idea-command-actions {
    align-items: center;
    flex-direction: row;
    gap: 20px;
    padding: 6px 8px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.04);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.idea-command-card--center .idea-command-actions .btn {
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.idea-command-btn {
    padding: 8px 16px;
    min-height: 36px;
}

.idea-generator-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

.idea-command-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.btn-idea-cta {
    background: linear-gradient(135deg, #11172b, #1d5cff);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 26px;
    font-size: 1rem;
    transition: opacity 160ms ease, filter 160ms ease;
}

.btn-idea-cta:hover {
    filter: brightness(1.05);
}

.btn-idea-cta:focus-visible {
    outline: 3px solid rgba(29, 92, 255, 0.35);
    outline-offset: 2px;
}

.idea-feed-shell {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.idea-feed-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.idea-feed-head h2 {
    margin-bottom: 4px;
}

.idea-feed-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    overflow: visible;
}

.idea-feed-toolbar .metrics-search {
    margin: 0;
    margin-left: auto;
}

.idea-feed-toolbar .metrics-summary-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: visible;
    margin-left: 12px;
}

.idea-feed-toolbar .metrics-summary-label {
    display: flex;
    align-items: center;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    gap: 0;
    white-space: nowrap;
}

.idea-feed-toolbar .metrics-range-input {
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: 999px;
    min-width: 180px;
}

.idea-feed-toolbar .metrics-range-calendar {
    right: 0;
    left: auto;
    transform: none;
    min-width: 240px;
    max-width: calc(100vw - 24px);
}

.idea-feed-toolbar .metrics-search-input {
    height: 32px;
    font-size: 0.8rem;
    width: min(220px, 100%);
}

.idea-feed-toolbar .form-field {
    margin: 0;
}

.idea-feed-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.idea-feed-filters::-webkit-scrollbar {
    display: none;
}

.idea-feed-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.idea-feed-filters .trend-view-button {
    padding: 5px 12px;
    font-size: 0.78rem;
}

.idea-feed-filter-count {
    font-size: 0.72rem;
    color: var(--muted);
}

.idea-feed-filter.is-active .idea-feed-filter-count {
    color: #fff;
}

.idea-feed-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

@media (max-width: 1100px) {
    .idea-feed-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .idea-feed-grid {
        grid-template-columns: 1fr;
    }
    .idea-feed-head {
        flex-direction: column;
    }
    .idea-feed-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .idea-feed-filters {
        justify-content: flex-start;
    }
}

.idea-feed-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    text-align: center;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 180px;
    align-items: center;
}

.idea-feed-card:hover {
    border-color: rgba(29, 92, 255, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.idea-feed-card.is-active {
    border-color: var(--accent);
    box-shadow: 0 8px 22px rgba(29, 92, 255, 0.25);
}

.idea-feed-card-status {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.idea-feed-pill {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.idea-feed-pill.status-queued {
    background: #f1f5ff;
    color: #2a4494;
}

.idea-feed-pill.status-generating {
    background: #fff4e5;
    color: #9c5703;
}

.idea-feed-pill.status-completed {
    background: #e5fbf2;
    color: #027a4b;
}

.idea-feed-pill.status-error {
    background: #ffe7ea;
    color: #8f1a2c;
}

.idea-feed-time {
    font-size: 0.8rem;
    color: var(--muted);
}

.idea-feed-card h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: var(--text);
    text-align: center;
}

.idea-feed-meta {
    display: flex;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--muted);
}

.idea-feed-empty {
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 18px;
    padding: 40px;
}

.idea-feed-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.idea-feed-pagination-pages {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.idea-page-link,
.idea-page-arrow {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--border);
    text-decoration: none;
    font-weight: 600;
    color: var(--text);
    background: #fff;
}

.idea-page-link.is-active {
    background: #1d5cff;
    border-color: #1d5cff;
    color: #fff;
}

.idea-page-arrow.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.idea-page-ellipsis {
    color: var(--muted);
    padding: 0 4px;
}

.idea-panel-loading {
    padding: 32px;
    text-align: center;
    color: var(--muted);
}

.idea-panel-loading.is-error {
    color: #8f1a2c;
}

.idea-panel-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.idea-panel-eyebrow {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.idea-panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.idea-panel-title-row h2 {
    margin: 0;
}

.idea-panel-status {
    display: flex;
    justify-content: flex-end;
}

.idea-panel-body {
    position: relative;
}

.idea-panel-edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 9, 20, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 20;
    backdrop-filter: blur(2px);
}

.idea-panel-edit-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 40px rgba(8, 9, 20, 0.25);
    color: #060a14;
}

.idea-panel-edit-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(6, 10, 20, 0.15);
    border-top-color: #0f1d62;
    border-radius: 50%;
    animation: trend-spin 0.85s linear infinite;
    flex-shrink: 0;
}

.idea-panel-edit-title {
    margin: 0 0 2px;
    font-weight: 600;
    font-size: 1rem;
}

.idea-panel-edit-sub {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(6, 10, 20, 0.7);
}

.idea-detail-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(5, 9, 20, 0.65);
    z-index: 1600;
    opacity: 0;
    transition: opacity 200ms ease;
}

.idea-detail-overlay.is-visible {
    opacity: 1;
}

.idea-detail-panel {
    width: min(960px, 100%);
    max-height: 90vh;
    background: var(--surface);
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 40px 90px rgba(6, 10, 20, 0.45);
    position: relative;
    display: flex;
    flex-direction: column;
}

.idea-detail-scroll {
    overflow-y: auto;
    margin-top: 16px;
    padding-right: 8px;
}

.idea-detail-scroll.is-locked {
    overflow: hidden;
}

.idea-detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 160ms ease;
}

.idea-detail-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.ideas-wizard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 13, 17, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 800;
}

.ideas-wizard {
    width: min(640px, 100%);
    background: var(--surface);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 80px rgba(9, 12, 20, 0.35);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ideas-wizard-head h2 {
    margin: 4px 0 8px;
}

.ideas-step-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}

.ideas-step-progress-label {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ideas-step {
    display: none;
    flex-direction: column;
    gap: 18px;
}

.ideas-step .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ideas-step textarea {
    width: 100%;
    max-width: 100%;
}

.ideas-step.is-active {
    display: flex;
}

.ideas-step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.ideas-step-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field--product-picker {
    gap: 0;
}

.form-field--product-picker label {
    margin-bottom: 6px;
}

.product-picker-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.product-picker-count {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.9rem;
}

.product-picker-search {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}

.product-picker {
    border: 1px solid var(--border);
    border-radius: 12px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
    overflow: hidden;
    background: #fff;
}

.product-picker-list {
    max-height: 76px;
    overflow-y: auto;
}

.product-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
    cursor: pointer;
}

.product-option:first-child {
    border-top: none;
}

.product-option.is-empty {
    color: var(--muted);
    cursor: default;
}

.product-checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.6px solid var(--border);
    background: #fff;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}

.product-checkbox:checked {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 3px #fff;
}

.product-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-name {
    color: var(--text);
}

.product-selected-inputs {
    display: none;
}

.ideas-trend-select {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ideas-trend-select select {
    flex: 1;
}

.ideas-step-grid select,
.ideas-step-grid input[type="number"] {
    width: 100%;
}

.ideas-trend-refresh {
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.ideas-wizard-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.ideas-wizard-footer .btn {
    flex-shrink: 0;
    border-radius: 999px;
    padding: 10px 18px;
}

.ideas-wizard-footer .btn-ghost {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header-actions .btn {
    white-space: nowrap;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
}

.page-header h1 {
    margin: 0;
    font-size: 2.35rem;
}

.page-header p {
    margin: 0;
    color: var(--muted);
    max-width: 700px;
}

.status-banner {
    margin-top: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    background: #eef4ff;
    color: #132a63;
    font-weight: 600;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 260ms ease, transform 260ms ease;
}

.brand-products-summary {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.form-field--catalog-summary .brand-products-summary {
    margin-top: 8px;
    padding-top: 0;
    border-top: none;
}

.brand-products-summary .brand-summary-label {
    display: block;
    margin-bottom: 6px;
}

.brand-products-preview {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brand-products-preview li {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.015);
}

.brand-products-usp {
    font-size: 0.85rem;
    color: var(--muted);
}

.surface-card-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.95rem;
}

.data-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.catalog-upload-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.catalog-upload-form input[type="file"] {
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 8px;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.015);
}

.catalog-edit-controls {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.catalog-edit-form {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.catalog-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

.catalog-input:focus {
    outline: 2px solid rgba(29, 92, 255, 0.3);
    border-color: var(--accent);
}

.catalog-input--multiline {
    resize: vertical;
    min-height: 70px;
}

.catalog-row-actions {
    text-align: center;
}

.catalog-row-remove {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.catalog-row-remove:focus-visible {
    outline: 2px solid rgba(29, 92, 255, 0.25);
    outline-offset: 2px;
}

.status-banner.is-fading {
    opacity: 0;
    transform: translateY(-6px);
}

.grid-panels {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 24px;
    align-items: start;
}

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

.surface-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: none;
}

.surface-card h2 {
    margin-top: 0;
    margin-bottom: 8px;
}

.surface-card p {
    margin-top: 0;
}

.ideas-form-card {
    border-radius: 0;
    border-color: rgba(17, 19, 34, 0.08);
    box-shadow: none;
}

.ideas-form-card--full {
    width: 100%;
    margin-top: 32px;
}

.ideas-form-head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.ideas-form-head-hints {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--muted);
}

.ideas-form-head-hints span {
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px dashed var(--border);
    background: rgba(243, 245, 255, 0.7);
}

.ideas-form-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ideas-field-cluster {
    display: grid;
    gap: 10px;
}

.ideas-brand-note {
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: rgba(242, 244, 255, 0.7);
}

.ideas-fieldset {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: grid;
    gap: 14px;
    background: rgba(246, 247, 255, 0.9);
}

.ideas-fieldset-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--muted);
}

.ideas-refresh {
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: #111b3a;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ideas-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.ideas-inline-group {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.ideas-constraints {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ideas-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.ideas-form-hint {
    font-size: 0.85rem;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.checkbox-inline input {
    width: auto;
    margin: 0;
}

.ideas-checklist {
    padding-left: 18px;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ideas-list-card {
    margin-top: 32px;
}

.idea-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 24px;
}

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

.idea-toolbar-actions .btn-ghost {
    border-radius: 999px;
    padding-inline: 20px;
}

.idea-status-filter {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 720px) {
    .idea-status-filter {
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }
}

.idea-status-filter-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.idea-status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.idea-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    width: auto;
    max-width: 100%;
    flex: 0 0 auto;
}

.idea-status-label {
    font-weight: 600;
}

.idea-status-count {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
}

.idea-status-pill.is-active .idea-status-count {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.ideas-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.idea-card {
    border: 1px solid rgba(10, 16, 42, 0.07);
    border-radius: 0;
    background: #fff;
    padding: 0;
    box-shadow: none;
    overflow: hidden;
}

.idea-edit-panel {
    margin-top: 12px;
}

.idea-loading-overlay {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    width: auto;
    max-width: min(460px, 90vw);
    z-index: 2100;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 200ms ease, transform 200ms ease;
    background: transparent;
}

.idea-loading-overlay.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.idea-loading-panel {
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(10, 12, 23, 0.92);
    color: #fff;
    padding: 18px 22px;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(7, 10, 26, 0.35);
    width: min(420px, 90vw);
    pointer-events: auto;
}

@media (max-width: 720px) {
    .idea-loading-overlay {
        right: 16px;
        left: 16px;
        top: 16px;
    }

    .idea-loading-panel {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .idea-loading-panel {
        flex-direction: column;
        text-align: center;
    }
    .idea-loading-ideas {
        width: 100%;
    }
}

.idea-loading-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: trend-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.idea-loading-title {
    margin: 0 0 4px;
    font-weight: 600;
}

.idea-loading-sub {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
}

.idea-loading-ideas {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.idea-loading-idea {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.9rem;
}

.idea-loading-idea.is-active {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

.idea-loading-idea-index {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.75);
}

.idea-loading-idea.is-active .idea-loading-idea-index {
    color: #fff;
}

.idea-loading-idea-status {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.idea-loading-idea-status[data-idea-status="writing"]::after {
    content: '...';
    animation: idea-typing 1.2s ease-in-out infinite;
}

.idea-loading-idea-status[data-idea-status="done"] {
    color: #8ef5c7;
}

.idea-loading-idea-status[data-idea-status="queued"] {
    color: rgba(255, 255, 255, 0.65);
}

.idea-loading-hint {
    margin: 14px 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

@keyframes idea-typing {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

 

.idea-edit-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.95rem;
    min-height: 96px;
    resize: vertical;
}

.idea-edit-hint {
    margin: 6px 0 12px;
    font-size: 0.85rem;
}

    border-color: #b7ebd0;
}

.idea-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    color: #111;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.idea-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(12, 18, 45, 0.08);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
}

.idea-chip--trend {
    background: rgba(33, 86, 255, 0.15);
    color: #1a1f6b;
    width: fit-content;
    white-space: nowrap;
}

.idea-chip--count {
    background: rgba(12, 17, 37, 0.12);
}

.idea-chip--sound {
    background: rgba(22, 160, 133, 0.18);
    color: #136755;
}

.idea-chip--assignee {
    background: rgba(11, 18, 50, 0.08);
    color: var(--text);
}

.idea-summary {
    list-style: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 16px;
    align-items: flex-start;
    padding: 24px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(11, 18, 50, 0.07);
}

.idea-summary::-webkit-details-marker {
    display: none;
}

.idea-summary:hover {
    background: rgba(255, 255, 255, 0.85);
}

.idea-summary-main h3 {
    margin: 0;
    font-family: var(--display-font);
}

.idea-summary-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 6px;
}

.idea-summary-eyebrow {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--muted);
}

.idea-summary-sub {
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.idea-summary-sub p {
    margin: 0;
}

.idea-summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.idea-summary-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    justify-content: flex-start;
    align-self: flex-start;
}

@media (max-width: 720px) {
    .idea-summary {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    .idea-summary-status {
.job-status-page {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.job-status-card {
    width: min(720px, 100%);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.job-status-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.job-status-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.job-status-pill {
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.job-status-pill--muted {
    color: var(--muted);
}

.job-status-indicator {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.job-status-spinner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent, #1d5cff);
    animation: job-spin 1s linear infinite;
}

.job-status-spinner.is-complete {
    animation: none;
    border-color: rgba(108, 110, 245, 0.4);
    border-top-color: #42d97c;
}

.job-status-spinner.is-failed {
    animation: none;
    border-color: rgba(255, 92, 92, 0.4);
    border-top-color: #ff5c5c;
}

.job-status-copy {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.job-status-message {
    font-size: 1.1rem;
    font-weight: 600;
}

.job-status-error {
    padding: 1rem;
    border-radius: 0.75rem;
    background: rgba(255, 92, 92, 0.08);
    border: 1px solid rgba(255, 92, 92, 0.4);
    color: #ffbcbc;
}

.job-status-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@keyframes job-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.idea-card-head-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.idea-inline-edit-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 0.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: color 120ms ease, background 120ms ease;
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.idea-inline-edit-btn:hover,
.idea-inline-edit-btn:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.idea-inline-edit-icon {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
}

.idea-inline-edit-btn [hidden] {
    display: none !important;
}

.idea-inline-save-label {
    display: none;
    color: var(--muted);
}

.idea-inline-edit.is-editing .idea-inline-save-label {
    display: inline-flex;
    align-items: center;
}

.idea-inline-edit-btn.is-editing .idea-inline-save-label {
    display: inline-flex;
    align-items: center;
}

.idea-inline-save-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    display: block;
}

.idea-inline-edit {
    position: relative;
}

.idea-inline-edit [data-inline-form] {
    display: none;
    margin-top: 0;
}

.idea-inline-edit.is-editing [data-inline-view] {
    display: none;
}

.idea-inline-edit.is-editing [data-inline-form] {
    display: none;
}

.idea-inline-editable {
    display: none;
    white-space: pre-wrap;
    min-height: 1.5rem;
}

.idea-inline-edit.is-editing .idea-inline-editable {
    display: block;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.6);
}

.idea-inline-editable:focus {
    outline: 2px solid rgba(31, 107, 255, 0.25);
    outline-offset: 2px;
}

.idea-inline-editable:empty::before {
    content: attr(data-empty-text);
    color: var(--muted);
}

.idea-inline-edit-icon--save {
    display: none;
}

.idea-inline-edit-btn .idea-inline-edit-icon--save {
    display: none;
}

.idea-inline-edit-btn.is-editing .idea-inline-edit-icon--save,
.idea-inline-edit.is-editing .idea-inline-edit-icon--save {
    display: block;
}

.idea-inline-edit.is-editing .idea-inline-edit-icon--edit {
    display: none;
}

.idea-inline-edit-btn.is-editing .idea-inline-edit-icon--edit {
    display: none;
}

.idea-inline-edit.is-editing .idea-inline-edit-icon--save {
    display: block;
}

.idea-inline-edit.is-editing [data-script-editable][contenteditable="true"] {
    cursor: text;
    outline: 2px solid rgba(31, 107, 255, 0.18);
    outline-offset: 2px;
    border-radius: 8px;
}

.idea-inline-edit.is-editing [data-script-editable][contenteditable="true"]:empty::before {
    content: attr(data-empty-text);
    color: var(--muted);
}

.idea-inline-form textarea {
    width: 100%;
    min-height: 2.5rem;
    resize: vertical;
    font: inherit;
    color: inherit;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    padding: 0.75rem 0.9rem;
}

.idea-inline-form-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-inline-save {
    min-width: 5rem;
}

        align-items: flex-start;
    }
}

.idea-status-chip {
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #e7ebff;
    color: #101845;
}

.idea-status-chip.status-generated { background: #f0f1ff; color: #1a1f6b; }
.idea-status-chip.status-approved { background: #eafbf2; color: #0f7a44; }
.idea-status-chip.status-draft { background: #fff4e9; color: #ab5a00; }
.idea-status-chip.status-shipped { background: #131f45; color: #fff; }

.idea-collapse {
    border: none;
    margin: 0;
    padding: 0;
}

.idea-collapse-icon {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    align-self: flex-start;
}

.idea-collapse-icon::before {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    display: inline-block;
}

.idea-collapse[open] .idea-collapse-icon {
    transform: rotate(180deg);
    background: #eef4ff;
    border-color: #cbd5ff;
    color: var(--text);
}

.idea-collapse-content {
    border-top: 1px solid var(--border);
    padding: 0 24px 24px;
    background: rgb(246 247 255 / 90%);
}

.idea-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 24px;
}

.idea-layout-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    padding-top: 24px;
}

.idea-block {
    width: 100%;
}

.idea-primary-card {
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

@media (max-width: 960px) {
    .idea-primary-card {
        grid-template-columns: 1fr;
    }
}

.idea-primary-main p {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.6;
    margin: 0;
}

.idea-primary-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.idea-script-card {
    padding: 24px;
}

.idea-script-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.idea-script-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

@media (min-width: 1280px) {
    .idea-script-steps {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.idea-audio-card {
    padding: 20px 24px;
}

.idea-audio-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.idea-current-sound {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.idea-sound-picker {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(16, 30, 85, 0.12);
}

.idea-sound-picker-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.idea-sound-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.idea-sound-option {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.idea-sound-option input[type="radio"] {
    margin-top: 6px;
}

.idea-sound-option-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.idea-sound-option-title {
    font-weight: 600;
}

.idea-sound-option-meta {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.idea-sound-actions {
    padding-top: 4px;
}

.idea-sound-empty {
    margin: 0;
    color: var(--muted);
}

.idea-sound-toggle {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-left: 0;
    color: var(--accent);
}

.idea-sound-toggle-icon {
    width: 14px;
    height: 14px;
}

.idea-script-step {
    border: 1px dashed var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(247, 248, 255, 0.85);
    min-height: 190px;
}

.idea-script-step-index {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.idea-script-step p {
    margin: 0;
    color: var(--text);
    line-height: 1.5;
}

.idea-shot-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.idea-shot-detail-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.idea-shot-detail p {
    margin: 0;
}

.idea-shot-meta {
    font-size: 0.88rem;
    color: var(--muted);
}

.idea-shot-meta span {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.idea-trio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.idea-trio-grid .idea-content-card {
    height: 100%;
}

.idea-hashtag-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 4px;
}

.idea-caption-hashtags {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.idea-caption-subhead {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.idea-caption-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.idea-bullet-list {
    margin: 4px 0 0;
    padding-left: 1.25rem;
    list-style-position: outside;
}

.idea-bullet-list li {
    margin-bottom: 6px;
}

.idea-bullet-list li:last-child {
    margin-bottom: 0;
}

.idea-caption-chip {
    border-radius: 16px;
    padding: 6px 12px;
    background: #eef4ff;
    font-weight: 600;
    color: #102165;
    white-space: nowrap;
}

.idea-hashtag-chip {
    border-radius: 16px;
    padding: 6px 12px;
    background: #eef4ff;
    font-weight: 600;
    color: #102165;
    white-space: nowrap;
}

.idea-actions-block {
    padding-top: 4px;
}

.idea-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.idea-actions-bar .trend-refresh-btn--danger {
    padding: 10px 18px;
    min-height: 40px;
    font-size: 0.95rem;
}

.idea-actions-bar .idea-action-btn--ghost {
    border-radius: 999px;
    padding: 10px 18px;
    min-height: 40px;
}

.idea-actions-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.idea-delete-form {
    margin: 0;
    display: flex;
    flex-shrink: 0;
}

.idea-actions-select,
.idea-actions-input {
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.9rem;
    background: #fff;
    min-height: 38px;
}

.idea-actions-select {
    min-width: 150px;
}

.idea-actions-input {
    min-width: 160px;
}

.idea-action-btn {
    border: none;
    border-radius: 0;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.idea-action-btn--primary {
    background: #1d5cff;
    color: #fff;
}

.idea-action-btn--primary:hover {
    background: #1545b5;
}

.idea-action-btn--danger {
    background: #ffecef;
    color: #a4161f;
    border: 1px solid #ffcfd4;
}

.idea-action-btn--danger:hover {
    background: #ffdfe3;
}

.idea-action-btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.idea-action-btn--ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.idea-edit-form {
    width: 100%;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.idea-edit-card .idea-content-card-head {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.idea-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 640px) {
    .idea-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .idea-actions-form,
    .idea-delete-form {
        width: 100%;
    }
    .idea-actions-select,
    .idea-actions-input {
        width: 100%;
    }
}

.idea-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.idea-content-card {
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.idea-content-card--script {
    grid-column: span 2;
}

@media (max-width: 860px) {
    .idea-content-card--script {
        grid-column: span 1;
    }
}

.idea-content-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    min-height: 32px;
}

.idea-hashtag-head {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.idea-copy-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: #f5f7fb;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.idea-copy-btn:hover,
.idea-copy-btn:focus-visible {
    background: #131f45;
    color: #fff;
    border-color: #131f45;
    outline: none;
}

.idea-copy-btn.is-copied {
    background: #e7fcef;
    border-color: #42d97c;
    color: #0b4526;
}

.idea-copy-icon {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
}

.idea-content-pill {
    border-radius: 999px;
    padding: 2px 10px;
    border: 1px solid var(--border);
    font-size: 0.75rem;
}

.idea-hashtag-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.idea-hashtag-list li {
    background: #f5f7fb;
    border-radius: 12px;
    padding: 6px 10px;
    font-weight: 600;
}

.idea-section {
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(12, 18, 45, 0.08);
}

.idea-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.idea-section-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 6px;
}

.idea-card-sidebar {
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.idea-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

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

.idea-meta-item .idea-chip {
    align-self: flex-start;
    width: fit-content;
}

.idea-meta-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.idea-meta-value {
    font-weight: 600;
}

.idea-sidebar-forms {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.idea-sidebar-forms form {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
}

.idea-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

 
.idea-edit-hint {
    margin: 0;
}

.idea-delete-btn {
    width: 100%;
}

.idea-card--focus {
    box-shadow: 0 0 0 3px var(--accent);
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    transition: box-shadow 0.2s ease;
}

.idea-sound-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.idea-sound-line .idea-sound-chip {
    margin-left: auto;
}

.idea-sound-chip {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 999px;
}

.idea-sound-chip--ok {
    background: #e8f7ef;
    color: #0f8a4b;
}

.idea-sound-chip--warn {
    background: #fff4ea;
    color: #b45309;
}

.idea-sound-reason {
    margin: 0 0 6px;
    color: var(--muted);
}

.idea-script summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
}

.idea-script pre {
    margin: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    font-family: inherit;
    white-space: pre-wrap;
}

.idea-update-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.idea-update-submit {
    display: flex;
    align-items: flex-end;
}

.idea-update-submit button {
    width: 100%;
}

.ideas-empty,
.ideas-empty-state {
    margin: 0;
}

.surface-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.trend-scope-head {
    flex-wrap: wrap;
    gap: 12px;
}

.trend-brand-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.trend-brand-pill {
    border: 1px solid var(--border);
    padding: 6px 14px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

.trend-brand-pill.is-active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.trend-view-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.trend-view-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.trend-view-toggle {
    display: flex;
    gap: 8px;
}

.trend-view-button {
    border: 1px solid var(--border);
    background: #f2f4f8;
    color: var(--muted);
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.trend-view-button:hover,
.trend-view-button:focus-visible {
    border-color: var(--text);
    color: var(--text);
    outline: none;
    background: #fff;
}

.trend-view-button.is-active {
    background: #111322;
    color: #fff;
    border-color: #111322;
    box-shadow: 0 8px 18px rgba(17, 19, 34, 0.15);
}
}

.trend-capture-summary {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(120deg, #fef6ff, #f3fbff);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.trend-capture-summary form {
    margin: 0;
}

@media (min-width: 900px) {
    .trend-capture-summary {
        flex-direction: row;
        align-items: flex-start;
    }
    .trend-filter-form {
        flex: 1;
    }
}

.trend-scope-meta h2 {
    margin-bottom: 4px;
}

.trend-scope-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.trend-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(12, 17, 37, 0.08);
    color: var(--text);
}

.trend-filter-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trend-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.trend-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
}

.trend-filter-field select {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 0.95rem;
    background: #fff;
}

.trend-filter-field--compact select {
    min-width: 140px;
}

.trend-filter-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.trend-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(11, 13, 17, 0.06);
    font-weight: 600;
    color: var(--text);
}

.trend-toggle input {
    width: 18px;
    height: 18px;
}

.trend-filter-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.trend-market-tape {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trend-feed-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.trend-feed-shell {
    gap: 16px;
}

.trend-feed-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 240px;
    flex: 1;
}

.trend-view-form--right {
    margin-left: auto;
}

.trend-filter-form--inline {
    flex: 1 1 100%;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    background: var(--surface);
}

.trend-scope-note {
    margin: 0;
}

.trend-view-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #f2f4f8;
    gap: 0;
    overflow: hidden;
}

.trend-view-switch-option {
    position: relative;
    z-index: 2;
    border: none;
    background: transparent;
    padding: 8px 18px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.trend-view-switch-option:hover,
.trend-view-switch-option:focus-visible {
    color: var(--text);
    outline: none;
    background: transparent;
    box-shadow: none;
}

.trend-view-switch-option.is-active {
    color: #fff;
}

.trend-view-switch-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    border-radius: 999px;
    background: #111322;
    box-shadow: 0 8px 18px rgba(17, 19, 34, 0.15);
    transition: transform 0.25s ease;
}

.trend-view-switch[data-view="sounds"] .trend-view-switch-indicator {
    transform: translateX(100%);
}

.trend-view-panel {
    display: block;
}

.trend-market-tape[data-view="sounds"] .trend-view-panel--hashtags {
    display: none;
}

.trend-market-tape[data-view="hashtags"] .trend-view-panel--sounds {
    display: none;
}

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

.trend-actions form {
    margin: 0;
}

.surface-card-head h2 {
    margin: 0;
}

.surface-card-head p {
    margin: 4px 0 20px;
}

.trend-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

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

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

.trend-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--surface);
}

.trend-card--empty {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: #fff;
}

.trend-card--empty h3 {
    margin: 0 0 6px;
}

.trend-card--empty p {
    margin: 0;
}

.trend-card--loading {
    background: #fbfbfe;
}

.trend-card-loader {
    display: flex;
    align-items: center;
    gap: 18px;
}

.trend-inline-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: trend-spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.trend-card-head h3 {
    margin: 2px 0 0;
    font-size: 1.45rem;
    font-weight: 700;
}

.trend-history {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 6px;
}

.trend-history--empty .trend-sparkline {
    display: none;
}

.trend-history--empty .trend-history-range {
    color: var(--muted);
}

.trend-history-range {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.trend-sparkline {
    width: 180px;
    height: 56px;
    display: block;
    max-width: 100%;
}

.trend-rank {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trend-rank span {
    font-size: 0.75rem;
    color: var(--muted);
}

.trend-rank strong {
    font-size: 1.4rem;
}

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

.trend-metrics span {
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.trend-metrics strong {
    font-size: 1.25rem;
}

.trend-metric-value--compact {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.trend-card--sound .trend-metrics span,
.trend-card--sound .trend-metrics strong {
    display: block;
}

.trend-card--sound .trend-card-head {
    min-height: 78px;
}

.trend-card--sound .trend-card-head h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trend-card--sound .trend-card-head .muted {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trend-analysis {
    border-top: 1px dashed var(--border);
    padding-top: 12px;
    margin-top: auto;
}

.trend-analysis-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    color: var(--text);
}

.trend-analysis-toggle svg {
    transition: transform 180ms ease;
}

.trend-analysis-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.trend-analysis-panel {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.02);
}

.trend-analysis-status {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.trend-analysis-status.is-loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
    animation: trend-spin 0.9s linear infinite;
}

.trend-histogram {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfcff;
    height: 120px;
    padding: 8px;
}

.trend-histogram canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.trend-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 13, 17, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.trend-loading-overlay.is-visible {
    opacity: 1;
}

.trend-loading-overlay[hidden] {
    display: none;
}

.trend-loading-panel {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 24px 32px;
    text-align: center;
    box-shadow: 0 20px 45px rgba(9, 14, 40, 0.24);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.trend-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: trend-spin 0.8s linear infinite;
}

@keyframes trend-spin {
    to {
        transform: rotate(360deg);
    }
}

.delta {
    font-size: 0.85rem;
    font-weight: 600;
}

.delta-up {
    color: #0f9d58;
}

.delta-down {
    color: #ea4335;
}

.app-shell {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}
.app-sidebar {
    width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    height: 100vh;
    box-sizing: border-box;
}
.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sidebar-link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    transition: color 160ms ease, background 160ms ease;
}
.sidebar-link.is-active {
    color: var(--text);
    background: #e6ecff;
    border-radius: 8px;
}
.sidebar-link.is-active .sidebar-icon {
    color: var(--accent);
}
.sidebar-link.is-active .sidebar-icon svg {
    stroke: var(--accent);
}
.sidebar-link:hover {
    color: var(--text);
    background: #f0f2f7;
}
.sidebar-icon {
    width: 1.38em;
    height: 1.38em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.sidebar-link.logout-link {
    color: var(--accent);
}
.sidebar-link.logout-link:hover { color: #1545b5; }
.sidebar-logo {
    display: inline-flex;
    align-items: center;
}
.sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    max-width: 100%;
    color: inherit;
}
.sidebar-brand:link,
.sidebar-brand:visited,
.sidebar-brand:hover,
.sidebar-brand:active {
    color: inherit;
    text-decoration: none;
}
.sidebar-brand-name {
    font-size: 1em;
    font-weight: 600;
    color: #0b0d11;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
}
.sidebar-brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f2f4f8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0b0d11;
    overflow: hidden;
}
.sidebar-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sidebar-brand-logo--placeholder {
    text-transform: uppercase;
}
.sidebar-logo svg {
    height: 38px;
    width: auto;
    display: block;
    fill: var(--text);
}
.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 32px;
}
.sidebar-bottom .sidebar-link { padding-left: 8px; padding-right: 8px; }

.sidebar-fixed-controls {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.feedback-inline {
    border: none;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0;
    cursor: pointer;
    letter-spacing: 0.01em;
}

.feedback-inline:hover {
    color: #2f3b52;
    text-decoration: underline;
    text-decoration-color: rgba(47, 59, 82, 0.4);
}

.sidebar-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: static;
}

.sidebar-settings-menu {
    position: fixed;
    left: 24px;
    bottom: 72px;
    min-width: 180px;
    z-index: 1201;
}

.sidebar-settings-toggle {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.sidebar-settings-toggle:hover {
    color: var(--text);
    background: #f0f2f7;
}

.sidebar-settings-label {
    display: none;
}

.sidebar-settings-menu {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.sidebar-settings-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 8px;
}

.sidebar-link.button-reset {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.sidebar-settings[open] .sidebar-settings-toggle {
    color: var(--text);
    background: #f0f2f7;
    border-radius: 8px;
}

.sidebar-settings-toggle::-webkit-details-marker {
    display: none;
}

.sidebar-settings-toggle {
    list-style: none;
}
.sidebar-switcher {
    position: relative;
    width: 100%;
}
.sidebar-switcher-button {
    width: 100%;
    border: none;
    background: none;
    font: inherit;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    appearance: none;
}
.sidebar-switcher-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.sidebar-switcher-caret {
    margin-left: auto;
    width: 1.2em;
    height: 1.2em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: transform 160ms ease;
}
.sidebar-switcher.is-open .sidebar-switcher-caret {
    transform: rotate(180deg);
}
.sidebar-switcher-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1200;
}
.sidebar-switcher-menu[hidden] {
    display: none;
}
.sidebar-switcher-list {
    max-height: 220px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid rgba(12, 17, 35, 0.08);
    background: #fff;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-switcher-status,
.sidebar-switcher-error,
.sidebar-switcher-empty {
    padding: 12px;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}
.sidebar-switcher-error { color: #c23b31; }
.sidebar-switcher-option {
    background: none;
    border: none;
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: background 140ms ease;
}
.sidebar-switcher-option:hover {
    background: #f0f2ff;
}
.sidebar-switcher-option.is-active {
    background: #e6ecff;
    font-weight: 600;
}
.sidebar-switcher-logo {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid rgba(12, 17, 35, 0.08);
    background: #f5f7ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}
.sidebar-switcher-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sidebar-switcher-logo--placeholder {
    color: var(--text);
}
.sidebar-switcher-option-name {
    flex: 1;
    min-width: 0;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-switcher-check {
    font-size: 0.9rem;
    color: var(--accent);
    opacity: 0;
    transition: opacity 140ms ease;
}
.sidebar-switcher-option.is-active .sidebar-switcher-check {
    opacity: 1;
}
.sidebar-switcher-add {
    border: 1px dashed rgba(12, 17, 35, 0.2);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 600;
    color: var(--accent);
    transition: border-color 140ms ease, background 140ms ease;
}
.sidebar-switcher-add:hover {
    border-color: var(--accent);
    background: rgba(29, 92, 255, 0.08);
}
.sidebar-switcher-add-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(29, 92, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.app-main {
    flex: 1;
    height: 100%;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
}
.app-main > main {
    flex: 1 0 auto;
    min-height: 100%;
}
main {
    padding: 48px 40px 64px;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    background: var(--bg);
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 32px;
}
.muted { color: var(--muted); }
button, .btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 0;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 160ms ease;
}

button.trend-refresh-btn,
.btn.trend-refresh-btn {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, #1f6bff, #2e4dff);
    color: #fff;
    box-shadow: 0 10px 18px rgba(31, 107, 255, 0.16);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button.trend-refresh-btn:hover,
button.trend-refresh-btn:focus-visible,
.btn.trend-refresh-btn:hover,
.btn.trend-refresh-btn:focus-visible {
    background: linear-gradient(135deg, #1a62f0, #2444ff);
    box-shadow: 0 12px 22px rgba(31, 107, 255, 0.2);
    filter: saturate(1.1);
}

button.trend-refresh-btn:active,
.btn.trend-refresh-btn:active {
    box-shadow: 0 6px 14px rgba(31, 107, 255, 0.18);
}

button.trend-refresh-btn--danger,
.btn.trend-refresh-btn--danger {
    background: linear-gradient(135deg, #c97878, #b05656);
    box-shadow: 0 10px 18px rgba(146, 69, 69, 0.18);
}

button.trend-refresh-btn--danger:hover,
button.trend-refresh-btn--danger:focus-visible,
.btn.trend-refresh-btn--danger:hover,
.btn.trend-refresh-btn--danger:focus-visible {
    background: linear-gradient(135deg, #b86a6a, #9b4a4a);
    box-shadow: 0 12px 22px rgba(146, 69, 69, 0.22);
}

button.idea-feed-card {
    background: var(--surface);
    color: var(--text);
}

button.ideas-refresh {
    background: #111b3a;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
}

.keyword-suggest-field textarea {
    min-height: 72px;
}

.manual-keyword-controls {
    margin-top: 10px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.manual-keyword-entry-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.manual-keyword-entry-row input {
    flex: 1 1 220px;
}

.manual-keyword-entry-row button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.manual-keyword-hint {
    font-size: 0.8rem;
    color: var(--muted);
}

.manual-keyword-hint.manual-keyword-hint--alert {
    color: #b42318;
    font-weight: 600;
}

.manual-keyword-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 24px;
}

.manual-keyword-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 0.82rem;
    border: 1px solid #0f172a;
    background: #0b0d11;
    color: #fff;
    cursor: pointer;
    transition: opacity 160ms ease;
}

.manual-keyword-pill:hover {
    opacity: 0.82;
}

.manual-keyword-pill-remove {
    font-size: 1rem;
    line-height: 1;
}

.keyword-suggest-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.keyword-suggest-status {
    font-size: 0.85rem;
    color: var(--muted);
}

.keyword-suggest-selected {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-selected-pill {
    border: 1px solid var(--border);
    padding: 4px 10px;
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0.02em;
}

.keyword-suggest-results {
    margin-top: 12px;
    border: 1px dashed var(--border);
    padding: 12px;
    background: #f8f9ff;
    display: none;
    flex-direction: column;
    gap: 12px;
}

.keyword-suggest-results.is-visible {
    display: flex;
}

.keyword-suggest-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-suggest-chip {
    border: 1px solid rgba(29, 92, 255, 0.35);
    background: #e9edff;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #142249;
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease, color 160ms ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.keyword-suggest-chip:hover {
    border-color: #1d5cff;
    background: #1d5cff;
    color: #fff;
    transform: translateY(-1px);
}

.keyword-suggest-apply {
    border: 1px solid var(--text);
    background: var(--text);
    color: #fff;
    padding: 6px 14px;
    font-weight: 600;
    cursor: pointer;
}

.keyword-suggest-clusters {
    display: grid;
    gap: 10px;
}

.keyword-suggest-cluster {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.keyword-suggest-cluster-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--muted);
}
button:hover, .btn:hover { background: #1545b5; }

/* Inline edit pencil buttons should not inherit primary button styling */
.idea-card-head-actions .idea-inline-edit-btn,
.idea-inline-edit-btn {
    background: transparent !important;
    color: var(--muted);
    border: 1px solid transparent;
    padding: 0;
    border-radius: 0.5rem;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    line-height: 1;
}

.idea-inline-edit-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    pointer-events: none;
}

.idea-card-head-actions .idea-inline-edit-btn:hover,
.idea-card-head-actions .idea-inline-edit-btn:focus-visible,
.idea-inline-edit-btn:hover,
.idea-inline-edit-btn:focus-visible {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(11, 13, 17, 0.18);
    color: var(--text);
}
form { display: grid; gap: 12px; }
label { font-weight: 600; color: var(--muted); display: inline-block; margin-bottom: 6px; }
input, select, textarea {
    padding: 12px 14px;
    border: 1px solid #d8dce4;
    background: #fff;
    color: var(--text);
    font-size: 16px;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}
textarea {
    min-height: 96px;
    resize: vertical;
}

.form-field--custom-prompt label {
    display: block;
}

.custom-generator-prompt {
    width: 100%;
    max-width: 100%;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}
.form-grid { display: grid; gap: 16px; }
.form-grid--stacked .form-field { display: flex; flex-direction: column; gap: 6px; }
.form-grid--responsive {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.form-field--end {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.form-field--end button { width: 100%; }
.form-divider {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
}
.error { color: #f87171; margin-top: 4px; }
.narrow-card { max-width: 420px; margin: 0 auto; }
.pill-row { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.pill { padding: 4px 12px; border: 1px solid var(--border); background: #f7f8fb; font-size: 0.85rem; color: var(--muted); }
.center { text-align: center; }
.form-grid { display: grid; gap: 14px; }
.field label { display: block; margin-bottom: 6px; }
.notice-success { margin-bottom: 12px; color: #4ade80; }
.notice-error { margin-bottom: 12px; color: #f87171; }
.section-spaced { margin-top: 20px; }
.input-with-button { display: flex; align-items: stretch; }
.input-with-button input {
    flex: 1 1 auto;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.ghost-btn {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 0 12px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.account-page {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    align-items: start;
}
.account-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.account-panel h2 {
    margin: 0;
}
.full-width { width: 100%; }
.login-wrapper { min-height: calc(100vh - 120px); display: grid; place-items: center; }
.login-card { width: min(520px, 100%); }
.form-narrow { max-width: 420px; margin: 0 auto; width: 100%; }
.login-split {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr;
    align-items: stretch;
}
.login-visual {
    background: #000;
    position: relative;
    overflow: hidden;
}
.login-visual video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px 48px;
}
@media (max-width: 900px) {
    .login-split { grid-template-rows: auto 1fr; }
    .login-panel { padding: 28px 18px 40px; }
    .login-visual { height: 38vh; }
}

/* Login page refinements */
body.login-page main {
    padding: 0;
    max-width: none;
}
body.login-page {
    background: #000;
    color: #fff;
}
body.login-page .login-split-tight { grid-template-rows: auto 1fr; }
body.login-page .login-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1940 / 1068;
    width: 100%;
    max-height: 56vh;
    background: #000;
}
body.login-page .login-visual video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scale(0.70);
    transform-origin: center center;
}
body.login-page .login-panel {
    padding: 0 24px 18px;
    box-sizing: border-box;
    min-height: auto;
    height: auto;
    background: #000;
    margin-top: -72px;
}
body.login-page .login-panel-inner {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 16px;
}
body.login-page .login-logo { text-align: center; }
body.login-page .login-logo svg {
    width: 56%;
    max-width: 272px;
    height: auto;
    display: inline-block;
    margin: 0 auto;
}
body.login-page .login-form {
    max-width: 384px;
    width: 100%;
    display: grid;
    gap: 16px;
    margin: 0 auto;
}
body.login-page .login-form label {
    color: #b9c2d9;
    font-weight: 600;
}
body.login-page .login-form input,
body.login-page .login-form button {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
}
body.login-page .login-form input {
    border: 1px solid rgba(120, 160, 205, 0.35);
    padding: 12px 14px;
    font-size: 16px;
    background: transparent;
    color: #d7deee;
    box-shadow: none;
}
body.login-page .login-form input:-webkit-autofill,
body.login-page .login-form input:-webkit-autofill:hover,
body.login-page .login-form input:-webkit-autofill:focus,
body.login-page .login-form input:-webkit-autofill:active,
body.login-page .login-form input:autofill,
body.login-page .login-form input:autofill:hover,
body.login-page .login-form input:autofill:focus,
body.login-page .login-form input:autofill:active {
    background-color: transparent;
    -webkit-text-fill-color: #d7deee;
    caret-color: #d7deee;
    transition: background-color 9999s ease-out 0s;
    box-shadow: 0 0 0 1000px transparent inset;
}
body.login-page .login-form input:focus {
    outline: none;
    border-color: rgba(120, 160, 205, 0.75);
    box-shadow: 0 0 10px rgba(91, 120, 150, 0.25);
}
body.login-page .login-form button {
    padding: 12px 16px;
    font-size: 16px;
    background: transparent;
    color: #d7deee;
    border: 1px solid rgba(120, 160, 205, 0.5);
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 160ms ease, box-shadow 160ms ease, transform 120ms ease;
    box-shadow: none;
}
body.login-page .login-form button:hover {
    background: rgba(12, 16, 24, 0.75);
    box-shadow: 0 0 12px rgba(91, 120, 150, 0.25);
}
body.login-page .login-form button:active {
    transform: translateY(1px);
}
body.login-page .login-options {
    display: grid;
    gap: 12px;
    width: 100%;
    max-width: 384px;
    margin: 0 auto;
}
body.login-page .connection-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    min-height: 48px;
    border: 1px solid rgba(120, 160, 205, 0.3);
    border-radius: 12px;
    background: rgba(8, 10, 14, 0.6);
    color: #d7deee;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
    width: 100%;
    box-sizing: border-box;
    box-shadow: none;
}
body.login-page .connection-option:focus-visible {
    outline: none;
    border-color: rgba(120, 160, 205, 0.7);
    box-shadow: 0 0 10px rgba(91, 120, 150, 0.25);
}
body.login-page .connection-option[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.6;
}
body.login-page .connection-option:not([aria-disabled="true"]):hover {
    border-color: rgba(120, 160, 205, 0.85);
    background: rgba(12, 16, 24, 0.75);
    box-shadow: 0 0 12px rgba(91, 120, 150, 0.25);
}
body.login-page .connection-option[aria-disabled="true"]:hover {
    border-color: rgba(120, 160, 205, 0.3);
}
body.login-page .connection-option .option-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #b5c6dd;
}
body.login-page .connection-option .option-icon svg {
    width: 100%;
    height: 100%;
}
body.login-page .connection-option .option-label {
    flex: 1;
    text-align: left;
}
body.login-page .login-provider-hint {
    margin-top: 4px;
    font-size: 14px;
    color: #8b8f99;
    text-align: center;
}
body.login-page .email-login {
    margin-top: 28px;
    padding-top: 28px;
}
body.login-page .email-login[hidden] {
    display: none;
}
body.login-page .login-options[hidden] {
    display: none;
}
body.login-page .forgot-link {
    font-size: 14px;
    text-align: right;
    color: #b9c2d9;
    text-decoration: none;
    display: block;
}
body.login-page .forgot-link[aria-disabled="true"] { cursor: default; }
body.login-page .forgot-link:hover { text-decoration: underline; }
@media (max-width: 900px) {
    body.login-page .login-visual { height: 40vh; min-height: 40vh; }
    body.login-page .login-panel { padding: 32px 20px; min-height: 0; height: auto; }
    body.login-page .login-logo svg { width: 61%; max-width: 357px; }
    body.login-page .login-form { max-width: 420px; }
}

.brand-grid {
    display: grid;
    gap: 16px;
}

.brand-library {
    background: transparent;
    border: none;
    padding: 0;
}

.brand-card {
    border: 1px solid var(--border);
    padding: 18px;
    background: var(--surface);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.brand-card-summary {
    display: grid;
    grid-template-columns: 88px minmax(260px, 2fr) repeat(3, minmax(140px, 0.9fr));
    column-gap: 16px;
    row-gap: 22px;
    align-items: flex-start;
}

.brand-summary-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.brand-summary-column--primary {
    min-width: 240px;
    gap: 6px;
    padding: 10px 16px 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 250, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%);
}

.brand-summary-column--compact {
    min-width: 120px;
    padding-top: 6px;
}

.brand-summary-column--logo {
    width: 88px;
    height: 88px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #f8fafc;
    align-self: start;
    flex-shrink: 0;
}

.brand-summary-column--logo-has-image {
    border: none;
}

.brand-summary-column--logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.brand-summary-column--logo:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.brand-logo-hint {
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    font-size: 0.7rem;
    background: rgba(11, 13, 17, 0.7);
    color: #fff;
    padding: 2px 4px;
    border-radius: 4px;
    text-align: center;
    opacity: 0;
    transition: opacity 160ms ease;
}

.brand-summary-column--logo:hover .brand-logo-hint,
.brand-summary-column--logo:focus .brand-logo-hint {
    opacity: 1;
}

.brand-summary-column--actions {
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    align-self: stretch;
}

.brand-summary-core {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    min-width: 0;
    flex: 1;
}

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

.brand-summary-description {
    margin: 0;
    color: var(--muted);
}

.brand-summary-description p {
    margin: 0;
}

.brand-summary-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.brand-hidden-field {
    display: none;
}

.brand-summary-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.brand-summary-label--ghost {
    visibility: hidden;
    height: 0;
}

.brand-inline-form textarea {
    min-height: 2.2rem;
}

.brand-intel-inline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    grid-column: 1 / -1;
}

.brand-intel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.brand-intel-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brand-intel-preview {
    margin-top: 8px;
    display: grid;
    gap: 12px;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.brand-intel-preview--full {
    grid-column: 1 / -1;
}

.brand-intel-preview__item {
    border: 1px solid rgba(16, 24, 40, 0.08);
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}

.brand-intel-preview__label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(17, 24, 39, 0.55);
}

.brand-intel-preview__value {
    margin: 6px 0 0;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.4;
}

.brand-intel-preview__value--action {
    display: flex;
    align-items: center;
    gap: 8px;
}

    font-size: 0.65rem;
    letter-spacing: 0.06em;
    gap: 0;
    white-space: nowrap;

.idea-inline-edit[data-inline-edit-mode="inplace"].is-editing .brand-intel-save-label {
    display: inline-flex;
    align-items: center;
}

.brand-intel-save-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.brand-intel-edit-btn .brand-intel-save-icon {
    display: none;
}

.idea-inline-edit.is-editing .brand-intel-save-icon {
    display: block;
}

.idea-inline-edit[data-inline-edit-mode="inplace"].is-editing .brand-intel-edit-icon {
    display: none;
}

.idea-inline-edit[data-inline-edit-mode="inplace"].is-editing [data-intel-field][contenteditable="true"] {
    cursor: text;
}

.idea-inline-edit[data-inline-edit-mode="inplace"].is-editing [data-intel-field][contenteditable="true"]:focus {
    outline: 2px solid rgba(29, 92, 255, 0.25);
    outline-offset: 2px;
    border-radius: 8px;
}

.idea-inline-edit[data-inline-edit-mode="inplace"].is-editing [data-intel-field][contenteditable="true"]:empty:before {
    content: attr(data-empty-text);
    color: rgba(17, 24, 39, 0.35);
}

.brand-catalog-link {
    color: var(--accent);
    text-decoration: underline;
}

.brand-catalog-link:hover {
    text-decoration: none;
}

.brand-summary-label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
}

.brand-summary-pills {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.brand-keyword-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
}

.brand-keyword-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    padding-right: 8px;
}

.brand-keyword-text {
    line-height: 1.2;
}

.brand-keyword-remove {
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0;
    font-size: 0.85rem;
    padding: 0;
    margin-left: 4px;
    cursor: pointer;
    transition: opacity 120ms ease;
}

.brand-keyword-pill:hover .brand-keyword-remove,
.brand-keyword-remove:focus-visible {
    opacity: 0.9;
}

.brand-keyword-remove:hover,
.brand-keyword-remove:focus-visible,
.brand-keyword-remove:active {
    color: inherit;
    background: transparent;
    outline: none;
    box-shadow: none;
}

.brand-keyword-add-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.brand-keyword-add-input {
    display: none;
    min-width: 160px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: inherit;
    font-size: 0.85rem;
}

.brand-keyword-add-row.is-open .brand-keyword-add-input {
    display: inline-flex;
}

.brand-keyword-add-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    transition: color 120ms ease, border-color 120ms ease;
}

.brand-keyword-add-btn:hover,
.brand-keyword-add-btn:focus-visible {
    color: var(--muted);
    border-color: transparent;
    outline: none;
    background: transparent;
    box-shadow: none;
}

.brand-keyword-add-btn:active {
    color: var(--muted);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.brand-summary-pills .brand-pill {
    margin: 0;
}


.brand-name {
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.1;
    color: var(--text);
}

.brand-meta-chip {
    color: var(--muted);
    font-size: 0.88rem;
}

.brand-card h3 {
    margin: 0;
}

.brand-card p {
    margin: 0;
}

.brand-card-body {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.brand-card-actions form {
    display: inline-flex;
}

.brand-pill {
    border: 1px solid #dbe5ff;
    background: #f4f6ff;
    padding: 4px 12px;
    font-size: 0.82rem;
    color: #2c3f77;
    border-radius: 999px;
}

.brand-pill--tone {
    background: #fff4e7;
    border-color: #ffd9b0;
    color: #8a4c06;
}

.brand-pill--must {
    background: #f0fbf4;
    border-color: #c6ecd8;
    color: #155b2c;
}

.brand-pill--avoid {
    background: #fff0f0;
    border-color: #f5cdcd;
    color: #8a1f1f;
}

.brand-summary-edit {
    justify-self: flex-end;
    align-self: center;
}

.brand-logo-form {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.brandbook-pill {
    border-color: #c3e9d6;
    background: #f0fbf4;
    color: #1a6137;
}

#add-brand {
    scroll-margin-top: 48px;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.btn-primary {
    background: #1d5cff;
    border-radius: 0;
    padding-inline: 28px;
}

.btn-primary:hover {
    background: #1545b5;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f4f6fb;
}

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

.list-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-card {
    border: 1px solid var(--border);
    padding: 16px;
    background: #fff;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    color: var(--muted);
}

.badge-accent {
    border-color: #b2c2ff;
    color: #1d2e78;
    background: #edf1ff;
}

.trends-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.trends-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trends-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.trend-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.trend-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.trend-item h3 {
    margin: 0 0 4px;
}

.trend-item time {
    font-size: 0.85rem;
    color: var(--muted);
}

.trend-item-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 13, 17, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.modal-overlay.is-visible {
    display: flex;
}

.modal-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    width: min(520px, 100%);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 32px;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.add-brand-files,
.add-brand-advanced {
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 12px 16px 4px;
    background: #f8fafc;
    margin-bottom: 16px;
}

.add-brand-files summary,
.add-brand-advanced summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    margin: -12px -16px 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-brand-files summary::after,
.add-brand-advanced summary::after {
    content: '▾';
    font-size: 0.9rem;
    color: var(--muted);
    margin-left: auto;
    transition: transform 160ms ease;
}

.add-brand-files[open] summary::after,
.add-brand-advanced[open] summary::after {
    transform: rotate(180deg);
}

.add-brand-files summary::marker,
.add-brand-advanced summary::marker,
.add-brand-files summary::-webkit-details-marker,
.add-brand-advanced summary::-webkit-details-marker {
    display: none;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
}

.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 160ms ease, color 160ms ease;
}

.modal-close:hover {
    background: #f0f2f7;
    color: var(--text);
}

.modal-panel .field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}

.modal-panel .field textarea,
.modal-panel .field select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    font: inherit;
    color: var(--text);
}

.modal-panel .field textarea:focus,
.modal-panel .field select:focus {
    outline: 2px solid var(--accent);
    box-shadow: 0 0 0 3px rgba(29, 92, 255, 0.18);
    background: #fff;
}

.modal-panel .btn {
    width: 100%;
}

body.modal-open {
    overflow: hidden;
}

/* Admin console */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
    align-items: start;
}

.admin-tabs {
    display: inline-flex;
    gap: 10px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.admin-tab-link {
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 8px 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    transition: background 150ms ease;
}

.admin-tab-link:hover {
    background: #f0f2f7;
}

.admin-tab-link.is-active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.admin-panel h2,
.admin-panel h3 {
    margin-top: 0;
}

.admin-panel .checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.admin-panel .checkbox-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.admin-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.admin-panel-head--actions {
    align-items: center;
    gap: 16px;
}

.admin-meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    padding: 12px 14px;
    background: #fbfbfe;
}

.admin-meta-row strong {
    display: block;
}

.admin-meta-row time,
.admin-meta-row span {
    color: var(--muted);
    font-size: 0.88rem;
}

.admin-meta-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-meta-actions form {
    margin: 0;
}

.btn-danger {
    background: #f87171;
    border: 1px solid #f87171;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.admin-meta-empty {
    justify-content: center;
    font-style: italic;
    color: var(--muted);
}

.admin-secondary {
    margin-top: 12px;
}

.pill--accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.admin-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.admin-metric {
    border: 1px solid var(--border);
    padding: 14px;
    background: #fcfcff;
}

.admin-metric span {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.admin-metric strong {
    font-size: 1.8rem;
    line-height: 1.1;
}

.admin-metrics-inline {
    margin-bottom: 28px;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    background: #f3f4f9;
}

.admin-form {
    border-top: 1px solid var(--border);
    margin-top: 20px;
    padding-top: 20px;
}

.admin-form h3 {
    margin-top: 0;
}

.metrics-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    flex-wrap: wrap;
}

.metrics-header-main {
    flex: 1;
    min-width: 280px;
}

.metrics-header-sync {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.metrics-description {
    margin-top: 0;
    margin-bottom: 16px;
    max-width: 520px;
}

.metrics-header-note {
    margin: 0;
    max-width: 520px;
    color: var(--muted);
}

.metrics-header-note + .metrics-header-note {
    margin-top: 4px;
}

.metrics-header-divider {
    width: 100%;
    height: 1px;
    border: none;
    background: rgba(255, 255, 255, 0.4);
    margin: 16px 0;
}

.metrics-header-actions {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: -22px;
}

.metrics-refresh-form {
    margin: 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    margin-top: 32px;
}

.metrics-heatmap {
    margin-top: 16px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 18px 40px rgba(20, 28, 64, 0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.metrics-heatmap-summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: fit-content;
}

.metrics-heatmap-summary::-webkit-details-marker {
    display: none;
}

.metrics-heatmap-icon {
    font-size: 0.9rem;
    color: var(--muted);
    transition: transform 150ms ease;
}

details[open] .metrics-heatmap-icon {
    transform: rotate(180deg);
}

.metrics-heatmap--inline {
    margin-top: 8px;
    padding: 12px 14px;
}

.metrics-table-wrap {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 18px 40px rgba(20, 28, 64, 0.08);
    overflow: hidden;
}

.metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.metrics-table th,
.metrics-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.metrics-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: #f7f8fc;
}

.metrics-table-row {
    cursor: pointer;
}

.metrics-table-row:hover {
    background: #f6f7fb;
}

.metrics-table-detail td {
    padding: 0;
    background: #f9f9ff;
}

.metrics-table-card {
    padding: 16px;
}

.metrics-summary {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 18px 40px rgba(20, 28, 64, 0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.metrics-summary-head h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.metrics-summary-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    align-items: end;
}

.metrics-summary-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.metrics-summary-filter select,
.metrics-summary-filter input {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 6px 8px;
    font-size: 0.9rem;
    background: #f9f9ff;
}

.metrics-range-picker {
    position: relative;
}

.metrics-range-input {
    width: 100%;
    text-align: left;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 8px 10px;
    font-size: 0.95rem;
    background: #f9f9ff;
    cursor: pointer;
    color: var(--text);
}

.metrics-range-calendar {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 18px 40px rgba(20, 28, 64, 0.12);
    min-width: 260px;
}

.metrics-range-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.metrics-range-calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

.metrics-range-nav {
    border: 1px solid var(--border);
    background: #f5f6fb;
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
}

.metrics-range-weekdays,
.metrics-range-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
}

.metrics-range-weekdays {
    margin-bottom: 4px;
}

.metrics-range-cell {
    border: none;
    background: #f5f6fb;
    border-radius: 8px;
    padding: 6px 0;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text);
}

.metrics-range-cell--empty {
    background: transparent;
    cursor: default;
}

.metrics-range-cell.is-range {
    background: rgba(29, 92, 255, 0.18);
}

.metrics-range-cell.is-start,
.metrics-range-cell.is-end {
    background: rgba(29, 92, 255, 0.9);
    color: #fff;
}

.metrics-summary-filter .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.metrics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.metrics-summary-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: #f9f9ff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.metrics-summary-item strong {
    font-size: 1rem;
}

.metrics-summary-label-row {
    display: block;
}

.metrics-info {
    position: absolute;
    top: 8px;
    right: 10px;
    color: #9aa3af;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: help;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.metrics-info::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #111322;
    color: #fff;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 0.65rem;
    line-height: 1.2;
    width: max-content;
    max-width: 180px;
    opacity: 0;
    transform: translateY(-2px);
    pointer-events: none;
    box-shadow: 0 6px 14px rgba(17, 19, 34, 0.18);
    z-index: 10;
}

.metrics-info:hover::after,
.metrics-info:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.metrics-heatmap-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.metrics-heatmap-head h2 {
    margin: 0 0 4px;
    font-size: 1.2rem;
}

.metrics-heatmap-meta {
    font-size: 0.9rem;
    color: var(--muted);
}

.metrics-heatmap-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-x: auto;
}

.metrics-heatmap-legend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--muted);
}

.metrics-heatmap-legend-bar {
    width: 140px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(29, 92, 255, 0.12), rgba(29, 92, 255, 0.92));
    border: 1px solid rgba(29, 92, 255, 0.2);
}

.metrics-heatmap-row {
    display: grid;
    grid-template-columns: 48px repeat(24, minmax(20px, 1fr));
    gap: 6px;
    align-items: center;
}

.metrics-heatmap-row--header {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.metrics-heatmap-cell {
    width: 100%;
    min-height: 20px;
    height: 100%;
    border-radius: 6px;
    background: rgba(29, 92, 255, 0.08);
    border: 1px solid rgba(29, 92, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metrics-heatmap-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(29, 92, 255, 0.85);
}

.metrics-heatmap-cell--label {
    aspect-ratio: unset;
    height: auto;
    border: none;
    background: transparent;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 20px 50px rgba(20, 28, 64, 0.08);
}

.metric-card h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    min-height: calc(1.35rem * 1.3 * 3);
}

.metric-card-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.metric-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 0.9rem;
    color: var(--muted);
}

.metric-card-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.metric-sentiment {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    background: #fbfbff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-sentiment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.metric-sentiment-title {
    margin: 0;
    font-weight: 600;
}

.metric-sentiment-bar {
    display: flex;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #e6e8f1;
}

.metric-sentiment-segment {
    display: block;
    height: 100%;
}

.metric-sentiment-positive {
    background: #20c46a;
}

.metric-sentiment-neutral {
    background: #b0b6c6;
}

.metric-sentiment-negative {
    background: #e24848;
}

.metric-sentiment-legend {
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
    font-size: 0.85rem;
    color: var(--muted);
    white-space: nowrap;
}

.metric-stat {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #f9f9ff;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.metric-stat-value {
    font-size: 1.4rem;
    font-weight: 600;
    display: block;
}

.metric-stat-delta {
    display: block;
    font-size: 0.85rem;
    margin-top: 4px;
}

.metric-card-empty {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 14px;
    background: #fbfbfe;
}

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

.metric-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-card-shipped {
    font-size: 0.85rem;
    color: var(--muted);
}

.metric-card-stop-form {
    margin: 0;
}

.metric-card-stop-button {
    border: none;
    background: none;
    color: #d32f2f;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.metric-card-stop-button:hover,
.metric-card-stop-button:focus {
    color: #b71c1c;
    outline: none;
}

.metric-virality {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 16px 24px;
    background: #fbfcff;
}

.metric-virality-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.metric-virality-title {
    margin: 0;
    font-weight: 600;
}

.metric-virality-current {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.metric-virality-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #304ffe;
}

.metric-virality-chart-wrap {
    height: 140px;
    margin-top: 12px;
}

.virality-chart {
    width: 100%;
    height: 100%;
    display: block;
}

.metric-virality-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.metric-virality-empty {
    margin: 16px 0 0;
}

.metrics-empty {
    margin-top: 40px;
}

.btn-outline {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}

.btn-outline:hover {
    background: #f3f4fb;
}

.ship-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 9, 27, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2200;
    transition: opacity 180ms ease;
    opacity: 0;
    pointer-events: none;
}

.ship-modal-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.ship-modal {
    width: min(520px, 100%);
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 30px 70px rgba(8, 16, 53, 0.25);
}

.ship-modal-head h3 {
    margin-bottom: 6px;
}

.ship-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
}

.ship-modal-error {
    display: block;
    min-height: 1.1em;
    color: #d93025;
    margin-top: 4px;
}

.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    text-align: left;
}

.dashboard-hero.trend-card {
    flex-direction: row;
    align-items: center;
}

.dashboard-hero > div {
    text-align: left;
}

.dashboard-hero h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text);
}

.dashboard-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-hero-actions .btn {
    padding: 8px 14px;
    font-size: 0.9rem;
    border-radius: 999px;
}

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

.dashboard-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.dashboard-panel-head h2 {
    margin: 0;
    font-size: 18px;
}

.dashboard-panel-head .text-link {
    color: #0b0d11;
    text-decoration: none;
    font-weight: 600;
    background: #f0f2f7;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.dashboard-panel-head .text-link:hover {
    background: #e6ecff;
    border-color: #cbd6ff;
    color: #0b0d11;
}

.dashboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-list-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.dashboard-list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dashboard-item-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--border);
    background: #ffffff;
}

.dashboard-list-title {
    font-weight: 600;
    color: var(--text);
}

.dashboard-metrics-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.dashboard-performance-summary {
    margin-bottom: 16px;
}

.dashboard-performance-summary .metrics-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.dashboard-performance-summary .metrics-summary-item {
    padding: 12px;
}

@media (max-width: 900px) {
    .dashboard-performance-summary .metrics-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

@media (max-width: 820px) {
    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .metrics-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .metric-card-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .ship-modal {
        padding: 20px;
    }
}
