:root {
    --primary: #6b55a3;
    --primary-dark: #3f3268;
    --primary-soft: #eee9f8;
    --accent: #d3a260;
    --bg: #fbf8f2;
    --surface: #ffffff;
    --surface-soft: #fffaf2;
    --text: #29242d;
    --subtext: #746b78;
    --muted: #a69aa5;
    --border: #eadfd2;
    --success: #3f7f65;
    --success-bg: #edf6ef;
    --success-border: #c9decf;
    --danger: #b85c4c;
    --warning-bg: #fff7e8;
    --warning-border: #ead7b7;
    --info-bg: #eef4fb;
    --info-border: #c5d9ed;
    --info-color: #2b5ea7;
    --shadow: 0 18px 45px rgba(34, 48, 48, 0.08);
    --radius: 8px;
}

/* ─── Three-stage Workbench ─── */
.analyst-view {
    grid-column: 1 / -1;
    display: grid;
    gap: 18px;
}

.top-header {
    min-height: 76px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    padding: 18px 22px;
}

.top-title {
    justify-self: center;
    color: var(--primary-dark);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.workbench-layout {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.workspace-gate {
    min-height: calc(100vh - 140px);
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.workspace-gate::before,
.workspace-gate::after {
    content: "";
    position: absolute;
    inset: auto auto 9% 50%;
    width: min(760px, 92vw);
    height: 180px;
    pointer-events: none;
    transform: translateX(-50%);
    opacity: 0.54;
    filter: blur(0.2px);
}

.workspace-gate::before {
    background:
        radial-gradient(ellipse at 20% 56%, rgba(107, 85, 163, 0.22), transparent 34%),
        radial-gradient(ellipse at 48% 54%, rgba(92, 137, 101, 0.18), transparent 36%),
        radial-gradient(ellipse at 74% 54%, rgba(42, 76, 106, 0.16), transparent 36%),
        radial-gradient(ellipse at 88% 62%, rgba(158, 91, 56, 0.16), transparent 30%);
}

.workspace-gate::after {
    height: 120px;
    background:
        linear-gradient(105deg, transparent 4%, rgba(107, 85, 163, 0.16), transparent 28%),
        linear-gradient(75deg, transparent 18%, rgba(211, 126, 96, 0.16), transparent 55%),
        linear-gradient(120deg, transparent 42%, rgba(75, 120, 154, 0.14), transparent 84%);
    border-radius: 999px;
}

.workspace-gate-card {
    width: min(488px, 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 252, 247, 0.94)),
        var(--surface);
    box-shadow: 0 26px 80px rgba(64, 46, 31, 0.12);
    padding: 42px 54px 34px;
    position: relative;
    z-index: 1;
    text-align: center;
    overflow: hidden;
}

.workspace-gate-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 39%, rgba(107, 85, 163, 0.08), transparent 26%),
        radial-gradient(circle at 18% 52%, rgba(211, 162, 96, 0.08), transparent 24%),
        radial-gradient(circle at 82% 54%, rgba(95, 143, 109, 0.08), transparent 24%);
    pointer-events: none;
}

.workspace-gate-card h1 {
    margin: 4px 0 2px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--text);
}

.workspace-gate-card p {
    margin: 0 0 22px;
    color: var(--subtext);
}

.workspace-gate-card > * {
    position: relative;
    z-index: 1;
}

.gate-subtitle {
    margin-bottom: 32px !important;
    color: var(--primary-dark) !important;
    letter-spacing: 0.1em;
}

.gate-brand-mark {
    width: 68px;
    height: 68px;
    margin: 0 auto 14px;
    border: 1px solid rgba(211, 162, 96, 0.54);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: inset 0 0 0 10px rgba(238, 233, 248, 0.5);
}

.gate-brand-mark span,
.brand-mark span,
.orbit-compass {
    position: relative;
    width: 30px;
    height: 30px;
    display: block;
    background: transparent;
    border: 1px solid rgba(211, 162, 96, 0.34);
    border-radius: 50%;
    transform: rotate(45deg);
}

