/* ==========================================================================
   Ignition — Innovation Portal
   Redesign: Archivo type, purple accent, light/dark, collapsible sidebar.
   UI only — every screen maps 1:1 to the existing backend payloads.
   ========================================================================== */

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

/* --- Design tokens ------------------------------------------------------- */
:root {
    color-scheme: light;
    --bg: #f6f6f8;
    --surface: #ffffff;
    --surface-2: #f9f9fb;
    --input: #f9f9fb;
    --kanban-col: #efeef4;
    --border: #e4e3ea;
    --border-strong: #c9c7d4;
    --hairline: #f0eff5;
    --hairline-2: #eeedf3;
    --ink: #191826;
    --muted: #5f5d70;
    --faint: #8d8b9e;
    --label: #3a3849;
    --acc: #6d28d9;
    --acc-hover: #5b21b6;
    --acc-soft: #f1ecfb;
    --acc-ink: #5b21b6;
    --link: #5b21b6;
    --focus-ring: #c4b5fd;
    --shadow-sm: 0 3px 10px rgba(60, 30, 120, .08);
    --shadow-md: 0 4px 16px rgba(60, 30, 120, .07);
    --shadow-lg: 0 12px 40px rgba(30, 20, 60, .06);
    --danger-bg: #fdecec;
    --danger-ink: #b42318;
    --danger-border: #f4c7c3;
    --ok-bg: oklch(0.95 0.05 155);
    --ok-ink: oklch(0.4 0.12 155);
    --ok-border: oklch(0.88 0.06 155);
    --green: oklch(0.55 0.14 155);

    /* stage chip tones */
    --st-backlog-bg: #f0eff5;
    --st-backlog-ink: #5f5d70;
    --st-reviewing-bg: oklch(0.95 0.035 250);
    --st-reviewing-ink: oklch(0.42 0.14 260);
    --st-poc-bg: #f1ecfb;
    --st-poc-ink: #5b21b6;
    --st-validated-bg: oklch(0.95 0.05 155);
    --st-validated-ink: oklch(0.4 0.12 155);
    --st-archived-bg: #f0eff5;
    --st-archived-ink: #8d8b9e;
    --dot-backlog: #8d8b9e;
    --dot-reviewing: oklch(0.55 0.14 260);
    --dot-poc: #6d28d9;
    --dot-validated: oklch(0.55 0.14 155);
    --dot-archived: #c9c7d4;

    --radius-card: 10px;
    --radius-ctl: 8px;
    --radius-chip: 6px;
    --font: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-display: 'Archivo', 'Instrument Sans', sans-serif;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e0e10;
    --surface: #161618;
    --surface-2: #1e1e21;
    --input: #1e1e21;
    --kanban-col: #121214;
    --border: #2a2a2e;
    --border-strong: #3a3a40;
    --hairline: #232326;
    --hairline-2: #232326;
    --ink: #f2f2f4;
    --muted: #a6a6ad;
    --faint: #8a8a92;
    --label: #cdccd6;
    --acc: #8b5cf6;
    --acc-hover: #7c3aed;
    --acc-soft: rgba(139, 92, 246, .16);
    --acc-ink: #a78bfa;
    --link: #a78bfa;
    --focus-ring: #7c3aed;
    --shadow-sm: 0 3px 10px rgba(0, 0, 0, .45);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .5);
    --shadow-lg: 0 16px 44px rgba(0, 0, 0, .55);
    --danger-bg: rgba(255, 90, 90, .12);
    --danger-ink: #ff9d99;
    --danger-border: rgba(255, 90, 90, .3);
    --ok-bg: rgba(52, 199, 120, .14);
    --ok-ink: #6ee7a8;
    --ok-border: rgba(52, 199, 120, .3);
    --green: #34c778;

    --st-backlog-bg: rgba(255, 255, 255, .06);
    --st-backlog-ink: #a6a6ad;
    --st-reviewing-bg: rgba(99, 102, 241, .18);
    --st-reviewing-ink: #a5b4fc;
    --st-poc-bg: rgba(139, 92, 246, .18);
    --st-poc-ink: #c4b5fd;
    --st-validated-bg: rgba(52, 199, 120, .15);
    --st-validated-ink: #6ee7a8;
    --st-archived-bg: rgba(255, 255, 255, .05);
    --st-archived-ink: #8a8a92;
    --dot-backlog: #8a8a92;
    --dot-reviewing: #818cf8;
    --dot-poc: #8b5cf6;
    --dot-validated: #34c778;
    --dot-archived: #4a4a52;
}

