/* Springboard — Studio OS */
:root {
    --bg-base: #080808;
    --bg-elevated: #111111;
    --text-primary: #f5f5f7;
    --text-secondary: #8e8e93;
    --text-muted: #48484a;

    --accent-border: rgba(255, 255, 255, 0.05);

    --status-idle: #636366;
    --status-active: #60a5fa;
    --status-complete: #34d399;
    --status-error: #f87171;

    --priority-critical: #f87171;
    --priority-high: #fbbf24;
    --priority-medium: #60a5fa;
    --priority-low: #636366;

    --font-display: 'Instrument Serif', serif;
    --font-ui: 'Inter', -apple-system, sans-serif;

    --nav-height: 84px;
    --safe-bottom: env(safe-area-inset-bottom, 24px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-ui);
    line-height: 1.6;
    overflow: hidden;
    display: flex;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: var(--bg-base);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* SCREEN STACK NAVIGATION */
.screen-stack {
    flex: 1;
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

.screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-base);
    display: flex;
    flex-direction: column;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    z-index: 1;
}

.screen.hidden-left { transform: translateX(-30%); opacity: 0; pointer-events: none; }
.screen.hidden-right { transform: translateX(100%); opacity: 0; pointer-events: none; }
.screen.active { transform: translateX(0); opacity: 1; z-index: 2; }

/* HEADERS */
.os-header {
    padding: 16px 24px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--accent-border);
    background: var(--bg-base);
    flex-shrink: 0;
}

.header-title {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-muted);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 0;
}

h1 {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.label-caps {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

/* STATUS ORB */
.status-orb {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: background 0.3s, box-shadow 0.3s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: 8px;
    margin: -8px;
}
.status-orb.alive { background: var(--status-complete); box-shadow: 0 0 8px var(--status-complete); }
.status-orb.dead { background: var(--status-error); box-shadow: 0 0 8px var(--status-error); }

/* NAV DOCK */
.nav-dock {
    position: absolute;
    bottom: var(--safe-bottom);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    height: 64px;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border-radius: 32px;
    border: 1px solid var(--accent-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    z-index: 50;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-dock.hidden { transform: translate(-50%, 150%); }

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
    transition: all 0.4s cubic-bezier(0.2, 0, 0, 1);
    cursor: pointer;
    height: 48px;
    justify-content: center;
    border-radius: 24px;
    border: none;
    background: none;
}
.nav-item.active { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.nav-item span { font-size: 9px; font-weight: 500; }
.nav-item .badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 16px);
    width: 6px;
    height: 6px;
    background: var(--status-error);
    border-radius: 50%;
}

/* SCROLL VIEW */
.scroll-view {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 140px;
    scrollbar-width: none;
}
.scroll-view::-webkit-scrollbar { display: none; }

/* PORTFOLIO GRID */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 24px;
}

.product-card {
    background: var(--bg-elevated);
    border-radius: 24px;
    padding: 24px;
    border: 1px solid var(--accent-border);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 1/1;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.product-card:active { background: #1a1a1a; }

.product-icon {
    width: 32px;
    height: 32px;
    background: #000;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent-border);
}

.product-card-title { font-size: 14px; font-weight: 500; }
.product-card-meta { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

.product-card.new-entity {
    border-style: dashed;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.product-card.new-entity:active { opacity: 0.7; }

/* STAT ROW */
.stat-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.stat-box {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--accent-border);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
}
.stat-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: 4px;
}

/* TASK LIST */
.task-list { margin-top: 24px; }
.task-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.task-list-header .accordion-icon {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}
.task-list-header.collapsed .accordion-icon { transform: rotate(-90deg); }

.task-list-body {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 5000px;
    opacity: 1;
}
.task-list-body.collapsed {
    max-height: 0;
    opacity: 0;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--accent-border);
    gap: 12px;
}

.task-priority-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.task-agent {
    font-size: 10px;
    color: var(--status-active);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

/* REVIEW VIEW */
.review-hero {
    background: #fff;
    color: #000;
    border-radius: 28px;
    padding: 32px;
    margin-bottom: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.review-hero:active { transform: scale(0.98); }
.review-hero h3 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 12px;
}
.review-hero p { font-size: 14px; opacity: 0.6; }

.review-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.review-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }

/* REVIEW DETAIL */
.review-card {
    background: var(--bg-elevated);
    border-radius: 28px;
    padding: 32px;
    border: 1px solid var(--accent-border);
}
.review-card h2 {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 16px;
}
.review-card p { color: var(--text-secondary); margin-bottom: 24px; font-size: 15px; line-height: 1.5; }

.review-actions { display: flex; gap: 12px; margin-top: 8px; }
.btn-revision {
    flex: 1;
    height: 56px;
    border-radius: 28px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--accent-border);
    color: #fff;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-revision:active { background: rgba(255,255,255,0.1); }
.btn-approve {
    flex: 2;
    height: 56px;
    border-radius: 28px;
    background: #fff;
    border: none;
    color: #000;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s;
}
.btn-approve:active { transform: scale(0.97); }

.feedback-input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--accent-border);
    border-radius: 16px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-ui);
    resize: none;
    outline: none;
    margin-top: 16px;
    min-height: 80px;
    display: none;
}
.feedback-input.visible { display: block; }
.feedback-input::placeholder { color: var(--text-muted); }