.gate-brand-mark span::before,
.gate-brand-mark span::after,
.brand-mark span::before,
.brand-mark span::after {
    content: "";
    position: absolute;
    inset: 5px 13px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--primary));
}

.gate-brand-mark span::after,
.brand-mark span::after {
    inset: 13px 5px;
}

.gate-orbit {
    position: absolute;
    left: 50%;
    top: 204px;
    width: 330px;
    height: 250px;
    transform: translateX(-50%);
    z-index: 0;
    opacity: 0.8;
    pointer-events: none;
}

.asset-orbit {
    top: 174px;
    width: min(620px, 132%);
    height: 390px;
    opacity: 1;
}

.asset-orbit::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -16px;
    width: min(520px, 96vw);
    height: 330px;
    transform: translateX(-50%);
    border: 1px solid rgba(211, 162, 96, 0.18);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, rgba(211, 162, 96, 0.1) 0 2px, transparent 3px),
        linear-gradient(90deg, transparent 49.8%, rgba(211, 162, 96, 0.15) 50%, transparent 50.2%),
        linear-gradient(0deg, transparent 49.8%, rgba(211, 162, 96, 0.12) 50%, transparent 50.2%);
    opacity: 0.55;
}

.asset-orbit img {
    position: absolute;
    display: block;
    max-width: none;
    pointer-events: none;
    user-select: none;
}

.asset-ribbon {
    left: 50%;
    bottom: 4px;
    width: 760px;
    transform: translateX(-50%);
    opacity: 0.42;
    mix-blend-mode: multiply;
}

.asset-stardust {
    left: 50%;
    top: -34px;
    width: 580px;
    transform: translateX(-50%);
    opacity: 0.28;
}

.orbit-line {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(211, 162, 96, 0.38);
    border-radius: 50%;
    background:
        linear-gradient(90deg, transparent 49.8%, rgba(211, 162, 96, 0.28) 50%, transparent 50.2%),
        linear-gradient(0deg, transparent 49.8%, rgba(211, 162, 96, 0.28) 50%, transparent 50.2%);
}

.orbit-compass {
    position: absolute;
    left: calc(50% - 14px);
    top: calc(50% - 14px);
    opacity: 0.58;
}

.orbit-label {
    position: absolute;
    color: rgba(158, 91, 56, 0.58);
    font-size: 13px;
    font-weight: 800;
}

.orbit-label.nt { left: 34px; top: 58px; }
.orbit-label.nf { right: 34px; top: 58px; }
.orbit-label.sj { left: 52px; bottom: 42px; }
.orbit-label.sp { right: 52px; bottom: 42px; }

.spectrum-wave {
    position: absolute;
    left: 50%;
    bottom: 22px;
    width: 400px;
    height: 74px;
    border-radius: 50%;
    transform: translateX(-50%) rotate(-4deg);
    background: linear-gradient(90deg, rgba(107, 85, 163, 0.22), rgba(211, 162, 96, 0.12), rgba(95, 143, 109, 0.14));
    filter: blur(0.4px);
}

.spectrum-wave.wave-b {
    bottom: 4px;
    transform: translateX(-50%) rotate(5deg);
    background: linear-gradient(90deg, rgba(211, 162, 96, 0.16), rgba(107, 85, 163, 0.18), rgba(42, 76, 106, 0.12));
}

.workspace-form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
    text-align: left;
}

.privacy-note {
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
}

.workspace-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(238, 233, 248, 0.82), rgba(255, 250, 242, 0.9));
}

.workspace-chip span {
    display: block;
    color: var(--subtext);
    font-size: 12px;
}

.workspace-chip strong {
    display: block;
    margin-top: 2px;
    color: var(--primary-dark);
    font-size: 16px;
}

