:root {
    --bg: #f4f1ea;
    --paper: #fffdf9;
    --line: #d8cfbf;
    --line-strong: #bfb29b;
    --text: #1c1b18;
    --muted: #6c675f;
    --accent: #0d6c63;
    --accent-2: #b75f2d;
    --ok: #1f7a4f;
    --pending: #b5760f;
    --fail: #b53535;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #f7f4ed 0%, #efe7d9 100%);
    color: var(--text);
    font-family: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.5;
}

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

a:hover {
    text-decoration: underline;
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}

button.plain-button {
    background: transparent;
    color: var(--accent);
    border-color: rgba(13, 108, 99, 0.22);
}

button:hover,
.button-link:hover {
    opacity: 0.92;
    text-decoration: none;
}

.ghost-button,
.button-link.secondary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.button-link.is-active-filter {
    background: rgba(13, 108, 99, 0.12);
    color: var(--accent);
    border-color: rgba(13, 108, 99, 0.25);
}

input,
textarea,
select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    color: var(--text);
    font: inherit;
}

textarea {
    resize: vertical;
}

.topbar {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(28, 27, 24, 0.08);
    background: rgba(255, 253, 249, 0.88);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.session-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(28, 27, 24, 0.08);
    color: var(--muted);
    font-size: 13px;
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 700;
}

.tag,
.pill {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(13, 108, 99, 0.12);
    color: var(--accent);
    font-size: 12px;
}

.pill.alt {
    background: rgba(183, 95, 45, 0.12);
    color: var(--accent-2);
}

.main-nav,
.session-box,
.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.actions.stacked {
    flex-direction: column;
    align-items: flex-start;
}

.page-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 22px 40px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.page-shell.narrow {
    max-width: 820px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-panel,
.card,
.login-panel {
    background: var(--paper);
    border: 1px solid rgba(28, 27, 24, 0.08);
    border-radius: 22px;
    box-shadow: 0 12px 36px rgba(96, 73, 40, 0.08);
}

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

.hero-panel {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    background:
            radial-gradient(circle at top right, rgba(13, 108, 99, 0.08), transparent 32%),
            radial-gradient(circle at bottom left, rgba(183, 95, 45, 0.08), transparent 28%),
            var(--paper);
}

.chat-console-page {
    max-width: 1600px;
    min-height: calc(100vh - 76px);
}

.chat-console-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 0 2px 0;
    margin-bottom: 8px;
}

.chat-console-title h1,
.chat-console-title p {
    margin: 0;
}

.chat-console-title h1 {
    font-size: 22px;
    line-height: 1.1;
    font-weight: 700;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.ops-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ops-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(28, 27, 24, 0.08);
}

.ops-chip-label {
    color: var(--muted);
    font-size: 11px;
}

.ops-chip strong {
    font-size: 13px;
}

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

.chat-console-actions .button-link {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
}

body.chat-ops-page .topbar {
    padding: 12px 18px;
    gap: 14px;
}

body.chat-ops-page .brand {
    gap: 8px;
}

body.chat-ops-page .brand a {
    font-size: 15px;
}

body.chat-ops-page .main-nav {
    gap: 12px;
    font-size: 14px;
}

body.chat-ops-page .main-nav a:first-child {
    display: none;
}

body.chat-ops-page .session-box {
    gap: 8px;
}

body.chat-ops-page .session-box .ghost-button {
    min-height: 34px;
    padding: 0 12px;
}

.chat-console-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: stretch;
    min-height: calc(100vh - 170px);
}

.chat-stage {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 170px);
    max-height: calc(100vh - 170px);
    padding: 0;
    overflow: hidden;
}

.chat-stage-head,
.chat-stage-foot {
    padding: 16px 18px;
}

.chat-stage-head {
    border-bottom: 1px solid rgba(28, 27, 24, 0.08);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.chat-lane {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) 32px minmax(0, 1fr);
    gap: 10px;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(28, 27, 24, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,243,235,0.88));
}

.chat-lane-node {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-lane-node strong {
    font-size: 15px;
}

.chat-lane-label {
    color: var(--muted);
    font-size: 12px;
}

.chat-lane-separator {
    align-self: center;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(13,108,99,0.22), rgba(183,95,45,0.22));
}

