/* Suvilabs Mobile Precision Update v1.19.0
 * Mobile-only layout overrides. Desktop settings and data flow remain intact.
 * Follows the current user theme; no simulated browser chrome or hard-coded account data.
 */
.settings-mobile-back,.settings-mobile-heading,.sb-mobile-recent { display:none; }
.settings-home-row-icon { display:flex;align-items:center;justify-content:center;flex:0 0 24px; }
.settings-account-avatar { flex:0 0 42px;width:42px;height:42px;display:grid;place-items:center;overflow:hidden; }
.settings-account-copy { display:flex;flex:1;flex-direction:column;gap:3px;min-width:0; }
.settings-account-copy strong { overflow-wrap:anywhere;font-size:14px;line-height:1.35;font-weight:650; }
.settings-account-copy small { color:var(--ink-3);font-size:12px; }
.settings-home-search { display:flex;align-items:center;gap:10px;padding:11px 13px;background:var(--surface);border:1px solid var(--line);border-radius:12px; }
.settings-home-search input { width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:14px; }
.settings-home-search input::placeholder { color:var(--ink-3); }
.settings-row-chevron { flex-shrink:0;opacity:.55; }
.settings-row-copy { display:flex;flex-direction:column;gap:1px;min-width:0; }
.settings-row-copy strong { overflow-wrap:anywhere; }
.settings-native-switch { appearance:none;-webkit-appearance:none;position:relative;flex:0 0 44px;height:26px;border-radius:20px;background:var(--surface-3);border:1px solid var(--line);cursor:pointer;transition:background .18s; }
.settings-native-switch:before { position:absolute;content:"";width:20px;height:20px;top:2px;left:2px;background:#fff;border-radius:50%;box-shadow:0 1px 4px #0004;transition:transform .18s; }
.settings-native-switch:checked { background:#2985db;border-color:#2985db; }
.settings-native-switch:checked:before { transform:translateX(18px); }
.settings-native-switch:disabled { opacity:.45;cursor:not-allowed; }
.settings-native-switch:focus-visible { outline:2px solid var(--accent);outline-offset:3px; }
.settings-home .settings-upgrade-copy { min-width:0; }

@media (max-width:760px) {
  /* Make account settings fully native on phones: one column and a distinct detail page. */
  .page.settings-home { height:100%; min-height:0;overflow-y:auto;overscroll-behavior:contain;background:var(--bg); }
  .settings-home .page-topbar { min-height:62px;position:sticky;top:0;z-index:4;padding:0 18px;border:0;background:var(--bg);display:grid;grid-template-columns:44px 1fr 44px;align-items:center; }
  .settings-home .page-topbar .topbar-title { font-family:Georgia,serif;font-size:25px;font-weight:500;text-align:center!important;min-width:0; }
  .settings-home .page-topbar .btn.icon { width:44px;height:44px;display:grid;place-items:center; }
  .settings-home .page-topbar .settings-info-action { justify-self:end; }
  .settings-home-inner { width:min(100%,560px);padding:16px 16px calc(36px + env(safe-area-inset-bottom)); }
  .settings-home h1 { display:none; }
  .settings-account { gap:12px;min-height:86px;padding:14px 16px;border:1px solid var(--line);border-radius:17px;background:var(--surface);color:var(--ink);text-decoration:none; }
  .settings-account .badge { border-radius:999px;padding:6px 11px;font-size:12px;white-space:nowrap; }
  .settings-account>.ic { flex-shrink:0;opacity:.5; }
  .settings-upgrade { display:flex;justify-content:space-between;align-items:center;gap:14px;border:1px solid var(--line);border-radius:18px;padding:20px 16px;margin:16px 0 20px;background:var(--surface); }
  .settings-upgrade h2 { font-size:17px;line-height:1.35;font-weight:650;letter-spacing:-.015em;margin:0 0 7px; }
  .settings-upgrade p { font-size:12px;line-height:1.55;margin:0;color:var(--ink-2); }
  .settings-upgrade .btn { flex:0 0 auto;border-radius:999px;padding:10px 14px;font-size:12px;white-space:nowrap; }
  .settings-home-search { margin:0 0 16px;min-height:46px; }
  .settings-home-group { border:1px solid var(--line-soft);background:var(--surface);border-radius:18px;margin:0 0 16px;overflow:hidden; }
  .settings-home-row { box-sizing:border-box;width:100%;min-height:63px;display:flex;align-items:center;gap:14px;padding:13px 16px;background:transparent;border:0;color:var(--ink);text-decoration:none; }
  .settings-home-row:not(:last-child) { border-bottom:1px solid var(--line-soft); }
  .settings-home-row strong { font-size:15px;font-weight:520;line-height:1.35; }
  .settings-home-row small { margin-top:4px;color:var(--ink-3);font-size:12px;line-height:1.35; }
  .settings-home-row .ic { width:22px;height:22px; }
  .settings-home-row .settings-row-chevron { width:17px;height:17px; }
  .settings-home-row-icon { flex:0 0 26px; }
  .settings-home-row:focus-visible { outline:2px solid var(--accent);outline-offset:-3px; }
  .settings-home-haptics .settings-home-row { cursor:default; }
  .settings-home .settings-logout { border:1px solid var(--line-soft);border-radius:17px;background:var(--surface);color:var(--danger);margin:2px 0 0;text-align:left;font-size:15px; }
  .settings-home .settings-logout>.grow { flex:1; }
  /* Detail settings full page replaces the squashed 130px desktop sidebar. */
  .preferences-page { inset:0!important;width:100%!important;height:100dvh!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:var(--bg)!important;display:flex!important;flex-direction:column; }
  .preferences-page .preferences-header { flex:0 0 auto;min-height:60px;height:auto;padding:10px 14px;display:grid;grid-template-columns:40px minmax(0,1fr) 40px;gap:8px;background:var(--bg);border-bottom:1px solid var(--line-soft); }
  .preferences-header .settings-mobile-back { display:grid;place-items:center;width:40px;height:40px;color:var(--ink);text-decoration:none;border-radius:10px; }
  .preferences-header .settings-mobile-heading { display:inline; }
  .preferences-header .settings-desktop-heading { display:none; }
  .preferences-header>strong { text-align:center;font-size:17px;font-weight:650;min-width:0; }
  .preferences-header .build-stamp { display:block;margin-top:3px;font-size:10px;color:var(--ink-3);font-weight:400; }
  .preferences-header .settings-header-actions { justify-content:end; }
  .preferences-header .settings-header-actions .btn:not(:last-child) { display:none; }
  .preferences-header .settings-header-actions>a:last-child { font-size:24px;width:40px;height:40px;padding:0; }
  .preferences-page .settings-layout { display:flex!important;flex:1;min-height:0;height:auto!important;min-width:0;padding:0!important;margin:0!important;overflow:hidden!important; }
  .preferences-page .settings-nav { display:none!important; }
  .preferences-page .settings-body { width:100%;flex:1;min-width:0;overflow-y:auto;overscroll-behavior:contain;padding:24px max(18px,env(safe-area-inset-left)) calc(52px + env(safe-area-inset-bottom))!important; }
  .preferences-page .settings-body>.anim-fade { max-width:680px;margin:0 auto; }
  .preferences-page .settings-body h2 { font-size:18px;line-height:1.35;margin:0 0 15px; }
  .preferences-page .settings-body h2:not(:first-child) { margin-top:26px; }
  .preferences-page .preference-row { display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:66px;padding:15px 0;flex-wrap:wrap; }
  .preferences-page .preference-row>div:first-child { flex:1 1 155px; }
  .preferences-page .preference-row small { font-size:12px;line-height:1.5; }
  .preferences-page .preference-control { flex:0 1 auto;margin-left:auto;max-width:100%; }
  .preferences-page .preference-select { font-size:14px;min-height:36px;max-width:100%; }
  .preferences-page input:not([type=checkbox]),.preferences-page textarea,.preferences-page select { font-size:16px; }
  .preferences-page .settings-modern,.preferences-page .general-preferences { min-width:0; }
  .preferences-page .setting-row { gap:12px; }
  .preferences-page .focus-inline-controls { width:100%;justify-content:flex-start; }
  .preferences-page .focus-inline-controls label { flex:1 1 130px; }
  .preferences-page .focus-inline-controls .select { width:100%;max-width:none; }
  .preferences-page .focus-time-row { flex-wrap:wrap; }
  .preferences-page .focus-day { width:38px;height:38px; }
  .preferences-page .code-themes,.preferences-page .billing-cards { grid-template-columns:minmax(0,1fr); }
  .preferences-page .billing-card { width:100%; }
  /* Drawer: bounded width, consistent icon gutters and recent list readability. */
  .sidebar { width:min(88vw,354px)!important;padding-top:env(safe-area-inset-top);background:var(--bg-deep); }
  .sidebar .sb-head { padding:18px 16px 12px;gap:9px;min-height:68px; }
  .sidebar .brand-name { font-size:23px;font-weight:500;letter-spacing:-.035em; }
  .sidebar .brand img { max-width:28px;max-height:28px; }
  .sidebar .sb-head>a[href='/code'] { display:none; }
  .sidebar .sb-search { margin:8px 16px 16px;min-height:46px;border-radius:12px;background:var(--surface);border:1px solid var(--line); }
  .sidebar .sb-search .input { font-size:16px; }
  .sidebar .sb-nav { margin:0 14px;padding:0 0 16px;gap:3px; }
  .sidebar .sb-nav .sb-link { min-height:44px;padding:10px 12px;gap:14px;font-size:15px;font-weight:550;border-radius:10px; }
  .sidebar .sb-nav .sb-link[aria-current=page] { background:var(--surface-2); }
  .sidebar .sb-nav .sb-link .ic { width:20px;height:20px; }
  .sidebar .sb-list { flex:1 1 auto;min-height:55px;padding:0 14px 10px;overflow:auto; }
  .sidebar .sb-mobile-recent { display:block;padding:14px 10px 8px;font-size:12px;color:var(--ink-3);font-weight:550; }
  .sidebar .sb-section { font-size:11px;margin:12px 8px 3px;padding:0;color:var(--ink-3); }
  .sidebar .conv-item { min-height:46px; }
  .sidebar .conv-item>a { min-width:0;display:flex;align-items:center;font-size:13px;min-height:44px;padding:10px 32px 10px 12px; }
  .sidebar .conv-item .more { right:2px; }
  .sidebar .sb-foot { flex:0 0 auto;padding:8px 14px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--line-soft);background:var(--bg-deep); }
  .sidebar .sb-settings-link { min-height:44px;padding:10px 12px;margin-bottom:8px;font-size:14px;border-radius:10px; }
  .sidebar .user-chip { width:100%;min-height:64px;padding:10px 12px;border-radius:13px;background:var(--surface-2); }
  .sidebar .user-chip .grow .ellipsis { line-height:1.4; }
  .sidebar .sb-new-bottom { min-height:48px;margin-top:10px;font-size:15px; }
  /* Chat home: compact, deliberate proportions and a two-column prompt grid. */
  .chat-empty { min-height:0;overflow-y:auto;overscroll-behavior:contain; }
  .chat-empty .topbar { flex:0 0 auto;min-height:52px;padding:6px 12px; }
  .chat-empty .welcome { flex:1 0 auto;justify-content:flex-start;gap:16px;min-height:0;margin:0 auto;padding:72px 16px 20px;max-width:640px;width:100%; }
  .chat-empty .welcome-plan { top:16px;font-size:12px; }
  .chat-empty .welcome-symbol .ic { width:34px;height:34px; }
  .chat-empty .welcome h1 { font-family:Georgia,serif;font-size:clamp(28px,8vw,37px);line-height:1.18;max-width:15ch;text-wrap:balance;letter-spacing:-.035em; }
  .chat-empty .welcome p { display:block;font-size:13px;line-height:1.65;max-width:38ch;color:var(--ink-2); }
  .chat-empty .starters { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;margin:10px 0 0;max-width:440px; }
  .chat-empty .starters .chip { min-width:0;width:100%;display:flex;align-items:center;justify-content:flex-start;gap:8px;min-height:48px;padding:11px 12px;border:1px solid var(--line);border-radius:15px;text-align:left;font-size:12px;line-height:1.3;color:var(--ink);background:var(--surface); }
  .chat-empty .starters .chip>span { flex:1; }
  .chat-empty .starters .chip .ic { flex:0 0 18px;width:18px;height:18px; }
  .chat-empty .starters .chip .starter-chevron { opacity:.5;width:13px;height:13px; }
  .chat-empty .composer-wrap { flex:0 0 auto;width:100%;padding:8px 12px calc(12px + env(safe-area-inset-bottom)); }
  .chat-empty .composer { border-radius:20px; }
  .composer textarea { font-size:16px;min-height:60px;padding:15px 15px 8px; }
  .composer-bar { gap:5px;padding:6px 9px 10px; }
  .composer-bar .tools { flex:1 1 auto;min-width:0;overflow-x:auto; }
  .composer-bar .pill-btn { min-height:34px;height:34px;white-space:nowrap;font-size:12px; }
  .composer-wrap { padding-bottom:calc(11px + env(safe-area-inset-bottom)); }
  .chat>.topbar { padding-left:12px;padding-right:12px; }
  .chat>.topbar .topbar-title { min-width:0;overflow:hidden;text-overflow:ellipsis; }
  .thread-inner { padding-left:16px;padding-right:16px; }
}
@media (max-width:390px) {
 .settings-upgrade { align-items:flex-start;flex-direction:column; }
 .settings-upgrade .btn { align-self:flex-start; }
 .settings-home-row { gap:11px;padding:13px 14px; }
 .sidebar { width:min(91vw,340px)!important; }
 .chat-empty .welcome { padding-top:62px;gap:12px; }
 .chat-empty .starters { gap:8px; }
 .chat-empty .starters .chip { padding:10px 9px;font-size:11px; }
}
@media (max-height:660px) and (max-width:760px) {
 .chat-empty .welcome { padding-top:36px;gap:9px; }
 .chat-empty .welcome h1 { font-size:27px; }
 .chat-empty .starters { margin-top:0; }
 .chat-empty .starters .chip { min-height:40px;padding:7px 10px; }
}
@media (prefers-reduced-motion:reduce) {
 .settings-native-switch,.settings-native-switch:before { transition:none; }
}