.task-sidebar,
.workspace {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.task-sidebar {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 14px;
    padding: 16px;
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.sidebar-create {
    display: grid;
    gap: 12px;
}

.create-appointment-btn {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #8067bf);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 14px 28px rgba(107, 85, 163, 0.26);
}

.create-fields {
    display: none;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.create-fields.show {
    display: grid;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-head h2 {
    font-size: 18px;
}

.compact-btn {
    min-height: 34px;
    padding: 0 10px;
}

.task-card.is-complete {
    opacity: 0.68;
}

.task-card-time {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.workspace {
    padding: 18px;
    min-width: 0;
}

.workspace-shell {
    display: grid;
    gap: 16px;
}

.workspace-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.workspace-head h2 {
    font-size: 24px;
}

.workspace-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.type-theme-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    padding: 6px 10px;
    white-space: nowrap;
}

.type-theme-pill.untyped {
    background: var(--surface-soft);
    color: var(--muted);
}

.workspace-head p {
    margin: 6px 0 0;
    color: var(--subtext);
}

.workspace-status {
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 13px;
    padding: 6px 12px;
    white-space: nowrap;
}

.type-dashboard {
    display: grid;
    grid-template-columns: 1.05fr 1fr 1fr;
    gap: 14px;
}

.type-dashboard > article {
    min-height: 178px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 34px rgba(64, 46, 31, 0.06);
    padding: 18px;
    overflow: hidden;
}

.type-dashboard span,
.preference-card > span,
.type-signal-card > span {
    display: block;
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 12px;
}

.type-candidate-card {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 233, 248, 0.7)),
        var(--primary-soft) !important;
}

.type-candidate-card strong {
    display: block;
    color: var(--primary);
    font-size: 26px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.type-candidate-card p {
    color: var(--subtext);
    margin: 0;
    font-size: 13px;
}

.type-card-hills {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -18px;
    height: 82px;
    background:
        radial-gradient(ellipse at 25% 78%, rgba(107, 85, 163, 0.12), transparent 48%),
        radial-gradient(ellipse at 58% 72%, rgba(211, 162, 96, 0.13), transparent 48%),
        radial-gradient(ellipse at 82% 80%, rgba(95, 143, 109, 0.12), transparent 45%);
}

.preference-card {
    display: grid;
    align-content: start;
    gap: 9px;
}

.preference-row {
    display: grid;
    grid-template-columns: 58px minmax(90px, 1fr) 58px;
    align-items: center;
    gap: 8px;
}

.preference-row small {
    color: var(--muted);
    font-size: 12px;
}

.preference-row small:last-child {
    text-align: right;
}

.preference-row small.active {
    color: var(--primary);
    font-weight: 900;
}

.preference-track {
    position: relative;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0.72;
}

.preference-track i {
    position: absolute;
    top: 50%;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.92);
    transform: translate(-50%, -50%);
}

.type-signal-card {
    display: grid;
    align-content: start;
    gap: 10px;
}

.signal-row {
    display: grid;
    gap: 3px;
    border-bottom: 1px solid rgba(234, 223, 210, 0.7);
    padding-bottom: 8px;
}

.signal-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.signal-row strong {
    color: var(--text);
    font-size: 13px;
}

.signal-row p {
    margin: 0;
    color: var(--subtext);
    font-size: 12px;
}

.stage-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.stage-column {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.stage-column.active {
    border-color: rgba(107, 85, 163, 0.26);
    box-shadow: 0 0 0 3px rgba(107, 85, 163, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), var(--primary-soft));
}

.stage-column.completed {
    background: rgba(255, 255, 255, 0.68);
    opacity: 0.9;
}

.stage-column.locked {
    background: rgba(248, 246, 241, 0.74);
    color: var(--muted);
}

.stage-column-head {
    position: relative;
    z-index: 2;
    list-style: none;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.stage-column-head::-webkit-details-marker {
    display: none;
}

.stage-column.locked .stage-column-head {
    cursor: default;
}

.stage-column-head h3 {
    font-size: 18px;
}

.stage-column-head span {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.stage-column.active .stage-column-head span {
    color: var(--primary);
    font-weight: 800;
}

.stage-column-body {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 12px;
    padding: 14px;
}

.stage-art {
    position: absolute;
    right: -38px;
    bottom: -34px;
    width: 210px;
    max-width: 62%;
    opacity: 0.18;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    mix-blend-mode: multiply;
}

.stage-column.active .stage-art {
    opacity: 0.22;
}

.stage-column.locked .stage-art {
    opacity: 0.12;
}

.stage-locked-text {
    padding: 14px;
    color: var(--muted);
    font-size: 14px;
}

.stage-action-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 250, 242, 0.86);
}

.stage-action-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.stage-action-card strong {
    color: var(--primary-dark);
}

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

.stage-actions .primary-btn,
.stage-actions .secondary-btn,
.stage-actions .ghost-btn {
    flex: 1 1 auto;
}

.stage-column .summary-grid,
.stage-column .quick-card-grid {
    grid-template-columns: 1fr;
}

.stage-column .artifact-box,
.stage-column .summary-card,
.stage-column .submission-full-item {
    padding: 12px;
}

@media (max-width: 1180px) {
    .type-dashboard {
        grid-template-columns: 1fr;
    }

    .stage-columns {
        grid-template-columns: 1fr;
    }

    .stage-column.completed:not([open]) {
        opacity: 1;
    }
}

@media (max-width: 860px) {
    .top-header,
    .workbench-layout {
        grid-template-columns: 1fr;
    }

    .top-title {
        justify-self: start;
        font-size: 20px;
    }

    .task-sidebar {
        position: static;
        max-height: none;
    }

    .workspace-gate-card {
        padding: 34px 24px 28px;
    }

    .asset-orbit {
        top: 178px;
        width: 118%;
        height: 330px;
    }

    .asset-ribbon {
        width: 640px;
        opacity: 0.34;
    }

    .empty-journey {
        min-height: 500px;
        padding: 28px 16px;
    }

    .empty-portal {
        height: 260px;
    }

    .empty-door-art {
        width: min(480px, 122%);
    }
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    line-height: 1.6;
    background:
        radial-gradient(circle at 12% 12%, rgba(107, 85, 163, 0.14), transparent 26rem),
        radial-gradient(circle at 78% 8%, rgba(211, 162, 96, 0.11), transparent 24rem),
        radial-gradient(circle at 85% 72%, rgba(95, 143, 109, 0.1), transparent 28rem),
        linear-gradient(135deg, var(--bg) 0%, var(--surface-soft) 100%);
    transition: background 0.2s ease, color 0.2s ease;
}

.top-header,
.workspace-gate-card,
.task-sidebar,
.workspace,
.workspace-chip,
.create-fields,
.stage-column,
.stage-action-card,
.summary-card,
.submission-full-item,
.artifact-box,
.primary-btn,
.secondary-btn,
.ghost-btn,
.create-appointment-btn,
.task-card,
.workspace-status,
.type-theme-pill {
    transition:
        background 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        color 0.18s ease;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.app-shell {
    width: min(1440px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 20px;
    padding: 20px 26px 26px;
}

/* ─── Sidebar ─── */
.side-nav {
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 26px;
}

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

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(211, 162, 96, 0.54);
    background: rgba(255, 255, 255, 0.78);
    display: grid;
    place-items: center;
}

.brand-mark span {
    width: 23px;
    height: 23px;
}

.brand-title {
    font-weight: 800;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 12px;
}

.nav-stack {
    display: grid;
    gap: 8px;
}

.nav-item {
    border: 0;
    border-radius: 8px;
    padding: 12px;
    background: transparent;
    color: var(--subtext);
    display: flex;
    gap: 10px;
    align-items: center;
    text-align: left;
}

.nav-item.active,
.nav-item:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
}

.nav-dot.muted {
    background: #bfc9c6;
}

/* Sidebar mini flow */
.flow-mini {
    display: grid;
    gap: 8px;
}

.flow-mini-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--subtext);
}

