/* V4: direct agent collaboration and bounded, optional capacity sharing. */
.narrative-v4 .exchange-tabs { gap:5px; padding-inline:20px; }
.narrative-v4 .exchange-tabs button { flex-direction:column; gap:7px; padding:14px 9px; }
.narrative-v4 .exchange-tabs button span { font-size:8px; }
.narrative-v4 .exchange-heading>p:last-child { max-width:660px; }
.exchange-workbench[data-mode=pair] .exchange-layout,
.exchange-workbench[data-mode=share] .exchange-layout { grid-template-columns:minmax(0,1fr); }
.exchange-workbench[data-mode=pair] #exchange-panel,
.exchange-workbench[data-mode=share] #exchange-panel { padding:0; min-height:0; }
.v4-pair-layout,.v4-share-layout { display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); }
.v4-pair-brief,.v4-share-copy { padding:37px 38px; min-width:0; }
.v4-pair-brief>h3,.v4-share-copy>h3 { font-size:clamp(30px,3vw,42px); letter-spacing:-.045em; line-height:1.12; color:#442453; margin:15px 0 18px; font-weight:550; }
.v4-pair-brief>p:not(.v4-ownership),.v4-share-copy>p:not(.v4-ownership) { font-size:14px; line-height:1.75; color:#887093; }
.v4-agent-route { display:flex; align-items:center; justify-content:space-between; padding:25px 0; margin:4px 0; gap:12px; }
.v4-agent-route>div { display:flex; flex-direction:column; align-items:flex-start; }
.v4-agent-avatar { display:grid; place-items:center; width:40px; height:40px; border-radius:13px; background:#eee0fa; color:#7311c8; font:600 28px Georgia,serif; margin-bottom:10px; box-shadow:inset 0 0 0 1px #dcc3ec; }
.v4-agent-avatar.is-friend { color:#4a756b; background:#e4f0e9; box-shadow:inset 0 0 0 1px #d2e3db; }
.v4-agent-route b { font-size:12px; color:#654674; }
.v4-agent-route small { font-size:9px; color:#9a83a7; margin-top:5px; line-height:1.5; }
.v4-route-bridge { flex:1; margin:0 5px; position:relative; color:#a37bbc; font-size:23px; text-align:center; }
.v4-route-bridge::before,.v4-route-bridge::after { content:""; display:block; position:absolute; top:13px; height:1px; background:#e8d8f2; width:calc(50% - 20px); }
.v4-route-bridge::after { right:0; }
.v4-route-bridge small { display:block; font-size:8px; letter-spacing:.1em; margin-top:2px; }
.v4-field { display:grid; gap:9px; color:#8b729c; font-size:11px; line-height:1.5; min-width:0; }
.v4-field select { width:100%; min-width:0; font-size:12px; padding:12px; border:1px solid #dfd0e9; border-radius:9px; color:#695078; background:#fff; }
.v4-field select:disabled { opacity:.7; }
.v4-field-row { display:grid; grid-template-columns:1fr 1fr; gap:15px; }
.v4-prompt-card { margin-top:20px; border:1px solid #e5daec; background:#faf7fd; border-radius:12px; padding:17px 19px; }
.v4-prompt-card>span { color:#ae8cc1; font-size:8px; letter-spacing:.09em; }
.v4-prompt-card>p { margin-top:10px; color:#765b85; font:11px/1.85 ui-monospace,SFMono-Regular,monospace; }
.v4-action { display:inline-flex; align-items:center; justify-content:center; background:#7311c8; color:#fff; min-height:42px; padding:12px 18px; font-size:12px; line-height:1.5; border-radius:9px; font-weight:500; }
.v4-action:hover:not(:disabled) { background:#6010a7; }
.v4-action.is-secondary { background:#f1e9f7; color:#8e6aa3; }
.v4-action.is-secondary:hover:not(:disabled) { background:#e7d8f1; }
.v4-pair-actions { margin-top:20px; }
.v4-ownership { font-size:10px; line-height:1.8; color:#9c86a6; margin-top:19px; }
.v4-pair-brief>.text-button,.v4-share-copy>.text-button { font-size:11px; margin-top:9px; }
.v4-pair-receiver { min-width:0; background:linear-gradient(145deg,#f7f1fc,#efe4f7); border-left:1px solid #e5d7ee; }
.v4-agent-window-bar { display:flex; flex-wrap:wrap; align-items:center; gap:13px; padding:19px 23px; background:#f2eaf8; border-bottom:1px solid #e4d6ee; color:#90779f; }
.v4-agent-window-bar>span:nth-child(2) { font:10px ui-monospace,SFMono-Regular,monospace; flex:1; }
.v4-agent-window-bar>b { font-size:8px; font-weight:500; color:#9b78b2; }
.v4-receiver-body { padding:30px; }
.v4-receiver-empty { display:flex; flex-direction:column; justify-content:center; min-height:490px; padding:20px 10px; }
.v4-large-glyph { display:grid; place-items:center; width:90px; height:90px; border-radius:27px; background:linear-gradient(145deg,#fff,#d9c1ec); box-shadow:0 18px 35px -20px #6c368f60,inset 0 1px #fff; color:#9260b5; font-size:45px; margin-bottom:33px; }
.v4-receiver-empty>h4,.v4-session-message>h4 { font-size:32px; letter-spacing:-.04em; line-height:1.16; font-weight:550; color:#65427d; margin-bottom:18px; }
.v4-receiver-empty>p,.v4-session-message>p { color:#9a7dac; font-size:14px; line-height:1.8; max-width:380px; }
.v4-receiver-empty>span:last-child { color:#af90c0; font-size:8px; letter-spacing:.06em; margin-top:28px; }
.v4-state-tag { display:inline-flex; align-items:center; gap:7px; color:#9672ad; font-size:9px; letter-spacing:.04em; line-height:1.5; margin-bottom:24px; }
.v4-session-message { padding:16px 4px; }
.v4-scope { display:grid; gap:9px; background:#ffffff8c; border:1px solid #e6d6f0; border-radius:12px; padding:20px; margin:25px 0; }
.v4-scope>b { font-size:11px; color:#7e588f; margin-bottom:4px; }
.v4-scope>span { font-size:12px; color:#8d6d9c; }
.v4-scope>small { color:#b096bc; font-size:10px; margin-top:6px; }
.v4-role-note { display:block; font-size:10px; line-height:1.6; color:#aa8ab9; margin-top:13px; }
.v4-terminal-log { background:#281932; border:1px solid #543262; border-radius:12px; padding:21px; margin:25px 0; }
.v4-terminal-log p { font:11px/1.9 ui-monospace,SFMono-Regular,monospace; color:#c7afda; margin-bottom:16px; }
.v4-terminal-log p:last-child { margin-bottom:0; }
.v4-terminal-log span { display:block; color:#a475c6; }
.v4-result-top>p { color:#8b6a9c; font-size:12px; line-height:1.75; margin-bottom:24px; }
.v4-result-top .v4-state-tag { margin-bottom:10px; }
.v4-dashboard { border:1px solid #e2d3ec; border-radius:13px; background:#fff; overflow:hidden; box-shadow:0 18px 40px -30px #4d146b50; }
.v4-dashboard-top { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:16px 19px; border-bottom:1px solid #eee5f4; color:#967ba4; }
.v4-dashboard-top b { font-size:10px; font-weight:500; }
.v4-dashboard-top>span { font-size:7px; letter-spacing:.07em; color:#b7a1c1; }
.v4-dashboard-metrics { display:flex; align-items:center; gap:24px; padding:24px 20px; }
.v4-dashboard-metrics small { font-size:10px; display:block; color:#a08cab; }
.v4-dashboard-metrics strong { display:block; font-size:30px; line-height:1.25; font-weight:550; letter-spacing:-.04em; color:#674178; margin-top:6px; }
.v4-dashboard-metrics label { display:grid; gap:8px; margin-left:auto; font-size:9px; color:#a087ad; }
.v4-dashboard-metrics select { padding:7px; border-radius:6px; border:1px solid #e7dced; color:#8f6ca0; background:#fcfaff; font-size:10px; }
.v4-chart { padding:0 20px 22px; display:grid; gap:18px; }
.v4-chart>div { display:flex; align-items:center; gap:12px; color:#a48ab1; font-size:10px; }
.v4-chart span { width:48px; }
.v4-chart i { display:block; flex:1; height:11px; background:#f6effa; border-radius:4px; overflow:hidden; }
.v4-chart b { display:block; height:100%; background:linear-gradient(90deg,#c4a0e2,#8748b9); border-radius:4px; }
.v4-chart strong { width:48px; text-align:right; font-weight:500; color:#8c699d; }
.v4-dashboard>p { padding:14px 20px; font-size:9px; color:#a78bb5; border-top:1px solid #f0e8f6; line-height:1.7; }
.v4-handoff { margin-top:19px; border-top:1px solid #dfcce9; padding-top:17px; }
.v4-handoff summary { display:flex; justify-content:space-between; gap:10px; list-style:none; cursor:pointer; color:#8d66a4; font-size:11px; }
.v4-handoff summary::-webkit-details-marker { display:none; }
.v4-handoff summary>span { font-size:9px; color:#b394c2; }
.v4-handoff ol { padding-left:17px; font-size:11px; line-height:1.8; color:#9c7daf; margin-top:17px; }
.v4-handoff pre { overflow:auto; padding:16px; background:#2b1b36; color:#ccb4df; border-radius:8px; font:10px/1.8 ui-monospace,SFMono-Regular,monospace; }
.v4-handoff small { font-size:9px; color:#aa88bc; line-height:1.6; }
#capacity-form { margin-top:27px; }
#capacity-form fieldset { border:0; padding:0; margin:0; display:grid; gap:17px; min-width:0; }
#capacity-form>.v4-action { margin-top:22px; }
.v4-capacity-principle { display:flex; gap:14px; border-top:1px solid #eadef0; margin-top:28px; padding-top:23px; }
.v4-capacity-principle>span { color:#b18bca; font-size:25px; }
.v4-capacity-principle b { display:block; font-size:13px; color:#80608e; }
.v4-capacity-principle p { font-size:12px; color:#9a83a5; line-height:1.8; margin-top:9px; }
.v4-night-window { min-width:0; background:radial-gradient(ellipse at 100% 0,#4c2469 0,transparent 70%),#241331; color:#e7d5f3; }
.v4-night-chrome { display:flex; align-items:center; gap:19px; padding:19px 24px; border-bottom:1px solid #ffffff0f; background:#ffffff04; color:#a68bb7; font:10px ui-monospace,SFMono-Regular,monospace; }
.v4-night-chrome>span:nth-child(2) { flex:1; }
.v4-night-chrome>span:last-child { font-size:7px; color:#9272a4; }
.v4-night-header { display:flex; align-items:center; gap:20px; padding:32px 30px 27px; }
.v4-moon { font-size:58px; line-height:1; color:#cbb0e2; text-shadow:0 0 30px #b286e670; }
.v4-night-header>div { flex:1; }
.v4-night-header>div>span { color:#b694d0; font-size:10px; }
.v4-night-header h4 { color:#ebd7fb; font-size:32px; letter-spacing:-.04em; margin:6px 0 8px; font-weight:500; }
.v4-night-header p { font-size:10px; color:#9d7bb0; }
.v4-night-header>i { width:7px; height:7px; border-radius:50%; background:#6e547e; }
.v4-night-header>i.is-on { background:#bb93dd; box-shadow:0 0 13px #bd88ee88; }
.v4-usage-meter { padding:0 30px 25px; }
.v4-usage-meter>div { display:flex; align-items:baseline; gap:12px; justify-content:space-between; }
.v4-usage-meter>div>span { font-size:13px; color:#8f6ba3; }
.v4-usage-meter b { color:#e0c6f2; font-size:27px; letter-spacing:-.03em; font-weight:500; }
.v4-usage-meter small { font-size:9px; color:#9370a7; }
.v4-usage-meter meter { appearance:none; width:100%; height:9px; display:block; margin:15px 0 12px; border-radius:10px; background:#ffffff0c; }
.v4-usage-meter meter::-webkit-meter-bar { background:#ffffff0c; border:0; border-radius:10px; }
.v4-usage-meter meter::-webkit-meter-optimum-value { background:linear-gradient(90deg,#8854bd,#d2adef); border-radius:10px; }
.v4-usage-meter meter::-moz-meter-bar { background:linear-gradient(90deg,#8854bd,#d2adef); border-radius:10px; }
.v4-usage-meter>p { font-size:9px; color:#a685bb; }
.v4-night-timeline { margin:0 30px; min-height:200px; border-top:1px solid #ffffff0d; }
.v4-night-timeline>div { display:flex; align-items:flex-start; gap:12px; padding:22px 0; border-bottom:1px solid #ffffff0d; }
.v4-night-timeline i { font-style:normal; color:#b694cd; font-size:12px; }
.v4-night-timeline p { flex:1; }
.v4-night-timeline b { display:block; font-size:12px; font-weight:500; color:#d2b5e6; }
.v4-night-timeline p>span { display:block; font-size:9px; color:#9876ac; margin-top:7px; }
.v4-night-timeline small { font-size:8px; color:#78568d; }
.v4-night-idle { padding-top:28px!important; border-bottom:0!important; }
.v4-night-idle>span { color:#af83cf; font-size:21px; }
.v4-night-idle p { max-width:310px; font-size:13px; line-height:1.8; color:#a586b7; }
.v4-night-controls { display:flex; gap:9px; flex-wrap:wrap; padding:20px 30px 0; }
.v4-night-controls .v4-action { background:#d4b3ed; color:#472259; font-size:11px; }
.v4-night-controls .v4-action:hover:not(:disabled) { background:#e4cbf6; }
.v4-night-controls .v4-action.is-secondary { background:#ffffff09; color:#c09ad7; border:1px solid #ffffff14; }
.v4-night-foot { padding:20px 30px 28px; color:#8f6ba3; font-size:9px; line-height:1.8; }
.v4-limit-note { margin:16px 30px 0; padding:13px 16px; border:1px solid #9470b347; background:#ffffff05; color:#c19dd5; font-size:11px; line-height:1.7; border-radius:10px; }
@media(max-width:1000px) {
  .v4-pair-brief,.v4-share-copy { padding:29px 26px; }
  .v4-receiver-body { padding:25px; }
  .v4-agent-window-bar>b { display:none; }
  .v4-agent-route { gap:8px; }
  .v4-agent-route small { font-size:8px; }
  .v4-night-header,.v4-usage-meter { padding-inline:25px; }
  .v4-night-timeline { margin-inline:25px; }
  .v4-field-row { gap:10px; }
}
@media(max-width:760px) {
  .narrative-v4 .exchange-tabs { overflow-x:auto; padding:13px 12px; justify-content:flex-start; scrollbar-width:thin; scrollbar-color:#d5bce7 transparent; }
  .narrative-v4 .exchange-tabs button { flex:0 0 120px; font-size:11px; }
  .narrative-v4 .exchange-tabs button span { font-size:7px; }
  .v4-pair-layout,.v4-share-layout { grid-template-columns:1fr; }
  .v4-pair-brief,.v4-share-copy { padding:29px 25px; }
  .v4-pair-brief>h3,.v4-share-copy>h3 { font-size:34px; }
  .v4-pair-receiver { border-left:0; border-top:1px solid #e5d7ee; }
  .v4-receiver-empty { min-height:260px; padding:5px; }
  .v4-receiver-empty>h4,.v4-session-message>h4 { font-size:28px; }
  .v4-large-glyph { width:65px; height:65px; border-radius:20px; font-size:34px; margin-bottom:23px; }
  .v4-receiver-empty>p,.v4-session-message>p { font-size:13px; }
  .v4-agent-window-bar>span:nth-child(2) { font-size:9px; }
  .v4-night-window { border-top:1px solid #e5d7ee; }
  .v4-night-timeline { min-height:170px; }
}
@media(max-width:400px) {
  .v4-pair-brief,.v4-share-copy { padding:25px 19px; }
  .v4-pair-brief>h3,.v4-share-copy>h3 { font-size:30px; }
  .v4-receiver-body { padding:24px 18px; }
  .v4-prompt-card { padding:15px; }
  .v4-field-row { grid-template-columns:1fr; gap:17px; }
  .v4-dashboard-metrics { gap:16px; padding:20px 15px; flex-wrap:wrap; }
  .v4-dashboard-metrics strong { font-size:26px; }
  .v4-chart { padding-inline:15px; }
  .v4-chart>div { gap:8px; }
  .v4-night-header,.v4-usage-meter { padding-inline:21px; }
  .v4-night-timeline { margin-inline:21px; }
  .v4-night-controls { padding-inline:21px; }
  .v4-night-chrome { gap:12px; padding-inline:19px; font-size:9px; }
  .v4-night-chrome>span:last-child { display:none; }
  .v4-agent-route small { font-size:8px; }
  .v4-usage-meter>div { flex-wrap:wrap; gap:7px; }
}