/* --- Base ---------------------------------------------------------------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--acc-hover);
}

::placeholder {
    color: var(--faint);
}

h1, h2, h3 {
    margin: 0;
}

.hidden {
    display: none !important;
}

.mono {
    font-variant-numeric: tabular-nums;
}

a, button {
    transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s, transform .15s, filter .15s;
}

button:active {
    transform: scale(.97);
}

:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 4px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 0;
    border-color: var(--acc);
}

/* --- Animations ---------------------------------------------------------- */
@keyframes drawerIn { from { opacity: 0; transform: translate(-50%,-50%) scale(.9); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@keyframes drawerOut { from { opacity: 1; transform: translate(-50%,-50%) scale(1); } to { opacity: 0; transform: translate(-50%,-46%) scale(.95); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes grow {
    from { transform: scaleX(0); }
}

@keyframes growV {
    from { transform: scaleY(0); }
}

[data-a] > * {
    animation: rise .45s ease backwards;
}

[data-a] > *:nth-child(1) { animation-delay: .02s; }
[data-a] > *:nth-child(2) { animation-delay: .06s; }
[data-a] > *:nth-child(3) { animation-delay: .1s; }
[data-a] > *:nth-child(4) { animation-delay: .14s; }
[data-a] > *:nth-child(5) { animation-delay: .18s; }
[data-a] > *:nth-child(6) { animation-delay: .22s; }
[data-a] > *:nth-child(7) { animation-delay: .26s; }
[data-a] > *:nth-child(8) { animation-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* --- Buttons ------------------------------------------------------------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-ctl);
    background: var(--acc);
    color: #fff;
    font: 600 14px var(--font);
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--acc-hover);
    color: #fff;
}

.btn-primary:disabled {
    opacity: .6;
    cursor: default;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-ctl);
    background: var(--surface);
    color: var(--muted);
    font: 500 13.5px var(--font);
    cursor: pointer;
}

.btn-ghost:hover {
    color: var(--ink);
    border-color: var(--border-strong);
}

.btn-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: var(--radius-ctl);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.btn-icon:hover {
    color: var(--ink);
    border-color: var(--border-strong);
}

.btn-icon svg {
    width: 15px;
    height: 15px;
}

/* --- App shell + sidebar ------------------------------------------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

.sidebar {
    flex: 0 0 auto;
    width: 230px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-sizing: border-box;
    transition: width .18s ease;
    overflow: hidden;
    z-index: 20;
}

.ig-collapsed .sidebar {
    width: 64px;
}

.sb-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--hairline-2);
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    min-width: 0;
    flex: 1;
}

.sb-brand:hover {
    color: var(--ink);
}

.sb-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
    overflow: hidden;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.sb-logo img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.sb-brand-text {
    min-width: 0;
}

.sb-brand-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.1;
    color: var(--ink);
}

.sb-brand-sub {
    display: block;
    font-weight: 600;
    font-size: 9.5px;
    letter-spacing: .05em;
    color: var(--faint);
    margin-top: 2px;
    text-transform: uppercase;
}

.sb-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 10px;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-ctl);
    color: var(--muted);
    font-weight: 600;
    font-size: 13.5px;
}

.sb-item:hover {
    color: var(--ink);
    background: var(--hairline);
}

.sb-item svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.sb-item.active {
    color: var(--acc-ink);
    background: var(--acc-soft);
}

.sb-item.active:hover {
    color: var(--acc-ink);
}

.sb-submit {
    padding: 0 10px;
}

.sb-submit-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    min-height: 38px;
    border-radius: var(--radius-ctl);
    background: var(--acc);
    color: #fff;
    font-weight: 600;
    font-size: 13.5px;
}

.sb-submit-btn:hover {
    filter: brightness(.93);
    color: #fff;
}

.sb-submit-btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.sb-foot {
    margin-top: auto;
    padding: 12px 10px;
    border-top: 1px solid var(--hairline-2);
    display: grid;
    gap: 8px;
}

.sb-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
}

.sb-avatar {
    position: relative;
    overflow: hidden;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--acc-soft);
    color: var(--acc-ink);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 11.5px;
    flex: 0 0 auto;
}

.sb-user-text {
    min-width: 0;
    flex: 1;
}

.sb-user-name {
    display: block;
    font-weight: 600;
    font-size: 12.5px;
    line-height: 1.2;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-user-handle {
    font-size: 11px;
    color: var(--faint);
}

.sb-signout {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    min-height: 34px;
    border-radius: var(--radius-ctl);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: 12.5px;
    cursor: pointer;
}

.sb-signout:hover {
    color: var(--ink);
    border-color: var(--border-strong);
}

.sb-signout svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

/* collapsed variants */
.ig-collapsed .sidebar .sb-brand {
    flex: 0 0 auto;
}

.ig-collapsed .sidebar .sb-brand-text,
.ig-collapsed .sidebar .sb-label,
.ig-collapsed .sidebar .sb-user-text {
    display: none;
}

/* stack the logo above the collapse arrow so they never overlap in 64px */
.ig-collapsed .sidebar .sb-top {
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ig-collapsed .sidebar .sb-item,
.ig-collapsed .sidebar .sb-submit-btn {
    justify-content: center;
}

.ig-collapsed .sidebar .sb-user {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
}

/* sign out matches the theme / help icon buttons when collapsed */
.ig-collapsed .sidebar .sb-signout {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    margin: 0 auto;
    justify-content: center;
}

/* collapse chevron points right when collapsed — CSS only, correct before paint */
.ig-collapsed .sb-collapse svg {
    transform: scaleX(-1);
}

/* theme icon: moon in light, sun in dark — swapped via CSS so it never flashes */
.ic-sun {
    display: none;
}

[data-theme="dark"] .ic-moon {
    display: none;
}

[data-theme="dark"] .ic-sun {
    display: block;
}

/* main column */
.main {
    flex: 1;
    min-width: 0;
    padding: 32px 40px 64px;
    box-sizing: border-box;
}

/* mobile bottom nav */
.mobile-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 8px 10px;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 52px;
    min-height: 44px;
    justify-content: center;
    border-radius: var(--radius-ctl);
    color: var(--muted);
    font: 600 9.5px var(--font);
}

.mobile-nav a.active {
    color: var(--acc-ink);
    background: var(--acc-soft);
}

.mobile-nav a svg {
    width: 19px;
    height: 19px;
}

/* Kanban is manager-only. Gated by a cached flag (html.ig-manager) applied
   before paint, so the link never flickers in/out on navigation. */
.sb-item--kanban,
.mobile-nav .m-kanban {
    display: none;
}

.ig-manager .sb-item--kanban {
    display: flex;
}

.ig-manager .mobile-nav .m-kanban {
    display: flex;
}

@media (max-width: 820px) {
    .sidebar {
        display: none;
    }
    .mobile-nav {
        display: flex;
    }
    .main {
        padding: 20px 14px 90px;
    }
}

/* --- Page header --------------------------------------------------------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 6px;
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: .09em;
    color: var(--acc);
    text-transform: uppercase;
}

.page-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: var(--ink);
}

.page-sub {
    margin: 6px 0 0;
    color: var(--muted);
    max-width: 600px;
}

.head-stat {
    text-align: right;
    flex: 0 0 auto;
}

.head-stat strong {
    display: block;
    font-weight: 800;
    font-size: 28px;
    color: var(--ink);
}

.head-stat span {
    font-weight: 600;
    font-size: 10.5px;
    letter-spacing: .05em;
    color: var(--faint);
    text-transform: uppercase;
}

@media (max-width: 820px) {
    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- Toolbar / filters --------------------------------------------------- */
.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    margin-bottom: 20px;
}