.flow-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.side-note {
    margin-top: auto;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.side-note-title {
    font-weight: 800;
    margin-bottom: 6px;
}

.side-note p {
    margin: 0;
    color: var(--subtext);
    font-size: 13px;
}

/* ─── Main view ─── */
.main-view {
    display: grid;
    gap: 20px;
}

.hero-panel,
.panel,
.intake-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.hero-panel {
    padding: 30px;
}

.hero-copy {
    max-width: 780px;
}

.hero-copy h1 {
    margin: 0 0 8px;
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.2;
}

.hero-copy p {
    color: var(--subtext);
    font-size: 16px;
    margin-bottom: 0;
}

/* ─── Flow Steps (hero) ─── */
.flow-steps {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 24px;
}

.flow-step {
    flex: 1;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.flow-step:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.flow-step:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.flow-step-arrow {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--muted);
    font-size: 24px;
    font-weight: 800;
}

.flow-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
}

.flow-step-body h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.flow-step-body p {
    margin: 0;
    color: var(--subtext);
    font-size: 12px;
}

/* ─── Step Badge ─── */
.step-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 12px;
    margin-bottom: 6px;
}

.section-kicker {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
}

.eyebrow {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
}

h2 {
    margin-bottom: 0;
    font-size: 22px;
}

h3 {
    margin-bottom: 0;
}

