/* GraphTutor - Graph + Panel layout */

/* Override tutor.css defaults for graphtutor-app */
body.graphtutor-app {
    --hb-chat-drawer-width: 320px;
    background: #1a1d23;
    color: #e0e0e0;
    overflow: hidden;
    min-height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

hb-lit-app-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────── */
#app-header {
    width: 100%;
    flex-shrink: 0;
    z-index: 100;
    box-sizing: border-box;
    transition: margin-left 0.24s ease, width 0.24s ease;
}

#app-header .header-left h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #7c8cf5;
    margin: 0;
}

#app-header .header-center {
    font-size: 0.85rem;
    color: #999;
}

#app-header .header-center .gt-header-link {
    color: #8ea5d8;
    text-decoration: none;
}

#app-header .header-center .gt-header-link:hover {
    color: #bfd0f5;
    text-decoration: underline;
}

#app-header .header-center .gt-header-link-sep {
    color: #6d778f;
}

#app-header .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

#app-header .hb-shell-version-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(138, 161, 205, 0.34);
    background: rgba(18, 24, 35, 0.58);
    color: #c8d7f6;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

#toolbar .hb-chat-rail-toggle {
    appearance: none;
    border: 1px solid rgba(133, 152, 194, 0.35);
    border-radius: 12px;
    background: rgba(20, 25, 33, 0.72);
    color: #dbe6fb;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-right: 0;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
    flex: 0 0 auto;
}

#toolbar .hb-chat-rail-toggle:hover {
    background: rgba(32, 39, 51, 0.92);
    border-color: rgba(144, 169, 214, 0.55);
}

#toolbar .hb-chat-rail-toggle.is-open {
    background: rgba(40, 53, 77, 0.95);
    border-color: rgba(122, 156, 222, 0.68);
}

body.graphtutor-app.hb-concept-modal-open #toolbar .hb-chat-rail-toggle {
    position: fixed;
    top: calc(var(--infra-shell-height, 0px) + 12px);
    left: 16px;
    z-index: 1201;
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

body.graphtutor-app.hb-concept-modal-open.hb-chat-rail-open #toolbar .hb-chat-rail-toggle {
    left: calc(var(--hb-chat-drawer-width) + 16px);
}

.hb-chat-rail-toggle-bars {
    width: 14px;
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
}

.hb-chat-rail-toggle-bar {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.hb-chat-rail-toggle-label {
    display: none;
}

/* Keep Lesson Builder aligned with app-shell nav link styling (not button styling). */
#infra-app-shell-root.infra-app-shell-graphtutor .infra-app-shell-right a.gt-btn.gt-btn-text[href*="/lesson-builder"] {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #8ea5d8;
    font-size: 0.85rem;
    line-height: 1.2;
    text-decoration: none;
    border-radius: 0;
}

#infra-app-shell-root.infra-app-shell-graphtutor .infra-app-shell-right a.gt-btn.gt-btn-text[href*="/lesson-builder"]:hover {
    background: transparent;
    color: #bfd0f5;
    text-decoration: underline;
}

#user-email {
    font-size: 0.85rem;
    color: #aaa;
}

#infra-app-shell-root.infra-app-shell-graphtutor .hb-shell-session-badge {
    display: inline-flex;
    align-items: center;
    max-width: min(40vw, 520px);
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(29, 40, 58, 0.92);
    border: 1px solid rgba(124, 148, 194, 0.28);
    color: #dbe7ff;
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#infra-app-shell-root.infra-app-shell-graphtutor #hb-admin-ui-notes-link {
    color: #8ea5d8;
}

#infra-app-shell-root.infra-app-shell-graphtutor #hb-admin-ui-notes-link:hover {
    color: #bfd0f5;
}

/* ── Buttons ─────────────────────────────────────────────── */
.gt-btn {
    border: none;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.gt-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gt-btn-primary {
    background: #667eea;
    color: #fff;
}

.gt-btn-primary:hover:not(:disabled) {
    background: #5568d4;
}

.gt-btn-text {
    background: transparent;
    color: #7c8cf5;
    padding: 5px 10px;
}

.gt-btn-text:hover {
    background: rgba(124, 140, 245, 0.1);
}

.gt-btn-text.is-active {
    background: rgba(124, 140, 245, 0.18);
    color: #f4f7ff;
    box-shadow: inset 0 0 0 1px rgba(124, 140, 245, 0.42);
}

.gt-btn-icon {
    background: transparent;
    border: none;
    color: #999;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
}

.gt-btn-icon:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.gt-btn-danger {
    background: transparent;
    color: #e57373;
    border: 1px solid #e57373;
}

.gt-btn-danger:hover {
    background: rgba(229, 115, 115, 0.15);
}

/* ── Auth gate ───────────────────────────────────────────── */
#auth-gate {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#auth-gate .auth-message {
    text-align: center;
    max-width: 400px;
}

#auth-gate .auth-message h2 {
    color: #e0e0e0;
    margin-bottom: 12px;
}

#auth-gate .auth-message p {
    color: #999;
    margin-bottom: 24px;
}

#auth-gate .auth-message .auth-doc-link {
    margin-top: 14px;
    margin-bottom: 0;
    font-size: 0.88rem;
    color: #9bb0cf;
}

#auth-gate .auth-message .auth-doc-link a {
    color: #7fa7ff;
    text-decoration: none;
}

#auth-gate .auth-message .auth-doc-link a:hover {
    text-decoration: underline;
}

/* ── Toolbar ─────────────────────────────────────────────── */
#toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #22252b;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    position: relative;
    z-index: 20;
}

#toolbar input[type="text"] {
    padding: 7px 12px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #2a2d35;
    color: #e0e0e0;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

#toolbar input[type="text"]:focus {
    border-color: #667eea;
}

#toolbar textarea,
.essay-create-panel textarea {
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 10px;
    background: #151923;
    color: #e0e0e0;
    font-size: 0.92rem;
    line-height: 1.5;
    outline: none;
    resize: vertical;
    min-height: 180px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#toolbar textarea:focus,
.essay-create-panel textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.14);
}

.node-input-shell {
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 560px;
}

#concept-input {
    width: 100%;
}

.node-create-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

#btn-create-concept,
#btn-create-project {
    white-space: nowrap;
}

#btn-create-project {
    border-color: #495c7d;
    color: #d8e4fb;
    background: #313d57;
}

#btn-create-project:hover:not(:disabled) {
    background: #394866;
    border-color: #61769d;
}

#btn-toggle-essay {
    border-color: #705843;
    color: #f8e4cf;
    background: #4a3526;
}

#btn-toggle-essay:hover:not(:disabled),
#btn-toggle-essay[aria-pressed="true"] {
    background: #5a4030;
    border-color: #8c6a51;
}

.essay-create-panel {
    display: grid;
    gap: 10px;
    padding: 12px 16px 14px;
    background:
        linear-gradient(180deg, rgba(24, 29, 39, 0.98), rgba(18, 21, 29, 0.98)),
        radial-gradient(circle at top right, rgba(199, 138, 83, 0.12), transparent 42%);
    border-bottom: 1px solid #2e3545;
    position: relative;
    z-index: 18;
}

.essay-create-copy {
    display: grid;
    gap: 4px;
}

.essay-create-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #f6efe7;
}

.essay-create-hint {
    font-size: 0.84rem;
    line-height: 1.45;
    color: #b9c0d0;
    max-width: 900px;
}

#essay-input {
    width: 100%;
}

.essay-create-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.essay-create-progress {
    display: grid;
    gap: 8px;
    min-height: 0;
}

.node-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    background: #2a2d35;
    border: 1px solid #444;
    border-radius: 10px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.node-suggestion-item {
    display: grid;
    gap: 2px;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: #e0e0e0;
    padding: 10px 12px;
    cursor: pointer;
}

.node-suggestion-item:hover,
.node-suggestion-item.is-active {
    background: rgba(102, 126, 234, 0.16);
}

.node-suggestion-label {
    font-size: 0.92rem;
}

.node-suggestion-meta {
    font-size: 0.78rem;
    color: #9aa0ad;
}
}

#topic-prep-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 260px;
    max-width: 480px;
}

#topic-prep-progress {
    flex: 1;
    min-width: 180px;
}

#topic-ready-btn {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#btn-view-prompts {
    white-space: nowrap;
}

.gt-toolbar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #3d4f70;
    border-radius: 999px;
    background: #2b3550;
    color: #c9d8f8;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    user-select: none;
    cursor: pointer;
}

.gt-toolbar-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #7ea4ff;
}

.gt-toolbar-toggle span {
    line-height: 1;
}

/* ── Prompt Catalog Modal ───────────────────────────────── */
.gt-prompts-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    box-sizing: border-box;
}

.gt-prompts-modal {
    width: min(1120px, 100%);
    max-height: 90vh;
    background: #141925;
    border: 1px solid #32405c;
    border-radius: 12px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gt-prompts-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #2f3a52;
    background: #1d2332;
}

.gt-prompts-modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #d8e2fb;
}

.gt-prompts-modal-updated {
    font-size: 0.74rem;
    color: #8f9ebf;
}

.gt-prompts-modal-close {
    font-size: 1.25rem;
    line-height: 1;
    padding: 2px 10px;
}

.gt-prompts-modal-body {
    padding: 14px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gt-prompts-modal-status {
    font-size: 0.84rem;
    color: #aebee0;
}

.gt-prompts-modal-status.is-error {
    color: #ff8b8b;
}

.gt-prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 12px;
}

.gt-prompts-card {
    background: #1b2231;
    border: 1px solid #2f3a52;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.gt-prompts-card-title {
    font-size: 0.83rem;
    font-weight: 700;
    color: #e3ecff;
}

.gt-prompts-card-meta {
    font-size: 0.72rem;
    color: #9bb0d5;
    line-height: 1.35;
    word-break: break-word;
}