.chat-thread {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    background:
            radial-gradient(circle at top right, rgba(13, 108, 99, 0.04), transparent 28%),
            linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,240,231,0.92));
    overflow: auto;
}

.chat-process-stream {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.chat-process-panel {
    width: min(86%, 900px);
    align-self: flex-start;
    border-radius: 14px;
    border: 1px solid rgba(28, 27, 24, 0.08);
    background: rgba(108, 103, 95, 0.05);
    overflow: hidden;
}

.chat-process-panel > summary {
    list-style: none;
}

.chat-process-panel > summary::-webkit-details-marker {
    display: none;
}

.chat-process-summary-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto 16px;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--muted);
}

.chat-process-panel[open] .chat-process-summary-bar {
    border-bottom: 1px solid rgba(28, 27, 24, 0.08);
}

.chat-process-summary-bar::after {
    content: "▸";
    justify-self: end;
    color: var(--muted);
    transition: transform 0.18s ease;
}

.chat-process-panel[open] .chat-process-summary-bar::after {
    transform: rotate(90deg);
}

.chat-process-kicker {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.chat-process-inline-step {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.chat-process-inline-status,
.chat-process-inline-time,
.chat-process-inline-hint {
    font-size: 12px;
    color: var(--muted);
}

.chat-process-group-head {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    padding: 0 2px;
}

.chat-process-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.chat-process-list.semantic {
    padding-bottom: 8px;
}

.chat-process-row.semantic {
    background: rgba(13, 108, 99, 0.05);
}

.chat-process-row.current {
    background: rgba(13, 108, 99, 0.06);
}

.chat-process-summary.semantic-static {
    cursor: default;
}

.chat-process-body.semantic-inline {
    padding-top: 0;
}

.chat-process-row {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(28, 27, 24, 0.08);
    background: rgba(108, 103, 95, 0.05);
    overflow: hidden;
}

.chat-process-row.is-active {
    border-color: rgba(13, 108, 99, 0.24);
    background: rgba(13, 108, 99, 0.07);
}

.chat-process-detail > summary {
    list-style: none;
}

.chat-process-detail > summary::-webkit-details-marker {
    display: none;
}

.chat-process-summary {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 9px 12px;
    cursor: pointer;
}

.chat-process-summary strong {
    font-size: 13px;
    line-height: 1.2;
}

.chat-process-body {
    padding: 0 12px 12px;
}

.chat-process-detail:not([open]) .chat-process-body {
    display: none;
}

.chat-debug-panel {
    margin: 0 10px 10px;
    border-top: 1px dashed rgba(28, 27, 24, 0.12);
    padding-top: 10px;
}

.chat-debug-panel > summary {
    cursor: pointer;
    list-style: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.chat-debug-panel > summary::-webkit-details-marker {
    display: none;
}

.chat-debug-panel > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.18s ease;
}

.chat-debug-panel[open] > summary::before {
    transform: rotate(90deg);
}

.chat-thread-empty,
.response-empty,
.timeline-empty {
    padding: 18px;
    border: 1px dashed rgba(28, 27, 24, 0.14);
    border-radius: 18px;
    background: rgba(255,255,255,0.72);
    color: var(--muted);
}

.chat-thread-empty p,
.response-empty p,
.timeline-empty p {
    margin: 10px 0 0;
}

.chat-message {
    max-width: min(82%, 820px);
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(28, 27, 24, 0.08);
    background: rgba(255,255,255,0.95);
    box-shadow: 0 8px 18px rgba(96, 73, 40, 0.06);
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(180deg, rgba(13,108,99,0.14), rgba(13,108,99,0.08));
    border-color: rgba(13,108,99,0.18);
}

.chat-message.assistant {
    align-self: flex-start;
    background: linear-gradient(180deg, rgba(183,95,45,0.12), rgba(183,95,45,0.06));
    border-color: rgba(183,95,45,0.16);
}

.chat-message.system {
    align-self: center;
    background: rgba(108, 103, 95, 0.08);
    border-color: rgba(108, 103, 95, 0.12);
}

.chat-message-content {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font: inherit;
}

.chat-stage-foot {
    border-top: 1px solid rgba(28, 27, 24, 0.08);
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px;
    gap: 10px;
    align-items: end;
}

.chat-composer-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.composer-label {
    font-size: 12px;
    color: var(--muted);
}

.chat-composer textarea {
    min-height: 44px;
    max-height: 72px;
    resize: vertical;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.4;
}

.chat-composer button {
    min-height: 44px;
}

body.chat-ops-page .chat-composer textarea::placeholder {
    color: rgba(108, 103, 95, 0.9);
}

.chat-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 86px;
    max-height: calc(100vh - 98px);
    overflow: hidden;
}

.response-live-card,
.response-timeline-card {
    padding: 16px 18px;
}

.response-live-card {
    padding: 14px 16px;
    background:
            radial-gradient(circle at top right, rgba(13, 108, 99, 0.08), transparent 38%),
            var(--paper);
}

.response-live-card {
    flex: 0 0 auto;
}

.section-header {
    margin-bottom: 10px;
}

.section-header h2 {
    margin: 0;
    font-size: 17px;
}

.section-header .subtle {
    margin: 4px 0 0;
    font-size: 12px;
}

.detail-list.compact div {
    grid-template-columns: 64px 1fr;
    gap: 8px;
}

.response-metrics {
    gap: 4px;
    font-size: 13px;
}

.result-output {
    margin-top: 10px;
}

.result-output > summary {
    cursor: pointer;
    color: var(--muted);
    font-weight: 600;
}

.output-block {
    margin-top: 10px;
    max-height: 140px;
}

.live-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(13, 108, 99, 0.12);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.live-chip::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    animation: pulse-live 1.2s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.85);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

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

