/* Production shell: one final, isolated responsive contract. */

:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid #ffd66b;
  outline-offset: 2px;
}

.tool-status {
  color: #858585;
}

.message,
.tool-card,
.plan-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}

.inspector-tab-list {
  display: flex;
  min-width: 0;
  flex: 1;
}

.sidebar-nav kbd,
.composer-hint {
  color: #858585;
}

.drawer-backdrop {
  display: none;
}

.composer-settings-toggle {
  display: none;
}

@media (max-width: 899px) {
  body.drawer-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .topbar {
    min-height: 52px;
    height: 52px;
    padding: 0 10px;
  }

  .topbar-title,
  #topbarWorkspaceButton,
  #topbarVscodeButton {
    display: none;
  }

  .drawer-backdrop:not([hidden]) {
    position: fixed;
    z-index: 34;
    inset: 52px 0 0;
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    border-radius: 0;
    background: rgb(0 0 0 / 58%);
    backdrop-filter: blur(2px);
  }

  .left-panel {
    z-index: 35;
    top: 52px;
    width: min(340px, 92vw);
  }

  .right-panel {
    z-index: 36;
    top: 52px;
    width: 100vw;
    max-width: 100vw;
  }

  .sidebar-brand {
    min-height: 52px;
  }

  .section-heading {
    min-height: 44px;
    padding-bottom: 0;
  }

  .section-toggle {
    min-height: 44px;
    flex: 1;
    font-size: 14px;
    text-align: left;
  }

  .section-chevron {
    width: 18px;
    height: 18px;
  }

  .sidebar-section.collapsed {
    flex: 0 0 auto;
    max-height: none;
    padding-top: 4px;
  }

  .sidebar-section.collapsed .section-heading > :not(.section-toggle) {
    display: none;
  }

  .persistence-note {
    flex: 0 0 auto;
  }

  .project-section {
    max-height: none;
    flex: 0 1 auto;
  }

  .project-list {
    max-height: min(25vh, 220px);
  }

  .conversation-header {
    min-height: 76px;
    padding: 9px 12px;
    gap: 8px;
  }

  .conversation-title-wrap {
    min-width: 0;
  }

  .conversation-title-wrap h2 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 15px;
    line-height: 1.25;
  }

  .thread-meta {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .conversation-actions .button:not(#openInspectorButton),
  .conversation-actions #threadActionsButton {
    display: none;
  }

  .message-list {
    padding: 14px 10px 18px;
  }

  .message {
    gap: 8px;
  }

  .message-avatar {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .composer-wrap {
    position: relative;
    z-index: 25;
    overflow: visible;
    padding: 6px 8px max(7px, env(safe-area-inset-bottom));
  }

  .composer {
    position: relative;
    overflow: visible;
    border-radius: 16px;
    padding: 8px 9px;
  }

  .composer textarea {
    min-height: 38px;
    max-height: min(30vh, 150px);
    padding-bottom: 4px;
    font-size: 16px;
  }

  .composer-footer {
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
  }

  .context-actions {
    flex: 1 1 auto;
    overflow: hidden;
  }

  .context-actions .labeled,
  .voice-control {
    display: none;
  }

  .composer-settings-toggle {
    display: inline-flex;
    width: auto;
    min-width: 44px;
    padding-inline: 9px;
    font-size: 11px;
  }

  .composer-controls {
    position: absolute;
    right: 8px;
    bottom: calc(100% + 8px);
    left: 8px;
    z-index: 20;
    display: none;
    max-width: none;
    padding: 10px;
    border: 1px solid #3b3b3b;
    border-radius: 14px;
    background: #202020;
    box-shadow: 0 -14px 40px rgb(0 0 0 / 45%);
  }

  .composer-controls.mobile-settings-open {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .composer-controls select {
    width: 100%;
    max-width: none;
    min-height: 44px;
    padding: 8px;
    border: 1px solid #404040;
    background: #292929;
  }

  .composer-hint {
    display: none;
  }

  .send-button,
  .composer-tool,
  .icon-button,
  .tiny-button,
  .conversation-actions .button,
  .inspector-tab {
    min-width: 44px;
    min-height: 44px;
  }

  .inspector-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    padding-right: 0;
    overflow: hidden;
  }

  .inspector-tab-list {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  #closeInspectorButton {
    position: sticky;
    left: 0;
    display: inline-grid;
    flex: 0 0 44px;
    z-index: 6;
    border-right: 1px solid #363636;
    background: #202020;
  }

  .inspector-content {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

@media (min-width: 900px) and (max-width: 1180px) {
  .left-panel {
    width: 264px;
  }

  .right-panel {
    width: min(620px, 68vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Production workflow: compact attention states, deliberate gold accents. */
.project-row { display:grid; grid-template-columns:minmax(0,1fr) 34px 34px; align-items:center; gap:2px; }
.project-row .project-item { width:100%; min-width:0; }
.project-mini-action { min-width:32px; min-height:32px; border:0; border-radius:8px; background:transparent; color:var(--muted,#968f83); font-size:16px; }
.project-mini-action:hover,.project-mini-action.active { color:#f4bd28; background:rgba(244,189,40,.09); }
.thread-status-filter { width:100%; min-height:38px; margin:6px 0 8px; }
.composer-hint { display:flex; justify-content:space-between; gap:12px; }
.composer-destination { width:max-content; max-width:100%; margin:0 0 5px 2px; padding:3px 8px; border:1px solid rgba(246,190,43,.25); border-radius:999px; color:#d6a625; background:rgba(246,190,43,.07); font-size:10px; font-weight:650; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.composer-destination[data-kind="thread"] { color:#aaa; border-color:#333; background:#171717; }
.composer-destination[data-kind="invalid"] { color:#e8a0a0; border-color:#633; background:#211; }
.sync-status { white-space:nowrap; color:#b48a24; font-weight:650; }
.inbox-list,.notification-history,.setup-checklist,.hidden-projects-list { display:grid; gap:6px; }
.inbox-group-title { margin:16px 0 4px; color:var(--muted,#968f83); font-size:11px; letter-spacing:.09em; text-transform:uppercase; }
.inbox-row,.queue-row,.notification-row,.setting-row,.setup-row { border:1px solid var(--border,#2b271f); border-radius:10px; background:rgba(255,255,255,.025); color:inherit; text-align:left; }
.inbox-row,.notification-row { width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 12px; text-decoration:none; }
.inbox-row > span:first-child,.notification-row { min-width:0; }
.inbox-row strong,.inbox-row small,.queue-row strong,.queue-row small,.notification-row strong,.notification-row small,.setup-row strong,.setup-row small { display:block; }
.inbox-row small,.queue-row small,.notification-row small,.setup-row small { margin-top:3px; color:var(--muted,#968f83); font-size:12px; }
.inbox-row.status-needs_input,.inbox-row.status-failed { border-color:rgba(244,189,40,.46); }
.status-label { flex:0 0 auto; padding:4px 7px; border-radius:999px; background:rgba(244,189,40,.1); color:#e8b82f; font-size:11px; font-weight:700; }
.queue-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; padding:11px 12px; }
.queue-actions { display:flex; align-items:center; gap:4px; flex-wrap:wrap; justify-content:flex-end; }
.settings-section { padding:16px 0; border-bottom:1px solid var(--border,#2b271f); }
.settings-section:first-of-type { padding-top:4px; }
.settings-section h4 { margin:0 0 12px; }
.settings-checks { display:grid; gap:10px; margin:14px 0; }
.settings-checks label,.setting-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.quiet-hours { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:12px 0 16px; }
.quiet-hours input { min-height:38px; }
.notification-history { max-height:280px; overflow:auto; }
.notification-row { display:block; }
.setting-row { padding:10px 12px; margin:6px 0; }
.setup-row { display:grid; grid-template-columns:24px 1fr; gap:8px; padding:10px 12px; }
.setup-row > span:first-child { color:#e0a928; font-weight:800; }
.setup-row.ready > span:first-child { color:#50b985; }
.credit-warning { color:#e8b82f; line-height:1.45; }
.run-outcome-banner { display:flex; align-items:center; gap:10px; width:min(800px,calc(100% - 32px)); margin:0 auto 8px; padding:10px 12px; border:1px solid rgba(80,185,133,.38); border-radius:10px; background:rgba(80,185,133,.08); }
.run-outcome-banner.interrupted { border-color:rgba(244,189,40,.42); background:rgba(244,189,40,.08); }
.outcome-mark { display:grid; place-items:center; width:24px; height:24px; flex:0 0 24px; border-radius:50%; background:#50b985; color:#07120d; font-weight:900; }
.run-outcome-banner.interrupted .outcome-mark { background:#e8b82f; color:#171005; }
.outcome-copy { min-width:0; flex:1; }
.outcome-copy strong,.outcome-copy small { display:block; }
.outcome-copy small { margin-top:2px; color:var(--muted,#968f83); }
.active-run-bar.disconnected .run-orbit { animation:none; opacity:.55; }
.active-run-bar.disconnected .run-orbit span { animation:none; }
.usage-chip.warning { border-color:#d39a1f; color:#f1c247; }
body[data-text-size="small"] .message-body { font-size:13px; }
body[data-text-size="large"] .message-body { font-size:17px; line-height:1.7; }
body[data-density="compact"] .message { margin-block:6px; }
body[data-density="compact"] .message-body { padding-block:8px; }
body.focus-mode .topbar,body.focus-mode .left-panel,body.focus-mode .right-panel { display:none !important; }
body.focus-mode .workspace { grid-template-columns:1fr !important; }
body.focus-mode .main-panel { grid-column:1; }
body.focus-mode .conversation-header { min-height:auto; padding-block:8px; }
.focus-exit { display:none; position:fixed; z-index:90; top:max(10px,env(safe-area-inset-top)); right:12px; }
body.focus-mode .focus-exit { display:block; }

@media (max-width: 899px) {
  .thread-status-filter { min-height:44px; }
  .project-row { grid-template-columns:minmax(0,1fr) 42px 42px; }
  .project-mini-action { min-width:42px; min-height:42px; }
  .composer-hint { font-size:11px; }
  .composer-hint > span:first-child { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .queue-row { grid-template-columns:1fr; }
  .queue-actions { justify-content:flex-start; }
  .inbox-row { min-height:56px; }
  .run-outcome-banner { width:calc(100% - 16px); margin-bottom:6px; }
  body[data-text-size="large"] .message-body { font-size:18px; }
}