.gt-prompts-card-text {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 0.72rem;
    line-height: 1.36;
    color: #d5ddf1;
    background: #101523;
    border: 1px solid #29344b;
    border-radius: 8px;
    padding: 9px;
    max-height: 280px;
    overflow: auto;
}

.gt-prompts-logs {
    max-height: 400px;
}
.gt-prompts-log-header {
    font-size: 0.68rem;
    color: #8899bb;
    padding: 6px 0 2px;
    border-top: 1px solid #29344b;
}

/* ── App Analysis Modal ───────────────────────────────── */
.gt-agent-analysis-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.76);
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    box-sizing: border-box;
}

.gt-agent-analysis-modal {
    width: min(1240px, 100%);
    max-height: 92vh;
    background: #10141d;
    border: 1px solid #2b3547;
    border-radius: 14px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gt-agent-analysis-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #293344;
    background: #171d28;
}

.gt-agent-analysis-modal-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #edf2ff;
}

.gt-agent-analysis-modal-subtitle {
    margin-top: 4px;
    font-size: 0.76rem;
    color: #91a2c4;
}

.gt-agent-analysis-modal-close {
    font-size: 1.25rem;
    line-height: 1;
    padding: 2px 10px;
}

.gt-agent-analysis-modal-body {
    padding: 16px 18px 18px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gt-agent-analysis-modal-status {
    font-size: 0.84rem;
    color: #c9d6ee;
}

.gt-agent-analysis-modal-status.is-error {
    color: #ff8f8f;
}

.gt-agent-analysis-widget-host .ccw-container {
    min-height: 420px;
}

.gt-agent-analysis-modal-note {
    font-size: 0.76rem;
    color: #93a2bc;
}
.gt-prompts-log-header:first-child {
    border-top: none;
    padding-top: 0;
}
.gt-prompts-log-entry {
    border: none;
    border-radius: 0;
    padding: 4px 0;
    max-height: none;
    margin-bottom: 8px;
}

.gt-prompts-card-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 6px;
}
.gt-prompts-tab {
    padding: 4px 12px;
    border: 1px solid #29344b;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: #101523;
    color: #9bb0d5;
    font-size: 0.72rem;
    cursor: pointer;
}
.gt-prompts-tab.active {
    background: #1a2238;
    color: #d5ddf1;
    border-color: #3d5280;
}
.gt-prompts-tab:hover:not(.active) {
    background: #151d30;
}

/* ── Similar warning ─────────────────────────────────────── */
#similar-warning {
    padding: 8px 16px;
    background: #3a3520;
    border-bottom: 1px solid #555530;
    font-size: 0.85rem;
    color: #e8d44d;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 20;
}

/* ── Main area ───────────────────────────────────────────── */
body.graphtutor-app {
    --hb-app-chat-rail-width: 248px;
}

#app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    transition: margin-left 0.24s ease, width 0.24s ease;
}

body.graphtutor-app.hb-chat-rail-open #app-header,
body.graphtutor-app.hb-chat-rail-open #app-content {
    margin-left: var(--hb-chat-drawer-width);
    width: calc(100% - var(--hb-chat-drawer-width));
}

#main-area {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

#app-chat-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 130;
    display: flex;
    flex-direction: column;
    width: var(--hb-chat-drawer-width);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-right: 1px solid rgba(82, 97, 131, 0.55);
    background: linear-gradient(180deg, #121821 0%, #0f141d 100%);
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.32);
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.24s ease, opacity 0.2s ease;
}

body.graphtutor-app.hb-chat-rail-open #app-chat-sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* ── Graph container ─────────────────────────────────────── */
#graph-container {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#graph-container svg {
    overflow: hidden;
}

#graph-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    font-size: 1rem;
}

/* Graph node/edge styles now handled by ForceGraph component (fg- prefix) */

