/* Shared type tokens, quiet chrome; a cloud/bolt + status distinguishes a hosted
   execution workspace from a folder and an ordinary conversational Session. */
#sidebar .wl-section { margin-bottom: 20px; }
#sidebar .wl-section-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 6px; }
#sidebar .wl-section-head > button { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0; color: var(--type-muted); font-size: var(--type-caption-size) !important; line-height: var(--type-caption-line) !important; background: none; border: 0; }
#sidebar .wl-section-head > .wl-add { width: 24px; height: 24px; justify-content: center; font-size: var(--type-section-size) !important; border-radius: 6px; }
#sidebar .wl-section-head button:hover { color: #7951b0; background: #eee8f6; }
#sidebar .wl-chevron { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 12px; width: 12px; height: 12px; }
#sidebar .wl-chevron svg { display: block; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#sidebar [data-wl="collapse"][aria-expanded="true"] .wl-chevron svg { transform: rotate(90deg); }
#sidebar :is(.wl-row,.wl-agent) { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 10px; text-align: left; background: transparent; border: 0; border-radius: 8px; color: #514b5c; font-weight: 400; min-width: 0; margin: 2px 0; }
#sidebar :is(.wl-row,.wl-agent):hover { background: #f0ecf5; }
#sidebar :is(.wl-row,.wl-agent).is-selected { background: #eee7f7; color: #7048a5; }
#sidebar .wl-row > span:not(.wl-session-icon) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.wl-row svg, .wl-session-icon { width: 16px; height: 16px; flex: 0 0 16px; color: #93869f; }
.wl-row time { margin-left: auto; white-space: nowrap; font-size: var(--type-caption-size); color: var(--type-muted); }
#sidebar .wl-project-head { display: flex; align-items: center; min-width: 0; gap: 2px; }
#sidebar .wl-project-head > .wl-row { flex: 1; width: auto; padding-inline: 4px; }
#sidebar :is(.wl-project-toggle,.wl-project-add) { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 22px; width: 22px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--type-muted); cursor: pointer; }
#sidebar :is(.wl-project-toggle,.wl-project-add):hover { background: #eee8f6; color: #7951b0; }
#sidebar .wl-project-add { font-size: var(--type-section-size); }
#sidebar .wl-project-children { margin-left: 12px; padding-left: 9px; border-left: 1px solid #e8e3ef; }
#sidebar .wl-project-children:empty { display: none; }
#sidebar .wl-project-children .wl-session { padding: 7px 6px; gap: 6px; }
#sidebar .wl-agent { padding-block: 9px; }
.wl-agent b { font-weight: 500; display: block; font-size: var(--type-body-size); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-agent > span:last-child { min-width: 0; }
.wl-agent small { display: block; color: #63776c; font-size: var(--type-caption-size); line-height: var(--type-caption-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-agent:has(.is-pending) small { color: #947448; }
.wl-cloud { position: relative; color: #688c7c; flex: 0 0 22px; width: 22px; height: 24px; }
.wl-cloud svg { width: 22px; height: 22px; }
.wl-cloud.is-running { display: inline-flex; align-items: center; justify-content: center; }
.wl-running-spinner { display: block; width: 18px; height: 18px; box-sizing: border-box; border: 2px solid rgba(104,140,124,.22); border-top-color: #688c7c; border-right-color: #688c7c; border-radius: 50%; animation: wl-spin 1.2s linear infinite; }
.wl-cloud i { width: 5px; height: 5px; border-radius: 50%; background: #57a580; position: absolute; right: 0; top: 0; box-shadow: 0 0 0 2px #faf9fc; }
.wl-cloud.is-pending { color: #aa8553; }
.wl-cloud.is-pending i { background: #bd935b; }
.ha-rule-notice { background: #fcf7ed; border: 1px solid #efe0c8; border-radius: 8px; color: #8c6a3b; padding: 10px 12px; margin-top: 12px; font-size: var(--type-caption-size); }
#sidebar .wl-empty { font-size: var(--type-caption-size); line-height: var(--type-caption-line); color: var(--type-muted); padding: 0 10px; margin: 5px 0; }
.wl-session-icon.is-working svg { color: #8b61bd; animation: wl-spin 2s linear infinite; }
@keyframes wl-spin { to { transform: rotate(360deg); } }
.main .fm-page.ha-page { container: hosted / inline-size; color: var(--type-text); }
.ha-page button { cursor: pointer; }
.ha-page p { line-height: var(--type-body-line); margin: 12px 0; }
.ha-page .fm-page-head h1 { font-size: var(--type-section-size); line-height: var(--type-section-line); }
.ha-page :is(h2,h3) { margin: 0; }
.ha-agent-intro { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.ha-agent-intro > div { flex: 1; min-width: 0; }
.ha-agent-intro b { font-weight: 500; }
.ha-agent-intro small { display: block; color: var(--type-muted); margin-top: 3px; }
.ha-cloud-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #eee8f5; color: #926dbb; flex: 0 0 40px; }
.ha-cloud-mark svg { width: 26px; height: 26px; }
.ha-status, .ha-offline { display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; padding: 3px 7px; color: #795799; background: #f1edf6; font-size: var(--type-caption-size); line-height: var(--type-caption-line); white-space: nowrap; }
.ha-status.positive { color: #34775f; background: #edf6f1; }
.ha-status.warning { color: #95703f; background: #fbf4e9; }
.ha-status.muted, .ha-offline { color: #777181; background: #f1eff4; }
.ha-source { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--type-muted); font-size: var(--type-caption-size); line-height: var(--type-caption-line); }
.ha-source button.fm-btn { padding: 3px 9px; font-size: var(--type-caption-size) !important; line-height: var(--type-caption-line) !important; min-height: 28px; }
#ha-connection-result:not(:empty) { padding: 8px 0; }
.ha-tabs { display: flex; overflow-x: auto; gap: 22px; border-bottom: 1px solid #e8e3ed; margin: 18px 0 24px; }
.ha-tabs button { padding: 10px 0; white-space: nowrap; border: 0; border-bottom: 2px solid transparent; color: var(--type-muted); background: none; }
.ha-tabs button[aria-selected="true"] { color: #8054b1; border-bottom-color: #9668c4; }
.ha-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; margin: 0 0 24px; }
.ha-metric { min-width: 0; }
.ha-metric > span { display: block; color: var(--type-muted); font-size: var(--type-caption-size); }
.ha-metric strong { display: block; font-size: var(--type-page-size); line-height: var(--type-page-line); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 7px 0 3px; }
.ha-metric small { display: block; color: var(--type-muted); font-size: var(--type-caption-size); }
.ha-gain { color: #34816c; }
.ha-loss { color: #bf6069; }
.ha-card { background: #fff; border: 1px solid #eae5ef; border-radius: 12px; padding: 20px; margin-bottom: 20px; min-width: 0; }
.ha-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.ha-card-head .fm-btn { flex-shrink: 0; }
.ha-decision { border: 1px solid #e7dff0; border-radius: 12px; background: linear-gradient(120deg,#f7f3fb,#fcfbfd); padding: 22px; margin-bottom: 22px; }
.ha-eyebrow { display: block; color: #8a789e; font-size: var(--type-caption-size); line-height: var(--type-caption-line); margin-bottom: 9px; }
.ha-decision-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 9px; }
.ha-decision-head .ha-eyebrow { margin: 0; }
.ha-decision-link { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 3px 0; border: 0; border-radius: 4px; background: transparent; color: #7951a5; font: inherit; font-size: var(--type-caption-size); line-height: var(--type-caption-line); font-weight: 500; white-space: nowrap; }
.ha-decision-link svg { width: 14px; height: 14px; flex: 0 0 14px; }
.ha-decision-link:hover { color: #603687; text-decoration: underline; text-underline-offset: 3px; }
.ha-decision-link:focus-visible { outline: 2px solid #a17bd1; outline-offset: 4px; }
.ha-decision p { color: #665c73; }
.ha-decision-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.ha-decision-footer > span { display: flex; align-items: center; gap: 7px; color: #857492; font-size: var(--type-caption-size); }
.ha-decision-footer svg { width: 17px; height: 17px; }
.ha-checks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px 32px; }
.ha-checks > div { display: grid; grid-template-columns: 1fr auto; gap: 4px; }
.ha-checks small { grid-column: 1/-1; color: var(--type-muted); }
.ha-checks b { font-weight: 500; }
.ha-two-col { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.ha-record { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid #f0edf3; }
.ha-record:last-child { border-bottom: 0; }
.ha-record b { font-weight: 500; }
.ha-record small { display: block; color: var(--type-muted); }
.ha-record > :last-child { text-align: right; }
.ha-fund-link, .ha-text-btn { display: inline-flex; align-items: center; color: #7e55a6; border: 0; background: none; padding: 0; text-align: left; }
.ha-text-btn { display: block; }
.ha-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.ha-filter button { border: 1px solid transparent; background: none; color: var(--type-muted); border-radius: 6px; padding: 5px 10px; }
.ha-filter button[aria-pressed="true"] { background: #eee7f6; color: #784fa5; }
.ha-timeline { list-style: none; padding: 0; margin: 20px 0 0; }
.ha-timeline li { display: grid; grid-template-columns: 85px 1fr; gap: 20px; padding: 0 0 24px; }
.ha-timeline li > div { border-left: 1px solid #e7def0; padding-left: 20px; }
.ha-timeline time { font-size: var(--type-caption-size); color: var(--type-muted); padding-top: 4px; }
.ha-timeline h3 { margin-top: 10px; }
.ha-timeline p { margin-bottom: 8px; color: #6e6579; }
.ha-order-links { display: flex; flex-wrap: wrap; gap: 8px; }
.ha-order-links:empty { display: none; }
.ha-muted, .ha-footnote { color: var(--type-muted); font-size: var(--type-caption-size); line-height: var(--type-caption-line); }
.ha-table-wrap { max-width: 100%; overflow-x: auto; }
.ha-table { width: 100%; min-width: 550px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ha-table :is(td,th) { padding: 13px 10px; text-align: right; border-bottom: 1px solid #efebf3; white-space: nowrap; font-weight: 400; }
.ha-table :is(td,th):first-child { text-align: left; padding-left: 0; }
.ha-table thead th { color: var(--type-muted); font-size: var(--type-caption-size); }
.ha-table small { display: block; font-size: var(--type-caption-size); color: var(--type-muted); }
.ha-table tr:last-child > * { border-bottom: 0; }
.ha-chart { width: 100%; max-height: 210px; display: block; }
.ha-chart-meta { display: flex; justify-content: space-between; color: var(--type-muted); font-size: var(--type-caption-size); }
.ha-chart-meta b { color: #7d55a6; font-weight: 500; }
.ha-allocation { display: grid; grid-template-columns: 140px 1fr 45px; align-items: center; gap: 16px; margin: 18px 0; }
.ha-allocation > div { height: 6px; background: #f3eff7; border-radius: 6px; overflow: hidden; }
.ha-allocation i { display: block; height: 100%; background: #a98bc9; border-radius: inherit; }
.ha-allocation b { font-weight: 500; text-align: right; }
.ha-card summary { color: #7d55a6; cursor: pointer; margin-top: 16px; }
.wl-questions { padding-left: 20px; margin-bottom: 0; color: #6e6478; }
.wl-questions li { padding: 7px 0; }
.wl-project-session { display: flex; justify-content: space-between; gap: 20px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #eee9f3; padding: 14px 0; color: var(--type-text); }
.wl-project-session:hover { color: #7c52ab; }
.wl-project-session time { color: var(--type-muted); font-size: var(--type-caption-size); white-space: nowrap; }
@container hosted (max-width: 760px) { .ha-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; } .ha-two-col { grid-template-columns: 1fr; gap: 0; } }
@container hosted (max-width: 460px) { .ha-card { padding: 16px; } .ha-checks { grid-template-columns: 1fr; } .ha-tabs { gap: 16px; } .ha-agent-intro { flex-wrap: wrap; } .ha-allocation { grid-template-columns: 100px 1fr 40px; gap: 10px; } .ha-timeline li { gap: 8px; grid-template-columns: 66px 1fr; } .ha-decision-footer { flex-wrap: wrap; } }
@media (max-width: 680px) { #sidebar #workspace-library { display: none; } }
@media (prefers-reduced-motion: reduce) { .wl-session-icon.is-working svg, .wl-running-spinner { animation: none; } }
