/* Workflow, screen-layout and error visibility upgrades. */
.sidebar{height:100vh;height:100dvh;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#758e9d52 transparent}
.sidebar .sidebar-bottom{flex-shrink:0;padding-top:18px}
.sidebar .nav-link{flex-shrink:0}
.toast{z-index:1400;top:90px;bottom:auto;right:22px;max-width:min(420px,calc(100vw - 30px));padding:16px 19px;background:#174d3e;color:#fff;border:1px solid #b5e5cc;border-left:5px solid #75d9a0;border-radius:14px;box-shadow:0 20px 52px rgba(14,31,45,.24);line-height:1.55;overflow-wrap:anywhere}
.toast.error{background:#fff5f2;color:#8b2c24;border:1px solid #f2b9a9;border-left:5px solid #e4533f}
.business-gstin-check{grid-column:1/-1;padding:13px 15px;border:1px solid #dbe7f1;border-radius:13px;background:#f6f9fd;display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.business-gstin-check small{flex-basis:100%;color:#53677d;line-height:1.5}
.business-gstin-check button,.business-gstin-check a{border:1px solid #cbd9e9;border-radius:9px;background:#fff;color:#315a8c;padding:8px 12px;font:700 11px/1.4 'DM Sans',sans-serif}
.business-gstin-check button:hover{background:#e8eff9}
.mapping-intro{background:#f2f7ff;border:1px solid #dce7f7;border-radius:13px;padding:15px;margin-bottom:15px}
.mapping-intro strong{font-size:14px;color:#243c69}.mapping-intro p{font-size:11px;color:#617590;margin-top:5px;line-height:1.55}
.mapping-grid{display:grid;gap:9px;max-height:42vh;overflow-y:auto;padding-right:5px;margin:14px 0}
.mapping-cell{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,1fr);gap:12px;align-items:center;border:1px solid #e5eaf0;border-radius:11px;background:#fff;padding:10px 13px}
.mapping-cell strong,.mapping-cell small{display:block;overflow-wrap:anywhere}.mapping-cell strong{font-size:12px;color:#29405b}.mapping-cell small{font-size:10px;color:#718195;margin-top:2px}
.mapping-cell label{display:grid;gap:4px}.mapping-cell label span{font-size:9px;letter-spacing:.08em;font-weight:800;color:#728299}.mapping-cell select,.mapping-fallbacks select{width:100%;border:1px solid #ccd6e3;border-radius:8px;padding:8px;font-size:11px;background:#f9fbff;color:#2d445d}
.mapping-fallbacks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0}
.mapping-fallbacks small{display:block;color:#607287;margin:4px 0}
.invoiced-demo-bar{margin:18px 0 24px;padding:18px 21px;background:linear-gradient(115deg,#eef5ff,#f8faff);border:1px solid #d9e7f8;border-radius:16px;display:flex;justify-content:space-between;gap:16px;align-items:center}
.invoiced-demo-bar strong,.invoiced-demo-bar span{display:block}.invoiced-demo-bar strong{color:#294a7f;font:800 14px Manrope,sans-serif}.invoiced-demo-bar span{font-size:11px;color:#5e718d;margin-top:5px}.invoiced-demo-bar button,.tour-launch{border:1px solid #c8d9ef;background:#fff;color:#2a4f84;border-radius:10px;padding:10px 13px;font-weight:800;font-size:11px;white-space:nowrap;cursor:pointer}
.tour-launch{display:flex;gap:7px;align-items:center}.tour-launch:hover,.invoiced-demo-bar button:hover{background:#e7f0fb}
.invoiced-tour-layer{position:fixed;inset:0;z-index:1300;background:rgba(12,30,54,.48);display:grid;place-items:center;padding:16px}
.invoiced-tour-card{width:min(100%,520px);background:#fff;box-shadow:0 30px 75px #102f5350;border-radius:22px;padding:25px 29px 22px;color:#203653}
.invoiced-tour-card small{color:#597ca6;letter-spacing:1.3px;font-size:10px;font-weight:900}
.invoiced-tour-card h2{font:800 24px/1.25 Manrope,sans-serif;margin:12px 0 10px}
.invoiced-tour-card p{font-size:13px;line-height:1.7;color:#5d7187}
.invoiced-tour-bullets{display:grid;gap:6px;margin:18px 0}.invoiced-tour-bullets span{background:#f2f7fd;padding:9px 12px;border-radius:9px;font-size:11px;color:#3c587a}
.invoiced-tour-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:21px}.invoiced-tour-actions button{padding:11px 15px;border:1px solid #cfdbe9;border-radius:9px;color:#244a80;background:#fff;font-weight:800}.invoiced-tour-actions button.primary{background:#2857c9;border-color:#2857c9;color:white}
.invoiced-fx{margin:13px 0;padding:15px 17px;background:#f4f8fc;border:1px solid #d7e4f2;border-radius:14px;display:grid;gap:9px}
.invoiced-fx strong{font:800 12px Manrope,sans-serif;color:#274b75}.invoiced-fx p{font-size:11px;color:#637a92;line-height:1.5}
.invoiced-fx-controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.invoiced-fx-controls select{padding:9px 11px;border:1px solid #cddbee;background:white;border-radius:9px;font-size:11px;color:#2e5079}
.invoiced-fx-controls button{padding:9px 13px;border:0;border-radius:9px;background:#295ec9;color:#fff;font-size:11px;font-weight:800}
.invoiced-fx-result{font-size:12px;color:#335a81;font-variant-numeric:tabular-nums}.invoiced-fx-result b{font-size:17px}
.gstin-studio-hint{display:block;font-size:10px;color:#55738e;line-height:1.5;margin-top:7px}.gstin-studio-hint.invalid{color:#ae3d36}
/* Each appearance choice changes layout, density and navigation as well as color. */
@media(min-width:1101px){
  html[data-ui-theme="calm"] .shell{display:flex;flex-direction:column;max-width:none}
  html[data-ui-theme="calm"] .sidebar{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:12px;position:sticky;top:0;z-index:80;width:100%!important;height:80px!important;min-height:80px;max-height:80px;padding:8px 16px;overflow-x:auto;overflow-y:hidden;border:0;box-shadow:0 3px 16px #213e3220}
  html[data-ui-theme="calm"] .sidebar>.nav-caption,html[data-ui-theme="calm"] .sidebar>.sidebar-bottom{display:none}
  html[data-ui-theme="calm"] .brand-block{flex:none;padding:0 14px 0 0}
  html[data-ui-theme="calm"] .workspace-tag{display:none}
  html[data-ui-theme="calm"] .side-nav{display:flex;gap:3px;flex:none}
  html[data-ui-theme="calm"] .nav-link{padding:0 11px;min-height:38px;white-space:nowrap}
  html[data-ui-theme="calm"] .sidebar nav.side-nav:last-of-type{padding-right:15px}
  html[data-ui-theme="calm"] .topbar{top:80px;height:63px}
  html[data-ui-theme="calm"] .page{max-width:1360px;padding-top:28px}
  html[data-ui-theme="calm"] .bold-intelligence-grid{grid-template-columns:1.1fr 1fr 1fr}
  html[data-ui-theme="signature"] .page{max-width:1290px}
  html[data-ui-theme="signature"] .studio-workspace{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr)}
  html[data-ui-theme="signature"] .page-header{border-bottom:1px solid #dce4e6;padding-bottom:20px}
  html[data-ui-theme="contrast"] .shell{grid-template-columns:228px minmax(0,1fr)}
  html[data-ui-theme="contrast"] .sidebar{width:228px}
  html[data-ui-theme="contrast"] .page{max-width:none;padding:26px 30px 45px}
  html[data-ui-theme="contrast"] .sales-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  html[data-ui-theme="contrast"] .dashboard-grid{grid-template-columns:1fr 1fr}
}
html[data-ui-theme="contrast"] :is(.panel,.studio-editor,.business-panel,.business-stock-row,.invoiced-demo-bar){border-radius:5px!important}
html[data-ui-theme="contrast"] .data-table th{font-size:12px}
@media(max-width:800px){
  .sidebar{height:100dvh;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain}
  .toast{top:80px;left:12px;right:12px;bottom:auto;max-width:none}
  .mapping-cell{grid-template-columns:1fr;gap:7px}
  .mapping-fallbacks{grid-template-columns:1fr}
  .invoiced-demo-bar{flex-direction:column;align-items:stretch}
  .tour-launch{padding:9px 10px}
}
@media(max-width:550px){.top-actions .tour-launch{font-size:0;gap:0}.invoiced-tour-card{padding:22px}.invoiced-fx-controls{align-items:stretch;flex-direction:column}}
/* Dock Saathi in the invoice toolbar: it never floats over the Next/Save CTA. */
#studioMount .studio-head-actions{position:relative;overflow:visible}
#studioMount .tax-chat-shell{position:relative;right:auto;bottom:auto;display:flex;align-items:center;justify-items:unset;gap:0;margin-left:auto;z-index:55}
#studioMount .tax-chat-launch{order:0;box-shadow:none;white-space:nowrap;padding:9px 12px;font-size:12px}
#studioMount .tax-chat-panel{order:1;position:absolute;right:0;top:calc(100% + 12px);z-index:56;max-height:min(590px,75dvh)}
.studio-step-warning{margin:0 0 18px;padding:16px 18px;background:#fff1ed;color:#842d25;border:1px solid #e9b3a6;border-left:5px solid #db5145;border-radius:12px;box-shadow:0 8px 20px rgba(147,44,31,.09)}
.studio-step-warning strong{display:block;font-size:13px}.studio-step-warning p{font-size:12px;line-height:1.65;margin:5px 0 0}
#studioEditorFields [aria-invalid="true"]{border:2px solid #d5453a!important;outline:3px solid #f4c3bd!important;outline-offset:1px}
.desktop-sidebar-toggle{display:grid;place-items:center;width:39px;height:39px;flex:0 0 39px;background:#f5f8f7;border:1px solid #d8e5df;border-radius:10px;color:#285d4c;cursor:pointer}
.desktop-sidebar-toggle svg{width:19px;height:19px}
@media(min-width:801px){
  html[data-sidebar-collapsed="true"] .shell{grid-template-columns:76px minmax(0,1fr)}
  html[data-sidebar-collapsed="true"] .sidebar{width:76px!important;padding:17px 10px;gap:2px}
  html[data-sidebar-collapsed="true"] .sidebar .brand-block{padding:0 0 15px}
  html[data-sidebar-collapsed="true"] .sidebar .brand{justify-content:center}
  html[data-sidebar-collapsed="true"] .sidebar .brand-words,html[data-sidebar-collapsed="true"] .sidebar .workspace-tag,html[data-sidebar-collapsed="true"] .sidebar .nav-caption,html[data-sidebar-collapsed="true"] .sidebar .sidebar-bottom{display:none!important}
  html[data-sidebar-collapsed="true"] .sidebar .side-nav{gap:5px}
  html[data-sidebar-collapsed="true"] .sidebar .nav-link,html[data-sidebar-collapsed="true"] .sidebar .nav-more-toggle{font-size:0;gap:0;padding:0;min-height:45px;display:flex;align-items:center;justify-content:center;white-space:nowrap}
  html[data-sidebar-collapsed="true"] .sidebar .nav-link>span:first-child,html[data-sidebar-collapsed="true"] .sidebar .nav-more-toggle>span:first-child{margin:0}
  html[data-sidebar-collapsed="true"] .sidebar .nav-count,html[data-sidebar-collapsed="true"] .sidebar .nav-shortcut,html[data-sidebar-collapsed="true"] .sidebar .nav-more-chevron{display:none}
  html[data-sidebar-collapsed="true"] .sidebar .advanced-link{padding:0!important}
}
@media(min-width:1101px){
  html[data-ui-theme="calm"][data-sidebar-collapsed="true"] .shell{display:flex;flex-direction:column}
  html[data-ui-theme="calm"][data-sidebar-collapsed="true"] .sidebar{width:100%!important;height:64px!important;min-height:64px;max-height:64px;flex-direction:row;padding:7px 14px;gap:10px}
  html[data-ui-theme="calm"][data-sidebar-collapsed="true"] .sidebar .brand-block{padding:0}
  html[data-ui-theme="calm"][data-sidebar-collapsed="true"] .sidebar .side-nav{display:flex}
  html[data-ui-theme="calm"][data-sidebar-collapsed="true"] .sidebar .nav-link{width:43px;min-width:43px}
  html[data-ui-theme="calm"][data-sidebar-collapsed="true"] .topbar{top:64px}
}
@media(max-width:800px){
  .desktop-sidebar-toggle{display:none}
  #studioMount .tax-chat-shell{flex:0 0 auto}
  #studioMount .tax-chat-launch{padding:9px 11px}
  #studioMount .tax-chat-panel{position:fixed;right:12px;top:80px;bottom:auto;max-width:calc(100vw - 24px);height:min(590px,calc(100dvh - 96px))}
}
@media print{#studioMount .tax-chat-shell,.desktop-sidebar-toggle,.studio-step-warning{display:none!important}}