/* VISION FEED */
.feed-month-label {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--text-primary);
    margin: 48px 0 16px;
    opacity: 0.8;
    font-weight: 400;
}
.feed-month-label:first-child { margin-top: 16px; }

.entry-card {
    background: var(--bg-elevated);
    border: 1px solid var(--accent-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 12px;
    display: flex;
    gap: 20px;
}

.entry-date-column {
    width: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding-top: 4px;
}

.date-number { font-size: 18px; font-family: var(--font-display); color: var(--text-primary); line-height: 1; }
.date-month { font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; }

.entry-content-column { flex: 1; min-width: 0; }
.entry-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.entry-tag {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
}
.entry-time { font-size: 9px; color: var(--text-muted); }
.entry-status { font-size: 9px; color: var(--status-complete); text-transform: uppercase; font-weight: 600; letter-spacing: 0.05em; }

.post-content-text {
    font-family: var(--font-display);
    font-size: 21px;
    line-height: 1.35;
    color: var(--text-primary);
    font-weight: 400;
}
.post-content-text.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.entry-card.tappable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.entry-card.tappable:active { opacity: 0.7; }

/* VISION INPUT */
.vision-input-container {
    position: absolute;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
    left: 20px;
    width: calc(100% - 40px);
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--accent-border);
    border-radius: 28px;
    padding: 8px 8px 8px 20px;
    display: none;
    align-items: flex-end;
    gap: 12px;
    z-index: 60;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.vision-input-container.hidden { transform: translateY(200%); }

.vision-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 15px;
    padding: 12px 0;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    font-weight: 400;
    font-family: var(--font-ui);
}
.vision-textarea::placeholder { color: var(--text-muted); }

.send-btn {
    width: 44px;
    height: 44px;
    background: var(--text-primary);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
}
.send-btn:active { transform: scale(0.9); }
.send-btn:disabled { opacity: 0.3; }

/* BOARD MATRIX */
.board-section { margin-bottom: 32px; }
.board-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.board-section-count {
    background: rgba(255,255,255,0.05);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
}

.board-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--accent-border);
}
.board-tag {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 72px;
    flex-shrink: 0;
}
.board-title { font-size: 14px; font-weight: 400; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-agent { font-size: 10px; color: var(--status-active); width: 80px; text-align: right; text-transform: uppercase; font-weight: 500; letter-spacing: 0.03em; flex-shrink: 0; }

/* AGENT GRID */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 32px;
}
.agent-chip {
    background: var(--bg-elevated);
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.agent-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.agent-dot.idle { background: var(--status-idle); }
.agent-dot.active { background: var(--status-active); box-shadow: 0 0 6px var(--status-active); }
.agent-name { font-size: 11px; font-weight: 500; flex: 1; }
.agent-count { font-size: 10px; color: var(--text-muted); }

/* LOADING STATE */
.loading-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* TOAST */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-elevated);
    border: 1px solid var(--accent-border);
    border-radius: 16px;
    padding: 12px 20px;
    font-size: 13px;
    color: var(--text-primary);
    z-index: 200;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* MODAL */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 150;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.modal-backdrop.visible { display: flex; }

.modal-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--bg-elevated);
    border-radius: 28px 28px 0 0;
    padding: 32px 24px;
    padding-bottom: calc(var(--safe-bottom) + 24px);
}