.toolbar input[type="search"],
.toolbar input:not([type]) {
    flex: 1;
    min-width: 200px;
}

.toolbar input,
.toolbar select {
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-ctl);
    padding: 0 12px;
    background: var(--input);
    font: 14px var(--font);
    color: var(--ink);
    box-sizing: border-box;
}

.toolbar select {
    background: var(--surface);
    font-size: 13px;
    padding: 0 10px;
    cursor: pointer;
}

.chip-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-ctl);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

.chip-toggle input {
    margin: 0;
    width: auto;
    min-height: 0;
    accent-color: var(--acc);
}

/* --- Chips --------------------------------------------------------------- */
.chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: var(--radius-chip);
    font: 600 11px var(--font);
    white-space: nowrap;
}

.chip--neutral {
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 500;
}

.chip--stage[data-stage="Backlog"] { background: var(--st-backlog-bg); color: var(--st-backlog-ink); }
.chip--stage[data-stage="Reviewing"] { background: var(--st-reviewing-bg); color: var(--st-reviewing-ink); }
.chip--stage[data-stage="POC/Prototype"] { background: var(--st-poc-bg); color: var(--st-poc-ink); }
.chip--stage[data-stage="Validated"] { background: var(--st-validated-bg); color: var(--st-validated-ink); }
.chip--stage[data-stage="Archived"] { background: var(--st-archived-bg); color: var(--st-archived-ink); }

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 22px;
    padding: 0 9px;
    border-radius: var(--radius-chip);
    border: 1px solid var(--border);
    color: var(--muted);
    font: 500 11px var(--font);
}

/* --- Ideas grid + cards -------------------------------------------------- */
.ideas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.idea-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.idea-card {
    overflow: hidden;
}

.idea-card:hover,
.idea-card:focus-visible {
    border-color: var(--focus-ring);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.idea-card h2 {
    margin: 2px 0 0;
    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
}

.idea-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.card-foot .meta-chip {
    border: 0;
    padding: 0;
    color: var(--faint);
}

.card-signals {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.comment-count {
    font: 500 11.5px var(--font);
    color: var(--faint);
}

.vote-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font: 600 11.5px var(--font);
    cursor: pointer;
}

.vote-pill:hover {
    border-color: var(--acc);
}

.vote-pill.active {
    background: var(--acc);
    border-color: var(--acc);
    color: #fff;
}

.empty {
    padding: 40px;
    text-align: center;
    color: var(--faint);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-card);
}

.loadmore {
    display: block;
    margin: 22px auto 0;
}