/* ── Concept panel progress card ────────────────────────── */
.gt-concept-nav-slot {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Increase visual separation between top context section and chat stream. */
body.graphtutor-app .igm-sidebar {
    background: #edf2fb;
    display: flex;
    flex-direction: column;
}

body.graphtutor-app.hb-unified-conversation .igm-sidebar {
    display: none !important;
}

body.graphtutor-app.hb-unified-conversation .igm-content {
    width: min(96vw, 1720px);
    max-width: 96vw;
}

body.graphtutor-app .igm-content,
body.graphtutor-app .igm-hero {
    border-radius: 0 !important;
}

body.graphtutor-app .igm-header {
    display: none;
}

body.graphtutor-app .igm-close-btn {
    display: none;
}

body.graphtutor-app .igm-nav-slot {
    background: linear-gradient(180deg, #f5f8ff 0%, #ebf1fd 100%);
    border-bottom: 1px solid #d2deef;
    box-shadow: none;
}

body.graphtutor-app .igm-messages {
    background: #ffffff;
    flex: 1;
    min-height: 0;
}

body.graphtutor-app .igm-input-area {
    background: #ffffff;
    border-top: 1px solid #dde6f3;
}

.hb-conversation-shell {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.hb-conversation-rail {
    flex: 1;
    min-width: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hb-conversation-rail-header {
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(89, 103, 138, 0.42);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hb-conversation-rail-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hb-conversation-rail-title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a9bbdb;
}

.hb-conversation-rail-context {
    font-size: 0.8rem;
    line-height: 1.35;
    color: #6f839f;
    word-break: break-word;
}

.hb-conversation-rail-mode-host {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hb-conversation-new-btn {
    width: 100%;
    justify-content: center;
}

.hb-conversation-rail-status {
    padding: 10px 16px 0;
    font-size: 0.74rem;
    color: #7e90ac;
}

.hb-conversation-rail-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hb-conversation-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hb-conversation-section-title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #667a97;
}

.hb-conversation-item {
    width: 100%;
    border: 1px solid rgba(72, 86, 117, 0.65);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(27, 35, 48, 0.94) 0%, rgba(20, 26, 37, 0.98) 100%);
    padding: 11px 12px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.hb-conversation-item:hover {
    border-color: rgba(121, 149, 200, 0.72);
    background: linear-gradient(180deg, rgba(34, 44, 61, 0.98) 0%, rgba(24, 32, 44, 0.98) 100%);
}

.hb-conversation-item.is-selected {
    border-color: rgba(118, 157, 228, 0.88);
    background: linear-gradient(180deg, rgba(37, 52, 77, 0.98) 0%, rgba(27, 39, 61, 0.98) 100%);
    box-shadow: inset 0 0 0 1px rgba(134, 170, 234, 0.3);
}

.hb-conversation-item.is-relevant {
    border-color: rgba(95, 117, 160, 0.82);
}

.hb-conversation-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.hb-conversation-item-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e6eefc;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-conversation-item-badge {
    flex-shrink: 0;
    border: 1px solid rgba(122, 155, 214, 0.48);
    border-radius: 999px;
    background: rgba(65, 87, 122, 0.42);
    color: #a9c2ea;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 6px;
}

.hb-conversation-item-topic {
    font-size: 0.72rem;
    color: #8ca1c1;
    line-height: 1.35;
    word-break: break-word;
}

.hb-conversation-item-meta {
    font-size: 0.68rem;
    color: #677c99;
}

.hb-conversation-empty {
    font-size: 0.76rem;
    color: #7488a4;
    line-height: 1.45;
    padding: 6px 2px 0;
}

.hb-conversation-auth-btn {
    align-self: flex-start;
    margin: 4px 2px 0;
}

body.graphtutor-app.hb-chat-rail-open .igm-overlay {
    left: var(--hb-chat-drawer-width);
    width: calc(100% - var(--hb-chat-drawer-width));
    padding-left: 16px;
}

body.graphtutor-app.hb-chat-rail-open .igm-content {
    width: min(95vw, calc(100vw - var(--hb-chat-drawer-width) - 32px));
    max-width: calc(100vw - var(--hb-chat-drawer-width) - 32px);
}

.hb-chat-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    padding: 28px 22px;
    color: #324862;
}

.hb-chat-placeholder-eyebrow {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7e97;
}

.hb-chat-placeholder-title {
    font-size: 1.1rem;
    line-height: 1.25;
    color: #21354f;
}

.hb-chat-placeholder-body {
    font-size: 0.9rem;
    line-height: 1.55;
    max-width: 28rem;
    color: #546b86;
}

.hb-chat-placeholder-action {
    align-self: flex-start;
}

.hb-conversation-mode-bar {
    display: grid;
    gap: 8px;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
}

.hb-conversation-mode-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #89a0bf;
}

.hb-conversation-mode-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(233, 241, 255, 0.08);
    border: 1px solid rgba(119, 140, 177, 0.36);
    width: 100%;
}

.hb-conversation-mode-btn {
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #a8bddb;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.hb-conversation-mode-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #eef5ff;
}

.hb-conversation-mode-btn.is-active {
    background: rgba(141, 175, 235, 0.18);
    border-color: rgba(135, 173, 238, 0.42);
    color: #f5f9ff;
    box-shadow: inset 0 0 0 1px rgba(193, 215, 248, 0.08);
}

.hb-conversation-mode-hint {
    font-size: 0.77rem;
    line-height: 1.45;
    color: #7d92b0;
}

.llm-progress-host[data-topic-bootstrap-progress="true"] {
    width: min(100%, 34rem);
    padding: 14px 14px 12px;
    border: 1px solid #d7e1ee;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
    font-size: 0.82rem;
    color: #5a708b;
}

.llm-progress-host[data-topic-bootstrap-progress="true"] .llm-progress-wrapper {
    margin-top: 0;
}

@media (max-width: 980px) {
    .hb-conversation-shell {
        height: auto;
    }
}

.concept-progress-card {
    margin: 1px 8px 2px;
    padding: 2px 4px;
    border-radius: 0;
    border: none;
    background: transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.concept-progress-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: start;
    /* Reserve space for the absolute top-right close button. */
    padding-right: 28px;
}

.concept-progress-main-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.concept-progress-bars-col {
    display: flex;
    justify-content: flex-end;
}

.concept-evidence-card {
    margin: 4px 14px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d7e1f0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.concept-evidence-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.concept-evidence-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6a7991;
    font-weight: 600;
}

.concept-evidence-count {
    font-size: 0.72rem;
    color: #64748b;
}

.concept-evidence-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.concept-evidence-empty {
    font-size: 0.78rem;
    color: #667085;
}

.concept-evidence-row {
    border-top: 1px solid #e8edf5;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.concept-evidence-row:first-child {
    border-top: none;
    padding-top: 0;
}

.concept-evidence-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.concept-evidence-type {
    font-size: 0.76rem;
    font-weight: 600;
    color: #2f3b51;
}

.concept-evidence-time {
    font-size: 0.72rem;
    color: #64748b;
}

.concept-evidence-level {
    font-size: 0.76rem;
    color: #3f4f67;
}

.concept-evidence-excerpt {
    font-size: 0.74rem;
    color: #5f6f87;
    line-height: 1.35;
}

/* ── Connection chips (used in InfographicModal nav slot) ── */
.connection-chip {
    padding: 4px 8px;
    background: #e8ecf1;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.connection-chip:hover {
    background: #d0d6e0;
    color: #333;
}

.connection-chip-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.connection-chip-progress {
    font-size: 0.68rem;
    line-height: 1.2;
    border-radius: 999px;
    padding: 2px 6px;
    background: #f8faff;
    border: 1px solid #cdd8ea;
    color: #4b5a73;
    flex-shrink: 0;
}

.connection-chip-progress-strong {
    background: #e4f5eb;
    border-color: #b3ddc5;
    color: #1b6e3f;
}

.connection-chip-progress-developing {
    background: #e6f2eb;
    border-color: #bddbc9;
    color: #256747;
}

.connection-chip-progress-early {
    background: #f2ead0;
    border-color: #e2d59f;
    color: #6e5a14;
}

.connection-chip-progress-unknown {
    background: #eceff5;
    border-color: #d1d8e6;
    color: #66748a;
}

/* ── Compact connected-concept progress bars (sidebar nav slot) ── */
.connection-mini-section {
    padding: 10px 14px 12px;
    border-top: 1px solid #e5ebf4;
}

.connection-mini-header {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #5d6c87;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.connection-mini-subheader {
    margin-top: 4px;
    margin-bottom: 6px;
    font-size: 0.68rem;
    color: #8491a8;
}

.connection-mini-fixed-label {
    min-height: 12px;
    margin-bottom: 0;
    font-size: 0.66rem;
    line-height: 1.15;
    color: #4d5f7c;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.connection-mini-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding-right: 0;
}

.connection-mini-label-row .connection-mini-fixed-label {
    flex: 1;
    min-width: 0;
}

.connection-nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.connection-nav-action {
    border: 1px solid #b8c9e3;
    border-radius: 999px;
    background: #e2ecfb;
    color: #35598a;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    min-height: 18px;
    min-width: 18px;
    padding: 2px 6px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.connection-nav-action:hover {
    background: #d7e5fa;
    border-color: #9fb7dc;
}


.connection-nav-close {
    font-size: 0.85rem;
    padding: 1px 6px;
}

.connection-nav-close-corner {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 2;
}

.connection-nav-delete {
    letter-spacing: 0.02em;
}

.connection-nav-cancel {
    background: #fde4db;
    border-color: #e6b5a2;
    color: #8a3f1d;
}

.connection-nav-cancel:hover {
    background: #f8d9ce;
    border-color: #d89d85;
}

.connection-nav-cancel:disabled {
    cursor: default;
    opacity: 0.7;
}

.connection-evidence-toggle {
    flex-shrink: 0;
    border: 1px solid #b8c9e3;
    border-radius: 999px;
    background: #e2ecfb;
    color: #35598a;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.connection-evidence-toggle:hover {
    background: #d7e5fa;
    border-color: #9fb7dc;
}

.connection-evidence-toggle:focus-visible {
    outline: none;
    border-color: #5f82bc;
    box-shadow: 0 0 0 2px rgba(95, 130, 188, 0.18);
}

.connection-evidence-toggle.is-off {
    background: #eff3fa;
    border-color: #cdd7e7;
    color: #5e6c81;
}

.concept-progress-card[data-knowledge-tier="developing"] .connection-mini-fixed-label,
.concept-progress-card[data-knowledge-tier="strong"] .connection-mini-fixed-label {
    color: #1f6a3b;
}

.concept-progress-mini-strip {
    margin-bottom: 0;
}

.connection-mini-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    align-items: flex-end;
    min-height: 20px;
    justify-content: flex-end;
    max-width: 92px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.connection-mini-bar {
    position: relative;
    width: 8px;
    height: 20px;
    border: 1px solid #cfd8ea;
    border-radius: 4px;
    background: #f3f6fc;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.connection-mini-bar.is-current {
    border-color: #5f82bc;
    box-shadow: 0 0 0 1px rgba(95, 130, 188, 0.18);
}

.connection-mini-bar.is-active {
    border-color: #5175b1;
    box-shadow: 0 0 0 2px rgba(95, 130, 188, 0.22);
}

.connection-mini-fill {
    position: absolute;
    left: 1px;
    right: 1px;
    bottom: 1px;
    min-height: 4px;
    border-radius: 3px;
    background: #b2bdd2;
    transition: height 0.25s ease;
}

.connection-mini-bar[data-progress-state="strong"] .connection-mini-fill {
    background: linear-gradient(180deg, #31c277 0%, #1f904f 100%);
}

.connection-mini-bar[data-progress-state="developing"] .connection-mini-fill {
    background: linear-gradient(180deg, #66b38a 0%, #2e774f 100%);
}

.connection-mini-bar[data-progress-state="early"] .connection-mini-fill {
    background: linear-gradient(180deg, #ebc35b 0%, #a17815 100%);
}

.connection-mini-bar[data-progress-state="unknown"] .connection-mini-fill {
    background: #b7c1d4;
}

.connection-mini-bar:hover {
    transform: translateY(-1px);
    border-color: #8fa6cb;
    box-shadow: 0 0 0 2px rgba(112, 146, 199, 0.14);
}

.connection-mini-bar:focus-visible {
    outline: none;
    border-color: #5f82bc;
    box-shadow: 0 0 0 3px rgba(95, 130, 188, 0.24);
}

.connection-mini-empty {
    font-size: 0.78rem;
    color: #8b97ac;
}

.concept-progress-evidence-panel {
    margin-top: 0;
    border-top: 1px solid #e6ecf7;
    padding-top: 3px;
}

.concept-progress-evidence-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.concept-progress-evidence-message {
    font-size: 0.75rem;
    color: #5f6f87;
}

.gt-experimental-section {
    margin: 8px 14px 12px;
    border: 1px dashed #c5d3e8;
    border-radius: 10px;
    background: #f8fbff;
}

.gt-experimental-toggle {
    width: 100%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
}

.gt-experimental-arrow {
    font-size: 0.62rem;
    color: #51607a;
    transition: transform 0.2s ease;
}

.gt-experimental-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #4d5c76;
    letter-spacing: 0.03em;
    font-weight: 700;
}

.gt-experimental-badge {
    margin-left: auto;
    border-radius: 999px;
    border: 1px solid #c8d7ef;
    background: #eef4ff;
    color: #4f6290;
    font-size: 0.66rem;
    font-weight: 600;
    padding: 2px 7px;
}

.gt-experimental-body {
    display: none;
    padding: 0 10px 10px;
    border-top: 1px dashed #d6e2f3;
}

.gt-experimental-section.open .gt-experimental-body {
    display: block;
}

.gt-experimental-copy {
    margin: 8px 2px 6px;
    font-size: 0.76rem;
    color: #5f6e87;
    line-height: 1.35;
}

.gt-experimental-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.gt-experimental-tag {
    border-radius: 999px;
    border: 1px solid #d2def0;
    background: #f2f6fd;
    color: #5d6d88;
    font-size: 0.66rem;
    font-weight: 600;
    padding: 2px 7px;
}

.gt-experimental-cards {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 2px;
}

.gt-experimental-empty {
    font-size: 0.76rem;
    color: #6d7a91;
    background: #f5f8ff;
    border: 1px solid #d9e3f2;
    border-radius: 8px;
    padding: 8px 10px;
}

.gt-experimental-entry {
    border: 1px solid #d4dfef;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gt-experimental-entry-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gt-experimental-entry-round {
    font-size: 0.72rem;
    color: #4e5d77;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.gt-experimental-entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.gt-experimental-entry-tag {
    border-radius: 999px;
    border: 1px solid #d9e4f3;
    background: #f5f8ff;
    color: #5c6e8d;
    font-size: 0.65rem;
    padding: 2px 7px;
    font-weight: 600;
}

.gt-experimental-entry .media-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0;
    margin-top: 0;
}

.gt-experimental-entry .media-card {
    border: 1px solid #d8e2f1;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

.connected-hero-carousel {
    width: 100%;
    background: #f4f7fc;
    border: 1px solid #dbe3f0;
    border-radius: 10px;
    padding: 10px;
    box-sizing: border-box;
}

.connected-hero-heading {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #606f86;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.connected-hero-empty {
    font-size: 0.82rem;
    color: #6f7b8f;
}

.connected-hero-stage {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.connected-hero-stage:focus-visible {
    outline: 2px solid #5c74d8;
    outline-offset: 2px;
    border-radius: 10px;
}

.connected-hero-nav {
    border: 1px solid #c8d1e1;
    background: #eef2f8;
    color: #4c5a72;
    border-radius: 8px;
    width: 34px;
    min-width: 34px;
    cursor: pointer;
    font-size: 18px;
}

.connected-hero-nav:hover {
    background: #e2e9f4;
}

.connected-hero-card {
    flex: 1;
    min-width: 0;
}

.connected-hero-image-frame {
    position: relative;
    width: 100%;
}

.connected-hero-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border-radius: 9px;
    border: 1px solid #d2dcea;
    background: #eef3fb;
    cursor: zoom-in;
}

.connected-hero-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: transparent;
    pointer-events: none;
}

.connected-hero-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(76, 90, 114, 0.25);
    border-top-color: #4c5a72;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 1px 8px rgba(47, 60, 84, 0.22);
    background: rgba(255, 255, 255, 0.78);
}

.connected-hero-image.connected-hero-image-is-loading {
    opacity: 0.65;
}

.connected-hero-title {
    margin-top: 7px;
    font-size: 0.9rem;
    color: #2f3c54;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.connected-hero-meta {
    margin-top: 3px;
    font-size: 0.78rem;
    color: #66748c;
}

.connected-hero-status {
    margin-top: 2px;
    font-size: 0.75rem;
    color: #a05b00;
    min-height: 16px;
}

.connected-hero-footer {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.connected-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.connected-hero-index {
    font-size: 0.75rem;
    color: #7d899e;
}

.connected-hero-prompt,
.connected-hero-open {
    font-size: 0.76rem;
    padding: 4px 8px;
}

.gt-context-prompt-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: #18334c;
}

.gt-context-prompt-section {
    border: 1px solid rgba(191, 205, 224, 0.95);
    border-radius: 14px;
    background: rgba(247, 250, 253, 0.98);
    padding: 12px 14px;
}

.gt-context-prompt-meta-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    font-size: 0.85rem;
}

.gt-context-prompt-meta-row + .gt-context-prompt-meta-row {
    margin-top: 8px;
}

.gt-context-prompt-meta-row span {
    color: #5d718c;
    flex: 0 0 auto;
}

.gt-context-prompt-meta-row strong,
.gt-context-prompt-meta-row code {
    min-width: 0;
    text-align: right;
    word-break: break-word;
}

.gt-context-prompt-label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4a6281;
    margin-bottom: 8px;
}