.modal-sheet h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 24px;
}

.form-field { margin-bottom: 16px; }
.form-field label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.form-field input, .form-field select {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-ui);
    outline: none;
}
.form-field input::placeholder { color: var(--text-muted); }
.form-field select { appearance: none; }
.form-field select option { background: var(--bg-elevated); }

.modal-actions { display: flex; gap: 12px; margin-top: 24px; }

/* UPTIME BANNER */
.uptime-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    margin-top: 24px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.uptime-banner:active { opacity: 0.7; }
.uptime-banner .uptime-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-complete);
    flex-shrink: 0;
}

/* COORDINATOR DETAIL */
.coord-terminal {
    background: #0a0a0a;
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    padding: 16px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.5;
    color: #b0b0b0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.coord-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
}
.coord-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.coord-status-dot.alive { background: var(--status-complete); box-shadow: 0 0 10px var(--status-complete); }
.coord-status-dot.dead { background: var(--status-error); box-shadow: 0 0 10px var(--status-error); }
.coord-refresh-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--accent-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    padding: 6px 14px;
    cursor: pointer;
    margin-left: auto;
}
.coord-refresh-btn:active { opacity: 0.6; }

/* ARTIFACT CONTENT */
.artifact-content {
    background: var(--bg-elevated);
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    padding: 20px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-x: auto;
}
.artifact-content h1 { font-size: 20px; font-weight: 600; margin: 20px 0 8px; }
.artifact-content h2 { font-size: 17px; font-weight: 600; margin: 20px 0 8px; }
.artifact-content h3 { font-size: 15px; font-weight: 600; margin: 16px 0 6px; }
.artifact-content h4 { font-size: 13px; font-weight: 600; margin: 12px 0 4px; color: var(--text-secondary); }
.artifact-content h1:first-child, .artifact-content h2:first-child { margin-top: 0; }
.artifact-content p { margin: 8px 0; }
.artifact-content strong { color: #fff; }
.artifact-content hr { border: none; border-top: 1px solid var(--accent-border); margin: 16px 0; }
.artifact-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12px; }
.artifact-content td { padding: 6px 10px; border: 1px solid var(--accent-border); }
.artifact-content tr:first-child td { font-weight: 600; background: rgba(255,255,255,0.03); }
.artifact-content .md-li { padding: 2px 0 2px 12px; }
.artifact-content .md-task { padding: 2px 0; color: var(--text-secondary); }
.artifact-content .md-task.done { color: var(--status-complete); }

/* QA SECTION */
.qa-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--accent-border);
    border-radius: 12px;
}
.qa-section h3 { font-size: 15px; font-weight: 600; margin: 0 0 16px; color: var(--text-primary); }
.qa-item { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--accent-border); }
.qa-item:last-of-type { border-bottom: none; margin-bottom: 8px; padding-bottom: 0; }
.qa-question { font-size: 13px; color: var(--text-primary); line-height: 1.5; margin-bottom: 8px; }
.qa-question strong { color: #fff; }
.qa-answer {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--accent-border);
    border-radius: 10px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-ui);
    resize: vertical;
    outline: none;
    min-height: 48px;
    transition: border-color 0.2s;
}
.qa-answer:focus { border-color: rgba(255,255,255,0.2); }
.qa-answer::placeholder { color: var(--text-muted); }
.qa-submit {
    width: 100%;
    height: 48px;
    border-radius: 24px;
    background: #fff;
    border: none;
    color: #000;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
    transition: transform 0.2s, opacity 0.2s;
}
.qa-submit:active { transform: scale(0.97); }
.qa-submit:disabled { opacity: 0.3; cursor: default; }

/* TASK DETAIL */
.task-detail-header { padding: 0 0 20px; border-bottom: 1px solid var(--accent-border); margin-bottom: 20px; }
.task-detail-id { font-size: 11px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.task-detail-title { font-size: 20px; font-weight: 600; line-height: 1.3; margin-bottom: 12px; }
.task-detail-desc { font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.task-detail-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.task-meta-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--accent-border);
    font-size: 12px; color: var(--text-secondary);
}
.task-meta-chip strong { color: var(--text-primary); font-weight: 500; }
.task-detail-section { margin-top: 24px; }
.task-detail-section-title { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.task-artifact-link {
    display: block; padding: 10px 14px; margin-bottom: 8px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--accent-border); border-radius: 10px;
    font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: background 0.2s;
}
.task-artifact-link:active { background: rgba(255,255,255,0.06); }