/* --- Idea detail modal (restyled drawer) --------------------------------- */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(10, 8, 20, .45);
    backdrop-filter: blur(1px);
}

.drawer {
    position: fixed;
    z-index: 101;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(660px, calc(100% - 32px));
    max-height: 86vh;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px;
    box-shadow: var(--shadow-lg);
    animation: drawerIn .22s cubic-bezier(.2,.9,.3,1.1) both;
}

body.drawer-open {
    overflow: hidden;
}

.drawer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-ctl);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

.drawer-close:hover {
    color: var(--ink);
    border-color: var(--border-strong);
}

.detail-title {
    margin: 12px 40px 4px 0;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
}

.detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 4px;
}

.vote-btn {
    border-radius: 999px;
}

.vote-btn.active {
    background: var(--acc);
    border-color: var(--acc);
    color: #fff;
}

.detail-section {
    margin-top: 20px;
}

.detail-section h3 {
    margin: 0 0 6px;
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--faint);
}

.detail-section p {
    margin: 0;
    color: var(--label);
    white-space: pre-wrap;
}

.detail-note {
    margin-top: 10px !important;
    color: var(--muted) !important;
}

.comments {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.comment {
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--hairline-2);
    border-radius: var(--radius-ctl);
}

.comment-meta {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
    font-size: 12px;
    color: var(--acc-ink);
}

.comment p {
    margin: 0;
    color: var(--label);
    font-size: 13.5px;
    white-space: pre-wrap;
}

.comment-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.comment-form textarea {
    flex: 1;
    min-height: 42px;
}

.muted {
    color: var(--faint);
}

/* --- Forms (fields shared by submit + edit) ------------------------------ */
.field {
    display: grid;
    gap: 7px;
}

.field > span {
    font-weight: 600;
    font-size: 12.5px;
    color: var(--label);
}

.field > span small {
    font-weight: 400;
    color: var(--faint);
}

.field input,
.field select,
.field textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius-ctl);
    background: var(--input);
    font: 14px var(--font);
    color: var(--ink);
    box-sizing: border-box;
}

.field input,
.field select {
    min-height: 40px;
    padding: 0 12px;
}

.field select {
    background: var(--surface);
    cursor: pointer;
}

.field textarea {
    padding: 10px 12px;
    line-height: 1.6;
    resize: vertical;
}

.field small {
    color: var(--faint);
    line-height: 1.5;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

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

.content-narrow {
    max-width: 760px;
    margin: 0 auto;
}

.proposal-form {
    display: grid;
    gap: 16px;
}

.form-section {
    display: grid;
    gap: 18px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

.form-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
}

.form-section h2 small {
    font-weight: 400;
    color: var(--faint);
    font-size: 12.5px;
}

.section-badge {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: var(--radius-chip);
    background: var(--acc-soft);
    color: var(--acc-ink);
    display: grid;
    place-items: center;
    font: 700 11px var(--font);
}

.edit-form {
    display: grid;
    gap: 16px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* status messages */
.error,
.success,
.notice {
    display: block;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-card);
    font-weight: 600;
    animation: rise .25s ease;
}

.error {
    background: var(--danger-bg);
    color: var(--danger-ink);
    border: 1px solid var(--danger-border);
}

.success {
    background: var(--ok-bg);
    color: var(--ok-ink);
    border: 1px solid var(--ok-border);
}

#drawer-error {
    margin: 12px 0 0;
}

/* --- Dashboard ----------------------------------------------------------- */
.dashboard-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.dashboard-toolbar #generated {
    font: 500 10.5px var(--font);
    color: var(--faint);
    letter-spacing: .02em;
}

.dashboard-toolbar select {
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-ctl);
    padding: 0 10px;
    background: var(--surface);
    font: 13px var(--font);
    color: var(--ink);
    cursor: pointer;
}

.tiles {
    display: grid;
    gap: 12px;
}

#tiles {
    grid-template-columns: repeat(6, 1fr);
    margin-bottom: 28px;
}

.tile {
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

.tile strong {
    display: block;
    font: 700 26px var(--font);
    line-height: 1.1;
    color: var(--ink);
}

.tile span {
    font: 500 10px var(--font);
    letter-spacing: .04em;
    color: var(--faint);
    text-transform: uppercase;
}

/* soft inner tiles used inside cards (engagement / workload) */
#engagement .tile,
#workload .tile {
    background: var(--surface-2);
    border-color: var(--hairline-2);
    padding: 12px 14px;
}

#engagement .tile strong,
#workload .tile strong {
    font-size: 20px;
}

#engagement .tile span,
#workload .tile span {
    font-size: 9.5px;
}

.dash-section {
    margin-bottom: 28px;
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
    padding-top: 10px;
}

.section-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ink);
}

.section-num {
    font: 700 12px var(--font);
    color: var(--acc);
}

.section-sub {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}

