.shell { height: 100dvh; min-height: 0; grid-template-columns: 300px minmax(0,1fr); overflow: hidden; }
.workspace { height: 100dvh; width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) auto; }
html,body { width: 100%; max-width: 100%; }
.shell { width: 100%; max-width: 100%; }
.content,.topbar,.composer-wrap,.sidebar,.task-list,.project-group,.project-tasks { min-width: 0; max-width: 100%; }
.content { width: 100%; }
.composer { width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr) 40px; }
.composer textarea { width: 100%; min-width: 0; }
.message { grid-template-columns: 36px minmax(0,1fr); min-width: 0; }
.message > div,.device > div,.brand > div { min-width: 0; }
.message pre,.message code,.approval code { max-width: 100%; overflow-wrap: anywhere; }
.device { grid-template-columns: 38px minmax(0,1fr); }
.model-controls { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 10px; width: 100%; max-width: 790px; margin: 0 auto 6px; }
.model-controls label { display: grid; gap: 5px; min-width: 0; font-size: 12px; color: var(--muted); }
.model-controls select { width: 100%; min-width: 0; max-width: 100%; min-height: 40px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; }
.composer-wrap > .model-hint { text-align: left; max-width: 790px; margin: 0 auto 8px; line-height: 1.4; }
.sidebar { min-height: 0; padding: 20px 12px 12px; overflow: hidden; }
.brand { padding: 0 8px 22px; }
.brand small { font-size: 12px; }
.brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.icon-button { display: inline-grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: inherit; }
.icon-button:hover { background: #ffffff15; }
.drawer-close { margin-left: auto; font-size: 28px; }
.drawer-close,.drawer-toggle { display: none; }
.sidebar-search { padding: 0 4px; }
.sidebar-search input { width: 100%; min-height: 44px; border: 1px solid #405950; background: #20372f; border-radius: 10px; padding: 10px 12px; color: #fff; font-size: 16px; }
.sidebar-search input::placeholder { color: #b0c5bb; }
.sidebar-options { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 4px 0; color: #bfd0c7; font-size: 14px; }
.sidebar-options label { display: flex; align-items: center; min-height: 44px; gap: 6px; cursor: pointer; }
.sidebar-options input { width: 16px; height: 16px; accent-color: #d9f65a; }
.sidebar-options button { min-height: 44px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; }
.task-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #50675d transparent; padding-bottom: 12px; }
.section-label { display: flex; justify-content: space-between; margin: 18px 10px 10px; font-size: 14px; letter-spacing: 0; color: #b0c5bb; }
#project-count { font-size: 12px; }
#session-list { max-height: none; }
.project-group { margin-bottom: 5px; }
.project-heading { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 10px 8px; cursor: pointer; border-radius: 9px; list-style: none; }
.project-heading::-webkit-details-marker { display: none; }
.project-heading:hover,.sidebar-options button:hover { background: #ffffff0b; }
.project-heading::before { content: '›'; color: #9cb8aa; font-size: 20px; width: 10px; transition: transform .18s; }
.project-group[open] > .project-heading::before { transform: rotate(90deg); }
.project-icon { display: grid; place-items: center; width: 22px; color: #d9e7de; flex-shrink: 0; }
.project-label { min-width: 0; flex: 1; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-count { color: #afc6b9; font-size: 12px; }
.project-count.running { color: #d9f65a; }
.project-tasks { margin: 0 0 8px 18px; padding-left: 8px; border-left: 1px solid #3c5549; }
.task-item { position: relative; padding: 11px 12px; min-height: 64px; margin: 2px 0; }
.task-item:hover { background: #ffffff0b; }
.task-item.active { background: #2d483c; box-shadow: inset 3px 0 #d9f65a; }
.task-item span { font-size: 14px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-item small { font-size: 12px; color: #afc6b9; margin-top: 4px; }
.task-item.is-running small { color: #d9f65a; }
.project-empty,.sidebar-empty { font-size: 14px; line-height: 1.7; color: #aac1b3; padding: 4px 12px 10px; }
.sidebar-footer { font-size: 12px; color: #9bb5a7; border-top: 1px solid #385045; padding: 14px 8px 2px; }
.sidebar :focus-visible { outline: 2px solid #d9f65a; outline-offset: 2px; }
.topbar { gap: 14px; padding: 16px 24px; }
.task-heading { min-width: 0; flex: 1; }
.topbar h1 { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; line-height: 1.5; }
.task-heading .eyebrow { display: block; font-size: 12px; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secure { flex-shrink: 0; font-size: 14px; }
.history-controls { max-width: 790px; margin: 0 auto 20px; font-size: 14px; }
.history-controls p { color: #526174; overflow-wrap: anywhere; margin-top: 0; }
.history-controls button { padding: 10px 16px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: white; font: inherit; cursor: pointer; }
.message p { overflow-wrap: anywhere; font-size: 16px; }
.message b,.device strong { font-size: 14px; }
.message small,.device small,.composer-wrap > p { font-size: 12px; }
.device-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 30; border: 0; background: #07120d70; }
.drawer-backdrop[hidden] { display: none; }
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0,1fr); }
  .sidebar { display: flex; position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(88vw,360px); height: 100dvh; padding-top: max(16px,env(safe-area-inset-top)); padding-bottom: max(12px,env(safe-area-inset-bottom)); transform: translateX(-102%); visibility: hidden; transition: transform .24s ease,visibility .24s; box-shadow: 12px 0 40px #07120d28; }
  .drawer-open .sidebar { transform: translateX(0); visibility: visible; }
  .drawer-open { overflow: hidden; }
  .drawer-close,.drawer-toggle { display: inline-grid; }
  .topbar { display: flex; gap: 9px; padding: 9px 12px 9px 6px; padding-top: max(9px,env(safe-area-inset-top)); }
  .topbar h1 { font-size: 16px; margin-top: 1px; }
  .topbar .icon-button:hover { background: #e5eee8; }
  .secure { font-size: 0; }
  .secure span { font-size: 14px; }
  .sidebar .brand { padding-bottom: 14px; }
  .device { min-width: 0; flex: 0 0 min(255px,100%); }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar,.project-heading::before { transition: none; }
}
