/* Independent workbench: mobile presentation only. */
@media (max-width: 720px) {
  :root { --bg:#f7f6f7; --line:#e9e3e6; --mobile-nav:72px; }
  html { -webkit-text-size-adjust:100%; scroll-padding-bottom:110px; }
  body { font-size:16px; line-height:1.65; padding-bottom:calc(var(--mobile-nav) + env(safe-area-inset-bottom,0px)); }
  body:has(>.sidebar)>.sidebar {
    position:relative; display:grid; grid-template-columns:30px minmax(0,1fr); align-items:center;
    gap:12px; width:100%; padding:20px 22px 18px; background:#fff;
    border:0; border-bottom:1px solid var(--line); z-index:10;
  }
  .sidebar .brand { font-size:29px; width:30px; height:39px; line-height:.72; }
  .sidebar .brandname { margin:0; font:14px/1.45 Georgia,"Times New Roman",serif; letter-spacing:1.5px; color:#472f38; }
  .sidebar .brandname small { display:block; margin-top:3px; font-size:10px; line-height:1.5; letter-spacing:2.4px; color:#8a7881; }
  body>.sidebar nav {
    position:fixed; inset:auto 0 0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr));
    align-items:stretch; gap:0; margin:0; padding:8px 8px calc(8px + env(safe-area-inset-bottom,0px));
    height:calc(var(--mobile-nav) + env(safe-area-inset-bottom,0px)); background:rgba(255,255,255,.97);
    border-top:1px solid #e9e0e5; box-shadow:0 -4px 24px #3e1d2a05; z-index:30;
  }
  body>.sidebar .nav { flex-direction:column; justify-content:center; gap:3px; padding:5px 2px; border:0; border-radius:11px; font-size:12px; font-weight:500; line-height:1.5; color:#847b81; }
  body>.sidebar .nav svg { width:21px; height:21px; stroke-width:1.5; }
  body>.sidebar .nav.active { color:var(--wine); background:#f8eff2; }
  body>.sidebar .sidefoot { display:none; }
  body>.sidebar+main { width:100%; margin:0; padding:0 18px; }
  body>.sidebar+main>header {
    display:grid; grid-template-columns:minmax(0,1fr) auto; height:auto; min-height:0;
    gap:12px 8px; margin:0 -18px; padding:14px 20px; background:#fff; border-bottom:1px solid var(--line);
  }
  header>span { font-size:12px; color:#8d838a; min-width:0; }
  header b { font-size:13px; color:#493b43; }
  header .connection { max-width:160px; min-height:32px; font-size:12px; line-height:1.4; padding:6px 10px; border-color:#e6e0e3; }
  header .session-controls { grid-column:1/-1; display:flex; flex-wrap:nowrap; gap:8px; justify-content:flex-end; padding-top:10px; border-top:1px solid #f0ecee; min-width:0; }
  header .session-name { min-width:0; margin-right:auto; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#79656e; }
  header .session-controls .secondary { flex-shrink:0; min-height:30px; padding:4px 10px; font-size:12px; border-radius:7px; text-decoration:none; }
  .heading { margin:28px 2px 20px; gap:12px; }
  .heading h1 { font-size:26px; line-height:1.35; font-weight:600; letter-spacing:-.6px; margin-bottom:8px; }
  .heading p { max-width:30em; font-size:14px; line-height:1.75; color:#82757e; }
  .heading .eyebrow { font-size:10px!important; letter-spacing:2.2px; margin-bottom:9px!important; color:#9d8053!important; }
  .heading>.secondary { min-height:40px; border-radius:9px; padding:8px 12px; font-size:13px; }
  .notice { padding:12px 14px; font-size:13px; line-height:1.75; border-radius:11px; margin-bottom:18px; }
  .workgrid,.settingsgrid { gap:20px; }
  .panel { min-width:0; padding:22px 18px; border:1px solid #e9e2e6; border-radius:17px; background:#fff; box-shadow:0 5px 22px #46223203; }
  .paneltitle { padding-bottom:17px; margin-bottom:23px; align-items:center; gap:8px; }
  h2,.paneltitle h2,#referrals h2 { font-size:17px; line-height:1.5; letter-spacing:-.2px; }
  .paneltitle span { font-size:11px; }
  label { font-size:14px; line-height:1.65; font-weight:500; color:#51464c; margin-bottom:21px; }
  input:not([type=checkbox]):not([type=file]),textarea,select { min-height:50px; border-radius:10px; border-color:#e3dce1; padding:12px; margin-top:8px; font-size:16px; color:#342e32; background-color:#fff; }
  select { padding-right:34px; }
  input::placeholder,textarea::placeholder { color:#ada5ab; font-weight:400; }
  small,.details-fields small,label>small { font-size:12px; line-height:1.75; color:#8e828a; margin-top:7px; font-weight:400; }
  .twocol,#refCreatePanel .twocol { gap:0; }
  .payment-row { gap:12px; margin-bottom:22px; }
  .payment-row label { font-size:13px; margin-bottom:0; }
  .payment-row select { font-size:15px; }
  .money { border-radius:10px; min-height:50px; padding:0 11px; border-color:#e3dce1; }
  .money input:not([type=checkbox]) { border:0; min-height:48px; padding:10px 4px; margin:0; }
  .generated-title { padding:14px; background:#fbf8fa; border:1px solid #f0e6eb; border-radius:11px; }
  .generated-title input:not([type=checkbox]) { padding:0; margin-top:4px; background:transparent; border:0; border-radius:0; min-height:32px; font:18px/1.5 Georgia,serif; color:var(--wine); }
  .details-fields { margin:25px 0 22px; padding-top:22px; border-color:#ece6e9; }
  .details-fields legend { font-size:14px; padding-right:12px; color:#6e4e5b; }
  .details-help { font-size:13px; line-height:1.8; color:#8a7d85; }
  .access-panel { margin:20px 0; padding:16px 14px; background:#fcfafb; border-radius:11px; }
  .switchrow b { font-size:14px; }
  .switchrow small { font-size:12px; }
  .upload { min-height:120px; padding:20px 14px; background:#fdfafb; border-color:#d9c5ce; border-radius:12px; }
  .upload b { font-size:14px; }
  .upload small { font-size:12px; }
  .primary,.secondary { border-radius:10px; min-height:46px; font-size:14px; padding:11px 15px; }
  .primary { box-shadow:0 3px 9px #6d1e3210; }
  .submit-actions { position:static; margin:24px -18px -4px; padding:18px 18px 0; gap:10px; background:#fff; }
  .submit-actions .primary { flex:1.25; min-width:0; }
  .submit-actions .secondary { flex:1; min-width:0; }
  .form-fold { border-radius:11px; border-color:#ebe4e8; }
  .form-fold summary { padding:14px; font-size:14px; }
  .form-fold summary small { font-size:12px; }
  .form-fold .details-fields { padding:0 14px 16px; }
  .preview>details>summary { padding:16px; border-radius:12px; background:#fff; border:1px solid var(--line); font-size:14px; }
  .previewcard { border-radius:15px; }
  .previewbody { padding:22px 20px; }
  .productphoto { height:270px; }
  .previewbody h3 { font-size:23px; }
  .record-filters { gap:10px; margin-bottom:20px; }
  .record-filters label>span { font-size:12px; }
  .record-filters input,.record-filters select { min-height:46px; }
  .tablewrap { padding:0; border:0; background:transparent; box-shadow:none; }
  tbody tr { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px 14px; padding:20px 18px; border-radius:15px; border-color:#e9e2e6; box-shadow:0 4px 18px #46223203; margin-bottom:15px; }
  td:before { font-size:11px; color:#9a8b94; margin-bottom:6px; letter-spacing:.3px; }
  td:first-child { line-height:1.6; color:#403039; }
  #records td:first-child small { font-size:12px; line-height:1.8; color:#8d7e87; }
  #records td:nth-child(2) { font:23px/1.3 Georgia,serif; color:var(--wine); }
  #records td:nth-child(2):before { font:11px/1.5 -apple-system,BlinkMacSystemFont,sans-serif; }
  .tablebtn,#referrals td button { min-height:40px; border-radius:8px; padding:9px 12px; font-size:13px; margin:4px 5px 4px 0; }
  .status { padding:5px 9px; border-radius:6px; font-size:12px; }
  #refRows td:nth-child(2) { grid-column:1/-1; padding:11px 13px; border-radius:9px; background:#fbf7f9; font-family:ui-monospace,SFMono-Regular,monospace; color:var(--wine); }
  #refRows td:nth-child(3),#refRows td:nth-child(4) { font-size:18px; font-variant-numeric:tabular-nums; }
  #referrals .panel { margin-bottom:20px; }
  .ref-actions { gap:9px; }
  .ref-actions>.primary { flex-basis:100%; }
  #refInvitationText { font-size:16px; line-height:1.8; }
  .help-fold>summary,.setup summary,.integration summary { font-size:13px; line-height:1.7; }
  .setup p,.setup li { font-size:13px; line-height:1.8; }
  #checkMessage { font-size:13px; line-height:1.8; padding-top:4px; }
  .result { border-color:#d7e6dc; margin-top:20px; }
  .result .url { font-size:13px; line-height:1.8; }
  .footnote { font-size:12px; line-height:1.8; }
  footer { padding:25px 2px 20px; gap:7px 12px; font-size:11px; }
  #toast { bottom:calc(var(--mobile-nav) + env(safe-area-inset-bottom,0px) + 12px); width:max-content; max-width:calc(100vw - 36px); font-size:13px; border-radius:11px; }
  input,textarea,select,summary { scroll-margin-top:24px; scroll-margin-bottom:110px; }
  .account-page { padding:20px 18px calc(24px + env(safe-area-inset-bottom,0px)); background:#f7f6f7; }
  .account-page .login-card { margin:24px 0!important; padding:30px 22px!important; border-radius:20px; border-color:#e8e0e5; box-shadow:0 12px 45px #48243405; }
  .account-page .wordmark { font-size:21px; letter-spacing:.6px; }
  .login-card h1 { font-size:25px; margin-top:28px; }
  .login-card #loginHelp { font-size:14px; line-height:1.8; margin-bottom:25px; }
  .login-card .eyebrow { font-size:10px; letter-spacing:2.5px; }
  .login-card .footnote { padding-top:8px; text-align:center; }
  .account-layout { padding:12px 0!important; }
  .account-layout>h1 { font-size:26px; margin:24px 0; }
  .account-layout>.wordmark { margin-bottom:7px; }
  .account-layout>a:not(.wordmark) { display:inline-block; font-size:13px; margin-bottom:7px; }
  .audit-row { font-size:13px; line-height:1.8; padding:16px 0; overflow-wrap:anywhere; }
  .audit-row small { font-size:12px; }
}
@media(max-width:360px) {
  body>.sidebar+main { padding-inline:12px; }
  body>.sidebar+main>header { margin-inline:-12px; padding-inline:14px; }
  .panel { padding-inline:15px; }
  .payment-row { grid-template-columns:1fr; gap:18px; }
  .submit-actions { margin-inline:-15px; padding-inline:15px; flex-wrap:wrap; }
  .submit-actions button { flex-basis:100%!important; }
  .sidebar .brandname { font-size:13px; }
}