/* ─── Panel ─── */
.panel {
    padding: 22px;
}

.panel-header,
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.panel-header {
    margin-bottom: 18px;
}

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

.section-heading-actions {
    align-items: center;
}

/* ─── Form ─── */
.form-stack,
.intake-form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--subtext);
    font-size: 14px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 12px 13px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(35, 78, 82, 0.12);
}

/* ─── Buttons ─── */
.primary-btn,
.secondary-btn,
.ghost-btn,
.copy-btn {
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 0 16px;
    font-weight: 800;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #8067bf);
    box-shadow: 0 16px 32px rgba(107, 85, 163, 0.28);
}

.secondary-btn,
.copy-btn {
    color: var(--primary-dark);
    background: var(--primary-soft);
    border-color: #c8d9d5;
}

.ghost-btn {
    color: var(--subtext);
    background: #fff;
    border-color: var(--border);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.copy-btn:hover {
    transform: translateY(-1px);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
}

.wide {
    width: 100%;
}

/* ─── Link Box ─── */
.link-box {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #c8d9d5;
    border-radius: 8px;
    background: #f3faf8;
    display: grid;
    gap: 10px;
}

.link-box-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.link-box-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.link-box span {
    color: var(--subtext);
    font-size: 13px;
}

.helper-text {
    margin: 0;
    font-size: 13px;
}

.copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

/* ─── Task Layout ─── */
.task-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    min-height: 480px;
}

.task-list {
    display: grid;
    gap: 10px;
    align-content: start;
}

.task-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    padding: 14px;
    text-align: left;
}

.task-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(107, 85, 163, 0.11);
    background: linear-gradient(135deg, rgba(238, 233, 248, 0.68), rgba(255, 255, 255, 0.9));
}

.task-card h3 {
    margin-bottom: 4px;
    font-size: 16px;
}

.task-card p {
    margin: 0;
    color: var(--subtext);
    font-size: 13px;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag {
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--subtext);
    font-size: 12px;
    padding: 3px 8px;
}

.tag.ready {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.tag.waiting {
    background: var(--warning-bg);
    color: #8a642e;
    border-color: var(--warning-border);
}

.task-detail {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: 18px;
    overflow: hidden;
}

.detail-stack {
    display: grid;
    gap: 16px;
}

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

.detail-top p {
    margin: 8px 0 0;
    color: var(--subtext);
}

.detail-actions,
.artifact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ─── Stage Cards ─── */
.stage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stage-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.stage-card.active {
    border-color: var(--info-border);
    background: var(--info-bg);
}

.stage-card.done {
    border-color: var(--success-border);
    background: var(--success-bg);
}

.stage-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 900;
}