.gt-context-prompt-pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #12273d;
}

/* Presentation mode owns the left hero column in experiment branch. */
/* Floating view toggle in hero area */
.hero-view-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: min(720px, calc(100% - 16px));
    max-width: calc(100% - 16px);
}

.hero-view-groups {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.hero-view-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
}

.hero-view-group-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #58708f;
    padding-right: 6px;
}

.hero-view-toggle {
    border: 1px solid #b8c9e3;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    width: 100%;
    max-width: 100%;
    backdrop-filter: blur(4px);
    transition: background 0.15s, border-color 0.15s;
}
.hero-view-toggle:hover {
    background: #e2ecfb;
    border-color: #9fb7dc;
}
.hero-view-tab {
    --hero-tab-fg: #35598a;
    --hero-tab-active-bg: #35598a;
    --hero-tab-active-text: #fff;
    --hero-tab-meter-bg: rgba(53, 89, 138, 0.18);
    --hero-tab-meter-fill: rgba(53, 89, 138, 0.28);
    --hero-tab-working-start: #5d93d8;
    --hero-tab-working-mid: #91beff;
    --hero-tab-working-end: #5d93d8;
    --hero-tab-active-meter-bg: rgba(255, 255, 255, 0.24);
    --hero-tab-ready-fill: #4c8a3f;
    --hero-tab-active-ready-fill: #d5f3cf;
    --hero-tab-error-fill: #c05b4c;
    --hero-tab-active-error-fill: #ffd0c7;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--hero-tab-fg);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 9px 6px;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
    flex: 0 0 auto;
    transition: background 0.15s ease, color 0.15s ease;
}

.hero-view-tab[data-kind="conversation"] {
    --hero-tab-fg: #995110;
    --hero-tab-active-bg: #b86418;
    --hero-tab-meter-bg: rgba(184, 100, 24, 0.18);
    --hero-tab-meter-fill: rgba(184, 100, 24, 0.3);
    --hero-tab-working-start: #d88c44;
    --hero-tab-working-mid: #efc27d;
    --hero-tab-working-end: #d88c44;
}

.hero-view-tab[data-kind="workspace"] {
    --hero-tab-fg: #1e6958;
    --hero-tab-active-bg: #2a836d;
    --hero-tab-meter-bg: rgba(42, 131, 109, 0.18);
    --hero-tab-meter-fill: rgba(42, 131, 109, 0.28);
    --hero-tab-working-start: #409c85;
    --hero-tab-working-mid: #88d5c0;
    --hero-tab-working-end: #409c85;
}

.hero-view-tab[data-kind="graph"] {
    --hero-tab-fg: #526579;
    --hero-tab-active-bg: #62778c;
    --hero-tab-meter-bg: rgba(98, 119, 140, 0.18);
    --hero-tab-meter-fill: rgba(98, 119, 140, 0.28);
    --hero-tab-working-start: #8298ad;
    --hero-tab-working-mid: #a7bdd1;
    --hero-tab-working-end: #8298ad;
}

.hero-view-tab.active {
    background: var(--hero-tab-active-bg);
    color: var(--hero-tab-active-text);
}

.hero-view-tab-label {
    display: block;
    text-align: center;
    white-space: nowrap;
}

.hero-view-tab-meter {
    display: block;
    width: 100%;
    min-width: 34px;
    height: 3px;
    border-radius: 999px;
    background: var(--hero-tab-meter-bg);
    overflow: hidden;
}

.hero-view-tab-meter-fill {
    display: block;
    height: 100%;
    width: 4%;
    border-radius: inherit;
    background: var(--hero-tab-meter-fill);
    transition: width 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.hero-view-tab.is-ready .hero-view-tab-meter-fill {
    background: var(--hero-tab-ready-fill);
}

.hero-view-tab.is-working .hero-view-tab-meter-fill {
    background: linear-gradient(90deg, var(--hero-tab-working-start) 0%, var(--hero-tab-working-mid) 55%, var(--hero-tab-working-end) 100%);
    background-size: 200% 100%;
    animation: hero-tab-meter-pulse 1.1s linear infinite;
}

.hero-view-tab.is-error .hero-view-tab-meter-fill {
    background: var(--hero-tab-error-fill);
}

.hero-view-tab.active .hero-view-tab-meter {
    background: var(--hero-tab-active-meter-bg);
}

.hero-view-tab.active.is-ready .hero-view-tab-meter-fill {
    background: var(--hero-tab-active-ready-fill);
}

.hero-view-tab.active.is-error .hero-view-tab-meter-fill {
    background: var(--hero-tab-active-error-fill);
}

@keyframes hero-tab-meter-pulse {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero-view-action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
}

.hero-view-action-btn {
    border: 1px solid rgba(32, 71, 122, 0.22);
    border-radius: 999px;
    background: rgba(24, 56, 94, 0.94);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(20, 45, 78, 0.18);
}

.hero-view-action-btn:hover:not(:disabled) {
    background: rgba(31, 70, 117, 0.98);
}

.hero-view-action-btn:disabled {
    opacity: 0.68;
    cursor: wait;
}

.hero-view-action-btn-secondary {
    background: rgba(255, 255, 255, 0.92);
    color: #21405d;
}

.hero-view-action-btn-secondary:hover:not(:disabled) {
    background: rgba(244, 248, 253, 0.98);
}

.hero-view-action-progress {
    width: min(360px, calc(100vw - 32px));
    max-height: min(48vh, 360px);
    overflow: auto;
    border: 1px solid rgba(184, 201, 227, 0.95);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 20px 40px rgba(23, 43, 71, 0.18);
    padding: 12px;
    color: #21405d;
}

.hero-view-action-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.hero-view-action-progress-title {
    font-size: 12px;
    font-weight: 700;
    color: #35598a;
}

.hero-view-action-progress-close {
    border: none;
    background: transparent;
    color: #56708f;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.hero-view-action-progress-close:hover {
    color: #21405d;
    text-decoration: underline;
}

.hero-view-action-progress-body {
    min-height: 0;
}

.hero-view-action-progress:empty {
    display: none;
}

.igm-hero-gallery {
    position: relative;
}

.igm-hero-gallery .igm-hero-img,
.igm-hero-gallery .igm-hero-placeholder {
    display: none !important;
}

body.graphtutor-app .igm-hero-placeholder {
    width: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
}

.hero-infographic-host,
.hero-panel-host {
    width: 100%;
    min-height: 100%;
}

.hero-infographic-host .igm-gallery-empty {
    position: absolute;
    inset: 120px 18px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    margin: 0;
    z-index: 1;
}

.hero-panel-host {
    display: block;
}

.hero-conversation-workspace {
    display: none;
    height: 100%;
    min-height: 0;
    padding: 18px;
    box-sizing: border-box;
    justify-content: center;
    overflow: hidden;
}

.hero-conversation-workspace-shell {
    width: min(1200px, 100%);
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    border: 1px solid #d6e0ed;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 18px 42px rgba(43, 73, 110, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hero-conversation-workspace-header {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #dbe5f1;
    box-sizing: border-box;
}

.hero-conversation-workspace-chrome {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
}

.hero-conversation-workspace-controls {
    min-width: 0;
    display: flex;
}

.hero-conversation-workspace-controls .hero-view-controls {
    position: static;
    top: auto;
    right: auto;
    width: 100%;
    max-width: none;
    gap: 6px;
}

.hero-conversation-workspace-controls .hero-view-groups {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-conversation-workspace-controls .hero-view-group {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
}

.hero-conversation-workspace-controls .hero-view-group-label {
    display: none;
}

.hero-conversation-workspace-controls .hero-view-toggle {
    width: auto;
    max-width: 100%;
}

.hero-conversation-workspace-nav {
    min-width: min(420px, 44vw);
    max-width: min(520px, 44vw);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
}

.hero-conversation-workspace-nav .concept-progress-card {
    max-height: none !important;
    overflow: visible !important;
    margin: 0;
}

.hero-conversation-speech-toggle {
    white-space: nowrap;
    align-self: flex-start;
}

.hero-conversation-workspace-body {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0 18px 18px;
    box-sizing: border-box;
}

.hero-conversation-workspace-content,
.hero-conversation-workspace-transcript,
.hero-conversation-workspace-composer {
    min-width: 0;
}

.hero-conversation-workspace-content {
    min-height: 0;
    display: none;
}

.hero-conversation-workspace-transcript {
    min-height: 0;
    display: flex;
}

.hero-conversation-workspace-transcript #chatContainer {
    width: 100%;
    min-height: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 18px 0 14px;
    overflow: auto;
}

.hero-conversation-workspace[data-transcript-format="text"] .hero-conversation-workspace-transcript #chatContainer {
    max-width: 860px;
    margin: 0 auto;
}

