:root {
  color-scheme: light;
  --bg: #12161c;
  --surface: #20252d;
  --surface-2: #191e24;
  --ink: #f3f5f7;
  --muted: #959da8;
  --line: #3b424d;
  --green: #20f179;
  --green-soft: #123a26;
  --blue: #2b8dff;
  --blue-soft: #183455;
  --amber: #ffb51b;
  --amber-soft: #423315;
  --red: #ff4a57;
  --red-soft: #462126;
  --purple: #dd45ff;
  --purple-soft: #41224a;
  --sidebar: #181b20;
  --radius: 18px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Avenir Next", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 14px; background: var(--sidebar); color: #fff; display: flex; flex-direction: column; border-right: 1px solid #313740; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 0 8px 30px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 14px; border: 1px solid rgba(49,85,217,.3); background: #fff; box-shadow: 0 5px 14px rgba(36,56,100,.16); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: .04em; }
.brand small { color: #8f9b91; margin-top: 2px; }
nav { display: grid; gap: 6px; }
.nav-item { border: 0; background: transparent; color: #929c94; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 11px; text-align: left; }
.nav-item span { width: 20px; text-align: center; font-size: 16px; }
.nav-item:hover { background: #242a31; color: #fff; }
.nav-item.active { background: #1d4e86; color: #fff; border-left: 2px solid #4ba4ff; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #2b332d; padding: 18px 8px 0; display: flex; align-items: center; gap: 10px; }
.sidebar-foot strong, .sidebar-foot small { display: block; font-size: 12px; }
.sidebar-foot small { color: #879188; margin-top: 3px; }
.safe-dot { width: 9px; height: 9px; border-radius: 50%; background: #48d597; }
main { min-width: 0; padding: 34px clamp(24px, 3.5vw, 54px) 70px; background-image: linear-gradient(rgba(59,66,77,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(59,66,77,.08) 1px, transparent 1px); background-size: 36px 36px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.topbar h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 500; letter-spacing: -.045em; margin: 2px 0 0; }
.eyebrow { color: var(--muted); font-weight: 750; font-size: 11px; letter-spacing: .13em; margin: 0; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.sync-state { border: 1px solid #385347; background: #17241e; padding: 9px 12px; border-radius: 999px; font-size: 12px; color: #9bb4a5; }
.sync-state i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--amber); }
.sync-state.live i { background: var(--green); }
.button { border: 1px solid transparent; padding: 10px 15px; border-radius: 10px; font-weight: 700; }
.button.primary { background: #e5e9e6; color: #13181d; }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.button.danger { background: var(--red-soft); color: var(--red); }
.button.small { padding: 7px 10px; font-size: 12px; }
.view { display: none; }
.view.active { display: block; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); margin-bottom: 14px; }
.metric { padding: 16px 18px; border-right: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric:last-child { border-right: 0; }
.metric strong { display: block; font-size: 25px; letter-spacing: -.04em; }
.metric.green strong { color: var(--green); text-shadow: 0 0 12px rgba(32,241,121,.28); }
.metric.blue strong { color: var(--blue); text-shadow: 0 0 12px rgba(43,141,255,.28); }
.metric.amber strong { color: var(--amber); text-shadow: 0 0 12px rgba(255,181,27,.26); }
.metric.purple strong { color: var(--purple); text-shadow: 0 0 12px rgba(221,69,255,.25); }
.metric span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.metric-bars { height: 38px; display: flex; align-items: end; gap: 3px; }
.metric-bars i { width: 4px; height: calc(var(--bar) * 4px); border-radius: 2px 2px 0 0; background: currentColor; opacity: .65; }
.metric.green .metric-bars { color: var(--green); }.metric.blue .metric-bars { color: var(--blue); }.metric.amber .metric-bars { color: var(--amber); }.metric.purple .metric-bars { color: var(--purple); }
.section-heading, .panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.section-heading { margin: 28px 0 16px; }
.section-heading h2, .panel h2, dialog h2 { margin: 3px 0 0; font-size: 21px; letter-spacing: -.025em; }
.muted { color: var(--muted); }
.desks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.desk { background: linear-gradient(145deg, #20262d, #1b2026); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-height: 190px; position: relative; overflow: hidden; }
.desk::after { content: ""; position: absolute; inset: auto 18px 14px; height: 2px; border-radius: 4px; background: var(--surface-2); }
.desk.working::after, .desk.reviewing::after { background: var(--blue); }
.desk.online::after { background: var(--green); }
.desk.paused::after, .desk.waiting::after { background: var(--amber); }
.desk.blocked::after { background: var(--red); }
.person { display: flex; align-items: center; gap: 11px; }
.avatar { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: #262c34; border: 1px solid #46505c; font-weight: 850; }
.person strong, .person small { display: block; }
.person small { color: var(--muted); margin-top: 3px; }
.status-pill { margin-left: auto; align-self: flex-start; border-radius: 999px; padding: 6px 9px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); color: var(--muted); }
.desk.working .status-pill, .desk.reviewing .status-pill { color: var(--blue); background: var(--blue-soft); }
.desk.online .status-pill { color: var(--green); background: var(--green-soft); }
.desk.paused .status-pill, .desk.waiting .status-pill { color: var(--amber); background: var(--amber-soft); }
.desk-current { color: var(--ink); font-size: 14px; line-height: 1.45; margin: 25px 0 0; max-width: 90%; }
.desk-time { color: var(--muted); font-size: 11px; margin-top: 10px; }
.desk-signal { height: 36px; display: flex; align-items: end; gap: 3px; margin-top: 16px; opacity: .8; }
.desk-signal i { flex: 1; max-width: 10px; height: calc(var(--signal) * 3px); border-radius: 2px 2px 0 0; background: #56606d; }
.desk.working .desk-signal i, .desk.reviewing .desk-signal i { background: var(--blue); }.desk.online .desk-signal i { background: var(--green); }.desk.paused .desk-signal i, .desk.waiting .desk-signal i { background: var(--amber); }
.two-column { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 14px; margin: 14px 0; }
.panel { background: linear-gradient(145deg, #20252d, #1c2127); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; }
.operations-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .75fr); gap: 14px; }
.operations-panel { border-color: #435044; }
.health-score { color: var(--green); font-size: 14px; text-shadow: 0 0 12px rgba(32,241,121,.38); }
.signal-legend { display: flex; gap: 18px; margin: 15px 0 8px; font-size: 10px; color: var(--muted); }
.signal-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; background: currentColor; }
.signal-legend .green { color: var(--green); }.signal-legend .red { color: var(--red); }.signal-legend .purple { color: var(--purple); }
.signal-chart { height: 190px; position: relative; overflow: hidden; border: 1px solid #39443c; border-radius: 10px; background: linear-gradient(rgba(32,241,121,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(32,241,121,.05) 1px, transparent 1px), #171c1c; background-size: 36px 36px; }
.signal-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.signal-chart .area { stroke: none; }.signal-chart .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.green-area { fill: url(#greenFill); }.green-line { stroke: var(--green); filter: drop-shadow(0 0 4px rgba(32,241,121,.55)); }
.purple-area { fill: url(#purpleFill); }.purple-line { stroke: var(--purple); filter: drop-shadow(0 0 3px rgba(221,69,255,.45)); }
.source-count { color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 11px; }
.source-list { display: grid; margin-top: 12px; }
.source-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.source-item:last-child { border-bottom: 0; }.source-item strong, .source-item small { display: block; }.source-item strong { font-size: 12px; }.source-item small, .source-item time { color: var(--muted); font-size: 10px; margin-top: 3px; }
.source-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); }.source-icon.red { color: var(--red); }.source-icon.amber { color: var(--amber); }.source-icon.green { color: var(--green); }
.text-button { background: transparent; border: 0; color: var(--blue); font-weight: 700; font-size: 12px; }
.task-list { display: grid; gap: 9px; margin-top: 18px; }
.task { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #1a1f25; cursor: pointer; }
.task:hover { border-color: #bcc5bd; }
.task-id { font-size: 11px; font-weight: 850; color: var(--muted); }
.task strong { display: block; font-size: 13px; }
.task small { display: block; color: var(--muted); margin-top: 4px; }
.stage { display: inline-flex; border-radius: 999px; padding: 6px 8px; font-size: 9px; letter-spacing: .06em; font-weight: 850; background: var(--blue-soft); color: var(--blue); white-space: nowrap; }
.stage.SHIPPED, .stage.COMPLETE { background: var(--green-soft); color: var(--green); }
.stage.BLOCKED, .stage.CHANGES_REQUESTED { background: var(--red-soft); color: var(--red); }
.stage.WAITING_OWNER, .stage.OWNER_APPROVED { background: var(--amber-soft); color: var(--amber); }
.lock { background: var(--ink); color: #fff; padding: 9px; border-radius: 9px; font-weight: 900; font-size: 10px; }
.gate-panel > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.gate-flow { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; font-size: 11px; font-weight: 800; }
.gate-flow b { color: var(--muted); }
.owner-wait { margin-top: 12px; font-size: 12px; color: var(--muted); }
.repo-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.repo-mini { padding: 12px; background: #181d22; border: 1px solid #313841; border-radius: 10px; }
.repo-mini strong, .repo-mini span { display: block; }
.repo-mini strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.repo-mini span { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); margin-top: 6px; }
.dirty { color: var(--amber) !important; }
.pipeline-board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 18px; }
.lane { min-height: 520px; background: #171b20; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.lane-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 3px 12px; }
.lane-head strong { font-size: 12px; }
.lane-head span { background: var(--surface); border: 1px solid var(--line); padding: 3px 7px; border-radius: 999px; font-size: 10px; }
.lane .task { grid-template-columns: 1fr; margin-bottom: 8px; background: var(--surface); }
.lane .stage { justify-self: start; }
.review-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.review-stat { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 15px; }
.review-stat strong, .review-stat span { display: block; }
.review-stat strong { font-size: 23px; }
.review-stat span { color: var(--muted); font-size: 11px; margin-top: 5px; }
.agent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.agent-card { min-height: 210px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, #20252d, #1b2026); cursor: pointer; }
.agent-card:hover { border-color: var(--blue); }
.agent-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; }
.agent-head strong, .agent-head small { display: block; }
.agent-head small { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.agent-avatar { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid #495463; border-radius: 12px; background: var(--purple-soft); color: var(--purple); font-weight: 900; }
.agent-status { padding: 6px 8px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.agent-status.running { background: var(--green-soft); color: var(--green); }.agent-status.failed, .agent-status.stopped { background: var(--red-soft); color: var(--red); }.agent-status.paused, .agent-status.waiting { background: var(--amber-soft); color: var(--amber); }.agent-status.completed { background: var(--blue-soft); color: var(--blue); }
.agent-card > p { min-height: 42px; margin: 24px 0; color: var(--ink); font-size: 12px; line-height: 1.5; }
.agent-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }
.bridge-state { display: flex; align-items: center; gap: 7px; margin-top: 13px; color: var(--amber); font-size: 10px; }
.bridge-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }.bridge-state.acknowledged { color: var(--green); }
.bridge-note { padding: 11px; border: 1px solid #5a4a27; border-radius: 10px; background: var(--amber-soft); color: #e8c878; font-size: 11px; line-height: 1.5; }
.agent-chat-dialog { width: min(760px, calc(100vw - 30px)); }
.agent-chat-dialog > div { padding: 24px; }
.agent-chat-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.agent-messages { display: grid; gap: 10px; max-height: min(48vh, 470px); overflow-y: auto; margin: 18px 0; padding: 4px; }
.agent-message { max-width: 84%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.agent-message.owner { justify-self: end; border-color: #315c8a; background: var(--blue-soft); }.agent-message.agent, .agent-message.claude { justify-self: start; border-color: #405946; background: var(--green-soft); }
.agent-message > div { display: flex; justify-content: space-between; gap: 16px; }.agent-message strong { font-size: 10px; text-transform: uppercase; }.agent-message span { color: var(--muted); font-size: 9px; }.agent-message p { margin: 7px 0 0; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.agent-controls { align-items: center; }.agent-controls .danger { margin-right: auto; }
.todo-list { display: grid; gap: 12px; max-width: 980px; }.todo-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: var(--radius); background: var(--surface); animation: todo-in .35s ease both; transition: transform .2s ease, border-color .2s ease, opacity .25s ease, box-shadow .2s ease; }.todo-card:hover { transform: translateY(-2px); border-color: var(--amber); box-shadow: 0 8px 24px rgba(0,0,0,.18); }.todo-card h3 { margin: 5px 0 9px; font-size: 17px; }.todo-card p:not(.eyebrow) { max-width: 800px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }.todo-card.complete { border-left-color: var(--green); opacity: .65; }.todo-actions { display: flex; align-items: center; gap: 8px; }.todo-status { color: var(--amber); font-size: 10px; font-weight: 800; text-transform: uppercase; }.todo-card.complete .todo-status { color: var(--green); }
@keyframes todo-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
.room-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: 650px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.room-people { padding: 20px; border-right: 1px solid var(--line); background: #181d23; }
.room-people h3 { margin: 4px 0 18px; }
.room-participants { display: grid; gap: 8px; }
.room-person { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid #333b46; border-radius: 11px; background: var(--surface-2); }
.room-person > i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 7px currentColor; color: var(--amber); }.room-person > i.connected { color: var(--green); background: var(--green); }
.room-person strong, .room-person small { display: block; }.room-person strong { font-size: 11px; }.room-person small { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.room-person button { width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }.room-person button:hover { background: var(--red-soft); color: var(--red); }
.room-chat { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; }
.room-messages { display: grid; align-content: start; gap: 11px; min-height: 0; max-height: 530px; overflow-y: auto; padding: 22px; }
.room-message { max-width: 78%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.room-message.owner { justify-self: end; border-color: #315c8a; background: var(--blue-soft); }.room-message.claude { justify-self: start; border-color: #49613c; background: var(--green-soft); }.room-message.codex { justify-self: start; border-color: #70457a; background: var(--purple-soft); }
.room-message > div { display: flex; justify-content: space-between; gap: 20px; }.room-message strong { font-size: 10px; text-transform: uppercase; }.room-message time, .room-message small { color: var(--muted); font-size: 9px; }.room-message p { margin: 8px 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.room-chat form { padding: 16px 20px 20px; border-top: 1px solid var(--line); background: #1b2026; }.room-chat form label { margin-top: 0; }.room-delivery-note { margin-right: auto; font-size: 10px; }
.remote-actions { display: grid; gap: 8px; margin-top: 12px; }.remote-actions .button { width: 100%; }
.remote-dialog-content { padding: 24px; }.remote-dialog-content pre { max-height: 420px; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--green); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.release-list { display: grid; gap: 12px; }
.release { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 20px; }
.release-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.manifest { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 12px; }
.manifest th, .manifest td { text-align: left; border-top: 1px solid var(--line); padding: 10px 8px; }
.manifest th { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.repo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.repo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.repo-card-head { display: flex; justify-content: space-between; gap: 12px; }
.repo-card h3 { margin: 0; font-size: 15px; }
.repo-card p { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repo-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.repo-meta span { padding: 6px 8px; background: var(--surface-2); border-radius: 8px; color: var(--muted); font-size: 10px; }
.activity-list { display: grid; }
.activity { display: grid; grid-template-columns: 90px 95px 1fr; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.activity:last-child { border-bottom: 0; }
.activity time, .activity .actor { color: var(--muted); }
.empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 13px; }
dialog { border: 1px solid var(--line); border-radius: 20px; padding: 0; background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 30px)); }
dialog::backdrop { background: rgba(4, 7, 9, .68); backdrop-filter: blur(3px); }
dialog form, .detail-dialog > div { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; margin-bottom: 20px; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; }
label { display: grid; gap: 7px; font-size: 12px; font-weight: 750; margin: 13px 0; }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 10px; padding: 11px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
.drop-zone { display: grid; place-items: center; min-height: 104px; border: 1px dashed #8d9990; border-radius: 13px; background: var(--surface-2); text-align: center; padding: 16px; cursor: pointer; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--blue); background: var(--blue-soft); }
.drop-zone strong, .drop-zone small { display: block; }
.drop-zone strong { font-size: 12px; }
.drop-zone small { color: var(--muted); font-weight: 500; margin-top: 6px; }
.attachment-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.attachment-thumb { position: relative; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-file { display: grid; place-content: center; gap: 6px; width: 100%; height: 100%; padding: 10px; color: var(--blue); text-align: center; }
.attachment-file small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-thumb button { position: absolute; top: 4px; right: 4px; width: 23px; height: 23px; border: 0; border-radius: 7px; background: rgba(10, 14, 11, .78); color: #fff; }
.detail-attachments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 15px 0; }
.detail-attachments a { display: block; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.detail-attachments img { width: 100%; height: 100%; object-fit: cover; }
.detail-video { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.detail-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.detail-video a { display: block; overflow: hidden; aspect-ratio: auto; padding: 8px; border: 0; color: var(--blue); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.detail-dialog { width: min(720px, calc(100vw - 30px)); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.detail-box { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.detail-box span, .detail-box strong { display: block; }
.detail-box span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.detail-box strong { font-size: 12px; margin-top: 5px; word-break: break-word; }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; border-radius: 11px; padding: 11px 15px; font-size: 12px; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* DIENST24 visual foundation: calm white surfaces with cobalt actions. */
:root { --bg:#f4f7fb; --surface:#fff; --surface-2:#f7f9fc; --ink:#172033; --muted:#68758a; --line:#dfe6f0; --blue:#3155d9; --blue-soft:#e9eeff; --green:#159b73; --green-soft:#e6f7f0; --amber:#b77908; --amber-soft:#fff4d8; --red:#d63c4c; --red-soft:#ffeaed; --purple:#7957c7; --purple-soft:#f0ebff; --sidebar:#fff; }
html[data-theme="dark"] { --bg:#12161c; --surface:#20252d; --surface-2:#191e24; --ink:#f3f5f7; --muted:#959da8; --line:#3b424d; --sidebar:#181b20; }
main { background-image: none; }
.global-search { display:flex; align-items:center; gap:7px; width:min(240px,24vw); margin:0; padding:0 11px; border:1px solid var(--line); border-radius:11px; background:var(--surface); color:var(--muted); }
.global-search input { min-width:0; padding:9px 0; border:0; background:transparent; color:var(--ink); }
.global-search input:focus { border:0; }
.theme-toggle { min-width:42px; padding-inline:10px; font-size:16px; }
.button.primary { background:var(--blue); color:#fff; }
.button.secondary { background:var(--surface); border-color:var(--line); color:var(--ink); }
.sidebar { box-shadow:8px 0 24px rgba(36,56,100,.05); }
.brand-mark { background:var(--blue); border-color:var(--blue); }
.nav-item.active { background:var(--blue-soft); color:var(--blue); border-left-color:var(--blue); }
.nav-item:hover { background:var(--blue-soft); color:var(--blue); }
.panel,.desk,.agent-card,.repo-card,.release,.lane,.room-shell,.summary-strip,.review-stat { box-shadow:0 8px 24px rgba(36,56,100,.05); }
.panel,.desk,.agent-card,.repo-card,.release,.lane,.room-shell,.summary-strip,.review-stat { animation: office-enter .35s ease both; }
.desk:hover,.agent-card:hover,.repo-card:hover,.release:hover { transform: translateY(-2px); transition: transform .2s ease, box-shadow .2s ease; box-shadow: 0 12px 28px rgba(36,56,100,.12); }
.signal-chart { animation: signal-breathe 4s ease-in-out infinite; }
@keyframes office-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes signal-breathe { 0%,100% { opacity: .88; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
@media (max-width:900px) { .global-search { width:min(220px,38vw); } }
@media (max-width:760px) { .global-search { order:3; width:100%; } .top-actions { width:100%; } .topbar { flex-wrap:wrap; } }

@media (max-width: 1050px) {
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .desks { grid-template-columns: 1fr; }
  .desk { min-height: 150px; }
  .two-column { grid-template-columns: 1fr; }
  .repo-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .brand { padding-bottom: 12px; }
  nav { display: flex; overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  .sidebar-foot { display: none; }
  main { padding: 24px 16px 50px; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .sync-state { display: none; }
  .repo-grid, .review-summary { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: 1fr; }
  .room-shell { grid-template-columns: 1fr; }.room-people { border-right: 0; border-bottom: 1px solid var(--line); }.room-messages { max-height: 460px; }
  .activity { grid-template-columns: 70px 70px 1fr; gap: 8px; }
}

@media (max-width: 1050px) { .operations-grid { grid-template-columns: 1fr; } }

/* Final surface pass: the Office stays light by default and only becomes dark
   when the explicit theme switch is enabled. */
:root {
  --shadow: 0 10px 28px rgba(36, 56, 100, .08);
  --shadow-hover: 0 16px 34px rgba(36, 56, 100, .14);
}
html[data-theme="dark"] {
  --shadow: 0 10px 28px rgba(0, 0, 0, .24);
  --shadow-hover: 0 16px 34px rgba(0, 0, 0, .34);
}

main { background: var(--bg); }
.panel, .desk, .agent-card, .repo-card, .release, .lane,
.room-shell, .summary-strip, .review-stat { box-shadow: var(--shadow); }
.desk, .panel, .agent-card { background: var(--surface); }
.task, .repo-mini, .lane, .room-people, .room-person, .room-chat form { background: var(--surface-2); }
.task:hover, .desk:hover, .agent-card:hover, .repo-card:hover, .release:hover {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  box-shadow: var(--shadow-hover);
}
.avatar, .agent-avatar, .source-icon { background: var(--blue-soft); border-color: var(--line); }
.signal-chart {
  border-color: var(--line);
  background: var(--surface-2);
}
html[data-theme="dark"] .signal-chart {
  background: #171c1c;
}

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.topbar h1 { font-weight: 720; }
.section-heading h2, .panel h2, dialog h2 { font-weight: 700; }

/* Small, useful motion: cards lift, controls respond, and live charts breathe. */
.button, .nav-item, .icon-button, .theme-toggle, .text-button,
.room-person button, .task, .desk, .agent-card, .repo-card, .release {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease,
    background-color .2s ease, color .2s ease;
}
.button:active, .icon-button:active, .theme-toggle:active { transform: scale(.97); }
.button:focus-visible, .nav-item:focus-visible, .icon-button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 35%, transparent);
  outline-offset: 2px;
}
.metric-bars i { animation: metric-pulse 1.8s ease-in-out infinite alternate; }
.metric-bars i:nth-child(2n) { animation-delay: -.65s; }
.metric-bars i:nth-child(3n) { animation-delay: -1.1s; }
@keyframes metric-pulse { from { transform: scaleY(.72); opacity: .48; } to { transform: scaleY(1); opacity: .9; } }

@media (prefers-reduced-motion: reduce) {
  .metric-bars i { animation: none; }
}
