/**
 * Journal workspace — Phase 0/1/2/3 visual upgrades.
 * Loaded alongside style.css in terminal.html.
 */

/* Batch overview is now always visible (no details toggle) */
.jcc-batch-overview {
    padding-top: 6px;
    padding-bottom: 6px;
}

/* ── Command bar active button state ───────────────────────────── */
.jcc-btn--active {
    background: rgba(88, 166, 255, 0.18);
    border-color: rgba(88, 166, 255, 0.65);
    color: #79c0ff;
}

.jcc-btn--submit {
    min-width: 100px;
}

/* ── Slide-in panel (quick note + thesis) ───────────────────────── */
.jcc-panel-slide {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 0;
    border-bottom: 1px solid transparent;
    background: linear-gradient(180deg, rgba(22, 27, 34, 0.98) 0%, rgba(13, 17, 23, 0.98) 100%);
}

.jcc-panel-slide[hidden] {
    display: block; /* override UA hidden so transition fires */
    visibility: hidden;
    pointer-events: none;
}

.jcc-panel-slide--open {
    max-height: 520px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    border-bottom-color: rgba(48, 54, 61, 0.85);
}

.jcc-panel-slide__inner {
    padding: 12px 14px 14px;
}

.jcc-panel-slide__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.jcc-panel-slide__title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c9d1d9;
}

.jcc-panel-slide__close {
    background: none;
    border: none;
    color: #8b949e;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.12s ease, background 0.12s ease;
}

.jcc-panel-slide__close:hover {
    color: #f0f6fc;
    background: rgba(255, 255, 255, 0.06);
}

.jcc-panel-slide__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jcc-panel-textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.28);
    color: #e6edf3;
    border: 1px solid rgba(48, 54, 61, 0.85);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    line-height: 1.45;
    min-height: 72px;
    transition: border-color 0.15s ease;
}

.jcc-panel-textarea:focus,
.jcc-panel-input:focus,
.jcc-panel-select:focus {
    outline: none;
    border-color: rgba(88, 166, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.jcc-panel-textarea--tall {
    min-height: 120px;
}

.jcc-panel-input,
.jcc-panel-select {
    background: rgba(0, 0, 0, 0.28);
    color: #e6edf3;
    border: 1px solid rgba(48, 54, 61, 0.85);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 11px;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.jcc-panel-input {
    flex: 1;
    min-width: 0;
}

.jcc-panel-select {
    min-width: 120px;
}

.jcc-panel-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

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

.jcc-panel-status {
    font-size: 10px;
    color: #8b949e;
}

.jcc-panel-status--ok {
    color: #3fb950;
}

.jcc-panel-status--err {
    color: #f85149;
}

/* ── Emotion chips ─────────────────────────────────────────────── */
.jcc-emotion-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.jcc-emotion-chip {
    font-size: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(48, 54, 61, 0.85);
    background: rgba(22, 27, 34, 0.8);
    color: #8b949e;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
    white-space: nowrap;
}

.jcc-emotion-chip:hover {
    border-color: rgba(88, 166, 255, 0.45);
    color: #c9d1d9;
}

.jcc-emotion-chip--active {
    border-color: rgba(88, 166, 255, 0.7);
    background: rgba(88, 166, 255, 0.14);
    color: #79c0ff;
}

/* ── Date preset active chip ───────────────────────────────────── */
.jcc-chip--preset-active {
    border-color: rgba(88, 166, 255, 0.75) !important;
    background: rgba(88, 166, 255, 0.16) !important;
    color: #79c0ff !important;
}

.jcc-chip--saving {
    opacity: 0.55;
    cursor: default;
}

/* ── Ghost btn (more actions) ──────────────────────────────────── */
.jcc-btn--ghost {
    background: none;
    border-color: transparent;
    color: #8b949e;
}

.jcc-btn--ghost:hover {
    border-color: rgba(48, 54, 61, 0.8);
    color: #c9d1d9;
}

.jcc-btn--block {
    display: block;
    width: 100%;
    text-align: left;
}

/* ── More actions dropdown ─────────────────────────────────────── */
.jcc-more-actions {
    position: relative;
}

.jcc-more-actions summary {
    list-style: none;
}

.jcc-more-actions summary::-webkit-details-marker {
    display: none;
}

.jcc-more-actions__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 160px;
    background: #161b22;
    border: 1px solid rgba(48, 54, 61, 0.95);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    padding: 4px;
    z-index: 200;
}

/* ── Pulse insight row (Phase 1 + 2) ──────────────────────────── */
.jcc-pulse-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.65);
    background: rgba(0, 0, 0, 0.22);
}