.hero-conversation-workspace[data-transcript-format="text"] .hero-conversation-workspace-composer #responseGroup {
    max-width: 860px;
    margin: 0 auto;
}

@media (max-width: 1180px) {
    .hero-conversation-workspace-chrome {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-conversation-workspace-nav {
        min-width: 0;
        max-width: none;
        justify-content: flex-start;
    }
}

.hero-conversation-workspace-composer #responseGroup {
    width: 100%;
    border: none;
    border-top: 1px solid #dbe5f1;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding-top: 14px;
}

.hero-entry-infographic-item {
    position: absolute;
    inset: 120px 18px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.hero-entry-infographic-content {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-entry-infographic-image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, 1280px);
    max-height: 100%;
    object-fit: contain;
}

.hero-infographic-host[hidden],
.hero-panel-host[hidden] {
    display: none !important;
}

.igm-hero-gallery.gt-memes-active .igm-gallery-item,
.igm-hero-gallery.gt-memes-active .igm-gallery-empty,
.igm-hero-gallery.gt-presentations-active .igm-gallery-item,
.igm-hero-gallery.gt-presentations-active .igm-gallery-empty,
.igm-hero-gallery.gt-videos-active .igm-gallery-item,
.igm-hero-gallery.gt-videos-active .igm-gallery-empty,
.igm-hero-gallery.gt-assets-active .igm-gallery-item,
.igm-hero-gallery.gt-assets-active .igm-gallery-empty,
.igm-hero-gallery.gt-artifacts-active .igm-gallery-item,
.igm-hero-gallery.gt-artifacts-active .igm-gallery-empty,
.igm-hero-gallery.gt-nearby-active .igm-gallery-item,
.igm-hero-gallery.gt-nearby-active .igm-gallery-empty,
.igm-hero-gallery.gt-analysis-active .igm-gallery-item,
.igm-hero-gallery.gt-analysis-active .igm-gallery-empty,
.igm-hero-gallery.gt-app-analysis-active .igm-gallery-item,
.igm-hero-gallery.gt-app-analysis-active .igm-gallery-empty,
.igm-hero-gallery.gt-updates-active .igm-gallery-item,
.igm-hero-gallery.gt-updates-active .igm-gallery-empty,
.igm-hero-gallery.gt-project-plan-active .igm-gallery-item,
.igm-hero-gallery.gt-project-plan-active .igm-gallery-empty,
.igm-hero-gallery.gt-project-items-active .igm-gallery-item,
.igm-hero-gallery.gt-project-items-active .igm-gallery-empty,
.igm-hero-gallery.gt-project-apps-active .igm-gallery-item,
.igm-hero-gallery.gt-project-apps-active .igm-gallery-empty {
    display: none !important;
}

.igm-hero-gallery.gt-conversation-active .hero-conversation-workspace {
    display: flex;
}

