:root {
    color-scheme: light;
    --bg: #eef2f6;
    --rail: #141b24;
    --rail-2: #1c2633;
    --rail-3: #253142;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --ink: #172033;
    --muted: #667085;
    --line: #d8dee8;
    --line-soft: #e9edf4;
    --blue: #255ec7;
    --blue-dark: #17489f;
    --green: #0c7c59;
    --amber: #a86612;
    --danger: #b42318;
    --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    --sans: "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
    --shadow: 0 16px 34px rgba(22, 32, 51, 0.08);
    --sidebar-width: 300px;
    --sidebar-collapsed-width: 64px;
    --chat-pane-width: 44%;
    --pane-resizer-width: 10px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    overflow: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
}

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

button {
    cursor: pointer;
}

button:disabled,
textarea:disabled {
    cursor: not-allowed;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    transition: grid-template-columns 160ms ease;
}

.sidebar-collapsed .app-shell {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 16px;
    background: var(--rail);
    color: #f8fafc;
    border-right: 1px solid #0e141d;
}

.brand {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 30px;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding-bottom: 14px;
    border-bottom: 1px solid #2d3847;
}

.brand-copy {
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 7px;
    background: #f8fafc;
    color: #172033;
    font-family: var(--mono);
    font-weight: 800;
}

.brand-copy strong,
.brand-copy span {
    display: block;
}

.brand-copy strong {
    font-size: 15px;
    line-height: 1.25;
}

.brand-copy > span {
    margin-top: 2px;
    color: #aab6c7;
    font-family: var(--mono);
    font-size: 11px;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #2d3847;
    border-radius: 6px;
    background: var(--rail-2);
    color: #e5edf8;
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 800;
}

.sidebar-toggle:hover {
    background: var(--rail-3);
}

.sidebar-collapsed .sidebar {
    padding: 14px 10px;
}

.sidebar-collapsed .brand {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .history-section {
    display: none;
}

.sidebar-collapsed .sidebar-tools {
    grid-template-columns: 1fr;
}

.sidebar-collapsed #newConversationButton {
    width: 42px;
    padding: 0;
    font-size: 0;
}

.sidebar-collapsed #newConversationButton::before {
    content: "+";
    font-size: 18px;
    line-height: 1;
}

.sidebar-collapsed #refreshAgentsButton {
    width: 42px;
}

.sidebar-tools {
    display: grid;
    grid-template-columns: 1fr 38px;
    gap: 8px;
    padding: 14px 0;
    border-bottom: 1px solid #2d3847;
}

.history-section {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding-top: 14px;
}

.rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
    color: #8d9bad;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 800;
}

.rail-label {
    margin: 0;
    text-transform: uppercase;
}

.history-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 7px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 1px;
}

.history-item {
    position: relative;
    display: grid;
    gap: 5px;
    width: 100%;
    min-height: 58px;
    padding: 10px 34px 10px 11px;
    border: 1px solid #2d3847;
    border-radius: 8px;
    background: var(--rail-2);
    color: #e9eef7;
    text-align: left;
}

.history-item:hover {
    border-color: rgba(151, 189, 246, 0.72);
    background: var(--rail-3);
}

.history-item.active {
    background: #f8fafc;
    border-color: #f8fafc;
    color: #101827;
}

.history-title {
    overflow: hidden;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-meta {
    overflow: hidden;
    color: #aeb9c8;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item.active .history-meta {
    color: #667085;
}

.history-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
}

.history-remove:hover {
    background: rgba(148, 163, 184, 0.18);
    color: #fff;
}

.history-item.active .history-remove:hover {
    color: #1f2937;
}

.workspace {
    display: block;
    min-width: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: var(--panel);
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: 0;
}

.agent-ready,
.profile-current {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.agent-ready {
    background: #e8f8f1;
    color: var(--green);
}

.start-page {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    padding: 44px 22px;
    background: var(--panel-soft);
}

.start-copy {
    max-width: 840px;
    margin: 0 auto 22px;
}

.start-copy h2 {
    color: #111827;
    font-size: 28px;
    line-height: 1.25;
}

.start-copy p:last-child {
    max-width: 620px;
    margin: 10px 0 0;
    color: #667085;
    font-size: 14px;
    line-height: 1.55;
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    max-width: 840px;
    margin: 0 auto;
}

.agent-card {
    display: grid;
    gap: 12px;
    min-width: 0;
    min-height: 154px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    box-shadow: 0 2px 14px rgba(23, 32, 51, 0.04);
}

.agent-card:hover {
    border-color: #9fc0f5;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.agent-card:focus-visible,
.primary-button:focus-visible,
.file-button:focus-within,
.icon-button:focus-visible,
.sidebar-toggle:focus-visible,
.agent-switch-button:focus-visible,
.profile-bar button:focus-visible,
.surface-field-tools button:focus-visible,
.assist-chips button:focus-visible,
.narda-nav button:focus-visible,
.pane-resizer:focus-visible,
.composer textarea:focus {
    outline: 2px solid rgba(37, 94, 199, 0.2);
    outline-offset: 2px;
}

.agent-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.agent-category {
    overflow: hidden;
    color: #667085;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.agent-card strong {
    min-width: 0;
    color: #172033;
    font-size: 18px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.agent-summary {
    color: #5f6b7a;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.agent-template {
    justify-self: start;
    padding: 4px 8px;
    border: 1px solid #c7d7ef;
    border-radius: 999px;
    background: #f4f8ff;
    color: #1f4f99;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 800;
}

.chat-page {
    height: 100%;
    min-height: 0;
}

.composer-switchbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    min-height: 34px;
}

.agent-switcher {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 1px 0;
}

.agent-switch-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid #e2e5e9;
    border-radius: 7px;
    background: #fff;
    color: #6b737e;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.agent-switch-button:hover {
    border-color: #bac0c8;
    background: #f6f7f8;
}

.agent-switch-button.active {
    border-color: #b9bec6;
    background: #eceef0;
    color: #292f37;
}

.agent-switch-button:disabled:not(.active) {
    opacity: 0.55;
}

.agent-switch-empty {
    color: #667085;
    font-size: 12px;
}

.profile-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
    max-width: 42%;
    overflow-x: auto;
}