.dash-card {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

.dash-card.wide {
    grid-column: 1 / -1;
}

.card-head {
    margin: 0 0 14px;
    font: 700 13.5px var(--font);
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
}

/* horizontal bars */
.bars {
    display: grid;
    gap: 10px;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(110px, 150px) 1fr auto;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.bar-row > span:first-child {
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    height: 8px;
    border-radius: 4px;
    background: var(--hairline);
    overflow: hidden;
    display: block;
}

.bar-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--acc);
    transform-origin: left;
    animation: grow .7s .15s ease both;
}

.bar-row strong {
    text-align: right;
    min-width: 28px;
    font: 600 12.5px var(--font);
    color: var(--ink);
}

/* vertical bars (volume) */
.vbars {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    height: 160px;
    padding: 0 6px;
}

.vbar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
}

.vbar strong {
    font: 600 12px var(--font);
    color: var(--muted);
}

.vbar i {
    width: 100%;
    max-width: 56px;
    border-radius: 6px 6px 2px 2px;
    background: var(--acc);
    transform-origin: bottom;
    animation: growV .7s .2s ease both;
    display: block;
}

.vbar span {
    font: 500 10.5px var(--font);
    color: var(--faint);
}

/* mini lists */
.mini-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mini-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid var(--hairline);
}

.mini-list li:last-child {
    border-bottom: 0;
}

.mini-list a {
    color: var(--ink);
    font-weight: 500;
}

.mini-list a:hover {
    color: var(--acc-ink);
}

.mini-list small {
    font: 500 11px var(--font);
    color: var(--faint);
    white-space: nowrap;
}

/* POC cards */
.poc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    align-items: start;
}

.poc-card {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

.poc-card .eyebrow {
    font-size: 10px;
    letter-spacing: .07em;
}

.poc-card h3 {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 600;
}

.poc-card h3 a {
    color: var(--ink);
}

.poc-card h3 a:hover {
    color: var(--acc-ink);
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--hairline);
    overflow: hidden;
    margin: 14px 0 8px;
}

.progress span {
    display: block;
    height: 100%;
    background: var(--acc);
    transform-origin: left;
    animation: grow .7s .15s ease both;
}

.poc-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 12.5px;
}

.poc-meta strong {
    color: var(--ink);
}

.timeline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 34px;
    margin: 14px 0 4px;
}

.timebar {
    position: relative;
    flex: 1;
    min-width: 3px;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.timebar i {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--hairline);
    border-radius: 2px;
}

.timebar i.closed {
    background: var(--acc);
}

@media (max-width: 820px) {
    #tiles {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .vbars {
        overflow-x: auto;
        padding-bottom: 6px;
    }
    .section-head h2 {
        font-size: 17px;
    }
    .dash-grid,
    .poc-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Kanban -------------------------------------------------------------- */
.board {
    display: grid;
    grid-template-columns: repeat(5, minmax(230px, 1fr));
    gap: 12px;
    align-items: start;
    overflow-x: auto;
}

.column {
    min-height: 480px;
    background: var(--kanban-col);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 10px;
    box-sizing: border-box;
    transition: background .15s, border-color .15s;
}

.column.dragover {
    border-color: var(--acc);
    background: var(--acc-soft);
}

.column-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px 12px;
    font-weight: 600;
    font-size: 13px;
    color: var(--ink);
}

.column-head .stage-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.column-head .stage-name::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dot-backlog);
}

.column[data-stage="Reviewing"] .stage-name::before { background: var(--dot-reviewing); }
.column[data-stage="POC/Prototype"] .stage-name::before { background: var(--dot-poc); }
.column[data-stage="Validated"] .stage-name::before { background: var(--dot-validated); }
.column[data-stage="Archived"] .stage-name::before { background: var(--dot-archived); }

.column-head .count {
    font: 600 11px var(--font);
    color: var(--faint);
}

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

.kanban-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 15px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    cursor: grab;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.kanban-card:hover,
.kanban-card:focus-visible {
    border-color: var(--focus-ring);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kanban-card h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
}

.kanban-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 500 11px var(--font);
    color: var(--faint);
}

.kanban-avatar {
    position: relative;
    overflow: hidden;
    margin-left: auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--acc-soft);
    color: var(--acc-ink);
    display: grid;
    place-items: center;
    font: 600 9.5px var(--font);
}

.kanban-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 1px;
    padding-top: 10px;
    border-top: 1px solid var(--hairline);
}

.kanban-foot .move {
    min-width: 0;
    flex-shrink: 1;
}

.kanban-foot .card-link {
    white-space: nowrap;
    font: 600 11.5px var(--font);
    color: var(--acc-ink);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.kanban-foot .card-link:hover {
    color: var(--acc);
}

.kanban-foot .move {
    min-height: 28px;
    max-width: 122px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    font: 11.5px var(--font);
    color: var(--muted);
    cursor: pointer;
}

@media (max-width: 820px) {
    .board {
        display: flex;
        overflow-x: auto;
    }
    .board > .column {
        flex: 0 0 250px;
    }
}

@media (max-width: 820px) {
    .drawer {
        width: calc(100% - 20px) !important;
        max-height: 92vh;
    }
    .bar-row {
        grid-template-columns: 96px 1fr auto;
    }
}

/* --- Login --------------------------------------------------------------- */
.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    box-sizing: border-box;
}