.hero-memes-panel {
    display: none;
    width: 100%;
    max-width: 980px;
    padding: 56px 18px 18px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.igm-hero-gallery.gt-memes-active .hero-memes-panel {
    display: flex;
}

.hero-presentation-panel {
    display: none;
    width: 100%;
    max-width: 1040px;
    padding: 56px 18px 18px;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
}

.igm-hero-gallery.gt-presentations-active .hero-presentation-panel {
    display: flex;
}

.hero-assets-panel {
    display: none;
    width: 100%;
    max-width: 1080px;
    padding: 56px 18px 18px;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
}

.igm-hero-gallery.gt-assets-active .hero-assets-panel {
    display: flex;
}

.hero-artifacts-panel {
    display: none;
    width: 100%;
    max-width: 1080px;
    padding: 56px 18px 18px;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
}

.igm-hero-gallery.gt-artifacts-active .hero-artifacts-panel {
    display: flex;
}

.hero-conversation-infographic-controls {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(720px, calc(100% - 36px));
    pointer-events: auto;
}

.hero-conversation-infographic-summary {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(16, 23, 31, 0.74);
    backdrop-filter: blur(8px);
    color: #f7fbff;
    box-shadow: 0 12px 28px rgba(9, 16, 26, 0.24);
}

.hero-conversation-infographic-prompt {
    border: 1px solid rgba(219, 228, 239, 0.55);
    background: rgba(243, 247, 252, 0.94);
    color: #28425f;
    border-radius: 999px;
    min-height: 42px;
    padding: 0 14px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(16, 24, 36, 0.14);
}

.hero-conversation-infographic-prompt:hover {
    background: rgba(232, 239, 248, 0.98);
}

.hero-conversation-infographic-summary:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.hero-conversation-infographic-title {
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-conversation-infographic-meta {
    font-size: 0.76rem;
    color: rgba(236, 243, 251, 0.82);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-conversation-infographic-nav {
    border: 1px solid rgba(219, 228, 239, 0.55);
    background: rgba(243, 247, 252, 0.94);
    color: #28425f;
    border-radius: 999px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(16, 24, 36, 0.14);
}

.hero-videos-panel {
    display: none;
    width: 100%;
    padding: 56px 18px 18px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    overflow: auto;
}

.igm-hero-gallery.gt-videos-active .hero-videos-panel {
    display: flex;
}

.hero-nearby-panel {
    display: none;
    width: 100%;
    padding: 56px 18px 18px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    overflow: auto;
}

.igm-hero-gallery.gt-nearby-active .hero-nearby-panel {
    display: flex;
}

.hero-conversation-workspace-content .hero-nearby-panel {
    display: flex;
    padding: 0;
    min-height: 0;
    flex: 1 1 auto;
}

.hero-app-analysis-panel {
    display: none;
    width: 100%;
    max-width: 1480px;
    padding: 56px 18px 18px;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
    color: #183252;
}

.igm-hero-gallery.gt-app-analysis-active .hero-app-analysis-panel {
    display: flex;
}

.hero-app-run-panel {
    display: none;
    width: 100%;
    max-width: 1040px;
    padding: 56px 18px 18px;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
    color: #183252;
}

.igm-hero-gallery.gt-analysis-active .hero-app-run-panel {
    display: flex;
}

.hero-app-updates-panel {
    display: none;
    width: 100%;
    max-width: 1040px;
    padding: 56px 18px 18px;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
    color: #183252;
}

.igm-hero-gallery.gt-updates-active .hero-app-updates-panel {
    display: flex;
}

.hero-project-panel {
    display: none;
    width: 100%;
    max-width: 1120px;
    padding: 56px 18px 18px;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
    color: #183252;
}

.igm-hero-gallery.gt-project-plan-active .hero-project-plan-panel,
.igm-hero-gallery.gt-project-items-active .hero-project-items-panel,
.igm-hero-gallery.gt-project-apps-active .hero-project-apps-panel {
    display: flex;
}

.hero-project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.hero-project-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #17365c;
}

.hero-project-subtitle {
    margin-top: 4px;
    font-size: 0.86rem;
    color: #586a86;
    line-height: 1.4;
}

.hero-project-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.hero-project-badge {
    border-radius: 999px;
    border: 1px solid #c8d6ea;
    background: #f2f7ff;
    color: #476081;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 9px;
    text-transform: capitalize;
}

.hero-project-form-grid,
.hero-project-item-list,
.hero-project-app-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.hero-project-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-project-field.is-wide {
    grid-column: 1 / -1;
}

.hero-project-field-label,
.hero-project-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #415672;
    letter-spacing: 0.01em;
}

.hero-project-input,
.hero-project-textarea,
.hero-project-select {
    width: 100%;
    border: 1px solid #c9d7ea;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #173252;
    font-size: 0.92rem;
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hero-project-input:focus,
.hero-project-textarea:focus,
.hero-project-select:focus {
    border-color: #6d8fc0;
    box-shadow: 0 0 0 3px rgba(109, 143, 192, 0.14);
}

.hero-project-textarea {
    resize: vertical;
    min-height: 84px;
}

.hero-project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.hero-project-item-card,
.hero-project-app-card,
.hero-project-section {
    border: 1px solid #d8e2f0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 28px rgba(24, 50, 82, 0.08);
    padding: 14px;
}

.hero-project-item-card.is-composer {
    background: linear-gradient(180deg, rgba(245, 249, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.hero-project-inline-grid,
.hero-project-section-head {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
}

.hero-project-section-head {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 10px;
}

.hero-project-empty {
    border: 1px dashed #c7d6ea;
    border-radius: 14px;
    background: rgba(247, 250, 255, 0.92);
    color: #59708e;
    font-size: 0.9rem;
    line-height: 1.45;
    padding: 16px;
}

.hero-project-app-title {
    font-size: 1rem;
    font-weight: 700;
    color: #183252;
}

.hero-project-app-meta,
.hero-project-app-description {
    font-size: 0.84rem;
    color: #5a6d89;
    line-height: 1.4;
}

.hero-project-inline-progress {
    min-height: 0;
}

@media (max-width: 900px) {
    .hero-project-form-grid,
    .hero-project-inline-grid {
        grid-template-columns: 1fr;
    }

    .hero-project-header {
        flex-direction: column;
    }

    .hero-project-badges {
        justify-content: flex-start;
    }
}

.hero-app-run-widget-host {
    min-height: 460px;
}

.hero-app-run-widget-host .ccw-container {
    min-height: 460px;
}

.hero-analysis-run-intro {
    font-size: 0.88rem;
    line-height: 1.55;
    color: #4d6585;
}

.hero-analysis-run-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.hero-analysis-run-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid #d7e4f5;
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
    box-shadow: 0 10px 28px rgba(14, 28, 45, 0.08);
}

.hero-analysis-run-card.is-selected {
    border-color: #9db7da;
    box-shadow: 0 14px 34px rgba(14, 28, 45, 0.12);
}

.hero-analysis-run-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.hero-analysis-run-card-selector {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.hero-analysis-run-card-selector:focus-visible {
    outline: 2px solid #5d78d4;
    outline-offset: 4px;
    border-radius: 10px;
}

.hero-analysis-run-card-title-block {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-analysis-run-card-title {
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.35;
    color: #183252;
}

.hero-analysis-run-card-meta {
    font-size: 0.78rem;
    line-height: 1.45;
    color: #5b7291;
}

.hero-analysis-run-card-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dce8f7;
    color: #27486f;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-analysis-run-preview {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #5f7695;
}

.hero-analysis-run-widget-host {
    min-height: 460px;
    border-radius: 14px;
    overflow: hidden;
    background: #101927;
    border: 1px solid #1f3147;
}

.hero-analysis-run-widget-host .ccw-container {
    min-height: 460px;
}

.hero-app-analysis-heading {
    font-size: 1rem;
    font-weight: 800;
    color: #183252;
}

.hero-app-updates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hero-app-analysis-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-app-analysis-meta-item {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e6eef9;
    color: #35506e;
    font-size: 0.76rem;
    font-weight: 700;
}

.hero-app-analysis-status,
.hero-app-analysis-error,
.hero-app-analysis-empty,
.hero-app-analysis-summary {
    border-radius: 14px;
    padding: 14px 16px;
    line-height: 1.5;
}

.hero-app-analysis-status {
    background: #edf5ff;
    border: 1px solid #c8ddfb;
    color: #214a80;
    font-size: 0.84rem;
    font-weight: 700;
}

.hero-app-analysis-status.is-warning {
    background: #fff8eb;
    border-color: #efcf9f;
    color: #8b5a12;
}

.hero-app-analysis-status.is-error,
.hero-app-analysis-error {
    background: #fff1f1;
    border: 1px solid #efc0c0;
    color: #8e1e1e;
}

.hero-app-analysis-error,
.hero-app-analysis-empty {
    font-size: 0.87rem;
}

.hero-app-analysis-empty {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #d5dfed;
    color: #35506e;
}

.hero-app-analysis-summary {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    border: 1px solid #cad8eb;
    color: #183252;
    font-size: 0.92rem;
    white-space: pre-wrap;
}

.hero-app-analysis-key-points {
    margin: 0;
    padding: 14px 16px 14px 34px;
    display: grid;
    gap: 8px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    border: 1px solid #cad8eb;
    border-radius: 14px;
    color: #183252;
    font-size: 0.88rem;
}

.hero-app-analysis-key-points li::marker {
    color: #4b678f;
}

.hero-app-analysis-progress {
    border: 1px solid #cad8eb;
    border-radius: 16px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    box-shadow: 0 14px 32px rgba(39, 70, 109, 0.08);
}

.hero-app-analysis-progress:empty {
    display: none;
}

.hero-app-analysis-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-app-analysis-diagram {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: clamp(420px, 70vh, 860px);
    border: 1px solid #cad8eb;
    border-radius: 16px;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
    box-shadow: 0 14px 32px rgba(39, 70, 109, 0.08);
}

.hero-app-analysis-diagram-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hero-app-analysis-diagram-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hero-app-analysis-diagram-btn {
    border: 1px solid #cad8eb;
    border-radius: 999px;
    padding: 8px 12px;
    background: #f7faff;
    color: #21405d;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.hero-app-analysis-diagram-btn:hover {
    background: #ecf3ff;
    border-color: #a9bfdc;
}

.hero-app-analysis-diagram-btn.is-active {
    background: #35598a;
    border-color: #35598a;
    color: #fff;
}

.hero-app-analysis-diagram-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #5b7291;
    font-size: 0.8rem;
    line-height: 1.45;
}

.hero-app-analysis-diagram-viewport {
    flex: 1;
    min-height: 340px;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid rgba(156, 180, 209, 0.55);
    background:
        radial-gradient(circle at top left, rgba(89, 122, 168, 0.09), transparent 28%),
        linear-gradient(180deg, #fbfdff 0%, #edf3fb 100%);
    cursor: grab;
}

.hero-app-analysis-diagram-viewport.is-dragging {
    cursor: grabbing;
}

.hero-app-analysis-diagram-stage {
    position: relative;
    min-width: 100%;
    margin: 0 auto;
}

.hero-app-analysis-diagram-render-host {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
}

.hero-app-analysis-diagram svg {
    display: block;
    max-width: none;
    margin: 0;
}

.hero-app-analysis-diagram .dn-container {
    min-height: 0;
    box-sizing: border-box;
}

body.hb-diagram-pan-active {
    user-select: none;
}

.hero-app-updates-list {
    display: grid;
    gap: 14px;
}

.hero-app-update-card {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 248, 253, 0.98) 100%);
    border: 1px solid #cad8eb;
    box-shadow: 0 12px 28px rgba(39, 70, 109, 0.08);
}

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

.hero-app-update-title-wrap {
    min-width: 0;
}

.hero-app-update-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    color: #183252;
}

.hero-app-update-meta {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #5a6e8d;
}

.hero-app-update-summary {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #28435f;
}

.hero-app-update-highlights {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 8px;
    color: #183252;
}

.hero-app-update-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-app-update-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #edf3fb;
    color: #35506e;
    font-size: 0.76rem;
    font-weight: 700;
}

.hero-app-update-chip.is-warning {
    background: #fff2d8;
    color: #8a5a00;
}

.hero-app-update-chip.is-info {
    background: #e4f3ff;
    color: #155180;
}

.hero-app-update-note {
    font-size: 0.83rem;
    line-height: 1.5;
    color: #35506e;
}

.hero-app-update-raw {
    border-top: 1px solid rgba(202, 216, 235, 0.9);
    padding-top: 10px;
}

.hero-app-update-raw summary {
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    color: #27466d;
}

.hero-app-update-raw pre {
    margin: 10px 0 0;
    padding: 12px;
    border-radius: 12px;
    background: #142033;
    color: #ecf4ff;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
}

.hero-nearby-empty {
    font-size: 0.88rem;
    color: #52627f;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 12px;
    padding: 14px;
}

.hero-meme-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff8e9 0%, #f7efe0 100%);
    border: 1px solid #e1d3b5;
    box-shadow: 0 10px 24px rgba(87, 64, 25, 0.08);
}

.hero-meme-caption {
    font-size: 0.9rem;
    font-weight: 700;
    color: #4d3f27;
}

.hero-meme-meta {
    font-size: 0.8rem;
    color: #7a6743;
}

.hero-meme-image {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    background: #fff;
    border: 1px solid #dccdaf;
    cursor: zoom-in;
}

.hero-meme-status,
.hero-memes-empty {
    font-size: 0.88rem;
    color: #6b5a39;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 14px;
}

.hero-videos-heading {
    font-size: 0.95rem;
    font-weight: 700;
    color: #27466d;
    margin-bottom: 14px;
}

.hero-media-carousel-stage {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.hero-media-carousel-nav {
    border: 1px solid #c8d1e1;
    background: #eef2f8;
    color: #29405f;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hero-media-carousel-card-host {
    min-width: 0;
}

.hero-media-carousel-counter {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #6a7b92;
    text-align: center;
}

.hero-video-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    width: 100%;
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f6f9ff 0%, #edf3fb 100%);
    border: 1px solid #cad8eb;
    box-shadow: 0 10px 24px rgba(39, 70, 109, 0.08);
}

.hero-video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #dce7f5;
    border: 1px solid #c8d6e6;
}

.hero-video-player,
.hero-video-thumb-link {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-video-player {
    border: 0;
    background: #000;
}

.hero-video-thumb-link {
    color: inherit;
    text-decoration: none;
}

.hero-video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-video-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.hero-video-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #183252;
}

.hero-video-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: #dce9fb;
    color: #214a80;
    font-size: 0.74rem;
    font-weight: 700;
}

.hero-video-meta {
    font-size: 0.8rem;
    color: #56708f;
}

.hero-video-description {
    font-size: 0.83rem;
    line-height: 1.45;
    color: #35506e;
}

.hero-video-open-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 4px;
    color: #214a80;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.hero-video-open-link:hover {
    text-decoration: underline;
}

.hero-video-status,
.hero-videos-empty {
    font-size: 0.88rem;
    color: #35506e;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 12px;
    padding: 14px;
}

.hero-media-task-progress {
    margin-bottom: 12px;
    max-width: 340px;
}

.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-wrapper {
    margin-top: 0;
}