.stage-card.done .stage-mark {
    background: var(--success);
    color: #fff;
}

.stage-card h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.stage-card strong {
    display: block;
    color: var(--primary-dark);
    font-size: 13px;
    margin-bottom: 4px;
}

.stage-card p {
    margin: 0;
    color: var(--subtext);
    font-size: 13px;
}

/* ─── Next Step Card ─── */
.next-step-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--info-border);
    background: var(--info-bg);
}

.next-step-card.action {
    border-color: #d4e2c8;
    background: #f0f7ec;
}

.next-step-card.done {
    border-color: var(--success-border);
    background: var(--success-bg);
}

.next-step-card.waiting {
    border-color: var(--warning-border);
    background: var(--warning-bg);
}

.next-step-icon {
    font-size: 20px;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}

.next-step-card.action .next-step-icon {
    color: var(--success);
}

.next-step-card.done .next-step-icon {
    color: var(--success);
}

.next-step-card.waiting .next-step-icon {
    color: #8a642e;
}

.next-step-body h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.next-step-card.action .next-step-body h3 {
    color: #2d5a1e;
}

.next-step-card.done .next-step-body h3 {
    color: var(--success);
}

.next-step-card.waiting .next-step-body h3 {
    color: #8a642e;
}

.next-step-body p {
    margin: 0;
    font-size: 13px;
    color: var(--subtext);
}

/* ─── Hint Card (replaces loading-card for waiting states) ─── */
.hint-card {
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--subtext);
    font-size: 14px;
}

/* ─── Info Grid ─── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.info-grid div,
.artifact-box,
.summary-card,
.submission-full-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.info-grid span,
.artifact-box span,
.summary-card span,
.submission-full-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

/* ─── Content Sections ─── */
.content-section {
    display: grid;
    gap: 12px;
}

.panel-subtitle {
    margin: 6px 0 0;
    color: var(--subtext);
    font-size: 13px;
}

.submission-stack,
.artifact-stack,
.artifact-summary,
.session-analysis-stack,
.material-list {
    display: grid;
    gap: 14px;
}

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

.summary-card p,
.submission-full-item p,
.quick-card p,
.artifact-detail-block p {
    margin-bottom: 0;
    white-space: pre-wrap;
    color: var(--subtext);
}

.detail-toggle {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.detail-toggle summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 800;
    color: var(--primary-dark);
    background: #f8fbfa;
}

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

.detail-toggle[open] summary {
    border-bottom: 1px solid var(--border);
}

.submission-full,
.artifact-detail {
    display: grid;
    gap: 12px;
    padding: 16px;
}

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

.quick-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: 14px;
}

.quick-card h3,
.artifact-detail-block h3 {
    margin-bottom: 8px;
    font-size: 16px;
}

.quick-card-tag {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success);
    font-size: 12px;
    font-weight: 800;
}

.quick-card-full {
    grid-column: 1 / -1;
}

.quick-list,
.artifact-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.artifact-detail-block {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.artifact-empty {
    margin: 0;
    color: var(--subtext);
}

.artifact-content {
    margin-top: 8px;
    white-space: pre-wrap;
    color: var(--subtext);
}

/* ─── Session Materials ─── */
.material-form {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

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

.material-hint {
    color: var(--muted);
    font-size: 13px;
}

.material-item summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.material-item small {
    color: var(--muted);
    font-weight: 500;
}

.material-content {
    padding: 16px;
    white-space: pre-wrap;
    color: var(--text);
    max-height: 420px;
    overflow: auto;
    background: #fff;
}

/* ─── Loading & Error ─── */
.loading-card,
.error-card {
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--warning-border);
    background: var(--warning-bg);
    color: #76562b;
}

.error-card {
    border-color: rgba(211, 162, 96, 0.34);
    background: rgba(255, 248, 238, 0.92);
    color: #7a5431;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.generation-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--info-border);
    background: var(--info-bg);
    color: var(--text);
}

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

.generation-card-head strong {
    color: var(--info-color);
    font-size: 16px;
}

.generation-card-head span,
.generation-note {
    color: var(--subtext);
    font-size: 13px;
}

.generation-card p {
    margin: 0;
    color: var(--subtext);
}

.generation-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(43, 94, 167, 0.12);
}