/* PRODUCT DETAIL */
.pd-section { margin-top: 24px; }
.pd-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pd-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-top: 12px;
}
.pd-tech-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pd-tech-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--accent-border);
    color: var(--text-secondary);
}
.pd-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 6px;
}
.pd-status-badge.shipped { background: rgba(52, 211, 153, 0.1); color: var(--status-complete); }
.pd-status-badge.active { background: rgba(96, 165, 250, 0.1); color: var(--status-active); }

/* URL Row */
.pd-url-row {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: background 0.15s;
}
.pd-url-row:active { background: rgba(255,255,255,0.05); }
.pd-url-icon {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255,255,255,0.04);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--text-secondary);
}
.pd-url-info { flex: 1; min-width: 0; }
.pd-url-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.pd-url-value { font-size: 13px; color: var(--status-active); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; text-decoration: none; }
.pd-url-value:hover { text-decoration: underline; }
.pd-copy-btn {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--accent-border);
    color: var(--text-muted); display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; transition: all 0.15s;
}
.pd-copy-btn:active { background: rgba(255,255,255,0.1); }
.pd-copy-btn.copied { color: var(--status-complete); border-color: var(--status-complete); }

/* Credential Row */
.pd-cred-row {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    margin-bottom: 8px;
}
.pd-cred-info { flex: 1; min-width: 0; }
.pd-cred-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.pd-cred-value {
    font-size: 13px; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    transition: filter 0.2s;
}
.pd-cred-value.blurred { filter: blur(6px); user-select: none; cursor: pointer; }
.pd-reveal-btn {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--accent-border);
    color: var(--text-muted); display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; transition: all 0.15s;
}
.pd-reveal-btn:active { background: rgba(255,255,255,0.1); }
.pd-reveal-btn.revealed { color: var(--status-active); border-color: var(--status-active); }

/* Report Card */
.pd-report-card {
    background: var(--bg-elevated);
    border: 1px solid var(--accent-border);
    border-radius: 16px;
    padding: 20px;
}
.pd-report-summary { font-size: 14px; line-height: 1.6; color: var(--text-secondary); margin-top: 12px; }
.pd-report-stats { display: flex; gap: 12px; margin-top: 16px; }
.pd-report-stat {
    flex: 1; text-align: center; padding: 12px 8px;
    background: rgba(255,255,255,0.02); border: 1px solid var(--accent-border); border-radius: 10px;
}
.pd-report-stat-value { font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1; color: var(--text-primary); }
.pd-report-stat-label { font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-top: 4px; }

/* Product status report */
.status-report {
    background: var(--bg-elevated); border: 1px solid var(--accent-border); border-radius: 12px;
    padding: 16px; margin-top: 20px;
}
.product-link-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; margin-top: 16px;
    background: #fff; color: #000; border: none; border-radius: 20px;
    font-weight: 600; font-size: 13px; cursor: pointer;
    text-decoration: none; transition: transform 0.2s;
}
.product-link-btn:active { transform: scale(0.97); }

/* =========================================================================
   CHAT WIDGET
   ========================================================================= */

.chat-fab {
    position: absolute;
    bottom: calc(var(--safe-bottom) + 80px);
    right: 16px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--text-primary);
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 60;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: transform 0.2s, opacity 0.3s;
}
.chat-fab:active { transform: scale(0.9); }
.chat-fab.hidden { opacity: 0; pointer-events: none; transform: scale(0.5); }

.chat-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    max-height: 520px;
    background: var(--bg-elevated);
    border-radius: 24px 24px 0 0;
    border: 1px solid var(--accent-border);
    border-bottom: none;
    display: flex;
    flex-direction: column;
    z-index: 70;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
.chat-panel.open { transform: translateY(0); }

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--accent-border);
    flex-shrink: 0;
}
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-header-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--status-idle);
    transition: background 0.3s, box-shadow 0.3s;
}
.chat-status-dot.connected { background: var(--status-complete); box-shadow: 0 0 6px var(--status-complete); }
.chat-status-dot.disconnected { background: var(--status-error); }

.chat-product-select {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--accent-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    font-family: var(--font-ui);
    padding: 4px 8px;
    outline: none;
    appearance: none;
    cursor: pointer;
    max-width: 120px;
}
.chat-product-select option { background: var(--bg-elevated); }

