/* Screen-only application chrome. Document tables and output styles remain in style.css. */
@media screen {
  body.workspace-ui { --shell-navy:#102442; --shell-blue:#1459e8; --shell-line:#dce3ee; height:100vh; height:100dvh; }
  .workspace-ui #main-content { min-width:0; background:#eef2f8; }
  .workspace-ui #sidebar { width:196px; min-width:196px; background:linear-gradient(155deg,#152d4d,#0e203b); border:0; padding:0 10px 8px; }
  .shell-brand { height:49px; display:flex; align-items:center; flex-shrink:0; padding:0 8px; font-size:16px; font-weight:700; letter-spacing:-.5px; color:#f6f9ff; }
  .workspace-ui #sidebar-ledger,.workspace-ui #sidebar-quote,.workspace-ui #book-sidebar,.workspace-ui #unsugil-sidebar { height:auto!important; flex:1; min-height:0; min-width:0; width:100%; background:transparent; overflow:hidden; }
  .workspace-ui .sidebar-header { background:none; border:0; padding:12px 2px 8px; }
  .workspace-ui .sidebar-header h2 { font-size:12px; margin-bottom:10px; color:#d5dfed; }
  .workspace-ui .sidebar-header button,.workspace-ui #btn-book-add-company { background:#155bd3; border:1px solid #6b99e0; padding:7px 8px; font-size:11px; border-radius:4px; }
  .workspace-ui .sidebar-search { padding:3px 2px 10px; }
  .workspace-ui #company-search,.workspace-ui #quote-company-search,.workspace-ui #book-company-search { background:#ffffff13; border:1px solid #ffffff25; border-radius:4px; font-size:11px; padding:6px 8px; }
  .workspace-ui .company-list-size-control { margin:0 2px 8px; padding:3px 6px; font-size:10px; background:transparent; border-color:#ffffff13; }
  .workspace-ui #company-list-font-size-input { padding:1px 3px; font-size:10px; width:40px; background:#ffffff13; border-color:#ffffff35; color:#e8efff; }
  .workspace-ui #company-list,.workspace-ui #quote-company-list { padding:3px 0; min-height:70px; }
  .workspace-ui #sidebar :is(.company-item,.quote-company-item,.book-company-item,.unsugil-month-item) { border-radius:4px; margin:2px 0; padding-top:7px; padding-bottom:7px; }
  .workspace-ui #sidebar :is(.company-item,.quote-company-item,.book-company-item,.unsugil-month-item).active { background:#1559cd; border-left-color:#a8ccff; color:white; }
  .workspace-ui #vehicle-panel,.workspace-ui #book-vehicle-section { background:transparent; border-top:1px solid #ffffff25; max-height:27vh; }
  .workspace-ui .vehicle-panel-header,.workspace-ui .book-sidebar-header,.workspace-ui .unsugil-sidebar-header { padding:10px 3px; color:#e0e9f9; font-size:11px; }
  .workspace-ui #book-sidebar .book-sidebar-section:first-child { min-height:80px; }
  .workspace-ui #book-company-search { margin:0 2px 9px; width:calc(100% - 4px); }
  .workspace-ui .unsugil-year-header { padding:9px 7px; }
  .workspace-ui .unsugil-month-item { padding:5px 12px 5px 26px!important; }
  .shell-backup,.shell-template { border-top:1px solid #ffffff26; flex-shrink:0; color:#dfe8f7; font-size:11px; }
  .shell-backup > summary,.shell-template > summary { padding:11px 4px; cursor:pointer; }
  .shell-backup[open] { max-height:40vh; overflow:auto; }
  .workspace-ui #all-backup-bar { display:block; padding:0 0 8px; border:0; background:transparent; }
  .workspace-ui #all-backup-bar > span { display:none; }
  .workspace-ui #all-backup-bar > div { display:flex; flex-direction:column; gap:6px; }
  .workspace-ui #all-backup-bar button { width:100%; text-align:left; font-size:10px; padding:7px 6px; color:#e7efff; border:1px solid #ffffff25; background:#ffffff0b; }
  .workspace-ui #all-backup-bar #btn-desktop-source { background:#ffffff0b; color:#e7efff; border-color:#ffffff25; }
  .workspace-ui .sidebar-footer { padding:0 2px 8px; background:transparent; border:0; }
  .workspace-ui .sidebar-footer button { font-size:10px; padding:6px; }
  .workspace-ui .shell-settings-link { background:transparent; border:0; color:#dfe8f7; text-align:left; font-size:11px; padding:9px 4px; }
  .workspace-ui #main-tabs { height:40px; border-bottom:1px solid var(--shell-line); background:#fcfdff; overflow-x:auto; }
  .workspace-ui .main-tab { color:#354257; padding:0 17px; font-size:12px; letter-spacing:-.3px; flex-shrink:0; }
  .workspace-ui .main-tab:hover { background:#edf3ff; color:#1459e8; }
  .workspace-ui .main-tab.active { color:#1459e8; background:#f5f8ff; border-bottom:3px solid #1459e8; }
  .shell-header { min-height:76px; flex-shrink:0; padding:10px 18px 12px; display:flex; align-items:center; justify-content:space-between; gap:12px; background:linear-gradient(110deg,#fff,#f5f8ff); border-bottom:1px solid var(--shell-line); }
  .shell-heading { min-width:100px; }
  .shell-breadcrumb { font-size:10px; color:#67778e; margin-bottom:5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:350px; }
  .shell-title { font-size:20px; line-height:1.4; letter-spacing:-.7px; color:#142238; font-weight:750; margin:0; }
  .shell-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:6px; }
  .shell-button,.shell-actions button,.shell-ribbon button,.shell-inspector button { font-family:inherit; cursor:pointer; border:1px solid #d0d9e6; border-radius:4px; background:#fff; color:#30425a; padding:5px 9px; font-size:11px; line-height:1.5; white-space:nowrap; }
  .shell-actions :is(.btn-pdf,.book-btn-sync) { background:#1459e8; color:white; border-color:#1459e8; box-shadow:0 2px 4px #1459e820; }
  .shell-actions button:hover,.shell-ribbon button:hover,.shell-inspector button:hover,.shell-button:hover { background:#eaf1ff; color:#1459e8; }
  .shell-actions button:disabled,.shell-inspector button:disabled { opacity:.5; }
  .workspace-ui :is(.shell-actions,.shell-ribbon,.shell-inspector,.shell-status,#sidebar,#main-tabs) :focus-visible { outline:2px solid #76a9ff; outline-offset:2px; }
  .workspace-ui :is(#toolbar,#quote-toolbar,#book-toolbar,#unsugil-toolbar).shell-ribbon { min-height:40px; max-height:52px; padding:5px 14px; background:#fafcff; display:flex; flex-wrap:nowrap; justify-content:flex-start; gap:10px; border-bottom:1px solid var(--shell-line); overflow:auto; flex-shrink:0; }
  .workspace-ui .shell-ribbon .toolbar-right { display:flex; flex-wrap:nowrap; gap:8px; width:auto; flex-shrink:0; }
  .workspace-ui .shell-ribbon .ribbon-group { display:inline-flex; flex-shrink:0; flex-wrap:nowrap; gap:4px; }
  .workspace-ui .shell-ribbon .ribbon-group:empty,.shell-ribbon-separator { display:none!important; }
  .workspace-ui .shell-ribbon button { border-color:transparent; background:transparent; color:#35465d; font-size:11px; padding:4px 6px; }
  .workspace-ui .shell-ribbon select { font-size:11px; max-width:130px; }
  .shell-ribbon-caption { background:#e7efff; border-bottom:2px solid #1459e8; color:#1459e8; font-size:11px; padding:4px 10px; }
  .workspace-ui :is(#sheet-tabs,#quote-sheet-tabs,#book-sheet-tabs) { min-height:37px; padding:4px 12px; flex-shrink:0; background:#f8faff; border-bottom:1px solid var(--shell-line); gap:6px; overflow-x:auto; }
  .workspace-ui :is(#tab-list,#quote-tab-list,#book-tab-list) { min-width:0; }
  .workspace-ui :is(#sheet-tabs,#quote-sheet-tabs,#book-sheet-tabs) button { font-size:10px; padding:5px 8px; flex-shrink:0; }
  .shell-workspace { display:flex; flex:1; min-height:0; min-width:0; overflow:hidden; position:relative; }
  .workspace-ui :is(#book-main,#unsugil-main) { min-height:0; min-width:0; }
  .workspace-ui .shell-canvas { flex:1; min-width:0!important; min-height:0; overflow:auto; background:#e5ebf5; padding:26px; scrollbar-gutter:stable; }
  /* Only the external scroll canvas is styled; the A4/table content stays original. */
  .shell-inspector { width:248px; min-width:248px; overflow:auto; flex-shrink:0; background:#fbfcff; border-left:1px solid #d5dfed; color:#34435a; padding:0 14px 18px; }
  .shell-inspector-heading { position:sticky; top:0; z-index:2; display:flex; justify-content:space-between; align-items:center; background:#fbfcff; border-bottom:2px solid #e6edfa; padding:13px 0 10px; font-size:13px; color:#182c49; }
  .shell-inspector-heading button { padding:0 5px; border:0; font-size:18px; background:transparent; }
  .shell-inspector-closed .shell-inspector { display:none; }
  .shell-section { border-bottom:1px solid #e0e6ef; padding:11px 0; }
  .shell-section > summary { cursor:pointer; font-size:11px; font-weight:700; color:#24364d; list-style-position:inside; }
  .shell-section-body { padding-top:10px; display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
  .workspace-ui .shell-inspector :is(#edit-panel,#quote-edit-panel,#book-col-width-panel) { background:transparent; border:0; padding:0; min-width:0; width:100%; }
  .workspace-ui .shell-inspector :is(.panel-row,.quote-panel-row) { display:flex; flex-wrap:wrap; gap:8px; padding:9px 0; border-bottom:1px solid #e5ebf3; margin:0; width:100%; }
  .workspace-ui .shell-inspector :is(.panel-row,.quote-panel-row)>label:first-child { width:100%; font-size:11px; font-weight:600; color:#40536f; }
  .workspace-ui .shell-inspector :is(.panel-item,.quote-panel-item) { margin:0!important; padding:0!important; border:0!important; display:flex; align-items:center; gap:6px; flex-wrap:wrap; max-width:100%; }
  .workspace-ui .shell-inspector :is(.col-width-row,.quote-col-width-inputs,#book-col-width-inputs) { display:flex; flex-wrap:wrap; gap:7px; width:100%; }
  .workspace-ui .shell-inspector :is(.col-width-row,.quote-col-width-inputs,#book-col-width-inputs)>* { flex:0 1 calc(50% - 4px); min-width:0; font-size:10px; }
  .workspace-ui .shell-inspector input:not([type=checkbox]):not([type=file]),.workspace-ui .shell-inspector select { min-width:0; max-width:100%; padding:4px 5px; border:1px solid #d5ddeb; border-radius:4px; background:#fff; color:#263955; font-size:11px; height:27px; }
  .workspace-ui .shell-inspector input[type=number] { width:57px; }
  .workspace-ui .shell-inspector input[type=checkbox] { accent-color:#1459e8; }
  .workspace-ui .shell-inspector .toolbar-left { display:flex; flex-wrap:wrap; gap:7px; width:100%; }
  .workspace-ui .shell-inspector .toolbar-left .toolbar-title,.workspace-ui .shell-inspector .toolbar-left .ribbon-sep { display:none; }
  .workspace-ui .shell-inspector .toolbar-email-label { display:flex; flex-wrap:wrap; gap:5px; width:100%; }
  .workspace-ui .shell-inspector .toolbar-email-label input { width:100%; }
  .workspace-ui .shell-inspector .ribbon-group { display:flex; flex-wrap:wrap; gap:8px; border:0; padding:0; width:100%; }
  .workspace-ui .shell-inspector :is(.unsugil-fontsize-group,.unsugil-colwidth-group) { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  .workspace-ui .shell-inspector .unsugil-toolbar-label { flex-basis:100%; font-size:10px; }
  .workspace-ui .shell-inspector :is(.unsugil-fontsize-group,.unsugil-colwidth-group)>.unsugil-toolbar-label { display:none; }
  .workspace-ui .shell-inspector .unsugil-fs-item { display:flex; align-items:center; justify-content:space-between; gap:4px; font-size:10px; }
  .workspace-ui .shell-inspector .unsugil-fs-input { width:50px!important; }
  .workspace-ui #unsugil-price-result { width:100%; color:#1459e8; background:#eaf1ff; padding:6px; text-align:right; }
  .workspace-ui .shell-inspector #btn-unsugil-credit-split { font-size:11px; white-space:normal; width:100%; }
  .shell-help { font-size:10px; color:#74839a; line-height:1.8; white-space:normal; }
  .shell-inspector > .shell-help { margin-top:12px; }
  .shell-status { height:31px; padding:0 14px; display:flex; align-items:center; gap:20px; flex-shrink:0; background:#f9fbff; border-top:1px solid #d4dfed; font-size:10px; color:#4a5e78; }
  .shell-status-text { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .shell-storage-note { color:#7b8a9f; margin-left:auto; }
  .shell-zoom { display:flex; align-items:center; gap:9px; margin-left:auto; flex-shrink:0; }
  .shell-zoom-group { display:flex; align-items:center; gap:4px; }
  .shell-zoom-group[hidden],.shell-zoom [hidden] { display:none; }
  .workspace-ui .shell-status button { border:0; background:transparent; color:#355784; font:inherit; padding:3px 6px; cursor:pointer; }
  .shell-screen-scale { zoom:var(--screen-zoom,1); flex-shrink:0; }
  .shell-document-stage { display:flex; justify-content:center; align-items:flex-start; flex-shrink:0; margin:0 auto; }
  .shell-document-stage > article { flex:0 0 auto; }
  .workspace-ui #credit-toolbar { background:transparent; border:0; padding:0; }
  .workspace-ui #credit-toolbar h2 { display:none; }
  .workspace-ui .credit-toolbar-right { flex-wrap:wrap; gap:6px; }
  .workspace-ui #panel-credit { background:#f5f8fd; }
  .workspace-ui #credit-sub-tabs { background:transparent; border-bottom:1px solid #dce3ed; padding:0 16px; }
  .workspace-ui .credit-sub-tab { background:transparent; border-radius:0; color:#57708f; }
  .workspace-ui .credit-sub-tab.active { color:#1459e8; background:transparent; border-bottom:3px solid #1459e8; }
  .workspace-ui #credit-summary-cards { padding:16px; gap:12px; }
  .workspace-ui .credit-card { background:white; border:1px solid #dce5f1; border-radius:7px; box-shadow:0 2px 5px #28466b04; color:#293a52; padding:14px 18px; }
  .workspace-ui .credit-card-value { color:#172c4a; font-size:23px; }
  .workspace-ui .credit-card-label { color:#63768e; font-size:11px; }
  .workspace-ui #credit-month-bar { background:transparent; padding:4px 16px 12px; }
  .workspace-ui .credit-month-btn { background:#fff; border:1px solid #d5dfec; border-radius:4px; color:#536980; }
  .workspace-ui .credit-month-btn.active { background:#1459e8; color:white; border-color:#1459e8; }
  #shell-menu,#shell-shade { display:none; }
  @media (max-width:1150px) {
    .workspace-ui #sidebar { width:168px; min-width:168px; }
    .shell-inspector { width:224px; min-width:224px; padding-left:10px; padding-right:10px; }
    .shell-header { padding:10px 12px; }
    .shell-title { font-size:17px; }
    .shell-actions { max-width:55%; }
    .shell-actions button { font-size:10px; padding:4px 7px; }
    .workspace-ui .main-tab { padding:0 12px; }
    .shell-storage-note { display:none; }
  }
  @media (max-width:1000px) {
    .shell-inspector { position:absolute; right:0; top:0; bottom:0; width:270px; z-index:70; box-shadow:-8px 0 28px #19396120; }
    .workspace-ui .shell-canvas { padding:18px; }
  }
  @media (max-width:700px) {
    .workspace-ui #sidebar { position:fixed; z-index:180; top:40px; bottom:31px; left:0; width:230px; min-width:230px; transform:translateX(-100%); transition:transform .18s ease; }
    .workspace-ui.shell-sidebar-open #sidebar { transform:translateX(0); }
    #shell-menu { display:block; position:sticky; left:0; z-index:3; border:0; border-radius:0; background:#102442; color:white; padding:0 13px; }
    .shell-sidebar-open #shell-shade { display:block; position:fixed; z-index:179; inset:40px 0 31px; background:#10244255; color:transparent; border:0; }
    .workspace-ui .main-tab { font-size:11px; padding:0 13px; }
    .shell-header { padding:9px 10px; flex-wrap:wrap; gap:8px; }
    .shell-heading { width:100%; }
    .shell-title { font-size:17px; }
    .shell-breadcrumb { font-size:9px; max-width:100%; }
    .shell-actions { max-width:100%; width:100%; justify-content:flex-start; gap:5px; }
    .shell-actions button { padding:5px 7px; }
    .workspace-ui .shell-ribbon { padding:4px 8px!important; }
    .shell-status { padding:0 8px; gap:8px; }
    .shell-status-text { max-width:150px; }
    .shell-zoom { gap:3px; }
    .shell-inspector { width:min(300px,90vw); }
    .workspace-ui #credit-summary-cards { padding:10px; gap:7px; flex-wrap:wrap; }
    .workspace-ui .credit-card { min-width:95px; padding:10px; }
    .workspace-ui .credit-card-value { font-size:16px; }
    .workspace-ui .credit-toolbar-right { justify-content:flex-start; }
    .workspace-ui #credit-month-btns { flex-wrap:wrap; }
  }
}
@media print {
  .shell-brand,.shell-header,.shell-inspector,.shell-status,.shell-backup,.shell-template,.shell-settings-link,#shell-menu,#shell-shade,.shell-ribbon { display:none!important; }
  .shell-workspace,.shell-screen-scale,.shell-document-stage { display:block; zoom:1!important; overflow:visible; }
  .shell-document-stage { width:auto!important; height:auto!important; }
}