.generation-progress span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: var(--info-color);
    animation: generation-slide 1.4s ease-in-out infinite;
}

@keyframes generation-slide {
    0% {
        transform: translateX(-110%);
    }
    100% {
        transform: translateX(250%);
    }
}

.empty-state {
    min-height: 280px;
    display: grid;
    place-content: center;
    text-align: center;
    color: var(--subtext);
}

.empty-state.compact {
    min-height: 180px;
}

.empty-journey {
    min-height: 620px;
    border: 1px solid rgba(234, 223, 210, 0.72);
    border-radius: 12px;
    background:
        radial-gradient(circle at 50% 45%, rgba(107, 85, 163, 0.08), transparent 22rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 250, 242, 0.84));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.56);
    padding: 44px;
}

.empty-journey h3 {
    color: var(--text);
    font-size: 24px;
    margin: 18px 0 8px;
}

.empty-journey p {
    width: min(420px, 100%);
    margin: 0 auto;
}

.empty-portal {
    position: relative;
    width: min(520px, 100%);
    height: 330px;
    margin: 0 auto;
}

.empty-portal::before {
    content: none;
}

.empty-door-art {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(580px, 112%);
    transform: translateX(-50%);
    translate: 0 -50%;
    opacity: 0.72;
    mix-blend-mode: multiply;
}

.empty-mini-compass {
    position: absolute;
    right: 2%;
    top: 10%;
    width: 180px;
    opacity: 0.18;
    pointer-events: none;
    user-select: none;
}

/* ─── Intake View ─── */
.intake-view {
    grid-column: 1 / -1;
    width: min(860px, 100%);
    margin: 0 auto;
}

.intake-card {
    padding: clamp(22px, 4vw, 42px);
}

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

.form-section h2 {
    font-size: 18px;
}

.field-note {
    margin-bottom: 0;
    color: var(--subtext);
    font-size: 13px;
}

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

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

.option-grid label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}

.option-grid input {
    width: auto;
    margin-top: 4px;
}

.success-state {
    margin-top: 24px;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--success-border);
    background: var(--success-bg);
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
    opacity: 0;
    background: var(--primary-dark);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

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

/* ─── Responsive ─── */
@media (max-width: 1050px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .side-nav {
        position: static;
        height: auto;
    }

    .task-layout {
        grid-template-columns: 1fr;
    }

    .quick-card-grid,
    .summary-grid,
    .stage-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .flow-steps {
        flex-direction: column;
        gap: 12px;
    }

    .flow-step {
        border-radius: var(--radius);
    }

    .flow-step:first-child,
    .flow-step:last-child {
        border-radius: var(--radius);
    }

    .flow-step-arrow {
        padding: 4px 0;
        text-align: center;
        transform: rotate(90deg);
    }
}

@media (max-width: 700px) {
    .app-shell {
        padding: 12px;
    }

    .side-nav {
        padding: 16px;
    }

    .hero-panel,
    .panel,
    .intake-card {
        padding: 18px;
    }

    h2 {
        font-size: 20px;
    }

    .info-grid,
    .two-col,
    .option-grid,
    .copy-row {
        grid-template-columns: 1fr;
    }

    .detail-top,
    .panel-header,
    .section-heading,
    .link-box-head {
        display: grid;
    }

    .primary-btn,
    .secondary-btn,
    .ghost-btn,
    .copy-btn {
        width: 100%;
    }

    .artifact-actions,
    .detail-actions {
        display: grid;
        width: 100%;
    }

}