.grid-three {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 16px;
}

.subtle,
small {
    color: var(--muted);
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(31, 122, 79, 0.1);
    border-color: rgba(31, 122, 79, 0.2);
}

.alert-error,
.field-error {
    color: var(--fail);
}

.alert-error {
    background: rgba(181, 53, 53, 0.1);
    border-color: rgba(181, 53, 53, 0.2);
}

.field-error {
    display: block;
    margin-top: 6px;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.toolbar-title h1,
.toolbar-title h2,
.toolbar-title p {
    margin: 0;
}

.toolbar-title p {
    margin-top: 6px;
}

.filter-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric-card {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(28, 27, 24, 0.08);
}

.metric-card strong {
    display: block;
    font-size: 26px;
    line-height: 1.1;
    margin-bottom: 6px;
}

.summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.summary-chip {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(28, 27, 24, 0.08);
    color: var(--muted);
    font-size: 13px;
}

.table-shell {
    overflow: hidden;
    border: 1px solid rgba(28, 27, 24, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-top: 1px solid rgba(28, 27, 24, 0.08);
    text-align: left;
    vertical-align: top;
}

thead th {
    border-top: 0;
    color: var(--muted);
    font-weight: 600;
    background: rgba(247, 242, 231, 0.8);
}

.status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.status-ok {
    background: rgba(31, 122, 79, 0.12);
    color: var(--ok);
}

.status-pending {
    background: rgba(181, 118, 15, 0.12);
    color: var(--pending);
}

.status-fail {
    background: rgba(181, 53, 53, 0.12);
    color: var(--fail);
}

.status-muted,
.status-unknown {
    background: rgba(108, 103, 95, 0.12);
    color: var(--muted);
}

.code-block,
.message-content {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #f7f2e7;
    font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

.code-block.compact {
    max-height: 360px;
    overflow: auto;
}

.code-block-label {
    display: block;
    margin: 12px 0 8px;
    color: var(--muted);
}

.detail-list {
    display: grid;
    gap: 10px;
}

.detail-list div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
}

.detail-list dt {
    color: var(--muted);
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.message-item {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(28, 27, 24, 0.08);
    background: rgba(255, 255, 255, 0.78);
}

.message-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 14px;
}

.event-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(13, 108, 99, 0.08);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    flex: 0 0 auto;
}

.event-time,
.event-duration {
    color: var(--muted);
    font-size: 11px;
}

.event-chip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.event-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(13, 108, 99, 0.08);
    border: 1px solid rgba(13, 108, 99, 0.12);
    color: var(--accent);
    font-size: 10px;
    line-height: 1;
}

.event-chip-raw {
    font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
    color: var(--muted);
    background: rgba(108, 103, 95, 0.08);
    border-color: rgba(108, 103, 95, 0.12);
}

.event-detail {
    margin: 8px 0 0;
    color: var(--text);
    font-size: 13px;
}

.event-meta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.event-meta {
    margin-top: 10px;
}

