/* ALRIX Control: persistent workspace, official brand tokens in control.css. */
.icon { display:block; width:20px; height:20px; flex:none; }
[data-icon] { display:inline-flex; align-items:center; justify-content:center; flex:none; line-height:0; }
.text-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:8px 0; background:transparent; color:var(--muted); font-size:12px; }
.text-button:hover { color:var(--ink); text-decoration:underline; text-underline-offset:4px; }
.app { display:grid; grid-template-columns:248px minmax(0,1fr); height:100dvh; min-height:540px; overflow:hidden; }
.sidebar { display:flex; flex-direction:column; min-height:0; padding:24px 16px 16px; border-right:1px solid var(--line); background:var(--paper); }
.sidebar>.brand { margin:0 10px 24px; gap:12px; }
.sidebar .brand img { width:113px; }
.sidebar .brand>span { font-size:8px; padding-left:12px; }
.workspace-label { display:flex; align-items:center; gap:12px; padding:16px 8px; margin-bottom:16px; border-block:1px solid var(--line); }
.workspace-avatar { width:36px; height:36px; background:var(--soft); border-radius:10px; }
.workspace-label>div { min-width:0; }
.workspace-label strong { display:block; font-size:13px; font-weight:600; }
.workspace-label div>span { display:block; margin-top:2px; color:var(--muted); font-size:11px; }
.private-dot { width:6px; height:6px; flex:none; margin-left:auto; background:var(--green); border-radius:50%; }
.attention-filter { display:flex; align-items:center; gap:12px; min-height:46px; padding:10px 12px; background:transparent; color:var(--muted); border:1px solid transparent; border-radius:9px; text-align:left; font-size:13px; }
.attention-filter:hover { background:var(--soft); }
.attention-filter b { margin-left:auto; font-size:12px; font-weight:500; font-variant-numeric:tabular-nums; }
.attention-filter.has-attention { color:var(--signal); background:var(--signal-soft); }
.attention-filter[aria-pressed=true] { border-color:var(--signal); }
.nav-section-label { display:flex; align-items:center; justify-content:space-between; margin:26px 12px 10px; color:var(--muted); font-size:10px; font-weight:500; letter-spacing:.1em; }
.session-list { display:flex; flex-direction:column; gap:6px; padding:3px; overflow-y:auto; min-height:0; scrollbar-width:thin; }
.session-item { position:relative; display:flex; align-items:center; gap:11px; width:100%; min-height:70px; padding:12px 10px; border:1px solid transparent; border-radius:10px; background:transparent; text-align:left; transition:background .16s,border-color .16s; }
.session-item:hover { background:var(--soft); }
.session-item.active { background:var(--white); border-color:var(--line); box-shadow:0 2px 4px #26292204; }
.session-item.active:before { content:''; position:absolute; left:-1px; top:50%; transform:translateY(-50%); width:3px; height:24px; background:var(--signal); border-radius:0 2px 2px 0; }
.session-icon { display:grid; place-items:center; flex:none; width:34px; height:34px; border-radius:9px; background:var(--soft); color:var(--muted); }
.session-item.active .session-icon { color:var(--ink); }
.session-icon .icon { width:18px; height:18px; }
.session-copy { min-width:0; flex:1; }
.session-copy strong { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; overflow-wrap:anywhere; font-size:13px; font-weight:500; line-height:1.4; }
.session-copy small { display:flex; align-items:center; gap:6px; margin-top:5px; color:var(--muted); font-size:11px; line-height:1.4; }
.session-copy small>span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.session-help-mark { display:grid; place-items:center; flex:none; width:18px; height:18px; border-radius:50%; background:var(--signal-soft); color:var(--signal); font-size:11px; font-weight:700; }
.new-session { width:100%; margin-top:14px; flex:none; background:transparent; }
.new-session:disabled { opacity:.65; border-style:dashed; }
.sidebar-bottom { margin-top:auto; padding-top:24px; }
.sidebar-link { display:flex; align-items:center; gap:12px; width:100%; min-height:44px; padding:10px 12px; border-radius:8px; background:transparent; font-size:12px; text-align:left; }
.sidebar-link>[data-icon]:last-child:not(:first-child) { margin-left:auto; }
.sidebar-link>[data-icon]:last-child:not(:first-child) .icon { width:16px; height:16px; }
.sidebar-link:hover { background:var(--soft); }
.sidebar-link.muted { color:var(--muted); }
.sidebar-divider { margin:12px; border-top:1px solid var(--line); }
.server-status { display:flex; align-items:center; gap:9px; padding:8px 14px; color:var(--muted); font-size:11px; }
.filter-empty { padding:16px 12px; color:var(--muted); font-size:12px; }
.workspace { display:flex; flex-direction:column; min-width:0; overflow:auto; outline:none; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:20px; height:64px; min-height:64px; padding:0 28px; border-bottom:1px solid var(--line); background:var(--white); }
.breadcrumb { display:flex; align-items:center; gap:12px; min-width:0; color:var(--muted); font-size:12px; }
.breadcrumb strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink); font-weight:500; }
.breadcrumb .icon { width:14px; height:14px; }
.private-badge { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:11px; white-space:nowrap; }
.private-badge .icon { width:14px; height:14px; }
.mobile-menu,.mobile-brand,.mobile-sidebar-close { display:none; }
.session-workspace { display:flex; flex-direction:column; flex:1; min-height:0; padding:24px 24px 16px; }
.session-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:22px; }
.session-heading>div { min-width:0; }
.session-kicker { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:11px; }
.kicker-line { height:10px; border-left:1px solid var(--line); }
.session-heading h1 { margin-top:7px; font:500 clamp(24px,2vw,30px)/1.25 var(--font-display); letter-spacing:-.035em; overflow-wrap:anywhere; }
.session-heading>.button { font-size:12px; }
.help-banner { display:flex; align-items:center; gap:14px; padding:16px; margin:0 0 18px; border:1px solid #dfb7ab; border-radius:10px; background:var(--signal-soft); }
.help-icon { color:var(--signal); }
.help-banner strong { font-size:13px; }
.help-banner p { margin-top:3px; color:var(--muted); font-size:12px; }
.help-banner>.button { margin-left:auto; flex:none; font-size:12px; }
.workspace-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,32%); gap:18px; flex:1; min-height:420px; }
.browser-column { display:flex; flex-direction:column; min-width:0; min-height:0; }
.browser-shell { display:grid; grid-template-rows:auto minmax(0,1fr) auto; flex:1; min-height:330px; overflow:hidden; border:1px solid var(--line); border-radius:var(--radius); background:var(--white); container-type:inline-size; }
.browser-toolbar { display:flex; align-items:center; justify-content:space-between; gap:6px; min-height:56px; padding:5px 8px 5px 16px; border-bottom:1px solid var(--line); }
.live-status { display:flex; align-items:center; gap:8px; min-width:0; color:var(--muted); font-size:11px; }
.live-status>span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.toolbar-actions { display:flex; flex:none; }
.toolbar-actions .icon { width:18px; height:18px; }
.zoom-control { display:flex; align-items:center; flex:none; gap:0; padding:0 2px; border:1px solid var(--line); border-radius:8px; background:var(--paper); }
.zoom-control .icon-button { width:36px; height:38px; }
.zoom-control .icon { width:16px; height:16px; }
.zoom-select-wrap { position:relative; }
.zoom-select-wrap select { appearance:none; width:114px; min-height:38px; padding:7px 25px 7px 8px; margin:0; background:transparent; border:0; border-radius:5px; font-size:12px; cursor:pointer; text-align:center; }
.zoom-select-wrap>[data-icon] { position:absolute; right:6px; top:50%; transform:translateY(-50%); pointer-events:none; }
.browser-stage { position:relative; min-width:0; min-height:0; background:var(--soft); }
.screen-viewport { position:absolute; inset:0; display:flex; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; }
.screen { flex:none; width:100%; height:100%; margin:auto; overflow:hidden; }
.screen-overlay { position:absolute; inset:0; z-index:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:24px; background:var(--paper); text-align:center; }
.screen-overlay h2 { font:500 21px/1.3 var(--font-display); letter-spacing:-.02em; }
.screen-overlay p { max-width:320px; color:var(--muted); font-size:13px; line-height:1.7; }
.overlay-icon { width:48px; height:48px; margin-bottom:5px; border:1px solid var(--line); border-radius:12px; }
.control-bar { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 14px; border-top:1px solid var(--line); }
.control-bar p { max-width:280px; color:var(--muted); font-size:12px; line-height:1.5; }
.control-bar .button { flex:none; font-size:12px; }
.control-bar .button.owned { background:var(--signal); border-color:var(--signal); }
.human-tools { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:8px; }
.human-tools>span { color:var(--muted); font-size:10px; letter-spacing:.08em; }
.human-tools .button { font-size:12px; }
.browser-footnote { display:flex; align-items:center; gap:7px; flex:none; padding:12px 2px 0; color:var(--muted); font-size:11px; }
.browser-footnote .icon { width:14px; height:14px; }
.browser-shell:fullscreen { width:100%; height:100dvh; border:0; border-radius:0; background:var(--paper); }
.panel-switch { display:none; }
.loader { width:22px; height:22px; border:2px solid var(--line); border-top-color:var(--signal); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.chat-panel { position:relative; display:flex; flex-direction:column; min-width:0; min-height:400px; overflow:hidden; border:1px solid var(--line); border-radius:var(--radius); background:var(--white); }
.chat-heading { display:flex; align-items:center; gap:12px; min-height:76px; padding:14px 16px; border-bottom:1px solid var(--line); }
.chat-avatar { position:relative; flex:none; width:36px; height:36px; background:var(--soft); border-radius:10px; }
.is-linked .chat-avatar:after { content:''; position:absolute; right:-2px; bottom:-2px; width:9px; height:9px; border:2px solid var(--white); border-radius:50%; background:var(--green); }
.chat-heading>div:nth-child(2) { flex:1; min-width:0; }
.chat-heading h2 { font-size:14px; font-weight:600; }
.chat-heading p { margin-top:2px; color:var(--muted); font-size:11px; line-height:1.5; }
.chat-heading>.icon-button { margin-left:auto; }
.chat-heading>.icon-button .icon { width:18px; height:18px; }
.chat-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; flex:1; min-height:0; padding:36px 24px; text-align:center; }
.chat-empty-visual { display:flex; align-items:center; margin-bottom:28px; }
.chat-empty-browser,.chat-empty-mark { width:48px; height:48px; border:1px solid var(--line); border-radius:13px; background:var(--paper); }
.chat-empty-mark { background:var(--ink); color:var(--white); border-color:var(--ink); }
.chat-empty-connector { width:28px; border-top:1px dashed var(--line); }
.chat-empty .eyebrow { color:var(--muted); font-size:9px; letter-spacing:.13em; }
.chat-empty h3 { margin-top:10px; font:500 23px/1.25 var(--font-display); letter-spacing:-.035em; }
.chat-empty p { max-width:270px; margin-top:12px; color:var(--muted); font-size:13px; line-height:1.75; }
.chat-empty .button { margin-top:24px; padding-inline:20px; font-size:12px; }
.chat-empty .text-button { margin-top:6px; }
.chat-empty .text-button .icon { width:14px; height:14px; }
.chat-empty-note { display:flex; align-items:center; gap:6px; margin-top:30px; color:var(--muted); font-size:10px; }
.chat-empty-note .icon { width:12px; height:12px; }
.chat-composer { flex:none; margin:0 12px 12px; padding:10px; border:1px solid var(--line); border-radius:12px; background:var(--white); box-shadow:0 3px 12px #26292205; }
.chat-composer:focus-within { border-color:var(--muted); }
.chat-composer textarea { min-height:72px; max-height:160px; padding:8px 6px; border:0; resize:none; background:transparent; font-size:14px; line-height:1.65; }
.chat-composer textarea:focus-visible { outline-offset:-2px; border-radius:5px; }
.composer-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-left:6px; }
.composer-footer>span { max-width:230px; color:var(--muted); font-size:10px; line-height:1.5; }
.send-button { display:grid; place-items:center; flex:none; width:40px; height:40px; background:var(--ink); color:var(--white); border-radius:10px; }
.send-button:hover:not(:disabled) { background:var(--signal); }
.send-button .icon { width:18px; height:18px; }
.chat-messages { flex:1; min-height:100px; overflow:auto; padding:22px 20px; scrollbar-width:thin; overscroll-behavior:contain; }
.message { margin:0 0 26px; overflow-wrap:anywhere; }
.message-header { display:flex; align-items:center; gap:8px; margin-bottom:8px; color:var(--muted); font-size:10px; }
.message-header strong { color:var(--ink); font-size:12px; font-weight:600; }
.message-body { font-size:13px; line-height:1.85; white-space:pre-wrap; }
.message.user { margin-left:16px; padding:14px; border-radius:12px 12px 3px 12px; background:var(--paper); border:1px solid var(--line); }
.message-status { display:block; margin-top:8px; color:var(--muted); font-size:10px; }
.message-status.failed { color:var(--signal); }
.message pre { max-width:100%; overflow-x:auto; padding:12px; border:1px solid var(--line); border-radius:8px; background:var(--paper); font-size:12px; white-space:pre; }
.message code { font-family:monospace; }
.chat-error { padding:12px 16px; border-bottom:1px solid #dfb7ab; background:var(--signal-soft); color:var(--signal); font-size:12px; }
.chat-error button { min-height:36px; margin-left:5px; background:transparent; color:inherit; font-size:12px; text-decoration:underline; }
.chat-to-bottom { position:absolute; bottom:158px; left:50%; transform:translateX(-50%); min-height:40px; border-color:var(--line)!important; background:var(--white)!important; box-shadow:0 3px 20px #26292210; font-size:12px; }
.chat-permissions:empty { display:none; }
.chat-permissions { max-height:45%; overflow:auto; padding:16px; border-bottom:1px solid var(--line); background:var(--signal-soft); }
.permission-card strong { font-size:13px; }
.permission-card pre { font-size:12px; white-space:pre-wrap; overflow-wrap:anywhere; }
.permission-actions { display:flex; gap:8px; margin-top:12px; }
.permission-actions .button { min-height:44px; font-size:12px; }
.history-note { margin:12px 0 24px; color:var(--muted); font-size:12px; text-align:center; }
.empty-state { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:18px; min-height:65dvh; padding:30px; text-align:center; }
.empty-state h1 { font:500 35px/1.2 var(--font-display); letter-spacing:-.03em; }
.empty-state p { max-width:350px; color:var(--muted); }
.empty-state>img { margin-bottom:12px; }
@container (max-width:450px) {
  .browser-toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 8px; padding:5px 10px 10px; }
  .toolbar-actions { grid-column:2; grid-row:1; }
  .zoom-control { grid-column:1/-1; grid-row:2; justify-self:stretch; justify-content:center; }
  .zoom-control .icon-button { width:44px; height:40px; }
  .zoom-select-wrap select { width:140px; min-height:40px; }
  .control-bar { flex-wrap:wrap; gap:10px; }
  .control-bar p { flex:1; min-width:120px; font-size:11px; }
  .control-bar .button { margin-left:auto; padding-inline:12px; font-size:11px; }
}
@media (min-width:1700px) {
  .workspace-grid { grid-template-columns:minmax(0,1fr) 400px; gap:24px; }
  .session-workspace { padding:28px 32px 20px; }
}
@media (max-width:1200px) {
  .app { grid-template-columns:224px minmax(0,1fr); }
  .sidebar { padding-inline:12px; }
  .sidebar .brand>span { display:none; }
  .session-workspace { padding:22px 18px 14px; }
  .workspace-grid { grid-template-columns:minmax(0,1fr) 304px; gap:14px; }
  .chat-empty { padding-inline:20px; }
  .chat-heading { padding-inline:12px; gap:10px; }
  .chat-heading>.icon-button { width:36px; }
  .chat-empty h3 { font-size:22px; }
  .topbar { padding-inline:20px; }
}
@media (max-width:980px) {
  .workspace-grid { grid-template-columns:minmax(0,1fr); min-height:420px; }
  .panel-switch { display:flex; flex:none; gap:4px; margin-bottom:16px; padding:4px; border:1px solid var(--line); border-radius:10px; background:var(--white); }
  .panel-switch button { display:flex; align-items:center; justify-content:center; gap:8px; flex:1; min-height:44px; border-radius:7px; background:transparent; color:var(--muted); font-size:13px; }
  .panel-switch button[aria-pressed=true] { background:var(--soft); color:var(--ink); }
  .panel-switch .icon { width:18px; height:18px; }
  .app[data-panel=browser] .chat-panel,.app[data-panel=chat] .browser-column { display:none; }
  .chat-empty p { max-width:310px; }
  .help-banner { flex-wrap:wrap; }
  .help-banner>.button { margin-left:34px; }
}
@media (max-width:680px) {
  .app { display:block; min-height:0; }
  .workspace { height:100dvh; }
  .sidebar { position:fixed; inset:0 auto 0 0; z-index:40; width:280px; max-width:calc(100% - 36px); padding-top:max(24px,env(safe-area-inset-top)); transform:translateX(-100%); transition:transform .22s var(--ease); }
  .menu-open .sidebar { transform:translateX(0); }
  .sidebar .brand>span { display:block; }
  .mobile-sidebar-close { display:inline-flex; position:absolute; right:8px; top:24px; }
  .sidebar-scrim { position:fixed; inset:0; z-index:35; background:#26292266; }
  .mobile-menu { display:inline-flex; }
  .mobile-menu .icon { width:20px; height:20px; }
  .mobile-brand { display:block; width:91px; height:auto; }
  .topbar { height:60px; min-height:60px; padding:0 12px 0 6px; gap:12px; }
  .breadcrumb { gap:6px; }
  .breadcrumb>span,.breadcrumb>strong { display:none; }
  .private-badge { font-size:10px; }
  .session-workspace { flex:none; min-height:calc(100dvh - 60px); padding:20px 12px max(16px,env(safe-area-inset-bottom)); }
  .session-heading { align-items:flex-start; gap:10px; margin-bottom:18px; }
  .session-heading h1 { font-size:26px; }
  .session-kicker { gap:8px; font-size:10px; flex-wrap:wrap; }
  .session-heading>.button { gap:6px; margin-top:8px; padding:8px; }
  .activity-button-text { display:none; }
  .workspace-grid { min-height:440px; }
  .browser-shell { min-height:410px; }
  .chat-panel { min-height:450px; }
  .chat-messages { padding:20px 16px; }
  .chat-composer textarea { font-size:16px; }
  .send-button { width:44px; height:44px; }
  .composer-footer>span { font-size:11px; }
  .chat-empty { padding:30px 22px; }
  .chat-empty-visual { margin-bottom:24px; }
  .chat-empty-note { margin-top:20px; }
  .chat-empty h3 { font-size:23px; }
  .help-banner { padding:14px; gap:10px; }
  .help-banner>div { flex:1; min-width:0; }
  .help-banner>.button { width:100%; margin:2px 0 0; }
  .human-tools>span { display:none; }
  .browser-footnote { font-size:10px; }
  .empty-state h1 { font-size:28px; }
}
@media (max-height:700px) and (min-width:681px) {
  .sidebar { padding-top:14px; }
  .sidebar>.brand { margin-bottom:10px; }
  .workspace-label { padding-block:10px; margin-bottom:8px; }
  .nav-section-label { margin-top:16px; }
  .sidebar-bottom { padding-top:10px; }
  .workspace-grid { min-height:400px; }
}
