:root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e8edf6;
  background: #080c12;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: radial-gradient(circle at 80% -20%, #1c2b3f 0, transparent 38%), #080c12; }
#app { min-height: 100dvh; }
button { font: inherit; }
.topbar { height: 72px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #1f2937; background: rgba(8, 12, 18, .88); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg, #ff7a3d, #d94b26); color: white; font-weight: 800; box-shadow: 0 8px 24px #ff623733; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 15px; letter-spacing: .01em; }
.brand-copy span, .subtle { color: #8e9bad; font-size: 12px; }
.connection { padding: 8px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.connection.offline { color: #f7c97f; background: #d9912020; border: 1px solid #d9912044; }
.fixture-banner { min-height: 46px; padding: 9px 28px; display: flex; align-items: center; gap: 12px; color: #b9c5d4; background: #17202d; border-bottom: 1px solid #263243; font-size: 12px; }
.fixture-banner strong { color: #f7c97f; }
.workspace { min-height: calc(100vh - 118px); display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.thread-panel { padding: 22px 16px; border-right: 1px solid #1f2937; background: #0b1018cc; }
.panel-title { padding: 0 8px 14px; display: flex; align-items: center; justify-content: space-between; }
.panel-title h1 { margin: 0; font-size: 14px; }
.count { color: #78879a; font-size: 12px; }
.thread-card { width: 100%; padding: 14px; display: grid; gap: 11px; text-align: left; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
.thread-card + .thread-card { margin-top: 6px; }
.thread-card:hover { background: #111925; }
.thread-card.selected { background: #142131; border-color: #2c4158; box-shadow: inset 3px 0 #ff6a36; }
.thread-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.thread-meta { display: flex; align-items: center; gap: 7px; color: #8190a3; font-size: 11px; }
.thread-meta time { margin-left: auto; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #78879a; }
.status-dot.waiting_approval { background: #f0b35c; box-shadow: 0 0 0 4px #f0b35c18; }
.status-dot.idle { background: #51b987; }
.detail-panel { padding: 30px clamp(20px, 4vw, 54px) 48px; overflow: hidden; }
.detail-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 7px; color: #ff8c59; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h2 { margin: 0; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.03em; }
h3 { margin: 0; font-size: 14px; }
.controls, .approval-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.button { min-height: 36px; padding: 0 13px; color: #cbd5e1; background: #141c28; border: 1px solid #2a3647; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 700; }
.button:hover { border-color: #4a5d74; }
.button.primary { color: white; background: #dc5b2f; border-color: #ed754c; }
.button.danger { color: #ffaaa0; }
.button.ghost { background: transparent; }
.recovery-card { margin-top: 28px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; border: 1px solid #28453d; border-radius: 12px; background: linear-gradient(90deg, #10231f, #0d1719); }
.recovery-icon { width: 32px; height: 32px; display: grid; place-items: center; color: #6bd6a4; background: #18372f; border-radius: 9px; font-size: 18px; }
.recovery-card div { display: grid; gap: 3px; }
.recovery-card div span { color: #8ba79f; font-size: 11px; }
.recovery-badge { margin-left: auto; padding: 5px 8px; color: #79d9aa; background: #19372f; border-radius: 6px; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.content-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr); gap: 18px; }
.card { border: 1px solid #202b3a; border-radius: 14px; background: linear-gradient(145deg, #101720, #0d131c); box-shadow: 0 16px 40px #0003; }
.timeline { padding: 20px; }
.timeline > h3 { margin-bottom: 18px; }
.timeline-row { padding: 14px 0; display: grid; grid-template-columns: 30px 1fr; gap: 11px; border-top: 1px solid #1e2937; }
.role { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: #1b2634; color: #8fa2b8; font-size: 10px; font-weight: 800; }
.role.assistant { color: #ff9a70; background: #3b211b; }
.role.tool { color: #72cfaa; background: #183128; }
.timeline-row strong { font-size: 10px; color: #7e8da0; }
.timeline-row p { margin: 5px 0 4px; color: #d1d9e5; font-size: 13px; line-height: 1.5; }
.timeline-row time { color: #657388; font-size: 10px; }
.side-stack { display: grid; align-content: start; gap: 18px; }
.approval-card, .action-card { padding: 20px; }
.approval-card h3, .action-card h3 { line-height: 1.45; }
.approval-card .subtle, .action-card .subtle { margin: 9px 0 16px; line-height: 1.5; }
.pairing-heading, .pairing-status { margin-inline: auto; width: min(760px, calc(100% - 32px)); }
.pairing-heading { margin-top: 28px; }
.pairing-heading.paired-shell-copy, .pairing-status.paired-shell-copy { display: none; }
.personal-list-header {
  margin: 0 auto;
  width: min(760px, 100%);
  padding: max(18px, env(safe-area-inset-top)) 18px 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  color: #d9d7e1;
  border: 1px solid #696475;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(150deg, #777184 0%, #656071 55%, #575363 100%);
  box-shadow: inset 0 1px #aaa4b4, 0 18px 50px #0007;
}
.personal-list-header > div:first-child { min-width: 0; display: grid; grid-template-columns: 70px minmax(100px, 1fr) auto; align-items: center; gap: 8px; }
.personal-list-header h2 { grid-column: 1; grid-row: 1; margin: 17px 0 0; color: #aaa7b5; font-size: 6px; letter-spacing: .2em; text-align: center; pointer-events: none; }
.console-brand { grid-column: 1; grid-row: 1; margin: 0; min-height: 35px; display: grid; place-items: center; color: #d8d6e0; border: 1px solid #555160; border-radius: 7px; background: linear-gradient(#777283, #5d5868); box-shadow: 0 3px 0 #474351, inset 0 1px #9d97a8; font-size: 14px; font-weight: 850; font-style: italic; letter-spacing: .12em; }
.personal-header-actions { display: flex; align-items: flex-start; }
.console-refresh-key {
  width: 27px;
  height: 27px;
  color: #cbc9d3;
  border: 1px solid #555160;
  border-radius: 999px;
  background: #5b5666;
  box-shadow: inset 0 1px #817b8d;
  font-size: 14px;
  font-weight: 800;
}
.console-refresh-key:active { transform: translateY(1px); }
.console-refresh-key:disabled { opacity: .45; }
.personal-connection { grid-column: 3; grid-row: 1; margin: 0; padding: 8px 10px 8px 21px; position: relative; color: #e3e2e8; border: 1px solid #565160; border-radius: 999px; background: #5b5666; font-size: 9px; font-weight: 850; letter-spacing: .02em; white-space: nowrap; }
.personal-connection::before { content: ""; width: 7px; height: 7px; position: absolute; left: 9px; top: 50%; transform: translateY(-50%); border-radius: 50%; background: #4de19a; box-shadow: 0 0 8px #4de19a; }
.quota-capsule { grid-column: 2; grid-row: 1; margin: 0; width: 100%; padding: 6px 9px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px 7px; color: #c8c5d0; border: 1px solid #565160; border-radius: 999px; background: #5b5666; font-weight: 800; }
.quota-used { color: #f0eef4; font-size: 12px; }
.quota-reset { justify-self: end; color: #b8b4c0; font-size: 9px; white-space: nowrap; }
.quota-track { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 99px; background: #403c49; box-shadow: inset 0 1px 2px #2227; }
.quota-fill { height: 100%; display: block; border-radius: inherit; background: #12aeb4; box-shadow: 0 0 7px #12aeb499; }
.personal-node-strip { grid-column: 1 / -1; grid-row: 2; margin-top: 4px; display: flex; gap: 5px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.personal-node-strip::-webkit-scrollbar { display: none; }
.personal-node-pill {
  min-height: 39px;
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #c5c2cc;
  background: #5c5767;
  border: 1px solid #4c4856;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}
.personal-node-pill.online { color: #85e0d7; border-color: #477d78; }
.personal-node-pill.offline { color: #d6b37f; border-color: #766248; }
.personal-node-pill.selected { color: #f5ffff; background: #393641; border-color: #2d2a33; box-shadow: inset 0 0 0 1px #777180, 0 2px 0 #292630; }
.personal-node-pill { display: grid; grid-template-columns: auto auto; align-items: center; gap: 1px 6px; text-align: left; }
.personal-node-pill strong { font-size: 11px; }
.node-primary-state { font-size: 10px; font-weight: 850; }
.personal-node-pill small { grid-column: 1 / -1; color: currentColor; opacity: .68; font-size: 9px; font-weight: 500; }
.personal-node-pill:disabled { cursor: not-allowed; opacity: .72; }
.create-thread-form { margin: 12px auto 0; width: min(760px, calc(100% - 32px)); padding: 16px; display: grid; gap: 10px; border: 1px solid #33465d; border-radius: 14px; background: #101923; }
.create-thread-actions, .thread-list-filters { display: flex; justify-content: flex-end; gap: 8px; }
.personal-thread-content {
  margin: 0 auto 36px;
  width: min(760px, 100%);
  min-height: 96px;
  padding: 5px 18px calc(22px + env(safe-area-inset-bottom));
  color: #31303a;
  border: 1px solid #696475;
  border-top: 0;
  border-radius: 0 0 24px 24px;
  background: linear-gradient(155deg, #6c6678, #575362);
  box-shadow: inset 0 -1px #898294, 0 18px 50px #0007;
  overflow-x: hidden;
}
.personal-thread-card { padding: 16px; display: grid; gap: 11px; border: 1px solid #1f2b3a; border-radius: 12px; background: #111925; }
.personal-thread-card + .personal-thread-card { margin-top: 10px; }
.personal-thread-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.personal-thread-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #8391a4; font-size: 11px; }
.personal-thread-meta .status-dot { width: auto; height: auto; padding-left: 14px; position: relative; background: none; }
.personal-thread-meta .status-dot::before { content: ""; width: 7px; height: 7px; position: absolute; left: 0; top: 3px; border-radius: 50%; background: #78879a; }
.personal-thread-meta .status-dot.idle::before { background: #51b987; }
.personal-thread-meta .status-dot.running::before { background: #62a8ff; }
.personal-thread-meta .status-dot.waiting_approval::before { background: #f0b35c; }
.personal-thread-meta .status-dot.failed::before { background: #ff766b; }
.personal-list-state { margin: 0; padding: 24px 12px; color: #8e9bad; text-align: center; font-size: 13px; }
.personal-list-state.error { color: #ffaaa0; }
.personal-thread-card:focus { outline: 2px solid #62a8ff; outline-offset: 2px; }
.console-task-bay { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 9px; }
.personal-task-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 7px;
}
.personal-task-slot {
  min-height: 82px;
  min-width: 0;
  padding: 8px 7px 7px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  gap: 3px;
  text-align: left;
  color: #393a42;
  background: linear-gradient(145deg, #f3e6fb, #d7c6e2);
  border: 1px solid #a698ae;
  border-radius: 9px;
  box-shadow: 0 5px 0 #8e8a94, 0 7px 11px #77727e55, inset 0 1px #fff;
}
.personal-task-slot:not(:disabled):active { transform: translateY(4px); box-shadow: 0 1px 0 #8e8a94, inset 0 1px #fff; }
.personal-task-slot.selected { outline: 2px solid #13aeb5; outline-offset: 1px; }
.personal-task-slot.empty { color: #85828c; background: linear-gradient(145deg, #eadcf1, #cbbcd5); }
.task-slot-number { grid-column: 1 / -1; color: #56505d; font-size: 14px; font-weight: 500; letter-spacing: .05em; text-align: center; }
.task-slot-led { width: 24px; height: 24px; position: absolute; left: 50%; top: 43px; transform: translate(-50%, -50%); border: 1.5px solid #857d8d; border-radius: 50%; background: transparent; }
.personal-task-slot.idle .task-slot-led { border-color: #20aaa8; background: radial-gradient(circle, #20aaa8 0 2px, transparent 3px); box-shadow: 0 0 5px #20aaa866; }
.personal-task-slot.running .task-slot-led { border-color: #19baca; background: radial-gradient(circle, #19baca 0 3px, transparent 4px); box-shadow: 0 0 7px #19baca88; animation: console-pulse 1.25s ease-in-out infinite; }
.personal-task-slot.waiting_approval .task-slot-led { border-color: #b98d46; background: radial-gradient(circle, #d39c43 0 3px, transparent 4px); }
.personal-task-slot.failed .task-slot-led { border-color: #b55a52; background: radial-gradient(circle, #cf655b 0 3px, transparent 4px); }
.personal-task-slot.offline .task-slot-led { border-color: #8a858f; background: repeating-linear-gradient(45deg, transparent 0 3px, #8a858f 3px 4px); box-shadow: none; }
.personal-task-slot.offline { filter: saturate(.45); }
.task-slot-short { overflow: hidden; color: #686771; font-size: 8px; font-weight: 900; letter-spacing: .06em; text-overflow: ellipsis; white-space: nowrap; }
.task-slot-node, .thread-node-badge {
  overflow: hidden;
  color: #087f85;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.console-add-key {
  padding: 6px;
  color: #fff7ee;
  border: 1px solid #c2582e;
  border-radius: 11px;
  background: linear-gradient(90deg, #e16431, #f07b3f);
  box-shadow: 0 5px 0 #9b3e20, 0 8px 14px #6c341e55, inset 0 1px #ffb18a;
  display: grid;
  place-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}
.console-add-plus { font-size: 30px; font-weight: 300; line-height: 1; }
.console-add-key:not(:disabled):active { transform: translateY(4px); box-shadow: 0 1px 0 #9b3e20, inset 0 1px #ffb18a; }
.console-add-key:disabled { filter: grayscale(.08); opacity: .82; }
.personal-console-actions {
  margin: 15px 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 7px;
}
.console-key {
  min-height: 46px;
  color: #4c4752;
  border: 1px solid #a698ae;
  border-radius: 8px;
  background: linear-gradient(#f2e4fa, #d3c4dd);
  box-shadow: 0 4px 0 #918498, 0 6px 9px #322e3844, inset 0 1px #fff;
  font-size: 10px;
  font-weight: 850;
}
.console-key.wide { grid-column: span 2; min-height: 55px; font-size: 12px; letter-spacing: .08em; }
.console-key:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 #918498, inset 0 1px #fff; }
.console-key:disabled { color: #77707c; opacity: .74; }
.console-key.all, .console-key.codex { color: #eeeef2; border-color: #2c2932; background: linear-gradient(#514d59, #35323b); box-shadow: 0 4px 0 #222027, 0 6px 9px #322e3844, inset 0 1px #77717e; }
.console-key.plan::before { content: "▯"; margin-right: 5px; }
.console-key.goal::before { content: "◎"; margin-right: 5px; }
.console-key.interrupt::before { content: "Ⅱ"; margin-right: 5px; }
.console-key.all::before { content: "▤"; margin-right: 5px; }
.console-key.voice::before { content: "◉"; margin-right: 7px; font-size: 15px; }
.home-console-control { margin-top: 18px; padding: 12px 11px 14px; display: grid; grid-template-columns: minmax(0, 1fr) 78px; align-items: end; gap: 10px; border: 1px solid #4a4553; border-radius: 9px; background: #514c5c; box-shadow: inset 0 1px #716a7d, 0 3px 0 #3f3b47; }
.console-control-heading { grid-column: 1 / -1; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.console-control-label { color: #aaa5b2; font-size: 9px; font-weight: 850; letter-spacing: .06em; }
.console-control-model { overflow: hidden; color: #e4e0e8; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.thread-context-summary { color: #8e9bad; font-size: 11px; }
.effort-rail { min-width: 0; display: grid; gap: 3px; }
.effort-rail input[type="range"] { width: 100%; min-height: 32px; margin: 0; accent-color: #0faeb5; touch-action: pan-x; }
.effort-rail-labels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; }
.effort-label { min-width: 0; min-height: 24px; padding: 0; color: #c0bbc6; border: 0; background: none; font-size: 8px; font-weight: 900; }
.effort-label.selected { color: #8bf3ef; text-shadow: 0 0 7px #35d5d0; }
.effort-label:disabled { color: #77727e; opacity: .52; }
.model-knob {
  width: 72px;
  height: 72px;
  position: relative;
  display: grid;
  place-content: center;
  gap: 2px;
  text-align: center;
  color: #4c4753;
  border: 4px solid #b5a8c0;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 31%, #e6d8ee, #baabc6 62%, #94869e);
  box-shadow: 0 5px 0 #37323e, 0 8px 13px #1e1b2455, inset 0 2px 3px #fff8;
}
.model-knob::before { content: ""; width: 2px; height: 13px; position: absolute; top: 4px; left: 50%; background: #ff5b4d; border-radius: 2px; box-shadow: 0 0 5px #ff5b4d; }
.model-knob strong { font-size: 8px; letter-spacing: .14em; }
.model-knob-value { max-width: 52px; overflow: hidden; color: #544e5a; font-size: 10px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.model-knob:active { transform: translateY(3px); box-shadow: 0 2px 0 #37323e, inset 0 2px 3px #fff8; }
.model-knob:disabled { filter: grayscale(.6); opacity: .55; }
.model-picker-sheet { width: min(480px, calc(100% - 20px)); max-height: min(68dvh, 520px); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); position: fixed; z-index: 20; left: 50%; bottom: 8px; transform: translateX(-50%); overflow-y: auto; color: #e9edf3; border: 1px solid #4c5968; border-radius: 20px; background: rgba(17, 24, 32, .98); box-shadow: 0 24px 80px #000b; backdrop-filter: blur(18px); }
.model-picker-sheet[hidden] { display: none; }
.model-picker-header { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 800; }
.model-picker-close { min-height: 36px; padding: 0 12px; color: #b9f3f0; border: 1px solid #385c5c; border-radius: 10px; background: #203638; font-weight: 800; }
.model-picker-options { display: grid; gap: 8px; }
.model-picker-option { min-height: 58px; padding: 10px 12px; display: grid; gap: 5px; text-align: left; color: #d8e0e8; border: 1px solid #354453; border-radius: 12px; background: #18222c; }
.model-picker-option.selected { border-color: #35c5c2; box-shadow: inset 3px 0 #35c5c2; }
.model-picker-option small { color: #8193a4; font-size: 10px; }
.current-task-screen { margin-top: 16px; min-height: 142px; padding: 14px 48px 13px 15px; position: relative; display: grid; align-content: start; gap: 7px; color: #dce9e9; border: 4px solid #76747d; border-radius: 12px; background: radial-gradient(circle at 16% 0%, #1d3639, transparent 38%), #121a1c; box-shadow: inset 0 0 24px #0008, 0 3px 0 #8d8993; }
.screen-kicker { color: #3fd1cd; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.current-task-screen strong { overflow: hidden; color: #f2f7f6; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.screen-meta { display: grid; gap: 3px; color: #86a09f; font-size: 10px; }
.screen-summary { margin: 2px 0 0; overflow: hidden; color: #c2d0cf; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.screen-enter-key { width: 31px; height: 54px; position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: #a9f2ef; border: 1px solid #38575a; border-radius: 8px; background: #27383b; font-size: 18px; }
.screen-enter-key:not(:disabled):active { transform: translateY(calc(-50% + 3px)); background: #345054; box-shadow: inset 0 0 0 1px #6cc8c5; }
.screen-enter-key:disabled { color: #556466; opacity: .55; }
.backend-switch { margin: 15px auto 0; width: min(240px, 100%); padding: 3px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #95929c; border-radius: 999px; background: #aaa7b0; }
.backend-switch button { min-height: 31px; color: #64636c; border: 0; border-radius: 999px; background: transparent; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.backend-switch button.active { color: #e6ffff; background: #30363b; box-shadow: inset 0 0 0 1px #596168; }
.backend-switch button:disabled { opacity: .45; }
.thread-drawer { margin-top: 15px; padding: 12px; color: #dce6f2; border: 1px solid #343e49; border-radius: 13px; background: #111820; }
.thread-drawer[hidden] { display: none; }
.thread-drawer-header { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.thread-drawer-header > strong { font-size: 12px; }
.thread-list-filters { align-items: center; }
.thread-drawer-close { min-height: 34px; padding: 0 10px; color: #b8c3d0; border: 1px solid #384654; border-radius: 8px; background: #1b2630; font-size: 10px; }
@keyframes console-pulse { 50% { opacity: .45; } }
.detail-header { margin: 28px auto 0; width: min(760px, calc(100% - 32px)); display: flex; align-items: center; gap: 14px; padding: 20px; border: 1px solid #202b3a; border-radius: 16px 16px 0 0; background: #0e151f; }
.detail-header > div:nth-child(2) { flex: 1; min-width: 0; }
.detail-header h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-panel { margin: 0 auto 36px; width: min(760px, calc(100% - 32px)); padding: 18px; border: 1px solid #202b3a; border-top: 0; border-radius: 0 0 16px 16px; background: #0b1119; }
.thread-history { display: grid; gap: 12px; }
.thread-message { padding: 14px; border-radius: 12px; background: #111925; }
.thread-message.user { border-left: 3px solid #62a8ff; }
.thread-message.assistant { border-left: 3px solid #72cfaa; }
.thread-message.tool { border-left: 3px solid #f0b35c; }
.thread-message-role { display: block; margin-bottom: 7px; color: #a9b7c8; font-size: 12px; font-weight: 700; }
.thread-message-body { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.thread-message-time { display: block; margin-top: 9px; color: #77879b; font-size: 11px; }
.mobile-approval-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #6b4f28;
  border-radius: 12px;
  background: #241b10;
}
.mobile-approval-card p { margin: 7px 0 0; }
.node-offline-banner {
  margin: 0 0 14px;
  padding: 11px 13px;
  color: #f0c98d;
  background: #251c10;
  border: 1px solid #664d2c;
  border-radius: 10px;
  font-size: 12px;
}
.thread-composer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 auto;
  width: min(760px, calc(100% - 32px));
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  border: 1px solid #202b3a;
  border-radius: 16px;
  background: rgba(11, 17, 25, .96);
  backdrop-filter: blur(18px);
}
.thread-composer-settings {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}
.thread-setting-select {
  min-height: 34px;
  max-width: 190px;
  padding: 0 9px;
  color: #dce6f2;
  background: #111925;
  border: 1px solid #2a3647;
  border-radius: 8px;
}
.thread-plan-setting {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8e9bad;
  font-size: 11px;
  white-space: nowrap;
}
.thread-composer-input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 68px;
  max-height: 32vh;
  resize: vertical;
  padding: 11px 12px;
  color: #e8edf6;
  background: #111925;
  border: 1px solid #2a3647;
  border-radius: 10px;
  font: inherit;
  line-height: 1.45;
}
.thread-input-actions { display: flex; gap: 7px; }
.thread-composer > .button.primary { justify-self: end; min-width: 88px; }
.thread-composer-input:focus { outline: 2px solid #62a8ff; outline-offset: 1px; }
.execution-state { margin: 8px 0 0; color: #8e9bad; font-size: 12px; font-weight: 700; }
.execution-state.accepted { color: #f0c36b; }
.execution-state.running { color: #62a8ff; }
.execution-state.completed { color: #72cfaa; }
.execution-state.failed, .execution-state.interrupted { color: #ff8f84; }
.live-output { margin-top: 16px; padding: 14px; border: 1px solid #26384c; border-radius: 12px; background: #0e1722; }
.live-output > strong { display: block; margin-bottom: 8px; font-size: 12px; }
.live-output-row { padding: 8px 0; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #1f2d3d; color: #b8c6d8; font-size: 12px; }
.live-output-row time { flex: 0 0 auto; color: #718096; font-size: 10px; }
.sync-state { margin: 12px 0 0; color: #72cfaa; font-size: 11px; }
@media (max-width: 820px) {
  .topbar { padding: 0 18px; }
  .fixture-banner { padding: 10px 18px; align-items: flex-start; flex-direction: column; gap: 3px; }
  .workspace { display: block; }
  .thread-panel { padding: 14px 12px; border-right: 0; border-bottom: 1px solid #1f2937; overflow-x: auto; white-space: nowrap; }
  .panel-title { display: none; }
  .thread-card { width: min(78vw, 280px); display: inline-grid; vertical-align: top; white-space: normal; }
  .thread-card + .thread-card { margin: 0 0 0 6px; }
  .detail-panel { padding: 24px 16px 42px; }
  .detail-header { align-items: flex-start; flex-direction: column; }
  .content-grid { grid-template-columns: 1fr; }
  .personal-list-header { margin-top: 0; }
  .personal-thread-content { overflow-x: hidden; }
  .personal-task-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .personal-console-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .thread-composer { grid-template-columns: 1fr; bottom: env(safe-area-inset-bottom); }
  .thread-composer-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
  }
  .thread-setting-select { width: 100%; min-width: 0; max-width: none; }
  .thread-plan-setting { grid-column: 1 / -1; white-space: normal; }
  .thread-composer .button { min-height: 44px; }
}

@media (max-width: 480px) {
  body { background: #575362; }
  #personal-thread-list, .personal-console-root { min-height: 100dvh; display: flex; flex-direction: column; background: #575362; }
  .personal-list-header, .personal-thread-content { border-inline: 0; border-radius: 0; }
  .personal-list-header { box-shadow: inset 0 1px #aaa4b4; }
  .personal-thread-content { margin-bottom: 0; min-height: 0; flex: 1; display: flex; flex-direction: column; justify-content: space-between; border-bottom: 0; box-shadow: none; }
}