.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-wrapper.visible {
    width: 100%;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-track {
    height: 6px !important;
    border-radius: 999px;
}

.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-fill {
    border-radius: 999px;
}

.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-title,
.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-info,
.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-model,
.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-branding,
.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-debug-btn,
.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-cancel-btn,
.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-logs-container,
.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-debug-panel,
.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-workflow,
.hero-media-task-progress[data-compact-llm-progress="true"] .llm-progress-retry {
    display: none !important;
}

.hero-assets-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.hero-artifacts-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.hero-assets-lead,
.hero-assets-empty,
.hero-artifacts-empty,
.hero-asset-description {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #35506e;
    background: rgba(255, 255, 255, 0.78);
    border-radius: 14px;
    padding: 14px 16px;
}

.hero-assets-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.hero-artifacts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.hero-asset-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(246, 250, 255, 0.98) 0%, rgba(237, 243, 251, 0.96) 100%);
    border: 1px solid #cad8eb;
    box-shadow: 0 14px 28px rgba(39, 70, 109, 0.08);
}

.hero-conversation-artifact-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98) 0%, rgba(239, 245, 252, 0.96) 100%);
    border: 1px solid #cad8eb;
    box-shadow: 0 14px 28px rgba(39, 70, 109, 0.08);
}

.hero-asset-meta {
    font-size: 0.82rem;
    color: #56708f;
}

.hero-presentation-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.hero-presentation-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-presentation-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #183252;
}

.hero-presentation-meta {
    font-size: 0.82rem;
    color: #56708f;
}

.hero-presentation-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e5eefb;
    color: #214a80;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: capitalize;
}

.hero-presentation-badge[data-status="completed"] {
    background: #ddf3e6;
    color: #17653d;
}

.hero-presentation-badge[data-status="failed"] {
    background: #fde6e5;
    color: #a3362f;
}

.hero-presentation-summary,
.hero-presentation-description,
.hero-presentation-error,
.hero-presentation-empty {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #35506e;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 14px;
    padding: 14px 16px;
}

.hero-presentation-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(230, 240, 252, 0.92) 0%, rgba(241, 247, 255, 0.92) 100%);
    border: 1px solid rgba(130, 164, 209, 0.38);
}

.hero-presentation-progress-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.hero-presentation-progress-label {
    font-size: 0.86rem;
    font-weight: 700;
    color: #23456a;
}

.hero-presentation-progress-value {
    font-size: 0.8rem;
    font-weight: 800;
    color: #345c8a;
}

.hero-presentation-progress-track {
    position: relative;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(125, 156, 201, 0.2);
}

.hero-presentation-progress-fill {
    position: relative;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4e86c3 0%, #78b4ff 100%);
}

.hero-presentation-progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0.05) 100%);
    transform: translateX(-100%);
    animation: hero-presentation-progress-sheen 1.8s linear infinite;
}

.hero-presentation-progress-detail {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #4d6787;
}

.hero-conversation-artifact-status {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #35506e;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 14px;
    padding: 14px 16px;
}

.hero-conversation-artifact-status-error {
    color: #8f2f29;
    background: #fff0ef;
    border: 1px solid #f4c9c5;
}

.hero-conversation-artifact-student-state {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #21405d;
    background: rgba(226, 238, 251, 0.72);
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(167, 192, 222, 0.75);
}

.hero-conversation-artifact-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.hero-conversation-artifact-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(202, 216, 235, 0.9);
}

.hero-conversation-artifact-section-heading,
.hero-conversation-artifact-list-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #183252;
}

.hero-conversation-artifact-section-summary {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #4d6786;
}

.hero-conversation-artifact-bullets,
.hero-conversation-artifact-focus-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #244665;
    font-size: 0.84rem;
    line-height: 1.45;
}

.hero-conversation-artifact-list-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(202, 216, 235, 0.9);
}

.hero-presentation-error {
    color: #8f2f29;
    background: #fff0ef;
    border: 1px solid #f4c9c5;
}

.hero-presentation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-presentation-link {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 12px;
    background: #214a80;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.hero-presentation-link:hover {
    background: #18365d;
}

.hero-presentation-slides {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.hero-presentation-slide {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f6f9ff 0%, #edf3fb 100%);
    border: 1px solid #cad8eb;
    box-shadow: 0 10px 24px rgba(39, 70, 109, 0.08);
}

.hero-presentation-slide-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #56708f;
}

.hero-presentation-slide-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #183252;
}

.hero-presentation-slide-lines {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #2e4b6b;
    font-size: 0.82rem;
}

.hero-presentation-slide-narration {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #56708f;
}

@keyframes hero-presentation-progress-sheen {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

@media (max-width: 768px) {
    .hero-media-carousel-stage {
        grid-template-columns: 1fr;
    }

    .hero-media-carousel-card-host {
        order: 1;
    }

    .hero-media-carousel-nav {
        width: 44px;
        height: 44px;
    }

    .hero-conversation-infographic-controls {
        width: calc(100% - 20px);
        top: 48px;
        gap: 8px;
    }

    .hero-entry-infographic-item {
        inset: 108px 12px 18px;
    }

    .hero-conversation-infographic-nav {
        width: 40px;
        height: 40px;
    }

    .hero-conversation-infographic-prompt {
        min-height: 40px;
        padding: 0 12px;
    }

    .hero-conversation-infographic-summary {
        padding: 9px 12px;
    }

    .hero-media-carousel-stage .hero-media-carousel-nav:first-child {
        order: 2;
        justify-self: start;
    }

    .hero-media-carousel-stage .hero-media-carousel-nav:last-child {
        order: 3;
        justify-self: end;
        margin-top: -44px;
    }

    .hero-presentation-header,
    .hero-assets-header {
        flex-direction: column;
    }

    .hero-presentation-progress-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

.igm-hero-gallery.gt-app-analysis-active .tutor-presentation-panel,
.igm-hero-gallery.gt-analysis-active .tutor-presentation-panel {
    display: none !important;
}

.graphtutor-app .message.tutor .media-strip {
    display: none !important;
}

@media (max-width: 980px) {
    .hero-app-run-widget-host,
    .hero-app-run-widget-host .ccw-container,
    .hero-analysis-run-widget-host,
    .hero-analysis-run-widget-host .ccw-container {
        min-height: 360px;
    }
}

/* ── Status bar ──────────────────────────────────────────── */
#status-bar {
    height: 28px;
    padding: 0 16px 0 var(--infra-badge-width, 120px); /* avoid infra-inject version badge */
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1e2127;
    border-top: 1px solid #333;
    flex-shrink: 0;
    font-size: 0.78rem;
    color: #777;
    position: relative;
    z-index: 20;
}

#bg-task-progress {
    display: inline-block;
    min-width: 0;
    position: relative;
}

#bg-task-progress .llm-progress-wrapper {
    margin-top: 0;
}

#bg-task-progress:not(.is-expanded) .llm-progress-wrapper.visible {
    width: clamp(150px, 18vw, 240px);
    max-width: 240px;
    padding: 4px 6px;
    border: 1px solid #3f4756;
    border-radius: 8px;
    background: #252a34;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

#bg-task-progress:not(.is-expanded) .llm-progress-track {
    height: 6px;
    border-radius: 999px;
}

#bg-task-progress:not(.is-expanded) .llm-progress-fill {
    border-radius: 999px;
}

#bg-task-progress:not(.is-expanded) .llm-progress-title,
#bg-task-progress:not(.is-expanded) .llm-progress-info,
#bg-task-progress:not(.is-expanded) .llm-progress-model,
#bg-task-progress:not(.is-expanded) .llm-progress-branding,
#bg-task-progress:not(.is-expanded) .llm-progress-debug-btn,
#bg-task-progress:not(.is-expanded) .llm-progress-cancel-btn,
#bg-task-progress:not(.is-expanded) .llm-progress-logs-container,
#bg-task-progress:not(.is-expanded) .llm-progress-debug-panel,
#bg-task-progress:not(.is-expanded) .llm-progress-workflow,
#bg-task-progress:not(.is-expanded) .llm-progress-retry {
    display: none !important;
}

#bg-task-progress.is-expanded {
    z-index: 45;
}

#bg-task-progress.is-expanded .llm-progress-wrapper.visible {
    position: absolute;
    right: 0;
    bottom: 34px;
    width: min(520px, calc(100vw - 32px));
    max-height: min(62vh, 560px);
    overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid #495364;
    border-radius: 10px;
    background: rgba(20, 24, 32, 0.98);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
    cursor: default;
}

#status-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Shared style for all status-bar action buttons */
#status-actions .gt-btn-text {
    height: 22px;
    padding: 0 8px;
    font-size: 0.72rem;
    line-height: 1;
    border: 1px solid #454b57;
    color: #a7adba;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

#status-actions .gt-btn-text:hover:not(:disabled) {
    border-color: #6a7180;
    color: #d3d8e3;
}

#status-actions .gt-btn-text:disabled {
    opacity: 0.65;
    cursor: wait;
}

#status-actions .gt-btn-text.is-open {
    background: rgba(124, 140, 245, 0.12);
    border-color: #7385eb;
    color: #d6dcff;
}

#btn-bg-activity.has-active {
    border-color: #4b8b63;
    color: #a5e6bc;
}

#bg-activity-panel {
    position: absolute;
    right: 12px;
    bottom: 34px;
    width: min(560px, calc(100vw - 28px));
    max-height: min(58vh, 520px);
    display: flex;
    flex-direction: column;
    border: 1px solid #3f4654;
    border-radius: 10px;
    background: rgba(20, 23, 30, 0.97);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
    overflow: hidden;
}

.bg-activity-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #353c4a;
    background: #212633;
}

.bg-activity-title {
    font-size: 0.78rem;
    color: #d7def0;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.bg-activity-refresh {
    justify-self: end;
    font-size: 0.68rem;
    color: #8f9cb7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-activity-close {
    border: none;
    background: transparent;
    color: #aebad6;
    font-size: 1.05rem;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}