.login-card {
    width: min(420px, 100%);
    padding: 44px 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    animation: rise .45s ease backwards;
    position: relative;
}

.login-logo {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    overflow: hidden;
    margin: 0 auto 20px;
}

.login-logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.login-card h1 {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.login-card .tagline {
    margin: 12px 0 28px;
    color: var(--muted);
}

.login-card .btn-primary {
    width: 100%;
    min-height: 44px;
}

.login-note {
    margin: 18px 0 0;
    font-size: 11.5px;
    color: var(--faint);
}

.login-theme {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* --- Help modal ---------------------------------------------------------- */
.help-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(8, 6, 16, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.help-card {
    width: min(560px, 100%);
    max-height: 85vh;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px;
    box-sizing: border-box;
    color: var(--ink);
    box-shadow: var(--shadow-lg);
    animation: rise .22s ease;
}

.help-card .help-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.help-card h2 {
    font-size: 19px;
    font-weight: 700;
}

.help-group-label {
    margin: 0 0 8px;
    font: 700 10.5px var(--font);
    letter-spacing: .06em;
    color: var(--acc-ink);
    text-transform: uppercase;
}

.help-group {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.help-group p {
    margin: 0;
    color: var(--muted);
}

.help-group p strong {
    color: var(--ink);
}


/* --- Colored tag chips (stream/focus) ------------------------------------ */
.chip--tag { border: 0; font-weight: 600; }
.chip--tag[data-tag="Internal"] { background: oklch(0.93 0.05 200); color: oklch(0.36 0.08 210); }
.chip--tag[data-tag="External"] { background: oklch(0.94 0.06 60); color: oklch(0.42 0.1 50); }
.chip--tag[data-tag="Business-Market"] { background: oklch(0.94 0.07 85); color: oklch(0.42 0.1 75); }
.chip--tag[data-tag="New-Product"] { background: oklch(0.93 0.05 250); color: oklch(0.4 0.12 255); }
.chip--tag[data-tag="New-Service"] { background: oklch(0.93 0.06 25); color: oklch(0.42 0.12 25); }
.chip--tag[data-tag="New-Tech"] { background: oklch(0.94 0.06 190); color: oklch(0.38 0.09 195); }
.chip--tag[data-tag="Process"] { background: oklch(0.93 0.03 280); color: oklch(0.4 0.06 280); }
.chip--tag[data-tag="Productivity"] { background: oklch(0.94 0.06 140); color: oklch(0.4 0.1 145); }
[data-theme="dark"] .chip--tag[data-tag="Internal"] { background: oklch(0.32 0.05 210 / .5); color: oklch(0.82 0.08 200); }
[data-theme="dark"] .chip--tag[data-tag="External"] { background: oklch(0.34 0.07 55 / .5); color: oklch(0.84 0.1 65); }
[data-theme="dark"] .chip--tag[data-tag="Business-Market"] { background: oklch(0.34 0.07 80 / .5); color: oklch(0.85 0.1 85); }
[data-theme="dark"] .chip--tag[data-tag="New-Product"] { background: oklch(0.33 0.08 255 / .5); color: oklch(0.82 0.09 250); }
[data-theme="dark"] .chip--tag[data-tag="New-Service"] { background: oklch(0.33 0.08 25 / .5); color: oklch(0.82 0.1 25); }
[data-theme="dark"] .chip--tag[data-tag="New-Tech"] { background: oklch(0.33 0.06 195 / .5); color: oklch(0.83 0.09 190); }
[data-theme="dark"] .chip--tag[data-tag="Process"] { background: oklch(0.32 0.04 280 / .5); color: oklch(0.82 0.05 280); }
[data-theme="dark"] .chip--tag[data-tag="Productivity"] { background: oklch(0.33 0.07 145 / .5); color: oklch(0.83 0.1 145); }

/* --- Metallic accent ------------------------------------------------------ */
.btn-primary,
.sb-submit-btn,
.vote-pill.active,
.vote-btn.active {
    background: var(--acc);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
    border-color: transparent;
}
.btn-primary:hover,
.sb-submit-btn:hover {
    background: var(--acc-hover);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 2px 8px rgba(91, 33, 182, .22);
    filter: none;
}

/* --- Card meta: stage dot, id pill, author avatar ------------------------ */
.stage-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: 600 11.5px var(--font);
    color: var(--label);
}
.stage-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dot-backlog);
}
.stage-dot[data-stage="Reviewing"]::before { background: var(--dot-reviewing); }
.stage-dot[data-stage="POC/Prototype"]::before { background: var(--dot-poc); }
.stage-dot[data-stage="Validated"]::before { background: var(--dot-validated); }
.stage-dot[data-stage="Archived"]::before { background: var(--dot-archived); }

.id-pill {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 8px;
    font: 600 11px var(--font);
    color: var(--faint);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.card-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--faint);
    font: 500 11px var(--font);
    white-space: nowrap;
}