.chat-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-messages::-webkit-scrollbar { display: none; }

.chat-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 40px 20px;
    margin: auto;
}

/* Message bubbles */
.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.chat-msg-ceo {
    align-self: flex-end;
    background: var(--text-primary);
    color: #000;
    border-bottom-right-radius: 4px;
}
.chat-msg-ceo .chat-msg-header { color: rgba(0,0,0,0.5); }

.chat-msg-agent {
    align-self: flex-start;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border: 1px solid var(--accent-border);
    border-bottom-left-radius: 4px;
}

.chat-msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.chat-msg-role {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-msg-agent-name {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--status-active);
}

.chat-msg-time {
    font-size: 9px;
    color: var(--text-muted);
    margin-left: auto;
}
.chat-msg-ceo .chat-msg-time { color: rgba(0,0,0,0.35); }

.chat-msg-content {
    white-space: pre-wrap;
}

/* Input row */
.chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    border-top: 1px solid var(--accent-border);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--accent-border);
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-ui);
    resize: none;
    outline: none;
    max-height: 120px;
    min-height: 40px;
    line-height: 1.4;
    transition: border-color 0.2s;
}
.chat-input:focus { border-color: rgba(255,255,255,0.15); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--text-primary);
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s, opacity 0.15s;
}
.chat-send-btn:active { transform: scale(0.9); }
.chat-send-btn:disabled { opacity: 0.3; cursor: default; }

/* =========================================================================
   AGENT DETAIL VIEW
   ========================================================================= */

.agent-chip-tappable {
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.agent-chip-tappable:active { background: #1a1a1a; border-color: rgba(255,255,255,0.1); }

.agent-detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--accent-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
}
.agent-detail-avatar.active { border-color: var(--status-active); box-shadow: 0 0 20px rgba(96, 165, 250, 0.15); }

.agent-detail-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.agent-detail-dot.idle { background: var(--status-idle); }
.agent-detail-dot.active { background: var(--status-active); box-shadow: 0 0 10px var(--status-active); }

.agent-detail-status-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 12px;
    border-radius: 12px;
    margin-top: 12px;
}
.agent-detail-status-badge.idle {
    background: rgba(99, 99, 102, 0.15);
    color: var(--status-idle);
}
.agent-detail-status-badge.active {
    background: rgba(96, 165, 250, 0.15);
    color: var(--status-active);
}

.agent-detail-task-card {
    background: var(--bg-elevated);
    border: 1px solid var(--accent-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.agent-detail-task-card:active { background: #1a1a1a; }

/* =========================================================================
   ACTIVITY FEED (Review View)
   ========================================================================= */

.activity-date-label {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text-primary);
    margin: 20px 0 10px;
    opacity: 0.8;
    font-weight: 400;
}
.activity-date-label:first-child { margin-top: 8px; }

.activity-entry {
    padding: 14px;
    margin-bottom: 8px;
}

.activity-tag-complete { background: rgba(52, 211, 153, 0.1); color: var(--status-complete); }
.activity-tag-warning { background: rgba(251, 191, 36, 0.1); color: var(--priority-high); }
.activity-tag-system { background: rgba(96, 165, 250, 0.08); color: var(--status-active); }
.activity-tag-idea { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.activity-tag-info { background: rgba(255, 255, 255, 0.04); color: var(--text-secondary); }

/* =========================================================================
   BOARD COMPLETED PAGINATION
   ========================================================================= */

.board-show-more-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
    -webkit-tap-highlight-color: transparent;
}
.board-show-more-btn:active { background: rgba(255, 255, 255, 0.06); }

/* =========================================================================
   CHAT CONTEXT BAR
   ========================================================================= */

.chat-context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(96, 165, 250, 0.08);
    border-bottom: 1px solid rgba(96, 165, 250, 0.15);
    flex-shrink: 0;
    gap: 8px;
}

.chat-context-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--status-active);
    min-width: 0;
    overflow: hidden;
}

.chat-context-label span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-context-label strong {
    font-weight: 600;
    color: var(--text-primary);
}

.chat-context-clear {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--accent-border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.chat-context-clear:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-secondary); }
.chat-context-clear:active { background: rgba(255, 255, 255, 0.15); }
