:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  color: #191919;
  background: #f6f6f5;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible { outline: 2px solid #555; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
p { line-height: 1.5; }

.app-shell { min-height: 100vh; }
.topbar { height: 64px; border-bottom: 1px solid #eaeae9; background: #fff; }
.topbar-inner { max-width: 620px; height: 100%; padding: 0 24px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 650; letter-spacing: -.65px; }
.brand-symbol { display: block; width: 26px; height: 26px; border-radius: 7px; object-fit: cover; }
.topbar-caption { color: #8a8a8a; font-size: 11px; }
.content { max-width: 620px; padding: 28px 24px 56px; margin: auto; }

.goal-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.goal-switch label { color: #191919; font-size: 18px; font-weight: 640; letter-spacing: -.25px; white-space: nowrap; }
.goal-switch-actions { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; }
.select-wrap { position: relative; min-width: 0; }
.select-wrap select { appearance: none; max-width: 100%; min-width: 184px; padding: 10px 36px 10px 14px; border: 1px solid #dededd; border-radius: 11px; background: #fff; color: #252525; font-size: 12px; font-weight: 600; }
.select-wrap span { position: absolute; top: 50%; right: 13px; transform: translateY(-58%); pointer-events: none; color: #777; font-size: 20px; }
.goal-add-button { flex: none; padding: 11px 13px; border: 0; border-radius: 11px; background: #202020; color: #fff; font-size: 11px; font-weight: 650; }

.goal-card { background: #fff; border: 1px solid #e7e7e6; border-radius: 22px; padding: 26px 27px 23px; box-shadow: 0 8px 25px #00000006; }
.goal-card-top { display: flex; justify-content: space-between; align-items: center; }
.eyebrow { color: #777; font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.goal-card h1 { margin-top: 18px; max-width: 460px; font-size: 27px; font-weight: 660; line-height: 1.28; letter-spacing: -.7px; }
.goal-numbers { display: flex; align-items: baseline; gap: 9px; margin-top: 27px; font-variant-numeric: tabular-nums; }
.goal-numbers strong { font-size: 42px; line-height: 1; font-weight: 650; letter-spacing: -1.7px; }
.goal-numbers span { color: #8a8a8a; font-size: 13px; }
.progress-track { height: 7px; overflow: hidden; background: #ededec; border-radius: 7px; margin-top: 17px; }
.progress-track span { display: block; height: 100%; background: #202020; border-radius: inherit; transition: width .24s ease; }
.progress-caption { margin-top: 12px; font-size: 12px; font-weight: 580; }
.goal-note { margin-top: 8px; font-size: 11px; color: #8d8d8d; }
.adaptive-goal { padding-bottom: 18px; }
.adaptive-goal h1 { margin-top: 0; }
.state-pill { padding: 5px 9px; border: 1px solid #dededd; border-radius: 999px; color: #555; font-size: 10px; white-space: nowrap; }
.adaptive-summary { display: -webkit-box; max-width: 500px; margin-top: 10px; overflow: hidden; color: #666; font-size: 12px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.adaptive-module { padding: 15px 0; border-top: 1px solid #ececeb; }
.adaptive-summary + .adaptive-module { margin-top: 15px; }
.module-title { display: block; margin-bottom: 11px; color: #777; font-size: 10px; font-weight: 650; letter-spacing: .04em; }
.adaptive-module > p { color: #5f5f5f; font-size: 12px; line-height: 1.7; }
.adaptive-facts { display: grid; gap: 12px; }
.adaptive-facts > div { display: grid; grid-template-columns: minmax(72px, .35fr) minmax(0, 1fr); align-items: start; gap: 18px; }
.adaptive-facts span { color: #888; font-size: 11px; line-height: 1.6; }
.adaptive-facts strong { font-size: 12px; font-weight: 520; line-height: 1.65; }
.adaptive-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.adaptive-chips > span { padding: 6px 10px; border: 1px solid #dededd; border-radius: 999px; color: #444; font-size: 11px; }
.module-more, .hidden-count { margin-top: 10px; color: #999 !important; font-size: 10px !important; }
.metric-value { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.metric-value strong { font-size: 28px; line-height: 1; }
.metric-value span { color: #888; font-size: 11px; }
.adaptive-metric .progress-track { margin-top: 13px; height: 6px; }
.adaptive-metric > p { margin-top: 9px; color: #999; font-size: 10px; }
.adaptive-more { padding: 14px 0; border-top: 1px solid #ececeb; }
.adaptive-more summary { color: #666; font-size: 11px; cursor: pointer; }
.adaptive-more[open] summary { margin-bottom: 4px; }
.card-actions { display: flex; justify-content: flex-end; padding-top: 16px; border-top: 1px solid #ececeb; }
.goal-card > .card-actions { margin-top: 18px; }
.agent-action { min-width: 104px; padding: 10px 16px; border: 1px solid #202020; border-radius: 11px; background: #202020; color: #fff; font-size: 12px; font-weight: 600; }

.task-section, .connection-section { margin-top: 32px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-heading h2 { font-size: 18px; letter-spacing: -.25px; font-weight: 640; }
.section-heading span { color: #9a9a9a; font-size: 11px; text-align: right; }
.focus-task { padding: 23px 25px 20px; border: 1px solid #e8e8e7; border-radius: 21px; background: #fff; color: #202020; }
.focus-top { display: flex; align-items: center; justify-content: space-between; color: #888; font-size: 11px; }
.task-chip { border: 1px solid #dededd; border-radius: 20px; padding: 4px 9px; color: #666; font-size: 10px; }
.focus-task h3 { margin-top: 22px; font-size: 22px; line-height: 1.32; letter-spacing: -.4px; font-weight: 610; }
.focus-task p { margin-top: 10px; max-width: 480px; color: #777; font-size: 12px; }
.focus-task .card-actions { margin-top: 19px; }
.task-list { background: #fff; border: 1px solid #e8e8e7; border-radius: 17px; margin-top: 10px; padding: 0 18px; }
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0; }
.task-row-button { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; }
.task-row + .task-row { border-top: 1px solid #eee; }
.task-row-mark { margin-top: 4px; width: 8px; height: 8px; border: 1.5px solid #999; border-radius: 50%; flex: none; }
.task-row > div { flex: 1; min-width: 0; }
.task-row strong { font-size: 12px; font-weight: 600; }
.task-row p { margin-top: 4px; color: #8e8e8e; font-size: 11px; }
.task-row-status { color: #a1a1a1; font-size: 10px; white-space: nowrap; }
.adaptive-task-card { padding: 0 22px 18px; border: 1px solid #e8e8e7; border-radius: 20px; background: #fff; }
.generated-status { padding: 17px 0 14px; color: #888; font-size: 10px; }
.generated-task { padding: 17px 0; border-top: 1px solid #ececeb; }
.generated-task-button { display: block; width: 100%; border-right: 0; border-bottom: 0; border-left: 0; background: transparent; color: inherit; text-align: left; font: inherit; }
.task-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: #888; font-size: 10px; }
.generated-task > strong { display: block; font-size: 15px; line-height: 1.45; }
.generated-task > p { margin-top: 7px; color: #777; font-size: 11px; line-height: 1.7; }
[data-weekly-workout-progress] { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; margin-top: 9px; font-size: 12px; }
[data-weekly-workout-progress] p { color: #555; }
[data-weekly-workout-progress] strong { color: #222; font-size: 18px; font-variant-numeric: tabular-nums; }
[data-weekly-workout-progress] > span { color: #555; }
[data-weekly-task] .generated-task { padding-bottom: 4px; }
.workout-history { padding-bottom: 7px; }
.workout-history summary, .health-review summary { display: flex; align-items: center; gap: 8px; min-height: 44px; list-style: none; cursor: pointer; }
.workout-history summary::-webkit-details-marker, .health-review summary::-webkit-details-marker { display: none; }
.workout-history summary::after, .health-review summary::after { content: ''; width: 6px; height: 6px; flex: none; border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); }
.workout-history[open] summary::after, .health-review[open] summary::after { transform: translateY(2px) rotate(225deg); }
.workout-history summary { color: #555; font-size: 12px; }
.workout-history p { margin-bottom: 4px; color: #555; font-size: 12px; line-height: 1.55; }
.review-in-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #555; font-size: 12px; }
.review-in-progress .minor-action { min-height: 44px; margin: 0; color: #444; }
.health-review { margin-top: 6px; color: #444; }
.health-review summary { font-size: 13px; font-weight: 550; }
.health-review time { margin-left: auto; color: #666; font-size: 11px; font-weight: 400; white-space: nowrap; }
.health-review p { font-size: 13px; line-height: 1.65; }
.health-review small { display: block; margin-top: 4px; color: #666; }
.health-review .minor-action { min-height: 44px; margin: 0; }
.next-reminder { display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; padding: 9px 0 14px; font-size: 13px; }
.next-reminder span, .next-reminder time { color: #555; font-size: 12px; }
.next-reminder strong { flex: 1; }
.next-reminder time { white-space: nowrap; }
.task-open-hint { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; color: #8a8a8a; font-size: 10px; }
.task-open-hint b { color: #333; font-size: 14px; font-weight: 400; }
.generated-task-button:hover .task-open-hint { color: #222; }
.missing-strip { margin: 10px 0 2px; padding: 12px 13px; border-radius: 10px; background: #f4f4f3; color: #676767; font-size: 10px; line-height: 1.65; }
.adaptive-task-card .card-actions { margin-top: 14px; }

.task-detail { padding-top: 23px; padding-bottom: 72px; }
.task-hero { margin-top: 29px; padding: 25px 26px; border-radius: 22px; background: #202020; color: #fff; }
.task-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.task-hero .eyebrow { color: #aaa; }
.run-status { display: inline-flex; align-items: center; gap: 6px; color: #c7c7c7; font-size: 10px; }
.run-status i { width: 7px; height: 7px; border-radius: 50%; background: #efb85f; box-shadow: 0 0 0 4px #efb85f20; }
.run-status.done i { background: #77c69a; box-shadow: 0 0 0 4px #77c69a20; }
.run-status.blocked i { background: #d77b6d; box-shadow: 0 0 0 4px #d77b6d20; }
.task-hero h1 { margin-top: 19px; font-size: 27px; line-height: 1.3; letter-spacing: -.6px; }
.task-hero > p { margin-top: 10px; color: #bdbdbd; font-size: 12px; }
.run-progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 26px; color: #aaa; font-size: 10px; }
.run-progress-head strong { color: #fff; font-size: 16px; font-variant-numeric: tabular-nums; }
.run-progress { height: 6px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: #3b3b3b; }
.run-progress span { display: block; height: 100%; border-radius: inherit; background: #f0f0ef; transition: width .35s ease; }
.task-record { margin-top: 20px; padding: 16px 18px; border: 1px solid #e5e5e4; border-radius: 14px; }
.task-record h2 { margin: 0; font-size: 15px; }
.task-record p { margin: 8px 0 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.task-record .minor-action { margin-top: 8px; min-height: 40px; font-size: 14px; }
.orchestration-section, .workers-section, .activity-section { margin-top: 33px; }
.orchestration-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 8px; align-items: center; }
.orchestration-flow > div { min-width: 0; min-height: 74px; padding: 12px; border: 1px solid #e6e6e5; border-radius: 13px; background: #fff; }
.orchestration-flow span { display: block; margin-bottom: 8px; color: #999; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.orchestration-flow strong { display: block; overflow: hidden; color: #333; font-size: 10px; font-weight: 600; line-height: 1.45; text-overflow: ellipsis; }
.orchestration-flow > b { color: #aaa; font-size: 11px; font-weight: 400; }
.mandate-card { margin-top: 10px; padding: 15px 16px; border-radius: 14px; background: #eaeae8; }
.mandate-card span { color: #777; font-size: 9px; font-weight: 650; letter-spacing: .04em; }
.mandate-card p { margin-top: 7px; color: #444; font-size: 11px; }
.worker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.worker-card { padding: 17px; border: 1px solid #e5e5e4; border-radius: 17px; background: #fff; }
.worker-card.working { border-color: #bdbdbb; box-shadow: 0 8px 22px #00000008; }
.worker-card.blocked { border-color: #e2b7b0; background: #fffafa; }
.worker-card-head { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.worker-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #ededec; color: #333; font-size: 12px; font-weight: 700; }
.worker-card.working .worker-mark { background: #202020; color: #fff; }
.worker-card-head strong { display: block; font-size: 12px; }
.worker-card-head div > span { display: block; margin-top: 2px; color: #aaa; font-size: 9px; }
.worker-state { padding: 4px 7px; border-radius: 999px; background: #f0f0ef; color: #777; font-size: 9px; white-space: nowrap; }
.worker-card.working .worker-state { background: #fff3d9; color: #8b6727; }
.worker-card.done .worker-state { background: #e7f4ec; color: #397454; }
.worker-card.blocked .worker-state { background: #fae9e6; color: #9d4e43; }
.worker-objective { min-height: 51px; margin-top: 14px; color: #5f5f5f; font-size: 10px; }
.worker-progress { height: 4px; margin-top: 13px; overflow: hidden; border-radius: 999px; background: #efefee; }
.worker-progress span { display: block; height: 100%; border-radius: inherit; background: #333; transition: width .35s ease; }
.worker-now, .worker-output { margin-top: 12px; color: #555; font-size: 10px; }
.worker-now span, .worker-output span { display: block; margin-bottom: 4px; color: #aaa; font-size: 9px; }
.activity-list { padding: 5px 18px; border: 1px solid #e5e5e4; border-radius: 17px; background: #fff; }
.activity-row { position: relative; display: grid; grid-template-columns: 12px 1fr; gap: 11px; padding: 14px 0; }
.activity-row + .activity-row { border-top: 1px solid #eeeeed; }
.activity-dot { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: #b9b9b9; }
.activity-dot.active { background: #e2a13e; box-shadow: 0 0 0 4px #e2a13e1c; }
.activity-row div { display: flex; justify-content: space-between; gap: 14px; }
.activity-row strong { font-size: 10px; font-weight: 560; }
.activity-row div span { color: #aaa; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.architecture-note { margin-top: 26px; padding: 16px; border: 1px dashed #d5d5d3; border-radius: 14px; color: #777; }
.architecture-note strong { color: #555; font-size: 10px; }
.architecture-note p { margin-top: 6px; font-size: 9px; line-height: 1.7; }
.empty-task { margin-top: 32px; padding: 24px; border: 1px solid #e6e6e5; border-radius: 18px; background: #fff; }
.empty-task h1 { font-size: 24px; }
.empty-task p { margin-top: 9px; color: #777; font-size: 12px; }

.connection-card { display: flex; align-items: center; gap: 12px; padding: 16px; background: #fff; border: 1px solid #e8e8e7; border-radius: 17px; }
.connection-symbol { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; color: #222; background: #efefee; font-size: 20px; }
.connection-copy { flex: 1; min-width: 0; }
.connection-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.connection-name strong { font-size: 12px; font-weight: 620; }
.source-tag { padding: 3px 6px; border-radius: 6px; background: #f2f2f1; color: #777; font-size: 10px; white-space: nowrap; }
.source-tag.real { color: #333; background: #e9e9e8; }
.connection-copy p { margin-top: 4px; color: #929292; font-size: 10px; }
.connection-agent-action { flex: none; white-space: nowrap; }
.connection-agent-action[href] { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.minor-action { border: 0; background: transparent; color: #727272; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; }
.connection-footnote { margin-top: 9px; color: #989898; font-size: 10px; }
.connection-metrics { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.connection-metrics > div { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px; border: 1px solid #e8e8e7; border-radius: 10px; background: #fff; }
.connection-metrics span { color: #999; font-size: 10px; }
.connection-metrics strong { color: #333; font-size: 11px; font-weight: 600; }
footer { padding: 0 0 26px; color: #aaa; text-align: center; font-size: 10px; }

.button { border: 1px solid #222; border-radius: 10px; padding: 10px 15px; background: #222; color: #fff; font-size: 12px; font-weight: 580; }
.button.secondary { border-color: #dedede; background: #fff; color: #333; }
.button:disabled { opacity: .45; cursor: default; }
#sheet { width: min(440px, calc(100% - 32px)); padding: 26px; border: 1px solid #ddd; border-radius: 20px; background: #fff; color: #191919; box-shadow: 0 24px 70px #0002; }
#sheet::backdrop { background: #0007; backdrop-filter: blur(3px); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sheet-head h2 { font-size: 19px; }
.icon-button { padding: 0 4px; border: 0; background: none; color: #888; font-size: 24px; line-height: 1; }
.sheet-copy { margin-top: 15px; font-size: 12px; color: #696969; }
.permission-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0; }
.permission-list span { padding: 7px 9px; border-radius: 7px; background: #f3f3f3; color: #555; font-size: 11px; }
.sheet-main-button { width: 100%; }
#task-instruction-form { display: grid; gap: 12px; }
#task-instruction-form textarea { padding-right: 15px; }
.sheet-footnote { color: #999; margin-top: 10px; font-size: 10px; }
#toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; z-index: 10; transform: translateX(-50%); max-width: calc(100% - 36px); padding: 10px 14px; border-radius: 9px; background: #222; color: #fff; font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }

.lab-content { padding-top: 23px; }
.lab-entry { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 34px; padding: 16px 0; border: 0; border-top: 1px solid #e6e6e5; background: transparent; color: #858585; text-align: left; font-size: 11px; }
.lab-entry span { font-size: 16px; }
.back-button { border: 0; background: none; color: #666; padding: 0; font-size: 12px; }
.back-button.icon-only { display: flex; width: 44px; height: 44px; margin: -10px 0 -5px; padding: 0; align-items: center; justify-content: flex-start; }
.back-button.icon-only svg { width: 12px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.back-button.icon-only:active { opacity: .55; }
.lab-content > h1 { margin-top: 28px; font-size: 27px; line-height: 1.25; letter-spacing: -.5px; }
.lab-intro { margin-top: 10px; color: #838383; font-size: 12px; }
.lab-card { margin-top: 24px; padding: 22px; border: 1px solid #e8e8e7; border-radius: 18px; background: #fff; }
.lab-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.lab-head strong { font-size: 14px; }
.lab-head p { margin-top: 5px; color: #888; font-size: 11px; }
.lab-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 21px; }
.lab-start { margin-top: 20px; }
.lab-hint { margin-top: 18px; color: #888; font-size: 11px; }
.change-card { border-top: 1px solid #eee; margin-top: 21px; padding-top: 19px; }
.change-flow { display: grid; grid-template-columns: 1fr 16px 1fr; align-items: center; gap: 8px; margin: 12px 0; }
.change-flow > div { min-height: 83px; padding: 12px; background: #f7f7f6; border-radius: 10px; }
.change-flow span:not(.flow-arrow) { display: block; margin-bottom: 7px; color: #999; font-size: 10px; }
.change-flow strong { font-size: 11px; line-height: 1.4; }
.flow-arrow { color: #aaa; text-align: center; }
.change-card p { color: #777; font-size: 11px; margin-top: 7px; }

.task-proposal { margin-top: 10px; padding: 18px; border: 1px solid #d8d8d7; border-radius: 16px; background: #fff; }
.task-proposal > span, .proposal-preview > span { display: block; color: #777; font-size: 11px; margin-bottom: 9px; }
.task-proposal strong { display: block; font-size: 15px; }
.task-proposal p { color: #666; font-size: 12px; margin: 8px 0 14px; }
.task-proposal .button { margin-right: 6px; }
.agent-shell { display: flex; height: var(--agent-viewport-height,100dvh); overflow: hidden; flex-direction: column; }
.agent-shell .topbar { flex: 0 0 64px; }
.agent-page { display: flex; width: 100%; min-height: 0; margin: 0 auto; padding-top: 0; padding-bottom: 0; overflow: hidden; flex: 1; flex-direction: column; }
.agent-scroll { min-height: 0; padding-top: 23px; padding-bottom: 10px; overflow-x: hidden; overflow-y: auto; flex: 1; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.agent-title { margin: 29px 0 22px; }
.agent-title h1 { margin-top: 8px; font-size: 26px; line-height: 1.3; }
.agent-title p { margin-top: 10px; color: #777; font-size: 12px; }
.runtime-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: -4px 0 12px; padding: 4px; border: 1px solid #e3e3e2; border-radius: 13px; background: #ececeb; }
.runtime-switch button { min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: #777; font: inherit; font-size: 11px; font-weight: 650; }
.runtime-switch button.active { background: #fff; color: #222; box-shadow: 0 1px 5px #00000012; }
.home-runtime-switch { margin: -5px 0 18px; }
.agent-status, .agent-setup { border: 1px solid #e3e3e2; border-radius: 15px; background: #fff; padding: 16px; font-size: 11px; color: #777; }
.agent-status { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 12px; }
.agent-status strong { color: #222; font-size: 12px; }
.agent-status span { line-height: 1.45; }
.agent-status em { padding: 4px 7px; border-radius: 7px; background: #efefee; color: #555; font-size: 10px; font-style: normal; white-space: nowrap; }
.agent-status.error { border-color: #e2b7b0; background: #fffafa; }
.agent-status.error strong, .agent-status.error span { color: #9d4e43; }
.agent-setup h2 { color: #222; font-size: 15px; }
.agent-setup p { margin-top: 8px; line-height: 1.6; }
.agent-setup code { font-family: ui-monospace, SFMono-Regular, monospace; color: #222; }
.agent-setup form { display: grid; gap: 9px; margin-top: 16px; }
.agent-setup input { width: 100%; padding: 12px; border: 1px solid #dededd; border-radius: 10px; background: #fff; color: #222; font: inherit; font-size: 12px; }
.agent-messages { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 12px; }
.agent-empty { color: #999; font-size: 12px; padding: 20px 0; }
.agent-message { align-self: flex-start; max-width: 88%; padding: 14px 15px; border: 1px solid #e7e7e6; border-radius: 17px; background: #fff; }
.agent-message.user { align-self: flex-end; margin-left: 42px; border-color: #eeeeed; border-bottom-right-radius: 6px; background: #eeeeed; }
.agent-message.assistant { margin-right: 28px; border-bottom-left-radius: 6px; }
.agent-message > p { white-space: pre-wrap; font-size: 13px; }
.agent-message.pending { padding: 12px 15px; color: #777; }
.agent-thinking { display: flex; align-items: center; gap: 9px; }
.agent-thinking > span { display: flex; gap: 3px; }
.agent-thinking i { width: 4px; height: 4px; border-radius: 50%; background: #8d8d8d; animation: agent-thinking 1.2s infinite ease-in-out; }
.agent-thinking i:nth-child(2) { animation-delay: .16s; }
.agent-thinking i:nth-child(3) { animation-delay: .32s; }
.agent-thinking p { font-size: 11px; }
@keyframes agent-thinking { 0%, 70%, 100% { opacity: .35; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }
.goal-orchestration { margin: 20px 0; padding: 18px; border: 1px solid #dededd; border-radius: 18px; background: #f7f7f6; }
.goal-orchestration.blocked { border-color: #e2b7b0; background: #fffafa; }
.goal-run-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.goal-run-head h2 { margin-top: 5px; font-size: 17px; }
.goal-run-head > strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.goal-orchestration > .run-progress { margin: 12px 0 17px; background: #dededd; }
.goal-orchestration > .run-progress span { background: #252525; }
.goal-orchestration .orchestration-flow { margin-bottom: 12px; }
.goal-orchestration .worker-grid { margin-top: 12px; }
.goal-run-events { margin-top: 13px; padding: 4px 12px; border-radius: 12px; background: #fff; }
.goal-run-events p { display: grid; grid-template-columns: 46px 1fr; gap: 9px; padding: 8px 0; color: #555; font-size: 10px; }
.goal-run-events p + p { border-top: 1px solid #eeeeed; }
.goal-run-events span { color: #aaa; font-variant-numeric: tabular-nums; }
.goal-run-error { margin-top: 12px; color: #9d4e43; font-size: 11px; }
.proposal-preview { margin-top: 15px; padding: 14px; border: 1px solid #dededd; border-radius: 11px; }
.proposal-preview strong { display: block; font-size: 15px; }
.proposal-preview p { margin: 7px 0; color: #666; font-size: 11px; }
.proposal-preview button { margin-top: 8px; }
.agent-composer-dock { z-index: 5; padding: 11px 0 calc(9px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom,#f6f6f500 0,#f6f6f5 18px,#f6f6f5 100%); flex: none; }
.agent-composer { position: relative; padding-top: 9px; }
.agent-composer textarea { display: block; width: 100%; min-height: 48px; max-height: 120px; padding: 13px 52px 12px 15px; overflow-y: auto; resize: none; border: 1px solid #d8d8d7; border-radius: 20px; outline: none; background: #fff; color: #222; box-shadow: 0 5px 18px #0000000a; font: inherit; font-size: 12px; line-height: 1.5; }
.agent-composer textarea:focus { border-color: #bdbdbb; box-shadow: 0 6px 20px #00000010; }
.agent-send { position: absolute; right: 7px; bottom: 6px; display: grid; width: 36px; height: 36px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #202020; color: #fff; }
.agent-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.agent-send:disabled { background: #d7d7d5; cursor: default; }
.agent-disclaimer { margin: 7px 8px 0; color: #999; text-align: center; font-size: 9px; }

@media (max-width: 600px) {
  .topbar { height: 58px; }
  .topbar-inner { padding: 0 20px; }
  .content { padding: 22px 18px 48px; }
  .agent-shell .topbar { flex-basis: 58px; }
  .agent-page { padding-top: 0; padding-bottom: 0; }
  .agent-scroll { padding-top: 22px; }
  .agent-composer textarea { font-size: 16px; }
  .goal-card { padding: 22px 20px 21px; border-radius: 20px; }
  .goal-card h1 { font-size: 25px; }
  .goal-numbers strong { font-size: 38px; }
  .task-section, .connection-section { margin-top: 29px; }
  .focus-task { padding: 21px 20px 22px; }
  .focus-task h3 { font-size: 20px; }
  .connection-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; padding: 14px; }
  .adaptive-goal { padding: 22px 20px 17px; }
  .adaptive-goal h1 { font-size: 24px; line-height: 1.38; }
  .adaptive-module { padding: 16px 0; }
  .adaptive-task-card { padding: 0 18px 16px; }
  .task-hero { padding: 22px 20px; }
  .task-hero h1 { font-size: 24px; }
  .orchestration-flow { grid-template-columns: 1fr 12px 1fr; }
  .orchestration-flow > b:nth-of-type(2) { display: none; }
  .orchestration-flow > div:nth-of-type(3) { grid-column: 1; }
  .orchestration-flow > b:nth-of-type(3) { grid-column: 2; grid-row: 2; }
  .orchestration-flow > div:nth-of-type(4) { grid-column: 3; grid-row: 2; }
  .worker-grid { grid-template-columns: 1fr; }
  .worker-objective { min-height: 0; }
  #sheet { position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; padding: 24px 22px calc(26px + env(safe-area-inset-bottom)); }
  .change-flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); }
}
@media (max-width: 370px) {
  .connection-card { grid-template-columns: 38px 1fr; }
  .connection-agent-action { grid-column: 2; justify-self: start; }
  .section-heading span { max-width: 140px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.day-task > strong { font-size: 18px; line-height: 1.45; }
.day-task .day-sub, .day-detail .day-sub { color: #424240; font-size: 13px; }
.day-status { color: #485646; font-size: 11px; }
.day-task .task-meta { color: #575754; font-size: 11px; }
.day-task [data-weekly-workout-progress], .day-task [data-weekly-workout-progress] strong { font-size: 11px; color: #656561; font-weight: 400; }
.day-detail small { display: block; margin-top: 12px; overflow-wrap: anywhere; color: #666; }

/* Recommendations use the same type, spacing and borders as existing goal cards. */
.recommendation-card { background:#fff; border:1px solid #e7e7e6; border-radius:20px; padding:22px 20px; overflow-wrap:anywhere; }
.recommendation-heading { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 14px; }
.recommendation-heading h2 { font-size:19px; line-height:1.4; flex:1; margin:0; }
.recommendation-heading > span, .recommendation-option summary > span { color:#777; font-size:11px; white-space:nowrap; }
.recommendation-card p, .recommendation-card li, .recommendation-card dl { font-size:13px; line-height:1.75; }
.recommendation-card p { margin:12px 0; white-space:pre-wrap; }
.recommendation-card ul, .recommendation-card ol { margin:6px 0 14px; padding-left:20px; }
.recommendation-card a { color:#246459; text-decoration:underline; text-underline-offset:3px; }
.recommendation-option { border-top:1px solid #ececeb; padding:14px 0; }
.recommendation-option summary { cursor:pointer; font-size:14px; line-height:1.6; }
.recommendation-option summary > span { margin-left:10px; }
.recommendation-option dl > div { display:flex; gap:12px; padding:4px 0; }
.recommendation-option dt { color:#777; min-width:4em; }
.recommendation-option dd { margin:0; }
.recommendation-label, .recommendation-check strong { font-weight:600; }
.recommendation-card .risk, .recommendation-stale { color:#8b503b; }
.recommendation-sources { border-top:1px solid #ececeb; padding-top:14px; font-size:12px; color:#777; }
.recommendation-sources summary { cursor:pointer; line-height:1.6; }
.recommendation-sources li > span { display:block; font-size:11px; }
.recommendation-next { color:#666; }
.agent-message:has(.recommendation-card) { max-width:100%; width:100%; padding:0; border:0; margin-right:0; }

.event-task-footer { display:flex; align-items:center; gap:12px; margin-top:12px; min-height:32px; }

.task-schedule-tag { display:inline-block; color:#666; font-size:11px; padding:3px 8px; border:1px solid #e5e5e3; border-radius:6px; }
.task-execution-list { margin:0; padding:0; list-style:none; }
.task-execution-list li { padding:12px 0; border-bottom:1px solid #eee; font-size:13px; }
.task-execution-list p { margin:5px 0 0; color:#888; font-size:11px; }
.event-task-card strong { font-size:14px; line-height:1.6; }

.task-detail-link { appearance:none; border:0; background:transparent; color:#999; font-size:12px; font-weight:400; line-height:1.5; padding:4px 0; min-height:32px; cursor:pointer; text-decoration:none; }
.task-detail-link:hover { color:#777; text-decoration:none; }
.task-detail-link:focus-visible { text-decoration:none; outline:2px solid #aaa; outline-offset:4px; border-radius:2px; }
.event-task-detail .goal-card { padding:20px; }
.event-task-detail .goal-card h1 { font-size:20px; line-height:1.45; margin:8px 0 10px; }
.event-task-detail .goal-card p { font-size:14px; line-height:1.65; margin:8px 0; }
.event-task-detail .goal-card .goal-note { font-size:12px; }
.event-task-detail .task-section { margin-top:22px; }
.event-task-detail .section-heading { margin-bottom:12px; }
.event-task-detail .section-heading h2 { font-size:16px; line-height:1.5; }
.event-task-detail .recommendation-card { padding:18px 16px; border-radius:16px; }
.event-task-detail .recommendation-heading h2 { font-size:17px; line-height:1.5; }
.event-task-detail .recommendation-card p { margin:10px 0; line-height:1.65; }

.event-task-card > .event-task-meta { flex:0 0 auto; align-self:stretch; display:flex; flex-direction:column; align-items:flex-end; justify-content:space-between; gap:12px; }
.event-task-meta .task-row-status { font-size:12px; line-height:1.5; color:#999; }
.task-detail-link:focus { text-decoration:none; }
.task-detail-chevron { margin-left:4px; font-size:14px; line-height:1; }

/* Results share the compact detail typography; long content stays in the page scroll. */
.event-task-detail, .event-task-detail .task-section, .event-task-detail .goal-card { min-width:0; overflow-wrap:anywhere; }
.task-result-card { background:#fff; border:1px solid #e7e7e6; border-radius:16px; padding:18px 16px; min-width:0; overflow-wrap:anywhere; }
.task-result-card h2 { font-size:16px; line-height:1.5; margin:0 0 10px; }
.task-result-card p, .task-result-card li, .task-result-card td, .task-result-card th { font-size:14px; line-height:1.75; }
.task-result-summary { color:#333; }
.task-result-actions { margin:14px 0; padding-left:22px; }
.task-result-actions li { padding:3px 0; }
.task-result-actions li > span { display:block; color:#888; font-size:12px; }
.task-result-prose p, .task-result-preview p { margin:10px 0; white-space:pre-wrap; }
.task-result-prose h3, .task-result-preview h3 { font-size:14px; line-height:1.6; margin:18px 0 8px; }
.task-result-prose > :first-child, .task-result-preview > :first-child { margin-top:0; }
.task-result-prose ul, .task-result-prose ol, .task-result-preview ul, .task-result-preview ol { padding-left:22px; margin:10px 0; }
.task-result-prose li + li, .task-result-preview li + li { margin-top:5px; }
.task-result-prose pre, .task-result-preview pre { margin:12px 0; padding:12px; background:#f6f6f5; border-radius:8px; white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; line-height:1.65; }
.task-result-prose code, .task-result-preview code { white-space:pre-wrap; overflow-wrap:anywhere; font-size:.92em; }
.task-result-prose blockquote, .task-result-preview blockquote { border-left:2px solid #ddd; margin:12px 0; padding-left:12px; color:#666; }
.task-result-explanation, .task-result-full { margin-top:14px; border-top:1px solid #ececeb; padding-top:12px; }
.task-result-explanation > summary, .task-result-full > summary { color:#777; font-size:12px; line-height:1.7; cursor:pointer; padding:5px 0; }
.task-result-explanation[open] > summary, .task-result-full[open] > summary { margin-bottom:10px; }
.task-result-card summary:focus-visible, .task-result-table:focus-visible { outline:2px solid #aaa; outline-offset:3px; border-radius:2px; }
.task-result-card .task-result-preview-label { margin-bottom:8px; font-size:11px; color:#999; }
.task-result-table { width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; margin:12px 0; }
.task-result-table table { width:100%; border-collapse:collapse; text-align:left; }
.task-result-table th, .task-result-table td { min-width:5em; padding:8px; border-bottom:1px solid #eee; vertical-align:top; }
.task-result-table th { color:#777; font-size:12px; font-weight:600; }
.recommendation-context { border-top:1px solid #ececeb; padding:12px 0; }
.recommendation-context > summary { font-size:12px; color:#777; line-height:1.7; cursor:pointer; }
.recommendation-context[open] > summary { margin-bottom:10px; }
.recommendation-card .recommendation-next { margin:14px 0; padding:12px; border-radius:10px; background:#f6f6f5; color:#333; }
.recommendation-next > strong { font-size:11px; color:#888; }
.recommendation-intro { min-width:0; }
.recommendation-option dl > div { display:grid; grid-template-columns:minmax(4em,.35fr) minmax(0,1fr); }
.recommendation-option dd { min-width:0; }