.author-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--faint);
    font: 500 11.5px var(--font);
}
.avatar {
    position: relative;
    overflow: hidden;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--acc-soft);
    color: var(--acc-ink);
    font: 700 10px var(--font);
    text-transform: uppercase;
}

.sync-button {
    min-height: 36px;
    padding: 0 12px;
    white-space: nowrap;
    font-size: 13px;
}
.sb-avatar img,
.kanban-avatar img,
.avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
    object-fit: cover;
}
.comment-count svg { vertical-align: -2px; margin-right: 3px; }

@keyframes votePop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
.vote-pill.bursting { animation: votePop .32s ease; }

/* --- Idea photos: card banner, detail hero, attachment grid, lightbox ---- */
.idea-photo {
    position: relative;
    display: block;
    width: auto;
    height: 120px;
    margin: -20px -20px 6px;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: var(--surface-2);
    cursor: zoom-in;
}
.idea-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.idea-card:hover .idea-photo img { transform: scale(1.06); }
.photo-count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font: 600 11px var(--font);
    backdrop-filter: blur(3px);
}

.detail-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    min-height: 150px;
    margin: 0 0 14px;
    padding: 16px 18px 14px;
    border-radius: var(--radius-card);
    overflow: hidden;
    cursor: default;
}
.detail-hero.has-photo { cursor: zoom-in; }
.detail-hero .hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .05) 25%, rgba(0, 0, 0, .58));
}
.detail-hero .hero-chips,
.detail-hero .hero-title { position: relative; z-index: 1; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-title {
    margin: 0;
    color: #fff;
    font: 800 22px/1.25 var(--font-display, var(--font));
    text-shadow: 0 1px 10px rgba(0, 0, 0, .45);
}

.att-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.att-tile {
    position: relative;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-ctl);
    overflow: hidden;
    background: var(--surface-2);
    cursor: zoom-in;
}
.att-tile img { width: 100%; height: 100%; object-fit: cover; }
.att-tile:hover { border-color: var(--acc); }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: rgba(8, 6, 16, .8);
    backdrop-filter: blur(6px);
    animation: fadeIn .18s ease both;
}
.lightbox.closing { animation: fadeOut .18s ease both; }
.lightbox-img {
    max-width: min(1000px, 92vw);
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    object-fit: contain;
}
.lightbox-nav,
.lightbox-close {
    position: absolute;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
}
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 22px; }
.lightbox-nav:hover,
.lightbox-close:hover { background: rgba(255, 255, 255, .26); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-close { top: 18px; right: 20px; width: 42px; height: 42px; font-size: 22px; line-height: 1; }
.lightbox-cap {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font: 600 12px var(--font);
}

/* --- Submit: 3-step wizard + attachment dropzone ------------------------- */
.stepper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 22px;
}
.step { display: flex; align-items: center; gap: 8px; }
.step-dot {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1.5px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
    font: 700 12px var(--font);
}
.step.active .step-dot { background: var(--acc); border-color: transparent; color: #fff; }
.step.done .step-dot { background: var(--green); border-color: transparent; color: #fff; }
.step-label { font: 600 12.5px var(--font); color: var(--muted); white-space: nowrap; }
.step.active .step-label,
.step.done .step-label { color: var(--ink); }
.step-line { flex: 1 1 auto; min-width: 16px; height: 1.5px; background: var(--border-strong); }
.step-line.done { background: var(--green); }
@media (max-width: 620px) {
    .step-label { display: none; }
    .step-line { min-width: 10px; }
}
.wizard-step { display: grid; gap: 18px; }
.wizard-step[hidden] { display: none; }
.wizard-actions [hidden] { display: none !important; }
.wizard-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}
.wizard-actions .spacer { flex: 1 1 auto; }

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 26px;
    text-align: center;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-card);
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover,
.dropzone.dragover { border-color: var(--acc); background: var(--acc-soft); color: var(--ink); }
.dropzone input { display: none; }
.dropzone-icon { color: var(--acc); }
.dropzone strong { color: var(--ink); font-weight: 600; }
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.file-tile {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-ctl);
    overflow: hidden;
    background: var(--surface-2);
}
.file-tile img { width: 100%; height: 100%; object-fit: cover; }
.file-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 3px 6px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font: 600 10px var(--font);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}
.file-remove:hover { background: var(--danger-ink); }
.file-icon { color: var(--faint); }