.bg-activity-close:hover {
    color: #f2f6ff;
}

.bg-activity-summary {
    padding: 7px 10px;
    font-size: 0.7rem;
    color: #9dabc7;
    border-bottom: 1px solid #303847;
    background: #1b1f29;
}

.bg-activity-list {
    overflow-y: auto;
    min-height: 70px;
    max-height: min(52vh, 430px);
    background: #171b24;
}

.bg-activity-empty {
    padding: 10px;
    font-size: 0.74rem;
    color: #8f9bb3;
}

.bg-activity-item {
    padding: 8px 10px 9px;
    border-bottom: 1px solid #2a3140;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bg-activity-item:last-child {
    border-bottom: none;
}

.bg-activity-item.status-failed {
    background: rgba(130, 36, 36, 0.16);
}

.bg-activity-item.status-running {
    background: rgba(60, 96, 156, 0.12);
}

.bg-activity-item.status-pending {
    background: rgba(100, 118, 150, 0.1);
}

.bg-activity-item.status-completed {
    background: rgba(46, 96, 66, 0.12);
}

.bg-activity-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bg-activity-item-title {
    font-size: 0.76rem;
    font-weight: 600;
    color: #d9e0f4;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bg-activity-item-status {
    flex-shrink: 0;
    font-size: 0.66rem;
    color: #93a3c2;
    text-transform: lowercase;
}

.bg-activity-item-detail {
    font-size: 0.7rem;
    line-height: 1.35;
    color: #b2bfd8;
}


/* ── Hide tutor.js debug panels on graph page ────────────── */
body.graphtutor-app #statusChecklist,
body.graphtutor-app #modelBadge {
    display: none !important;
}

body.graphtutor-app .conversation-round-search-match {
    outline: 1px solid rgba(102, 126, 234, 0.35);
    border-radius: 10px;
}

body.graphtutor-app mark.conversation-search-hit {
    background: #ffe082;
    color: #22252b;
    border-radius: 3px;
    padding: 0 2px;
}

/* ── Spinner (used by tutor.js) ──────────────────────────── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ── Utility ─────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    body.graphtutor-app {
        --hb-chat-drawer-width: min(76vw, 300px);
    }

    .hero-conversation-workspace {
        padding: 12px;
    }

    .hero-conversation-workspace-shell {
        border-radius: 18px;
    }

    .hero-conversation-workspace-header {
        padding: 12px 12px 10px;
    }

    .hero-conversation-workspace-body {
        padding: 0 12px 12px;
    }

    .hero-conversation-workspace-transcript #chatContainer {
        padding: 14px 0 12px;
    }

    .hero-conversation-workspace-composer #responseGroup {
        padding-top: 12px;
    }

    #app-header .header-left {
        flex: 1;
        min-width: 0;
    }

    #app-header .header-left h1 {
        font-size: 1.05rem;
    }

    #app-header .header-center {
        order: 3;
        flex: 1 1 100%;
        font-size: 0.75rem;
        line-height: 1.2;
    }

    #app-header .header-right {
        gap: 6px;
    }

    #toolbar .hb-chat-rail-toggle {
        padding: 8px 10px;
        order: 0;
    }

    #user-email {
        max-width: 40vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.75rem;
    }

    #infra-app-shell-root.infra-app-shell-graphtutor .hb-shell-session-badge {
        max-width: 48vw;
        font-size: 0.74rem;
    }

    #toolbar {
        flex-wrap: wrap;
        align-items: stretch;
        gap: 6px;
        padding: 8px 10px;
    }

    #concept-input {
        order: 1;
        flex: 1 1 100%;
        max-width: unset;
        min-width: 0;
    }

    .node-create-actions {
        order: 2;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 6px;
    }

    #btn-create-concept,
    #btn-create-project,
    #btn-toggle-essay {
        flex: 1 1 auto;
        min-height: 36px;
    }

    .essay-create-panel {
        padding: 10px;
    }

    #essay-input {
        min-height: 220px;
    }

    .essay-create-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .gt-toolbar-toggle {
        order: 3;
        flex: 1 1 auto;
        justify-content: center;
        min-height: 36px;
    }

    #btn-view-prompts {
        order: 4;
        flex: 1 1 auto;
        min-height: 36px;
    }

    #topic-prep-container {
        order: 5;
        flex: 1 1 100%;
        min-width: 0;
        max-width: unset;
    }

    #topic-prep-progress {
        min-width: 0;
    }

    #topic-ready-btn {
        max-width: unset;
    }

    #similar-warning {
        padding: 8px 10px;
        flex-wrap: wrap;
        row-gap: 6px;
    }

    #main-area {
        min-height: 0;
        padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    }

    #app-chat-sidebar {
        width: var(--hb-chat-drawer-width);
    }

    #graph-container,
    #graph-container svg {
        touch-action: none;
    }

    #status-bar {
        height: auto;
        min-height: 54px;
        padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
        flex-wrap: wrap;
        gap: 6px;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
    }

    body.graphtutor-app.hb-chat-rail-open #status-bar {
        left: var(--hb-chat-drawer-width);
        width: calc(100% - var(--hb-chat-drawer-width));
    }

    #status-actions {
        order: 1;
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }

    #status-text {
        order: 2;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #status-actions .gt-btn-text {
        height: 28px;
        padding: 0 10px;
        font-size: 0.78rem;
        flex-shrink: 0;
    }

    #bg-activity-panel {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: calc(58px + env(safe-area-inset-bottom, 0px));
        max-height: 56vh;
    }

    .recent-nodes-panel {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: calc(58px + env(safe-area-inset-bottom, 0px));
        max-height: 56vh;
    }

    #bg-task-progress {
        flex: 1;
        min-width: 0;
    }

    #bg-task-progress:not(.is-expanded) .llm-progress-wrapper.visible {
        width: 100%;
        max-width: unset;
    }

    #bg-task-progress.is-expanded .llm-progress-wrapper.visible {
        right: 0;
        left: 0;
        width: auto;
        bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    }

    .gt-prompts-modal-backdrop {
        padding: 8px;
    }

    .gt-prompts-modal {
        max-height: 96vh;
    }

    .gt-prompts-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Activity Log Panel ──────────────────────────────────────────────── */
.activity-log-panel {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 340px;
    max-height: 360px;
    overflow-y: auto;
    background: #1e2127;
    border: 1px solid #3f4756;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
    z-index: 100;
    font-size: 12px;
}
.activity-log-loading,
.activity-log-empty {
    padding: 16px;
    text-align: center;
    color: #777;
}
.activity-log-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}
.activity-log-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 10px;
    color: #bbb;
    line-height: 1.4;
}
.activity-log-item:hover {
    background: #282c34;
}
.activity-log-icon {
    flex-shrink: 0;
    width: 14px;
    text-align: center;
    color: #667eea;
    font-weight: bold;
}
.activity-log-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.activity-log-time {
    flex-shrink: 0;
    color: #555;
    font-size: 11px;
}

.recent-nodes-panel {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: min(420px, calc(100vw - 24px));
    max-height: 420px;
    overflow-y: auto;
    background: #1e2127;
    border: 1px solid #3f4756;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.42);
    z-index: 101;
    font-size: 12px;
}

.recent-nodes-loading,
.recent-nodes-empty {
    padding: 16px;
    text-align: center;
    color: #777;
}

.recent-nodes-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.recent-nodes-item {
    width: 100%;
    border: none;
    background: transparent;
    color: inherit;
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid rgba(63, 71, 86, 0.55);
}

.recent-nodes-item:last-child {
    border-bottom: none;
}

.recent-nodes-item:hover,
.recent-nodes-item:focus-visible {
    background: #282c34;
    outline: none;
}

.recent-nodes-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.recent-nodes-item-title {
    flex: 1;
    min-width: 0;
    color: #d9deea;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-nodes-item-type {
    flex-shrink: 0;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f3f6ff;
    background: #46506b;
}

.recent-nodes-item-type.type-concept {
    background: #485a8c;
}

.recent-nodes-item-type.type-project {
    background: #5f546d;
}

.recent-nodes-item-type.type-platform2040-app {
    background: #5f4b38;
}

.recent-nodes-item-type.type-disambiguation {
    background: #44685b;
}

.recent-nodes-item-meta {
    color: #8f98ad;
    font-size: 11px;
}

.recent-nodes-item-description {
    color: #b6bdcb;
    font-size: 12px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tutor-codebase-task {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #d7e4f5;
    border-radius: 10px;
    background: #f7fbff;
}

.tutor-codebase-task[data-task-kind="edit"] {
    border-color: #cddfb9;
    background: #f8fcf1;
}

.tutor-codebase-task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.tutor-codebase-task-title {
    font-size: 12px;
    font-weight: 700;
    color: #1f3b63;
}

.tutor-codebase-task[data-task-kind="edit"] .tutor-codebase-task-title {
    color: #35511c;
}

.tutor-codebase-task-status {
    font-size: 11px;
    color: #4b6284;
    text-transform: capitalize;
}

.tutor-codebase-task-query {
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: #23364f;
}

.tutor-codebase-task-note {
    font-size: 12px;
    line-height: 1.5;
    color: #516885;
}

.tutor-codebase-task-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tutor-codebase-task-open-btn {
    appearance: none;
    border: 1px solid #b7cae4;
    border-radius: 999px;
    padding: 6px 12px;
    background: #ffffff;
    color: #1f3b63;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.tutor-codebase-task-open-btn:hover:not(:disabled) {
    background: #edf4fb;
}

.tutor-codebase-task-open-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.tutor-codebase-task-widget {
    min-height: 140px;
}

.tutor-codebase-task-error {
    font-size: 12px;
    color: #9a2d2d;
}