.event-meta summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.role-pill.user {
    background: rgba(13, 108, 99, 0.1);
    color: var(--accent);
}

.role-pill.assistant {
    background: rgba(183, 95, 45, 0.1);
    color: var(--accent-2);
}

.role-pill.system {
    background: rgba(108, 103, 95, 0.14);
    color: var(--muted);
}

.wrap {
    word-break: break-word;
}

.primary-link {
    font-weight: 600;
}

.soft-link {
    color: var(--muted);
    font-size: 13px;
}

.soft-link:hover {
    color: var(--accent);
}

.icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    border: 1px solid rgba(28, 27, 24, 0.12);
}

.gear-menu {
    position: relative;
}

.gear-menu summary {
    list-style: none;
}

.gear-menu summary::-webkit-details-marker {
    display: none;
}

.gear-menu[open] summary.icon-button {
    border-color: rgba(13, 108, 99, 0.28);
    box-shadow: 0 8px 20px rgba(13, 108, 99, 0.12);
}

.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(28, 27, 24, 0.1);
    background: var(--paper);
    box-shadow: 0 18px 40px rgba(96, 73, 40, 0.16);
    z-index: 8;
}

.menu-panel form,
.menu-panel a,
.menu-panel button {
    width: 100%;
}

.menu-panel .menu-label {
    margin: 2px 4px 8px;
    color: var(--muted);
    font-size: 12px;
}

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

.menu-item {
    justify-content: flex-start;
}

.dialog-form {
    width: min(100%, 720px);
    border: 0;
    padding: 0;
    background: transparent;
}

.dialog-form::backdrop {
    background: rgba(28, 27, 24, 0.35);
    backdrop-filter: blur(3px);
}

.dialog-card {
    background: var(--paper);
    border: 1px solid rgba(28, 27, 24, 0.08);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(64, 45, 21, 0.18);
    padding: 22px;
}

.dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.dialog-head h2,
.dialog-head p {
    margin: 0;
}

.dialog-head p {
    margin-top: 6px;
}

.dialog-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.inspector {
    border-top: 1px dashed rgba(28, 27, 24, 0.16);
    padding-top: 14px;
}

.inspector summary {
    cursor: pointer;
    color: var(--muted);
    font-weight: 600;
}

.list-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.list-entry-meta {
    min-width: 0;
}

.list-entry-meta strong,
.list-entry-meta span {
    display: block;
}

.list-entry-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.chat-shell {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 18px;
    align-items: start;
}

.chat-window {
    display: flex;
    flex-direction: column;
    min-height: 70vh;
}

.chat-feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(28, 27, 24, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(247,242,231,0.9));
    min-height: 420px;
}

.chat-bubble {
    max-width: 86%;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(28, 27, 24, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.chat-bubble.user {
    align-self: flex-end;
    background: rgba(13, 108, 99, 0.1);
    border-color: rgba(13, 108, 99, 0.18);
}

.chat-bubble.assistant {
    align-self: flex-start;
    background: rgba(183, 95, 45, 0.08);
    border-color: rgba(183, 95, 45, 0.16);
}

.chat-bubble.system {
    align-self: center;
    background: rgba(108, 103, 95, 0.08);
    border-color: rgba(108, 103, 95, 0.12);
}

.chat-bubble pre {
    margin: 8px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font: inherit;
}

.composer-card {
    position: sticky;
    top: 88px;
}

.composer-card textarea {
    min-height: 150px;
}

.aside-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(100%, 520px);
}

.login-panel {
    padding: 28px;
}

@media (max-width: 900px) {
    .grid-two,
    .grid-three,
    .metric-grid,
    .chat-shell,
    .chat-console-layout,
    .hero-panel,
    .topbar {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .session-box,
    .main-nav,
    .actions {
        flex-wrap: wrap;
    }

    .detail-list div {
        grid-template-columns: 1fr;
    }

    .chat-bubble {
        max-width: 100%;
    }

    .chat-stage,
    .chat-side {
        position: static;
        max-height: none;
        min-height: auto;
    }

    .chat-composer {
        grid-template-columns: 1fr;
    }

    .chat-message {
        max-width: 100%;
    }

    .ops-chip-row {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-console-layout {
        min-height: auto;
    }

    .menu-panel {
        left: auto;
        right: 0;
    }
}