/* --- Idea detail internals: hero pills, meta row, timeline --------------- */
.hero-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 6px;
    font: 600 11px var(--font);
    white-space: nowrap;
}
.hero-pill--stage { background: rgba(255, 255, 255, .92); color: #191826; }
.hero-pill--out { font-weight: 500; border: 1px solid rgba(255, 255, 255, .5); color: rgba(255, 255, 255, .96); }

.detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 4px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--hairline);
}
.detail-meta .avatar { width: 30px; height: 30px; font-size: 11px; }
.detail-meta .who { min-width: 0; display: grid; }
.detail-meta .who b { font: 600 12.5px var(--font); color: var(--ink); line-height: 1.2; }
.detail-meta .who span { font: 500 11px var(--font); color: var(--faint); }
.detail-meta .grow { margin-left: auto; }

.tl { display: grid; margin-top: 18px; }
.tl-row { display: flex; gap: 14px; }
.tl-node { display: flex; flex-direction: column; align-items: center; }
.tl-badge {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
}
.tl-badge--problem { background: var(--danger-bg); color: var(--danger-ink); }
.tl-badge--solution { background: var(--acc-soft); color: var(--acc-ink); }
.tl-badge--impact { background: var(--ok-bg); color: var(--ok-ink); }
.tl-badge--exec { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tl-line { flex: 1; width: 2px; background: var(--border); margin: 6px 0; }
.tl-body { flex: 1; min-width: 0; padding-bottom: 20px; }
.tl-row:last-child .tl-body { padding-bottom: 0; }
.tl-body h3 {
    margin: 5px 0 5px;
    font: 700 11px var(--font);
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--faint);
}
.tl-body h3.acc { color: var(--acc-ink); }
.tl-body h3.ok { color: var(--ok-ink); }
.tl-body p { margin: 0; color: var(--label); white-space: pre-wrap; }
.tl-body .detail-note { margin-top: 10px; color: var(--muted); }

/* --- Idea detail: discussion bubbles ------------------------------------ */
.detail-head .chips { margin-bottom: 6px; }
.discussion {
    margin-top: 20px;
    padding: 16px 16px 14px;
    background: var(--surface-2);
    border: 1px solid var(--hairline-2);
    border-radius: 12px;
}
.discussion > h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 12px;
    font: 700 11px var(--font);
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--faint);
}
.bubble-list { display: grid; gap: 10px; }
.bubble { display: flex; gap: 9px; align-items: flex-start; }
.bubble .avatar { width: 26px; height: 26px; font-size: 9.5px; }
.bubble-body {
    flex: 1;
    min-width: 0;
    padding: 10px 13px;
    background: var(--surface);
    border: 1px solid var(--hairline-2);
    border-radius: 4px 12px 12px 12px;
}
.bubble-body .who { margin: 0 0 2px; font: 600 12px var(--font); color: var(--ink); }
.bubble-body .who span { font-weight: 500; color: var(--faint); }
.bubble-body p { margin: 0; color: var(--label); font-size: 13.5px; line-height: 1.55; }
.discussion-empty { margin: 0; color: var(--faint); font-size: 13px; }
.discussion .comment-form { margin-top: 14px; }

/* --- Idea detail: wide two-column layout (Ideas + Kanban share it) ------- */
.drawer--wide {
    width: min(1020px, calc(100% - 40px));
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.drawer--wide #drawer-body { flex: 1; min-height: 0; overflow: auto; }
.drawer--wide .drawer-close {
    top: 14px;
    right: 14px;
    z-index: 6;
    background: rgba(10, 8, 20, .45);
    color: #fff;
    border-color: rgba(255, 255, 255, .35);
    backdrop-filter: blur(4px);
}
.drawer--wide .drawer-close:hover { background: rgba(10, 8, 20, .65); color: #fff; border-color: rgba(255, 255, 255, .5); }

.idea-hero-full {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    min-height: 128px;
    padding: 16px 26px;
    overflow: hidden;
    cursor: zoom-in;
}
.idea-hero-full .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.idea-hero-full::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .05) 25%, rgba(0, 0, 0, .55)); }
.idea-hero-full .hero-chips,
.idea-hero-full .hero-title { position: relative; z-index: 1; }

.idea-body { padding: 16px 26px 24px; }
.detail-acts { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.detail-cols { display: flex; gap: 26px; align-items: stretch; flex-wrap: wrap; margin-top: 18px; }
.detail-left { flex: 1.35 1 320px; min-width: 0; display: grid; align-content: start; }
.detail-right {
    flex: 1 1 280px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface-2);
    border: 1px solid var(--hairline-2);
    border-radius: 12px;
    padding: 16px 16px 14px;
    box-sizing: border-box;
}
.detail-right .disc-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 12px;
    font: 700 11px var(--font);
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--faint);
}
.detail-right .bubble-list { align-content: start; }
.detail-right .comment-form { margin-top: auto; align-items: flex-end; padding-top: 14px; }
.detail-right .comment-form textarea {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-ctl);
    background: var(--input);
    color: var(--ink);
    font: 13.5px/1.5 var(--font);
    padding: 9px 12px;
    resize: vertical;
    box-sizing: border-box;
}
@media (max-width: 720px) {
    .detail-cols { gap: 18px; }
    .detail-left,
    .detail-right { flex: 1 1 100%; }
}