.prompt-templates {
    display: grid;
    gap: 6px;
}

.prompt-templates[data-workflow="dataon-management"] {
    max-height: min(30vh, 320px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.prompt-template {
    display: flex;
    min-width: 0;
    border: 1px solid #e2e5e9;
    border-radius: 8px;
    background: #f8fafc;
}

.prompt-template-run {
    display: grid;
    flex: 1;
    min-width: 0;
    gap: 3px;
    padding: 9px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    color: #26364a;
}

.prompt-template-run strong { font-size: 12px; }
.prompt-template-run span { font-size: 11px; line-height: 1.5; color: #667085; overflow-wrap: anywhere; }
.prompt-template-run:hover:not(:disabled) { background: #edf3fa; }
.prompt-template-edit { align-self: flex-start; margin: 7px; padding: 4px; border: 0; background: transparent; color: #51657f; font-size: 11px; }
.prompt-template button:disabled { opacity: .55; cursor: not-allowed; }

.registration-modes { display: flex; flex-shrink: 0; gap: 5px; }
.registration-modes button { padding: 7px 10px; border: 1px solid #dbe3ee; border-radius: 6px; background: #fff; color: #51657f; }
.registration-modes button[aria-pressed="true"] { background: #e9f1fb; color: #174a86; border-color: #9bbadd; }

.profile-current {
    flex: 0 0 auto;
    background: #eef4ff;
    color: #1f4f99;
}

.profile-bar button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #a7d9ca;
    border-radius: 999px;
    background: #fff;
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
}

.profile-bar button:hover {
    background: #ecfdf7;
}

.workbench-pane {
    display: grid;
    grid-template-columns: minmax(320px, min(var(--chat-pane-width), calc(100% - 320px - var(--pane-resizer-width)))) var(--pane-resizer-width) minmax(320px, 1fr);
    min-width: 0;
    height: 100%;
    min-height: 0;
}

.chat-column {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    min-height: 58px;
    padding: 12px 22px;
    border-bottom: 1px solid #eceef0;
    background: #fff;
}

.chat-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px 10px;
    width: 100%;
    min-width: 0;
}

.chat-heading h2,
.chat-heading strong {
    color: #202328;
    font-size: 15px;
    font-weight: 650;
}

#chatAgentName {
    color: #343a42;
    font-size: 14px;
    line-height: 1.5;
}

.chat-activity {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: #62676f;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
}

.chat-activity::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b2b7bd;
}

.chat-activity[data-state="running"]::before {
    background: #6c6f75;
    animation: activity-pulse 1.6s ease-in-out infinite;
}

.chat-activity[data-state="done"]::before {
    background: #258365;
}

.chat-activity[data-state="error"] {
    color: var(--danger);
}

.chat-activity[data-state="error"]::before {
    background: var(--danger);
}

.chat-scroll-area {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.latest-message-button {
    position: absolute;
    z-index: 2;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
    border-radius: 999px;
    background: #fff;
    color: #3c4149;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgb(0 0 0 / 8%);
}

.latest-message-button:hover {
    background: #f5f5f5;
}

.latest-message-button:focus-visible,
.orchestrator-summary:focus-visible,
.messages:focus-visible {
    outline: 2px solid #8a9aa9;
    outline-offset: -2px;
}

@keyframes activity-pulse {
    50% { opacity: 0.35; }
}

.pane-resizer {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    border-right: 1px solid #cbd5e1;
    border-left: 1px solid #e4e9f1;
    background: #edf2f7;
    cursor: col-resize;
    touch-action: none;
}

.pane-resizer::before {
    content: "";
    width: 8px;
    height: 46px;
    border-right: 2px solid #9aa8ba;
    border-left: 2px solid #9aa8ba;
    opacity: 0.72;
}

.pane-resizer:hover,
.pane-resizer:focus-visible {
    background: #dfe8f4;
}

.pane-resizer:hover::before,
.pane-resizer:focus-visible::before {
    border-color: #255ec7;
    opacity: 1;
}

body.pane-resizing {
    cursor: col-resize;
    user-select: none;
}

body.pane-resizing * {
    cursor: col-resize !important;
}

.orchestrator-panel {
    flex: 0 0 auto;
    align-self: stretch;
    display: block;
    min-width: 0;
    border: 1px solid #e5e7ea;
    border-radius: 10px;
    background: #fafafa;
}

.orchestrator-panel.error {
    border-color: #e9c7c3;
}

.orchestrator-summary {
    display: grid;
    grid-template-columns: 12px auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
}

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

.orchestrator-summary::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: 1px;
    border-right: 1.5px solid #747981;
    border-bottom: 1.5px solid #747981;
    transform: rotate(-45deg);
}

.orchestrator-panel[open] .orchestrator-summary::before {
    transform: rotate(45deg);
}

.orchestrator-status {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 1px 6px;
    border-radius: 5px;
    background: #eceeef;
    color: #5e646c;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.orchestrator-status.running {
    background: #eeeff1;
    color: #424850;
}

.orchestrator-status.done {
    background: #edf5f0;
    color: #357457;
}

.orchestrator-status.error {
    background: #fff0ee;
    color: var(--danger);
}

.orchestrator-title {
    min-width: 0;
    color: #3c4149;
    font-size: 12px;
    font-weight: 550;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.orchestrator-detail {
    margin: 0;
    color: #646b74;
    font-size: 12px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.orchestrator-elapsed {
    color: #767b83;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.orchestrator-body {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 0 14px 14px 31px;
}

.orchestrator-steps {
    display: grid;
    gap: 0;
}

.orchestrator-steps span {
    position: relative;
    min-width: 0;
    padding: 6px 0 6px 22px;
    color: #7b8087;
    font-size: 12px;
    line-height: 1.5;
}

.orchestrator-steps span::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 10px;
    left: 1px;
    width: 9px;
    height: 9px;
    border: 1px solid #cdd1d6;
    border-radius: 50%;
    background: #fafafa;
}

.orchestrator-steps span:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 20px;
    bottom: -8px;
    left: 5px;
    border-left: 1px solid #e0e3e6;
}

.orchestrator-steps span.complete {
    color: #56685e;
}

.orchestrator-steps span.complete::before {
    border-color: #6b987e;
    background: #6b987e;
}

.orchestrator-steps span.active {
    color: #343940;
    font-weight: 650;
}

.orchestrator-steps span.active::before {
    border-color: #575f68;
    background: #575f68;
    box-shadow: 0 0 0 3px #e9ebee;
}

.orchestrator-steps span.error {
    color: var(--danger);
}

.orchestrator-steps span.error::before {
    border-color: var(--danger);
    background: var(--danger);
}

.orchestrator-history {
    min-width: 0;
    padding-top: 12px;
    border-top: 1px solid #e8eaed;
}

.orchestrator-history-title {
    display: block;
    color: #676d75;
    font-size: 11px;
    font-weight: 600;
}

.orchestrator-events {
    display: grid;
    gap: 9px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.orchestrator-events li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 2px 8px;
    min-width: 0;
}

.orchestrator-event-time,
.orchestrator-event-offset {
    color: #757b84;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.orchestrator-event-time {
    grid-column: 1 / -1;
}

.orchestrator-event-text {
    min-width: 0;
    color: #4d555f;
    font-size: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.control-surface {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    background: #f2f5f8;
}

.viewer-tabs {
    display: flex;
    min-width: 0;
    max-width: 100%;
    align-items: end;
    gap: 4px;
    height: 40px;
    padding: 6px 9px 0;
    background: #dce3ed;
}

.viewer-agent-tabs {
    flex: 0 1 auto;
    min-width: 0;
}

.viewer-agent-tabs:empty { display: none; }
.viewer-browser-tabs {
    flex: 1;
    min-width: min(50%, 180px);
}

.viewer-tabs-hint {
    align-self: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #526070;
    font-size: 12px;
}

.viewer-agent-tab:disabled { cursor: default; opacity: .6; }
.viewer-agent-tab:focus-visible { outline: 2px solid #356be6; outline-offset: -2px; }
.viewer-run-tab { padding-right: 12px; }
.viewer-agent-icon { background: #51647e; }
.narda-browser-host, .narda-conversation-browser { min-height: 0; min-width: 0; height: 100%; overflow: hidden; }
.security-browser-host, .security-conversation-browser { min-height: 0; min-width: 0; height: 100%; overflow: hidden; }

.control-canvas {
    min-height: 0;
    overflow: auto;
    padding: 14px;
}

.control-canvas.dataon-canvas {
    padding: 0;
    background: #f4f4f4;
}

.dataon-screen.af-form-pane {
    container-type: inline-size;
    min-width: 0;
    min-height: 100%;
    border: 0;
    background: #f4f4f4;
    color: #555;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 300;
    box-shadow: none;
}

.dataon-screen.af-form-pane a {
    color: inherit;
    text-decoration: none;
}

.dataon-screen.af-form-pane button {
    cursor: pointer;
    font-family: inherit;
}

.dataon-screen.af-form-pane input,
.dataon-screen.af-form-pane textarea,
.dataon-screen.af-form-pane select {
    font-family: inherit;
    font-size: 14px;
}

.dataon-screen.af-form-pane .blind {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.dataon-screen.af-form-pane .dataon-register-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 18px 60px;
}

.dataon-screen.af-form-pane .brick {
    margin-bottom: 8px;
    border: 1px solid #e1e2e2;
    background: #fff;
}

.dataon-screen.af-form-pane .data_form_inner {
    padding: 15px 28px;
}

.dataon-screen.af-form-pane .inner_h3 {
    margin: 0 0 14px;
    padding-left: 12px;
    border-left: 4px solid #17448b;
    color: #111;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.dataon-screen.af-form-pane .collection-title {
    margin-bottom: 0;
    padding-left: 0;
    border: 0;
    font-size: 17px;
}

.dataon-screen.af-form-pane .collection-title span {
    color: #276bd7;
}

.dataon-screen.af-form-pane .d_f_title_box {
    margin: 20px 0 4px;
    padding: 0 0 6px;
    border-bottom: 2px solid #414141;
}

.dataon-screen.af-form-pane .d_f_title_box h4 {
    display: inline;
    margin: 0;
    color: #222;
    font-size: 19px;
    font-weight: 700;
}

.dataon-screen.af-form-pane .d_f_title_box h4.pointer {
    cursor: pointer;
}

.dataon-screen.af-form-pane .d_f_title_box h4.pointer::after {
    content: " ▲";
    color: #666;
    font-size: 12px;
}

.dataon-screen.af-form-pane .d_f_title_box h4.collapsed::after {
    content: " ▼";
}

.dataon-screen.af-form-pane .d_f_title_box > span {
    margin-left: 10px;
    color: #666;
    font-size: 13px;
}

.dataon-screen.af-form-pane .asterisk_t {
    color: #e05000;
    font-size: 13px;
    font-style: normal;
}

.dataon-screen.af-form-pane .add_item_box {
    position: relative;
    margin-top: 8px;
    padding: 14px 0;
    border-bottom: 2px solid #ddd;
}

.dataon-screen.af-form-pane .add_item_box h5 {
    margin: 6px 0 0 10px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.8;
}

.dataon-screen.af-form-pane .item_info_wrap {
    margin-left: 160px;
    padding-right: 10px;
}

.dataon-screen.af-form-pane .item_info_box {
    border: 1px solid #ddd;
}

.dataon-screen.af-form-pane .add_row {
    padding: 12px;
}

.dataon-screen.af-form-pane .a_i_row {
    padding: 0;
}

.dataon-screen.af-form-pane .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.dataon-screen.af-form-pane .d_f_item {
    padding: 0 12px;
}

.dataon-screen.af-form-pane .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.dataon-screen.af-form-pane .col-lg-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.dataon-screen.af-form-pane .col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.dataon-screen.af-form-pane .d_f_i_title {
    float: left;
    clear: left;
    width: 140px;
    padding-top: 10px;
}

.dataon-screen.af-form-pane .d_f_i_title label {
    color: #444;
    font-size: 13px;
    font-weight: 500;
}

.dataon-screen.af-form-pane .d_label_t {
    font-size: 13px;
}

.dataon-screen.af-form-pane .d_f_i_int {
    min-height: 40px;
    margin-left: 145px;
    padding: 6px 0;
}

.dataon-screen.af-form-pane .row-clear {
    clear: both;
}

.dataon-screen.af-form-pane input[type="text"],
.dataon-screen.af-form-pane input[type="email"] {
    height: 38px;
    padding: 0 0 0 8px;
    border: 1px solid #d8d8d8;
    border-radius: 0;
    outline: none;
    background: #fcfbfb;
    color: #111;
}

.dataon-screen.af-form-pane input[type="text"]:focus,
.dataon-screen.af-form-pane input[type="email"]:focus,
.dataon-screen.af-form-pane textarea:focus,
.dataon-screen.af-form-pane select:focus {
    border-color: #276bd7;
    outline: none;
}

.dataon-screen.af-form-pane input[readonly] {
    background: #f0f0f0;
    color: #888;
}

.dataon-screen.af-form-pane textarea {
    width: 100%;
    min-height: 90px;
    padding: 8px;
    resize: vertical;
    border: 1px solid #d8d8d8;
    border-radius: 0;
    outline: none;
    background: #fcfbfb;
    color: #111;
}

.dataon-screen.af-form-pane select {
    height: 38px;
    padding: 0 8px;
    border: 1px solid #d8d8d8;
    border-radius: 0;
    outline: none;
    background: #fcfbfb;
    color: #111;
}

.dataon-screen.af-form-pane .d_f_i_int input[type="text"],
.dataon-screen.af-form-pane .d_f_i_int input[type="email"],
.dataon-screen.af-form-pane .d_f_i_int select,
.dataon-screen.af-form-pane .d_f_i_int textarea {
    width: 100%;
}

.dataon-screen.af-form-pane .panel_radio_wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 16px;
    margin-bottom: 4px;
}

.dataon-screen.af-form-pane .panel_radio_wrap input[type="radio"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #276bd7;
}

.dataon-screen.af-form-pane .panel_radio_wrap label {
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

.dataon-screen.af-form-pane .code-radio {
    display: flex;
    flex-wrap: wrap;
    padding: 4px 0;
}

.dataon-screen.af-form-pane .detail-border {
    margin-top: 6px;
    padding: 10px 0;
    border-top: 1px solid #eee;
    text-align: center;
}

.dataon-screen.af-form-pane .relation-content.collapsed {
    display: none;
}

.dataon-screen.af-form-pane .tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 38px;
    padding: 3px 6px;
    border: 1px solid #d8d8d8;
    background: #fcfbfb;
    cursor: text;
}

.dataon-screen.af-form-pane .tag-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 2px;
    background: #276bd7;
    color: #fff;
    font-size: 12px;
}

.dataon-screen.af-form-pane .tag-item button {
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    font-size: 13px;
}

.dataon-screen.af-form-pane .tag-input-wrap > input {
    min-width: 80px;
    height: 28px;
    border: 0;
    outline: none;
    background: transparent;
    color: #111;
    font-size: 14px;
}

.dataon-screen.af-form-pane .inline-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.dataon-screen.af-form-pane .inline-row label {
    color: #555;
    font-size: 13px;
    white-space: nowrap;
}

.dataon-screen.af-form-pane .email-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.dataon-screen.af-form-pane .email-wrap input[type="text"] {
    flex: 1;
    min-width: 80px;
    height: 38px;
}

.dataon-screen.af-form-pane .email-at {
    color: #666;
    font-size: 15px;
}

.dataon-screen.af-form-pane .ai-recommendation {
    margin-top: 6px;
    padding: 10px 14px;
    border: 1px dashed #b0c0e0;
    background: #f2f4fb;
}

.dataon-screen.af-form-pane .ai-recommendation__header {
    margin-bottom: 4px;
    color: #4a5fa0;
    font-size: 13px;
    font-weight: 700;
}

.dataon-screen.af-form-pane .ai-recommendation__placeholder-text {
    color: #8090b0;
    font-size: 12px;
}

.dataon-screen.af-form-pane .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
}

.dataon-screen.af-form-pane .btn-dark-sm {
    height: 34px;
    padding: 0 12px;
    border: 1px solid #333;
    border-radius: 2px;
    background: #444;
    color: #fff;
    font-size: 12px;
}

.dataon-screen.af-form-pane .btn-outline-sm {
    height: 34px;
    padding: 0 12px;
    border: 1px solid #aaa;
    border-radius: 2px;
    background: #fff;
    color: #333;
    font-size: 12px;
}

.dataon-screen.af-form-pane .normal_bt,
.dataon-screen.af-form-pane .primary_bt,
.dataon-screen.af-form-pane .btn-danger-bt {
    min-width: 110px;
    height: 40px;
    border-radius: 0;
    color: #fff;
    font-size: 14px;
}

.dataon-screen.af-form-pane .normal_bt {
    border: 1px solid #3b3d3d;
    background: #3b3d3d;
}

.dataon-screen.af-form-pane .primary_bt {
    border: 1px solid #17448b;
    background: #17448b;
}

.dataon-screen.af-form-pane .primary_bt:hover {
    background: #0f2f6a;
}

.dataon-screen.af-form-pane .btn-danger-bt {
    border: 1px solid #a00017;
    background: #c0001a;
}

.dataon-screen.af-form-pane .license_chk_date {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.dataon-screen.af-form-pane .embargo_date_int {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}

.dataon-screen.af-form-pane .embargo_date_int input {
    width: 140px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #d8d8d8;
    background: #fcfbfb;
}

.dataon-screen.af-form-pane .d_b_upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    padding: 24px;
    border: 2px dashed #ccc;
    background: #fafafa;
    color: #aaa;
    font-size: 13px;
    text-align: center;
}

.dataon-screen.af-form-pane .upload-icon {
    display: block;
    margin-bottom: 6px;
    color: #ccc;
    font-size: 28px;
}

.dataon-screen.af-form-pane .data_bottom_box {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 24px 0 8px;
}

.dataon-screen.af-form-pane .person-label {
    margin: 6px 0 0 10px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.dataon-screen.af-form-pane .mgb_10 {
    margin-bottom: 10px;
}

.dataon-screen.af-form-pane .af-field-shell.af-pending input,
.dataon-screen.af-form-pane .af-field-shell.af-pending textarea,
.dataon-screen.af-form-pane .af-field-shell.af-pending select,
.dataon-screen.af-form-pane .af-field-shell.af-pending .tag-input-wrap {
    border-color: #276bd7;
    background: #f4f8ff;
}

.dataon-screen.af-form-pane .af-field-shell.af-low-confidence input,
.dataon-screen.af-form-pane .af-field-shell.af-low-confidence textarea,
.dataon-screen.af-form-pane .af-field-shell.af-low-confidence select,
.dataon-screen.af-form-pane .af-field-shell.af-low-confidence .tag-input-wrap {
    border-color: #e2aa4a;
    background: #fffaf0;
}

.dataon-screen.af-form-pane .af-field-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin-top: 5px;
    padding: 0 7px;
    border: 1px solid #bfe1d7;
    border-radius: 999px;
    background: #effcf7;
    color: #087455;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 800;
}

.dataon-screen.af-form-pane .af-field-shell.af-low-confidence .af-field-status {
    border-color: #f0d398;
    background: #fff8e8;
    color: #9b650d;
}

.dataon-screen.af-form-pane .af-assist-block {
    margin-top: 7px;
    padding: 8px 10px;
    border: 1px solid #dbe3ee;
    background: #fbfdff;
    color: #465366;
    font-size: 12px;
    line-height: 1.45;
}

.dataon-screen.af-form-pane .af-assist-block p {
    margin: 0 0 4px;
}

.dataon-screen.af-form-pane .af-assist-block p:last-child {
    margin-bottom: 0;
}

.dataon-screen.af-form-pane .af-assist-block .warn {
    color: #9f3915;
}

.dataon-screen.af-form-pane .af-assist-block .hint {
    color: #1f4f99;
}

.dataon-screen.af-form-pane .af-assist-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.dataon-screen.af-form-pane .af-assist-chips button {
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    color: #1f4f99;
    font-size: 12px;
    font-weight: 800;
}

.dataon-screen.af-form-pane .af-submit-status {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-right: auto;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.dataon-screen.af-form-pane .af-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #dbe3ee;
    background: #fff;
}

.dataon-screen.af-form-pane .af-toolbar-hint {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #667085;
}

.dataon-screen.af-form-pane .af-accept-all {
    flex-shrink: 0;
    min-height: 32px;
    padding: 0 14px;
    border: 1px solid #158040;
    border-radius: 5px;
    background: #1a9c4d;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.dataon-screen.af-form-pane button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.dataon-screen.af-form-pane .af-assist-anchor {
    position: relative;
}

.dataon-screen.af-form-pane .assist-icon {
    position: absolute;
    top: -10px;
    right: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #276bd7;
    border-radius: 50%;
    background: #fff;
    color: #276bd7;
    font-size: 15px;
    opacity: 0;
    pointer-events: none;
}

.dataon-screen.af-form-pane .af-assist-active > .af-assist-anchor > .assist-icon,
.dataon-screen.af-form-pane .af-assist-active > .assist-icon,
.dataon-screen.af-form-pane .assist-icon:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.dataon-screen.af-form-pane .assist-pending-ctrl {
    position: absolute;
    top: -10px;
    right: 28px;
    z-index: 2;
    display: flex;
    gap: 4px;
}

.dataon-screen.af-form-pane .assist-btn {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid;
    border-radius: 50%;
    background: #fff;
    font-size: 12px;
}

.dataon-screen.af-form-pane .assist-btn-ok { color: #158040; }
.dataon-screen.af-form-pane .assist-btn-no { color: #c0001a; }

.dataon-screen.af-form-pane .af-assist-popover {
    position: absolute;
    top: 18px;
    right: 0;
    z-index: 5;
    width: min(340px, 100%);
    max-height: 320px;
    overflow: auto;
    overflow-wrap: anywhere;
    margin-top: 0;
    padding: 10px 28px 10px 10px;
    border: 1px dashed #b0c0e0;
    border-radius: 6px;
    background: #f2f4fb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.dataon-screen.af-form-pane .assist-card-close {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px;
    border: 0;
    background: transparent;
    color: #667085;
}

.dataon-screen.af-form-pane .af-assist-popover .warn,
.dataon-screen.af-form-pane .af-assist-popover .hint {
    padding: 4px 6px;
    border: 1px solid #a9c4ec;
    border-radius: 4px;
    background: #eef4ff;
    line-height: 1.5;
}

.dataon-screen.af-form-pane .af-assist-popover .warn {
    border-color: #e6b28a;
    background: #fff4ec;
}

.dataon-screen.af-form-pane .assist-ask-input-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.dataon-screen.af-form-pane .assist-ask-input-row input {
    flex: 1;
    min-width: 0;
}

.dataon-screen.af-form-pane .assist-ask-input-row button {
    flex-shrink: 0;
    border: 1px solid #276bd7;
    border-radius: 4px;
    background: #276bd7;
    color: #fff;
    font-size: 12px;
}

.dataon-screen.af-form-pane .data_bottom_box {
    flex-wrap: wrap;
}

@container (max-width: 760px) {
    .dataon-screen.af-form-pane .dataon-register-container {
        padding: 18px 14px 56px;
    }

    .dataon-screen.af-form-pane .data_form_inner {
        padding: 14px 18px;
    }

    .dataon-screen.af-form-pane .d_f_title_box > span {
        display: block;
        margin-top: 6px;
        margin-left: 0;
    }

    .dataon-screen.af-form-pane .item_info_wrap,
    .dataon-screen.af-form-pane .d_f_i_int {
        margin-left: 0;
    }

    .dataon-screen.af-form-pane .d_f_i_title {
        float: none;
        width: 100%;
        padding-top: 4px;
    }

    .dataon-screen.af-form-pane .col-lg-6,
    .dataon-screen.af-form-pane .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.agent-screen {
    min-width: 0;
    border: 1px solid #cfd7e3;
    background: #fff;
    box-shadow: 0 5px 18px rgba(23, 32, 51, 0.06);
}

.screen-toolbar {
    position: sticky;
    top: -14px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 10px 14px;
    border-bottom: 1px solid #dfe5ee;
    background: #17448b;
    color: #fff;
}

.screen-toolbar strong {
    font-size: 14px;
}

.screen-toolbar span {
    color: #dbe8ff;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 800;
}

.surface-section {
    padding: 14px;
    border-bottom: 1px solid #e4e9f1;
}

.surface-section:last-child {
    border-bottom: 0;
}

.surface-section h3 {
    padding-left: 10px;
    border-left: 4px solid #17448b;
    color: #172033;
    font-size: 15px;
    line-height: 1.35;
    margin-bottom: 10px;
}

.surface-field {
    display: grid;
    grid-template-columns: minmax(108px, 132px) minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    min-height: 40px;
    padding: 7px 0;
    border-top: 1px solid #eef2f7;
}

.surface-field:first-of-type {
    border-top: 0;
}

.surface-field label {
    padding-top: 9px;
    color: #465366;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.surface-field input,
.surface-field textarea,
.surface-field select {
    width: 100%;
    min-width: 0;
    border: 1px solid #ccd5e1;
    border-radius: 4px;
    background: #fcfdff;
    color: #172033;
    font-size: 13px;
}

.surface-field input {
    height: 34px;
    padding: 0 9px;
}

.surface-field select {
    height: 34px;
    padding: 0 8px;
}

.surface-field textarea {
    resize: vertical;
    min-height: 72px;
    padding: 8px 9px;
    line-height: 1.45;
}

.surface-field input:focus,
.surface-field textarea:focus,
.surface-field select:focus {
    border-color: #255ec7;
    outline: 2px solid rgba(37, 94, 199, 0.14);
}

.surface-field.pending input,
.surface-field.pending textarea,
.surface-field.pending select {
    border-color: #55b793;
    background: #f0fff8;
}

.surface-field.low-confidence input,
.surface-field.low-confidence textarea,
.surface-field.low-confidence select {
    border-color: #e2aa4a;
    background: #fffaf0;
}

.surface-field-tools {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
}

.surface-field-tools button,
.assist-chips button,
.narda-nav button {
    min-height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.surface-field-tools button {
    padding: 0 8px;
}

.surface-field-tools button:hover,
.assist-chips button:hover,
.narda-nav button:hover {
    border-color: #8fb4ee;
    background: #f4f8ff;
}

.surface-field-tools button:disabled {
    opacity: 0.55;
}

.surface-field-tools .assist-request {
    border-color: #9bd4c5;
    color: var(--green);
}

.pending-meta {
    color: #0f7c5b;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.low-confidence .pending-meta {
    color: #9b650d;
}

.assist-notice {
    grid-column: 2 / -1;
    display: grid;
    gap: 7px;
    padding: 9px;
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    background: #fbfdff;
}

.assist-notice p {
    margin: 0;
    color: #465366;
    font-size: 12px;
    line-height: 1.45;
}

.assist-notice .warn {
    color: #9f3915;
}

.assist-notice .hint {
    color: #1f4f99;
}

.assist-notice .ask {
    color: #172033;
    font-weight: 800;
}

.assist-notice .reason {
    color: #667085;
}

.assist-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.assist-chips button {
    padding: 0 9px;
    color: #1f4f99;
}

.surface-empty {
    margin: 0;
    color: #667085;
    font-size: 13px;
}

.surface-gates .gate-item {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid #dfe5ee;
    border-radius: 6px;
    background: #f8fafc;
}

.surface-gates .gate-item + .gate-item {
    margin-top: 7px;
}

.surface-gates strong {
    color: #172033;
    font-size: 12px;
}

.surface-gates span {
    color: #667085;
    font-size: 12px;
    line-height: 1.45;
}

.surface-log p {
    margin: 0;
    padding: 5px 0;
    border-top: 1px solid #eef2f7;
    color: #465366;
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.45;
}

.surface-log p:first-of-type {
    border-top: 0;
}

.narda-screen {
    border-color: #c8d3de;
}

.narda-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 14px;
    border-bottom: 1px solid #dfe5ee;
    background: #f7f9fc;
}

.narda-topbar strong {
    color: #17448b;
    font-size: 17px;
    letter-spacing: 0;
}

.narda-topbar span {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.narda-body {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    min-height: 520px;
}

.narda-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-right: 1px solid #dfe5ee;
    background: #26364a;
}

.narda-nav button {
    justify-content: flex-start;
    width: 100%;
    min-height: 34px;
    padding: 0 9px;
    border-color: #43546b;
    background: #314258;
    color: #dbe4f1;
    text-align: left;
}

.narda-nav button.active {
    border-color: #1aa97a;
    background: #e9faf4;
    color: #0e7a57;
}

.narda-main {
    min-width: 0;
    background: #fff;
}

.narda-crumb {
    margin: 0;
    padding: 12px 14px 0;
    color: #667085;
    font-size: 12px;
}

.narda-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 14px 0;
}

.narda-stats span {
    display: grid;
    gap: 2px;
    min-height: 58px;
    padding: 10px;
    border: 1px solid #dfe5ee;
    background: #f8fafc;
}

.narda-stats b {
    color: #172033;
    font-size: 18px;
    line-height: 1;
}

.narda-stats small {
    color: #667085;
    font-size: 11px;
    font-weight: 800;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    scroll-padding-block: 24px;
    padding: 24px 22px 46px;
    background: #fff;
}

/* Every conversation entry keeps its content height; only this pane scrolls. */
.messages > * {
    flex: 0 0 auto;
    min-width: 0;
}

.conversation-empty {
    display: grid;
    justify-items: start;
    align-self: stretch;
    gap: 8px;
    margin: 24px 0;
    padding: 18px 0;
    color: #71767e;
    text-align: left;
    line-height: 1.7;
}

.conversation-empty strong {
    color: #32373e;
    font-size: 17px;
    font-weight: 600;
}

.conversation-empty span {
    font-size: 13px;
}

.message {
    display: grid;
    gap: 7px;
    width: 100%;
    max-width: none;
    min-width: 0;
    color: #292d33;
    font-size: 15px;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
}

.message.user {
    align-self: flex-end;
    width: auto;
    max-width: min(92%, 720px);
    padding: 12px 15px;
    border: 1px solid #eceef0;
    border-radius: 16px;
    background: #f3f4f5;
}

.message.assistant {
    align-self: stretch;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    white-space: normal;
    box-shadow: none;
}

.message.system {
    align-self: stretch;
    display: block;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: #747981;
    font-size: 12px;
    line-height: 1.65;
    box-shadow: none;
}

.message-transition {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    list-style: none;
    cursor: pointer;
    color: #777e88;
    font-size: 11px;
    line-height: 1.6;
}

.message-transition::-webkit-details-marker {
    display: none;
}

.message-transition span {
    min-width: 0;
}

.message-transition span::before {
    content: "›";
    display: inline-block;
    margin-right: 7px;
    color: #9ca2ab;
}

.message-transition-item[open] .message-transition span::before {
    transform: rotate(90deg);
}

.message-transition time {
    flex: 0 0 auto;
    color: #8c929a;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.message-transition:focus-visible {
    outline: 2px solid #8a9aa9;
    outline-offset: 3px;
    border-radius: 3px;
}

.message-transition-item .message-text {
    padding: 8px 0 0 12px;
}

.message-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    color: #767b83;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
}

.message-head span:last-child {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.message.assistant .message-head span:first-child {
    min-width: 0;
    color: #464c54;
    font-size: 12px;
    font-weight: 650;
}

.message.user .message-head {
    color: #737982;
}

.message.system .message-head {
    display: none;
}

.message-text {
    min-width: 0;
}

.codex-output {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.codex-output h3 {
    margin: 9px 0 0;
    color: #24282e;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.55;
}

.codex-output h3:first-child {
    margin-top: 0;
}

.codex-output p {
    margin: 0;
    color: #292d33;
    line-height: 1.75;
    white-space: pre-wrap;
}

.codex-output ul,
.codex-output ol {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 22px;
}

.codex-output li {
    padding-left: 2px;
    color: #292d33;
    line-height: 1.75;
}

.codex-output li::marker {
    color: #737a84;
}

.codex-output a {
    color: #32639c;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.codex-output code {
    padding: 2px 4px;
    border-radius: 4px;
    background: #f0f1f3;
    font-family: var(--mono);
    font-size: 0.86em;
}

.codex-output pre {
    min-width: 0;
    overflow-x: auto;
    margin: 0;
    padding: 13px 15px;
    border: 1px solid #e4e6e9;
    border-radius: 8px;
    background: #f7f8f9;
    color: #333b46;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.7;
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
}

.codex-output pre code {
    padding: 0;
    background: transparent;
    font-size: inherit;
}

.markdown-table-wrap {
    min-width: 0;
    overflow-x: auto;
    border: 1px solid #e3e6e9;
    border-radius: 8px;
    background: #fff;
}

.markdown-table-wrap table {
    width: 100%;
    min-width: 400px;
    border-collapse: collapse;
    font-size: 13px;
}

.markdown-table-wrap th,
.markdown-table-wrap td {
    padding: 10px 12px;
    border-bottom: 1px solid #e8eaed;
    text-align: left;
    vertical-align: top;
}

.markdown-table-wrap th {
    background: #f6f7f8;
    color: #4e5660;
    font-size: 12px;
    font-weight: 600;
}

.markdown-table-wrap td {
    color: #3c434c;
    line-height: 1.7;
}

.markdown-table-wrap tr:last-child td {
    border-bottom: 0;
}

.message-duration {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    color: #767d86;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    line-height: 1.6;
}

.composer {
    position: relative;
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px 20px 16px;
    border-top: 1px solid #eceef0;
    background: #fff;
}

.composer textarea {
    width: 100%;
    height: 84px;
    min-height: 64px;
    max-height: min(180px, 25dvh);
    resize: vertical;
    border: 1px solid #dce0e4;
    border-radius: 13px;
    padding: 12px 14px;
    background: #fafafa;
    color: #303740;
    font-size: 14px;
    line-height: 1.6;
}

.composer textarea::placeholder {
    color: #787f88;
}

.composer textarea:disabled {
    background: #f5f6f7;
    color: #747b85;
}

.composer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.composer .primary-button {
    border-radius: 8px;
    background: #25292f;
    font-weight: 600;
}

.composer .primary-button:hover {
    background: #434950;
}

.composer .file-button {
    border-color: #e2e5e9;
    border-radius: 8px;
    color: #666e78;
    font-weight: 500;
}

.primary-button,
.file-button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
}

.primary-button {
    padding: 0 13px;
    background: var(--blue);
    color: #fff;
}

.primary-button:hover {
    background: var(--blue-dark);
}

.primary-button:disabled {
    opacity: 0.55;
}

.file-button {
    padding: 0 12px;
    background: #fff;
    color: #334155;
    border-color: #cbd5e1;
}

.file-button:hover {
    background: #f8fafc;
}

.file-button.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.icon-button {
    width: 38px;
    padding: 0;
    background: var(--rail-2);
    color: #f8fafc;
    border-color: #2d3847;
    font-family: var(--mono);
    font-size: 16px;
}

.icon-button:hover {
    background: var(--rail-3);
}

.empty-state {
    margin: 0;
    color: #98a2b3;
    font-size: 13px;
}

.empty-panel {
    grid-column: 1 / -1;
    min-height: 112px;
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #667085;
    font-size: 14px;
    text-align: center;
}

@media (min-width: 861px) and (max-width: 1100px) {
    :root {
        --sidebar-width: 200px;
    }

    .sidebar {
        padding: 12px;
    }
}

@media (max-width: 860px) {
    body {
        overflow: auto;
    }

    .app-shell {
        display: block;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .sidebar-collapsed .app-shell {
        display: block;
    }

    .sidebar,
    .workspace {
        min-height: 360px;
    }

    .sidebar-collapsed .sidebar {
        min-height: auto;
    }

    .history-list {
        max-height: 260px;
    }

    .workspace {
        min-height: 640px;
        overflow: visible;
    }

    .chat-page,
    .workbench-pane {
        height: auto;
    }

    .profile-bar {
        justify-content: flex-start;
        max-width: 100%;
        width: 100%;
    }

    .composer-switchbar,
    .agent-switcher {
        width: 100%;
    }

    .composer-switchbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .workbench-pane {
        grid-template-columns: 1fr;
    }

    .pane-resizer {
        display: none;
    }

    .chat-column {
        height: max(480px, 90dvh);
        min-height: 0;
    }

    .control-surface {
        min-height: 620px;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .surface-field {
        grid-template-columns: minmax(96px, 124px) minmax(0, 1fr);
    }

    .surface-field-tools {
        grid-column: 2;
    }

    .assist-notice {
        grid-column: 1 / -1;
    }

    .dataon-screen.af-form-pane {
        min-width: 0;
    }

    .dataon-screen.af-form-pane .item_info_wrap,
    .dataon-screen.af-form-pane .d_f_i_int {
        margin-left: 0;
    }

    .dataon-screen.af-form-pane .d_f_i_title {
        float: none;
        width: 100%;
        padding-top: 4px;
    }

    .dataon-screen.af-form-pane .col-lg-6,
    .dataon-screen.af-form-pane .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .composer-actions {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .sidebar,
    .start-page,
    .chat-header,
    .messages,
    .composer {
        padding-left: 12px;
        padding-right: 12px;
    }

    .sidebar-tools {
        grid-template-columns: 1fr 36px;
    }

    .sidebar-collapsed .sidebar-tools {
        grid-template-columns: 1fr;
    }

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

    .message {
        max-width: 100%;
    }

    .surface-field,
    .narda-body {
        grid-template-columns: 1fr;
    }

    .surface-field-tools,
    .assist-notice {
        grid-column: 1;
    }

    .narda-nav {
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid #dfe5ee;
    }

    .narda-nav button {
        flex: 0 0 auto;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-shell {
        transition: none;
    }

    .chat-activity[data-state="running"]::before {
        animation: none;
    }
}