@media (max-width: 900px) {
    .jcc-pulse-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .jcc-pulse-row {
        grid-template-columns: 1fr;
    }
}

.jcc-pulse-card {
    padding: 10px 12px;
    border-right: 1px solid rgba(48, 54, 61, 0.55);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 88px;
    transition: background 0.15s ease;
}

.jcc-pulse-card:last-child {
    border-right: none;
}

.jcc-pulse-card:hover {
    background: rgba(88, 166, 255, 0.04);
}

.jcc-pulse-card__label {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6e7681;
    margin-bottom: 2px;
}

.jcc-pulse-card__sublabel {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #6e7681;
    margin-top: 4px;
}

.jcc-pulse-card__metrics {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.jcc-pulse-metric {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.jcc-pulse-metric__val {
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #f0f6fc;
}

.jcc-pulse-metric__k {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6e7681;
}

.jcc-pulse-val--primary { color: #f0f6fc; }
.jcc-pulse-val--story   { color: #39d4d4; }
.jcc-pulse-val--risk    { color: #f85149; }
.jcc-pulse-val--ai      { color: #79c0ff; }
.jcc-pulse-val--thesis  { color: #a371f7; }
.jcc-pulse-val--replay  { color: #3fb950; }
.jcc-pulse-val--muted   { color: #8b949e; font-size: 11px; }

.jcc-pulse-card__badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(48, 54, 61, 0.8);
    color: #8b949e;
}

.jcc-pulse-badge--risk {
    background: rgba(248, 81, 73, 0.12);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.35);
}

.jcc-pulse-badge--up {
    background: rgba(63, 185, 80, 0.12);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.35);
}

.jcc-pulse-badge--down {
    background: rgba(248, 81, 73, 0.1);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.jcc-pulse-empty {
    font-size: 10px;
    color: #6e7681;
    font-style: italic;
}

/* ── Sparkline (activity trend card) ──────────────────────────── */
.jcc-spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 48px;
    padding-bottom: 2px;
}

.jcc-spark-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.jcc-spark-bar {
    width: 100%;
    background: rgba(88, 166, 255, 0.5);
    border-radius: 2px 2px 0 0;
    min-height: 3px;
    transition: background 0.2s ease;
}

.jcc-spark-bar-wrap:hover .jcc-spark-bar {
    background: rgba(88, 166, 255, 0.85);
}

.jcc-spark-label {
    font-size: 7px;
    color: #6e7681;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    max-width: 28px;
    display: inline-block;
}

/* ── Symbol card ───────────────────────────────────────────────── */
.jcc-pulse-symbol {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    gap: 6px;
}

.jcc-pulse-symbol--recent {
    opacity: 0.72;
}

.jcc-pulse-symbol__tag {
    font-size: 10px;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    color: #c9d1d9;
    background: rgba(48, 54, 61, 0.65);
    padding: 1px 6px;
    border-radius: 4px;
}

.jcc-pulse-symbol__count {
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    color: #8b949e;
}

/* ── Session card tags ─────────────────────────────────────────── */
.jcc-pulse-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.jcc-pulse-tag {
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(88, 166, 255, 0.3);
    background: rgba(88, 166, 255, 0.07);
    color: #79c0ff;
}

.jcc-pulse-tag__n {
    color: #6e7681;
    font-weight: 700;
}

.jcc-pulse-thesis-row {
    font-size: 10px;
    color: #a371f7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ── Calendar popover (wire the existing popover HTML) ─────────── */
.jcc-calendar-popover {
    position: absolute;
    z-index: 300;
    background: #161b22;
    border: 1px solid rgba(48, 54, 61, 0.95);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    padding: 12px;
    min-width: 240px;
    top: calc(100% + 8px);
    left: 0;
}

.jcc-calendar-popover__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.jcc-calendar-popover__title {
    font-size: 11px;
    font-weight: 700;
    color: #c9d1d9;
}

.jcc-calendar-popover__hint {
    font-size: 9px;
    color: #6e7681;
    margin: 8px 0 0;
}

.jcc-date-strip {
    position: relative;
}

.jcc-cal-weekrow,
.jcc-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.jcc-cal-weekrow {
    margin-bottom: 4px;
}

.jcc-cal-dayname {
    font-size: 8px;
    font-weight: 700;
    color: #6e7681;
    text-align: center;
    padding: 2px 0;
}

.jcc-cal-cell {
    font-size: 10px;
    color: #8b949e;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    text-align: center;
    padding: 4px 0;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.jcc-cal-cell--empty {
    cursor: default;
}

.jcc-cal-cell:not(.jcc-cal-cell--empty):hover {
    background: rgba(88, 166, 255, 0.14);
    color: #c9d1d9;
    border-color: rgba(88, 166, 255, 0.3);
}

.jcc-cal-cell--today {
    border-color: rgba(88, 166, 255, 0.55);
    color: #79c0ff;
    font-weight: 700;
}

.jcc-cal-cell--heat0 { background: transparent; }
.jcc-cal-cell--heat1 { background: rgba(88, 166, 255, 0.07); color: #c9d1d9; }
.jcc-cal-cell--heat2 { background: rgba(88, 166, 255, 0.15); color: #c9d1d9; }
.jcc-cal-cell--heat3 { background: rgba(88, 166, 255, 0.28); color: #e6edf3; }
.jcc-cal-cell--heat4 { background: rgba(88, 166, 255, 0.45); color: #f0f6fc; font-weight: 700; }

/* ── Rail tag pill ─────────────────────────────────────────────── */
.jcc-rail-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(48, 54, 61, 0.75);
    color: #c9d1d9;
    margin: 2px;
}

/* ── Phase 3: Enhanced feed cards ─────────────────────────────── */
.jcc-card {
    border-left: 3px solid transparent;
    transition: transform 0.13s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.jcc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Type-specific left borders + accent treatment */
.jcc-card--note {
    border-left-color: #58a6ff;
}

.jcc-card--exec {
    border-left-color: #388bfd;
}

.jcc-card--intel {
    border-left-color: #a371f7;
    box-shadow: 0 0 12px rgba(163, 113, 247, 0.08);
}

.jcc-card--intel:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 16px rgba(163, 113, 247, 0.15);
}

.jcc-card--risk {
    border-left-color: #f85149;
}

.jcc-card--caution {
    border-left-color: #d29922;
}

.jcc-card--thesis {
    border-left-color: #a371f7;
}

.jcc-card--story {
    border-left-color: #39d4d4;
}

/* Expand/collapse support — cards are expandable */
.jcc-card--expanded .jcc-card__summaryline {
    white-space: normal;
    -webkit-line-clamp: unset;
    max-height: none;
}

.jcc-card__summaryline {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    cursor: pointer;
}

.jcc-card__expand-btn {
    font-size: 9px;
    color: #6e7681;
    background: none;
    border: none;
    padding: 2px 0;
    cursor: pointer;
    font-family: inherit;
}

.jcc-card__expand-btn:hover {
    color: #8b949e;
}

.jcc-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.jcc-card__tag {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(48, 54, 61, 0.8);
    color: #8b949e;
    background: rgba(22, 27, 34, 0.75);
}

.jcc-card__tag--type-exec    { border-color: rgba(56, 139, 253, 0.4); color: #79c0ff; }
.jcc-card__tag--type-risk    { border-color: rgba(248, 81, 73, 0.4); color: #f85149; }
.jcc-card__tag--type-ai      { border-color: rgba(163, 113, 247, 0.4); color: #a371f7; }
.jcc-card__tag--type-journal { border-color: rgba(88, 166, 255, 0.3); color: #79c0ff; }

.jcc-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.jcc-card__link-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(48, 54, 61, 0.8);
    color: #8b949e;
    background: rgba(22, 27, 34, 0.7);
    margin: 2px 2px 0 0;
    font-family: ui-monospace, monospace;
}

.jcc-card__link-pill--replay { border-color: rgba(63, 185, 80, 0.4); color: #3fb950; }
.jcc-card__link-pill--trade  { border-color: rgba(88, 166, 255, 0.4); color: #79c0ff; }
.jcc-card__link-pill--thesis { border-color: rgba(163, 113, 247, 0.4); color: #a371f7; }

/* Pulse animation for newest card */
@keyframes jcc-card-enter {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.jcc-card--enter {
    animation: jcc-card-enter 0.25s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

/* ── AI summarize button: violet accent ──────────────────────── */
#journal-btn-ai-summarize {
    background: rgba(163, 113, 247, 0.12);
    border-color: rgba(163, 113, 247, 0.45);
    color: #c9a7ff;
}

#journal-btn-ai-summarize:hover {
    background: rgba(163, 113, 247, 0.2);
    border-color: rgba(163, 113, 247, 0.7);
    color: #d2b4ff;
}

/* ── Reflection Studio panel ──────────────────────────────────── */
.jcc-panel-slide--wide .jcc-panel-slide__inner {
    max-width: 720px;
}

.jcc-reflection-hint {
    font-size: 10px;
    color: #6e7681;
    margin: 0 0 8px;
    line-height: 1.45;
}

.jcc-reflection-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.jcc-reflection-preset {
    font-size: 10px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(163, 113, 247, 0.3);
    background: rgba(163, 113, 247, 0.07);
    color: #a371f7;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.jcc-reflection-preset:hover {
    border-color: rgba(163, 113, 247, 0.6);
    background: rgba(163, 113, 247, 0.14);
    color: #c9a7ff;
}

.jcc-reflection-preset--active {
    border-color: rgba(163, 113, 247, 0.8);
    background: rgba(163, 113, 247, 0.2);
    color: #d2b4ff;
}

.jcc-btn--ai {
    background: rgba(163, 113, 247, 0.14);
    border-color: rgba(163, 113, 247, 0.5);
    color: #c9a7ff;
}

.jcc-btn--ai:hover {
    background: rgba(163, 113, 247, 0.22);
    border-color: rgba(163, 113, 247, 0.75);
    color: #d2b4ff;
}

/* ── Session Review panel ─────────────────────────────────────── */
.jcc-review-body {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.jcc-review-section {
    padding: 8px 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.4);
}

.jcc-review-section:last-child {
    border-bottom: none;
}

.jcc-review-section--risk .jcc-review-row {
    color: #f85149;
}

.jcc-review-section__title {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #58a6ff;
    margin-bottom: 6px;
}

.jcc-review-metrics {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.jcc-review-metric {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 40px;
}

.jcc-review-metric__n {
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #f0f6fc;
    line-height: 1;
}

.jcc-review-metric__k {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6e7681;
}

.jcc-review-row {
    font-size: 11px;
    color: #c9d1d9;
    line-height: 1.45;
    padding: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jcc-review-symrow {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Density modes (Phase 6) ───────────────────────────────────── */
/* compact: tighter padding everywhere */
.jcc--density-compact .jcc-card__inner {
    padding: 6px 8px;
}

.jcc--density-compact .jcc-card__summaryline {
    -webkit-line-clamp: 2;
    font-size: 10px;
    line-height: 1.35;
}

.jcc--density-compact .jcc-pulse-card {
    min-height: 68px;
    padding: 6px 10px;
}

.jcc--density-compact .jcc-pulse-metric__val {
    font-size: 14px;
}

.jcc--density-compact .jcc-stat-card__val {
    font-size: 14px;
}

/* expanded: more breathing room */
.jcc--density-expanded .jcc-card__inner {
    padding: 14px 16px;
}

.jcc--density-expanded .jcc-card__summaryline {
    -webkit-line-clamp: 4;
    font-size: 12px;
}

.jcc--density-expanded .jcc-pulse-card {
    min-height: 110px;
    padding: 14px 14px;
}

.jcc--density-expanded .jcc-pulse-metric__val {
    font-size: 22px;
}

/* ── Phase 5: Tab underline animation ─────────────────────────── */
.jcc-mode-btn {
    position: relative;
}

.jcc-mode-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 0;
    height: 2px;
    background: rgba(88, 166, 255, 0.75);
    border-radius: 1px;
    transform: translateX(-50%);
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.jcc-mode-btn.journal-view-tab--active::after {
    width: 60%;
}

/* ── Phase 5: Pulse row skeleton shimmer ──────────────────────── */
@keyframes jcc-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.jcc-pulse-card--loading {
    background: linear-gradient(90deg,
        rgba(48, 54, 61, 0.5) 25%,
        rgba(88, 166, 255, 0.08) 50%,
        rgba(48, 54, 61, 0.5) 75%
    );
    background-size: 200% 100%;
    animation: jcc-shimmer 1.8s ease infinite;
}

/* ── Phase 5: Live AI badge pulse ─────────────────────────────── */
@keyframes jcc-ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(163, 113, 247, 0); }
    50%       { box-shadow: 0 0 12px 3px rgba(163, 113, 247, 0.2); }
}

.jcc-card--intel {
    animation: jcc-ai-pulse 3.5s ease-in-out infinite;
}

.jcc-card--intel:hover {
    animation: none;
}

/* ── Live shell: hero, collapsible filters, onboarding ───────────── */
.jcc--journal-shell .jcc-header--hero {
    padding-bottom: 8px;
}

.jcc-hero-hints {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 10px;
    line-height: 1.5;
    color: #8b949e;
    max-width: min(560px, 92vw);
}

.jcc-hero-hints li {
    margin-bottom: 4px;
}

.jcc-btn--primary {
    background: linear-gradient(180deg, rgba(63, 185, 80, 0.22) 0%, rgba(46, 160, 67, 0.14) 100%);
    border-color: rgba(63, 185, 80, 0.55);
    color: #aff5b4;
    font-weight: 700;
}

.jcc-btn--primary:hover {
    border-color: rgba(63, 185, 80, 0.85);
    background: rgba(63, 185, 80, 0.2);
}

.jcc-btn--small {
    font-size: 0.85em;
    padding: 4px 8px;
    border-radius: 6px;
}

.jcc-filters-pack {
    border-bottom: 1px solid rgba(48, 54, 61, 0.65);
    background: rgba(0, 0, 0, 0.12);
}

.jcc-filters-pack__summary {
    list-style: none;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6e7681;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.jcc-filters-pack__summary::-webkit-details-marker {
    display: none;
}

.jcc-filters-pack__summary-title {
    color: #79c0ff;
}

.jcc-filters-pack__summary-hint {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.02em;
    color: #6e7681;
}

.jcc-filters-pack__inner {
    padding: 0 0 6px;
}

.jcc-filters-pack[open] .jcc-filters-pack__summary {
    border-bottom: 1px solid rgba(48, 54, 61, 0.45);
}

.jcc-spark--in-card {
    height: 36px;
    margin-top: 4px;
}

.jcc-pulse-card__foot {
    font-size: 9px;
    line-height: 1.35;
    color: #6e7681;
    margin: 4px 0 0;
}

.jcc-pulse-card__metrics--tight {
    margin-top: 6px;
    gap: 8px;
}

.jcc-onboarding {
    padding: 12px 14px 16px;
    border-radius: 8px;
    border: 1px solid rgba(48, 54, 61, 0.75);
    background: linear-gradient(165deg, rgba(22, 27, 34, 0.98) 0%, rgba(13, 17, 23, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.jcc-onboarding__hero {
    margin-bottom: 12px;
}

.jcc-onboarding__title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #e6edf3;
}

.jcc-onboarding__lead {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    color: #8b949e;
}

.jcc-onboarding__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.jcc-onboarding__card {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(48, 54, 61, 0.65);
    background: rgba(0, 0, 0, 0.2);
}

.jcc-onboarding__card-k {
    display: block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #58a6ff;
    margin-bottom: 4px;
}

.jcc-onboarding__card p {
    margin: 0;
    font-size: 10px;
    line-height: 1.45;
    color: #8b949e;
}

.jcc-onboarding__steps {
    margin: 0 0 12px;
    padding-left: 18px;
    font-size: 10px;
    line-height: 1.55;
    color: #c9d1d9;
}

.jcc-onboarding__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.jcc-intel-card--guide {
    border: 1px solid rgba(88, 166, 255, 0.15);
    background: rgba(88, 166, 255, 0.04);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.jcc-intel-guide-list {
    margin: 6px 0 0;
    padding-left: 16px;
    font-size: 10px;
    line-height: 1.45;
    color: #8b949e;
}

.jcc-intel-card__hint {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.45;
    color: #8b949e;
}

.jcc-intel-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.jcc-rail-muted {
    color: #6e7681;
    font-size: 10px;
    line-height: 1.45;
}

.jcc-rail-next {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 10px;
    line-height: 1.5;
    color: #8b949e;
}

.jcc-rail-block--muted {
    color: #8b949e;
}

/* ── Command strip + “insight” pulse cards ───────────────────────── */
.jcc-command-strip {
    border-bottom: 1px solid rgba(48, 54, 61, 0.75);
    background: linear-gradient(90deg, rgba(88, 166, 255, 0.08) 0%, rgba(13, 17, 23, 0.95) 45%, rgba(163, 113, 247, 0.06) 100%);
}

.jcc-command-strip__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 8px 12px;
    font-size: 10px;
}

.jcc-command-strip__status {
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(48, 54, 61, 0.85);
}

.jcc-command-strip__status--live {
    color: #aff5b4;
    border-color: rgba(63, 185, 80, 0.45);
    background: rgba(63, 185, 80, 0.12);
    box-shadow: 0 0 16px rgba(63, 185, 80, 0.12);
}

.jcc-command-strip__status--alert {
    color: #ffb1ab;
    border-color: rgba(248, 81, 73, 0.55);
    background: rgba(248, 81, 73, 0.12);
    box-shadow: 0 0 18px rgba(248, 81, 73, 0.15);
}

.jcc-command-strip__status--idle {
    color: #79c0ff;
    border-color: rgba(88, 166, 255, 0.35);
    background: rgba(88, 166, 255, 0.08);
}

.jcc-command-strip__status--muted {
    color: #6e7681;
}

.jcc-command-strip__metrics {
    color: #c9d1d9;
    font-weight: 600;
}

.jcc-command-strip__next {
    color: #8b949e;
    flex: 1 1 220px;
    min-width: 0;
}

.jcc-pulse-card--command {
    background: linear-gradient(180deg, rgba(22, 27, 34, 0.55) 0%, rgba(13, 17, 23, 0.92) 100%);
    border-right: 1px solid rgba(48, 54, 61, 0.55);
}

.jcc-pulse-card__kicker {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #58a6ff;
    opacity: 0.9;
}

.jcc-pulse-metric__val--hero {
    font-size: 22px;
    font-weight: 900;
    text-shadow: 0 0 24px rgba(240, 246, 252, 0.08);
}

.jcc-pulse-card__action {
    font-size: 9px;
    line-height: 1.35;
    color: #8b949e;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed rgba(48, 54, 61, 0.65);
}

.jcc-pulse-card--glow-risk {
    box-shadow: inset 0 0 0 1px rgba(248, 81, 73, 0.25), 0 0 20px rgba(248, 81, 73, 0.06);
}

.jcc-pulse-card--glow-warn {
    box-shadow: inset 0 0 0 1px rgba(210, 153, 34, 0.28), 0 0 18px rgba(210, 153, 34, 0.06);
}

.jcc-pulse-card--glow-ai {
    box-shadow: inset 0 0 0 1px rgba(163, 113, 247, 0.28), 0 0 22px rgba(163, 113, 247, 0.1);
}

/* ── Guided strip + power bar + session focus ───────────────────── */
.jcc-guided-strip {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.55);
    background: rgba(88, 166, 255, 0.04);
}

.jcc-guided-strip__title {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #58a6ff;
    margin-bottom: 6px;
}

.jcc-guided-strip__steps {
    margin: 0;
    padding-left: 18px;
    font-size: 10px;
    line-height: 1.45;
    color: #c9d1d9;
}

.jcc--journal-shell {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.jcc--journal-shell .jcc-body {
    flex: 1 1 auto;
    min-height: 0;
}

.jcc-power-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-top: 1px solid rgba(48, 54, 61, 0.75);
    background: linear-gradient(180deg, rgba(13, 17, 23, 0.98) 0%, rgba(22, 27, 34, 0.98) 100%);
    position: sticky;
    bottom: 0;
    z-index: 5;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

.jcc-power-bar__btn {
    font-size: 10px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(48, 54, 61, 0.85);
    background: rgba(22, 27, 34, 0.9);
    color: #c9d1d9;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.jcc-power-bar__btn:hover {
    border-color: rgba(88, 166, 255, 0.45);
    background: rgba(88, 166, 255, 0.08);
}

.jcc-power-bar__btn--accent {
    border-color: rgba(163, 113, 247, 0.55);
    background: rgba(163, 113, 247, 0.12);
    color: #e6d7ff;
}

.jcc-btn--mega {
    font-size: 11px !important;
    padding: 8px 16px !important;
    box-shadow: 0 0 20px rgba(63, 185, 80, 0.15);
}

.jcc-btn--review-hero {
    font-weight: 800;
    border-color: rgba(163, 113, 247, 0.55) !important;
    background: linear-gradient(180deg, rgba(163, 113, 247, 0.2) 0%, rgba(88, 28, 135, 0.12) 100%) !important;
    color: #e6d7ff !important;
}

.jcc-btn--focus.jcc-btn--active {
    border-color: rgba(88, 166, 255, 0.65);
    background: rgba(88, 166, 255, 0.14);
    color: #79c0ff;
}

.jcc--session-focus .jcc-hero-hints {
    display: none;
}

.jcc--session-focus .jcc-header--hero {
    padding-bottom: 4px;
}

.jcc--session-focus .jcc-pulse-card {
    padding: 8px 10px;
    min-height: 72px;
}

.jcc-intel-card--elevated {
    border: 1px solid rgba(163, 113, 247, 0.22);
    background: linear-gradient(165deg, rgba(163, 113, 247, 0.08) 0%, rgba(13, 17, 23, 0.5) 100%);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.jcc-intel-card__sub {
    margin: 0 0 6px;
    font-size: 9px;
    color: #6e7681;
}

.jcc-coach-list {
    margin: 0;
    padding-left: 16px;
    font-size: 10px;
    line-height: 1.5;
    color: #c9d1d9;
}

.jcc-riskmix {
    display: flex;
    height: 6px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    margin-bottom: 6px;
    gap: 1px;
}

.jcc-riskmix__bar {
    height: 100%;
    min-width: 2px;
}

.jcc-riskmix__bar--risk {
    background: linear-gradient(90deg, #f85149, #ff7b72);
}

.jcc-riskmix__bar--ai {
    background: linear-gradient(90deg, #a371f7, #79c0ff);
}

/* ── Feed tiers + ribbons + “why” context ───────────────────────── */
.jcc-card--tier-primary {
    padding: 2px 0;
}

.jcc-card--tier-primary .jcc-card__inner {
    padding: 10px 10px 10px 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.95) 0%, rgba(13, 17, 23, 0.98) 100%);
    border: 1px solid rgba(48, 54, 61, 0.65);
}

.jcc-card--tier-secondary .jcc-card__inner {
    opacity: 0.96;
}

.jcc-card--tier-tertiary .jcc-card__inner {
    opacity: 0.88;
    transform: scale(0.995);
}

.jcc-card__ribbon {
    display: inline-block;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.1em;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.jcc-card__ribbon--high {
    background: rgba(248, 81, 73, 0.18);
    color: #ffb1ab;
    border: 1px solid rgba(248, 81, 73, 0.35);
}

.jcc-card__ribbon--ai {
    background: rgba(163, 113, 247, 0.18);
    color: #e6d7ff;
    border: 1px solid rgba(163, 113, 247, 0.35);
    box-shadow: 0 0 14px rgba(163, 113, 247, 0.12);
}

.jcc-card__ribbon--risk {
    background: rgba(210, 153, 34, 0.15);
    color: #f0c674;
    border: 1px solid rgba(210, 153, 34, 0.35);
}

.jcc-card__ribbon--exec {
    background: rgba(88, 166, 255, 0.12);
    color: #79c0ff;
    border: 1px solid rgba(88, 166, 255, 0.3);
}

.jcc-card__ribbon--routine {
    background: rgba(48, 54, 61, 0.5);
    color: #6e7681;
    border: 1px solid rgba(48, 54, 61, 0.65);
}

.jcc-card__why {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(88, 166, 255, 0.15);
    background: rgba(88, 166, 255, 0.04);
}

.jcc-card__why-k {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #58a6ff;
    margin-bottom: 4px;
}

.jcc-card__why-list {
    margin: 0;
    padding-left: 16px;
    font-size: 10px;
    line-height: 1.45;
    color: #c9d1d9;
}

/* ── Scan mode: compact feed grid, topline, importance, toasts ──── */
.jcc-toast-host {
    position: absolute;
    right: 10px;
    bottom: 52px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    pointer-events: none;
    max-width: min(320px, 88vw);
}

.jcc--journal-shell {
    position: relative;
}

.jcc-toast {
    font-size: 11px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(48, 54, 61, 0.85);
    background: rgba(22, 27, 34, 0.96);
    color: #c9d1d9;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.jcc-toast--show {
    opacity: 1;
    transform: translateY(0);
}

.jcc-toast--ok {
    border-color: rgba(63, 185, 80, 0.45);
    color: #aff5b4;
}

.jcc-toast--err {
    border-color: rgba(248, 81, 73, 0.55);
    color: #ffb1ab;
}

.jcc-toast--info {
    border-color: rgba(88, 166, 255, 0.45);
    color: #79c0ff;
}

.jcc-btn--loading {
    opacity: 0.75;
    cursor: wait;
}

.jcc-workflow-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 6px 10px;
}

.jcc-workflow-strip__label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #58a6ff;
}

.jcc-workflow-strip__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
}

.jcc-workflow-btn {
    font-size: 10px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(48, 54, 61, 0.85);
    background: rgba(22, 27, 34, 0.9);
    color: #c9d1d9;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.jcc-workflow-btn:hover {
    border-color: rgba(88, 166, 255, 0.45);
    background: rgba(88, 166, 255, 0.08);
}

.jcc-workflow-btn--primary {
    border-color: rgba(63, 185, 80, 0.45);
    color: #aff5b4;
}

.jcc-workflow-btn--accent {
    border-color: rgba(163, 113, 247, 0.45);
    color: #d2b4ff;
}

.jcc-workflow-btn--review {
    border-color: rgba(163, 113, 247, 0.55);
    background: rgba(163, 113, 247, 0.1);
}

.jcc-card__topline {
    display: none;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 10px;
    line-height: 1.2;
    margin-bottom: 4px;
    color: #8b949e;
}

.jcc-card__topline-main {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.jcc-card__topline-time,
.jcc-card__topline-sym {
    font-variant-numeric: tabular-nums;
    color: #c9d1d9;
}

.jcc-card__topline-sym {
    font-weight: 800;
    font-family: ui-monospace, monospace;
}

.jcc-card__topline-type {
    color: #6e7681;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.jcc-card__imp-badge {
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.jcc-card__imp-badge--high {
    background: rgba(248, 81, 73, 0.18);
    color: #ffb1ab;
    border: 1px solid rgba(248, 81, 73, 0.35);
}

.jcc-card__imp-badge--medium {
    background: rgba(210, 153, 34, 0.15);
    color: #f0c674;
    border: 1px solid rgba(210, 153, 34, 0.35);
}

.jcc-card__imp-badge--low {
    background: rgba(48, 54, 61, 0.65);
    color: #6e7681;
    border: 1px solid rgba(48, 54, 61, 0.85);
}

.jcc-card--imp-high { border-left-width: 4px; }
.jcc-card--imp-medium { border-left-width: 3px; opacity: 0.98; }
.jcc-card--imp-low { opacity: 0.92; }

.jcc--density-compact .jcc-card__topline { display: flex; }

.jcc:not(.jcc--density-compact) .jcc-card__topline { display: none; }

.jcc--density-compact .jcc-card {
    cursor: pointer;
}

.jcc--density-compact .jcc-card:focus-visible {
    outline: 2px solid rgba(88, 166, 255, 0.75);
    outline-offset: 1px;
}

.jcc--density-compact .jcc-card:not(.jcc-card--expanded) .jcc-card__details {
    display: none;
}

.jcc--density-compact .jcc-card:not(.jcc-card--expanded) .jcc-card__inner {
    min-height: 70px;
    max-height: 90px;
    overflow: hidden;
}

.jcc--density-compact .jcc-card--expanded .jcc-card__inner {
    max-height: none;
    overflow: visible;
}

.jcc--density-compact .jcc-card__headline {
    font-size: 11px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
}

.jcc--density-compact .jcc-card--expanded .jcc-card__headline {
    -webkit-line-clamp: unset;
}

.jcc--density-compact .jcc-entries:not(.jcc-entries--single) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
    align-content: start;
}

.jcc--density-compact .jcc-entries.jcc-entries--single {
    display: block;
}

@media (max-width: 720px) {
    .jcc--density-compact .jcc-entries:not(.jcc-entries--single) {
        grid-template-columns: 1fr;
    }
}

/* ── Journal shell: ~20% tighter vertical rhythm ──────────────── */
.jcc--journal-shell .jcc-header {
    padding: 8px 11px 10px;
    gap: 8px;
}

.jcc--journal-shell .jcc-header__row {
    gap: 8px;
}

.jcc--journal-shell .jcc-rail {
    padding: 8px 8px 10px;
}

.jcc--journal-shell .jcc-rail__head {
    margin: 8px 0 4px;
}

.jcc--journal-shell .jcc-feed-chrome {
    padding: 8px 10px 6px;
}

.jcc--journal-shell .jcc-narrative {
    margin-top: 8px;
}

.jcc--journal-shell .jcc-batch-overview {
    padding-top: 5px;
    padding-bottom: 5px;
}

.jcc--journal-shell .jcc-command-strip__inner {
    padding: 6px 10px;
}

.jcc--journal-shell .jcc-guided-strip {
    padding: 6px 10px;
}

.jcc--journal-shell .jcc-power-bar {
    padding: 6px 8px;
}

/* ── Reduce motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .jcc-panel-slide { transition: none; }
    .jcc-card { transition: none; }
    .jcc-card--enter { animation: none; }
    .jcc-spark-bar { transition: none; }
    .jcc-emotion-chip, .jcc-btn { transition: none; }
    .jcc-pulse-card--loading { animation: none; }
    .jcc-card--intel { animation: none; }
    .jcc-mode-btn::after { transition: none; }
    .jcc-pulse-card--glow-risk,
    .jcc-pulse-card--glow-warn,
    .jcc-pulse-card--glow-ai { box-shadow: none; }
    .jcc-command-strip__status--live,
    .jcc-command-strip__status--alert { box-shadow: none; }
    .jcc-toast { transition: none; }
}
