/* Only the phone layout changes; colors and account appearance use existing tokens. */
:root[data-mobile-workbench="true"] body {
  position:fixed; top:var(--mobile-viewport-top,0px); left:0; right:0;
  height:var(--mobile-viewport-height,100dvh); width:100%; display:block; overflow:hidden;
}
:root[data-mobile-workbench="true"] body::before { display:none; }
:root[data-mobile-workbench="true"] #appearance-lasers,:root[data-mobile-workbench="true"] #appearance-space-background { display:none; }
:root[data-mobile-workbench="true"] .sidebar { display:none; }
:root[data-mobile-workbench="true"] .workspace { display:flex; flex-direction:column; height:100%; min-height:0; }
:root[data-mobile-workbench="true"] .topbar {
  display:grid; grid-template-columns:44px minmax(0,1fr) 44px; flex:none;
  height:52px; min-height:52px; padding:4px 12px; gap:8px;
  background:var(--canvas); border:0; box-shadow:none; backdrop-filter:none;
}
.topbar .title-group { grid-column:1; }
.topbar .sample-label { display:none; }
#open-history { width:44px; height:44px; font-size:25px; }
#mobile-workbench-menu { grid-column:2; min-width:0; height:44px; display:flex; align-items:center; justify-content:center; gap:6px; padding:0 2px; font-size:18px; font-weight:600; border-radius:10px; white-space:nowrap; }
#mobile-workbench-menu img { width:24px; height:24px; flex:none; object-fit:contain; }
#mobile-new-chat { grid-column:3; width:44px; height:44px; font-size:28px; border-radius:10px; }
:root[data-mobile-workbench="true"] .conversation-scroll {
  flex:1 1 0; min-height:0; padding:12px 14px 20px; overflow-y:auto; overflow-x:hidden;
  scroll-padding-block:16px; -webkit-overflow-scrolling:touch;
}
.messages { width:100%; max-width:none; gap:22px; padding-top:4px; }
.message.user,.message.assistant { font-size:16px; line-height:1.65; }
:root[data-mobile-workbench="true"] .message.user {
  max-width:92%; padding:11px 14px; border-radius:18px; border:0;
  background:var(--selected); box-shadow:none; backdrop-filter:none;
}
.message.assistant { gap:0; width:100%; }
.assistant-mark { display:none; }
:root[data-mobile-workbench="true"] .message.assistant .message-body {
  padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; backdrop-filter:none;
}
.message .message-note,.message .system-note { font-size:13px; }
.output-media { max-width:100%; }
.image-output img { width:100%; height:auto; max-height:60dvh; aspect-ratio:auto; object-fit:contain; }
.output-actions { gap:18px; font-size:14px; }
.output-actions button,.output-actions a { min-height:40px; font-size:14px; display:inline-flex; align-items:center; }
.message .file-name { font-size:14px; max-width:220px; }
.message .file-meta { font-size:12px; }
.message.assistant .image-attachment { display:flex; flex-direction:column; align-items:stretch; width:100%; padding:0; border:0; background:none; }
.message.assistant .image-attachment img { width:100%; height:auto; max-height:60dvh; object-fit:contain; border-radius:14px; cursor:zoom-in; }
.message.assistant .image-attachment .file-description { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; }
.message.assistant .image-attachment .file-name { flex:1 1 150px; min-width:0; max-width:none; font-size:13px; }
.message.assistant .image-attachment .file-meta { display:none; }
.message.assistant .image-attachment .image-download { font-size:14px; display:inline-flex; align-items:center; min-height:40px; }
.turn-billing { font-size:13px; }
:root[data-mobile-workbench="true"] .welcome {
  margin:clamp(32px,14vh,110px) auto 24px; padding:0 12px; background:none;
  border:0; box-shadow:none; backdrop-filter:none;
}
.welcome .welcome-kicker,.welcome .connection-note { display:none; }
.welcome .welcome-mark { display:block; margin:0 auto 16px; line-height:0; }
.welcome .welcome-mark img { display:block; width:64px; height:64px; margin:auto; object-fit:contain; }
.welcome h2 { font-size:22px; margin:0 0 8px; letter-spacing:0; }
.welcome p { font-size:14px; line-height:1.7; }
:root[data-mobile-workbench="true"] .composer-area {
  flex:none; width:100%; max-width:none; padding:8px 12px max(10px,env(safe-area-inset-bottom));
  background:var(--canvas); min-height:0;
}
#mobile-quick-tools { display:flex; align-items:center; gap:8px; width:100%; margin:0 0 8px; }
#mobile-quick-tools .output-modes { flex:1 1 0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; min-width:0; border:0; padding:0; background:none; border-radius:0; }
#mobile-quick-tools .output-mode { min-width:0; }
#mobile-quick-tools .output-mode > span {
  display:flex; justify-content:center; align-items:center; height:44px; padding:0 8px;
  border:1px solid var(--line); border-radius:12px; font-size:15px; white-space:nowrap;
}
#mobile-quick-tools .output-mode input:checked + span { background:var(--action); border-color:var(--action); color:var(--action-text); }
#mobile-tool-select {
  flex:0 1 auto; max-width:132px; min-width:94px; height:44px; padding:0 10px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border:1px solid var(--line); border-radius:12px; font-size:14px;
}
#mobile-tool-select::after { content:' ▾'; color:var(--muted); }
:root[data-mobile-workbench="true"] .composer {
  width:100%; padding:5px; border:1px solid var(--composer-border); border-radius:23px;
  background:var(--surface); box-shadow:none; backdrop-filter:none;
}
:root[data-mobile-workbench="true"] .composer:focus-within { border-color:var(--accent); box-shadow:none; }
.composer-toolbar { display:none; }
#mobile-input-row { display:flex; align-items:flex-end; gap:6px; min-height:44px; }
#mobile-input-row #attach,#mobile-input-row #send { flex:none; width:44px; height:44px; min-height:44px; padding:0; border-radius:50%; }
#mobile-input-row #attach { display:flex; align-items:center; justify-content:center; color:var(--text); }
#mobile-input-row #attach span:first-child { font-size:29px; }
#mobile-input-row #attach span:last-child { display:none; }
#mobile-input-row #send { font-size:28px; }
#mobile-input-row #prompt {
  flex:1 1 0; min-width:0; width:auto; align-self:center; min-height:28px; max-height:112px;
  font-size:16px; line-height:26px; border-radius:0; padding:0; margin:8px 0;
  background:none; color:var(--text); resize:none;
}
.composer #reference { font-size:13px; margin:2px 4px 6px; }
.composer .attachments:not(:empty) { flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; max-height:78px; padding:4px 4px 7px; }
.composer .attachments .file-chip { flex:none; max-width:190px; padding:6px; gap:6px; }
.composer .attachments .file-chip img { width:42px; height:42px; }
.composer .attachments .file-description { max-width:95px; }
.composer .attachments .file-name { font-size:12px; }
.composer .attachments .file-state { font-size:11px; }
.composer .attachments .remove-file { width:32px; height:40px; }
#mobile-alerts { max-height:min(120px,22vh); overflow-y:auto; }
#mobile-alerts:empty { display:none; }
#notice[data-passive="true"],#notice:empty,#billing-status:empty { display:none; }
#notice { color:var(--muted); font-size:13px; line-height:1.5; }
#notice.error,#billing-status { color:var(--danger); }
#mobile-alerts #billing-context { font-size:13px; align-items:center; }
#context-new { flex:none; min-height:40px; color:var(--accent); }
#billing-quote { font-size:13px; line-height:1.5; margin:5px 4px 0; color:var(--muted); max-height:60px; overflow-y:auto; }
#billing-quote:not([data-state="active"]) { display:none; }
:root[data-mobile-keyboard="true"] #mobile-quick-tools { display:none; }
:root[data-mobile-keyboard="true"] .topbar { min-height:44px; height:44px; padding-block:0; }
:root[data-mobile-keyboard="true"] .composer-area { padding-top:4px; }
.mobile-sheet {
  width:100%; max-width:600px; max-height:calc(var(--mobile-viewport-height,100dvh) - 20px);
  margin:auto auto 0; border-radius:20px 20px 0 0; padding:0; overflow:hidden;
}
.mobile-sheet[open] { display:flex; flex-direction:column; }
.mobile-sheet-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 18px; flex:none; border-bottom:1px solid var(--line); }
.mobile-sheet-heading h2 { margin:0; font-size:18px; }
.mobile-sheet-heading button { min-width:44px; min-height:44px; color:var(--accent); font-size:14px; }
.mobile-sheet-content { padding:16px 18px max(20px,env(safe-area-inset-bottom)); overflow-y:auto; min-height:0; }
#mobile-image-settings .image-shortcuts { padding:0; }
#mobile-image-settings .image-shortcuts-heading { display:none; }
#mobile-image-settings .image-shortcuts-list { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
#mobile-image-settings .image-shortcuts-list button { min-height:56px; font-size:15px; white-space:normal; }
#mobile-image-settings .image-shortcuts-list small { font-size:12px; }
#mobile-image-settings .image-output-settings { margin-top:18px; padding:16px 0 0; border:0; border-top:1px solid var(--line); border-radius:0; background:none; }
#mobile-image-settings .image-output-settings-heading { margin-bottom:14px; }
#mobile-image-settings .image-output-settings-heading strong { font-size:16px; }
#mobile-image-settings .image-output-settings-fields { gap:12px; }
#mobile-image-settings .image-output-settings-fields label { grid-template-columns:minmax(0,1fr) minmax(130px,1.2fr); font-size:15px; }
#mobile-image-settings .image-output-settings select { font-size:16px; min-height:44px; max-width:none; }
#mobile-image-settings .image-output-settings > p { font-size:12px; }
#mobile-details-dialog #conversation-title { font-size:16px; max-width:none; margin:0 0 14px; white-space:normal; }
#mobile-details-dialog .header-actions { display:flex; flex-wrap:wrap; gap:12px; }
#mobile-details-dialog .prototype-badge { display:none; }
#mobile-details-dialog #mobile-account-billing { flex-basis:100%; font-size:15px; }
#mobile-details-dialog #mobile-account-usage { position:static; width:auto; margin:8px 0; box-shadow:none; font-size:13px; }
#mobile-details-dialog .appearance-open { width:auto; padding:8px 12px; }
#mobile-details-dialog .appearance-open > span { display:inline; }
#mobile-usage-details { margin-top:18px; }
#mobile-usage-details #conversation-usage { display:block; padding:12px 0; font-size:13px; }
#mobile-usage-details #billing-context { font-size:13px; margin:12px 0; }
#mobile-usage-details .composer-footnote { font-size:13px; line-height:1.7; display:block; }
#mobile-usage-details .composer-footnote span { display:block; margin-top:8px; }
#mobile-video-settings #video-tools { margin:0; }
#mobile-video-settings #video-settings { max-height:none; overflow:visible; overscroll-behavior:auto; }
:root[data-mobile-workbench="true"] #image-preview-dialog { max-height:calc(var(--mobile-viewport-height,100dvh) - 20px); }
:root[data-mobile-workbench="true"] #image-preview-form { max-height:calc(var(--mobile-viewport-height,100dvh) - 22px); }
@media(max-width:360px) {
  #mobile-quick-tools { gap:5px; }
  #mobile-quick-tools .output-modes { gap:4px; }
  #mobile-quick-tools .output-mode > span { padding:0 5px; }
  #mobile-tool-select { min-width:88px; padding-inline:7px; font-size:13px; }
}
