/* Steelwise screen-only legibility pass for the existing Design C shell.
   Business forms, ERP records and print/PDF templates are unchanged. */
@media screen {
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) {
    font-size:15px;
  }

  /* Groups stay closed until the user opens them. Give the labels enough room
     to remain readable in either language and keep the active group visible. */
  @media (min-width:768px) {
    html[data-sw-color-scheme] body:not([data-tenant="weko"]) .sidebar {
      width:clamp(224px,20vw,252px);
    }
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .sidebar nav {
    padding:10px 9px 18px;
    overflow-x:hidden;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .navgroup-label {
    padding:12px 9px 6px;
    font-size:.69rem;
    font-weight:700;
    letter-spacing:.035em;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .nav-folder {
    margin:4px 0 7px;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .nav-folder-toggle {
    min-height:44px;
    max-width:100%;
    gap:10px;
    padding:8px 10px;
    border-radius:7px;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .nav-folder-toggle>svg:first-child {
    width:17px;
    height:17px;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .nav-folder-title strong {
    font-size:.83rem;
    font-weight:700;
    line-height:1.25;
    letter-spacing:0;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .nav-folder-title small {
    font-size:.65rem;
    line-height:1.35;
    letter-spacing:0;
    text-transform:none;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .nav-folder-count {
    min-width:25px;
    height:25px;
    font-size:.69rem;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .nav-folder-items {
    margin:4px 0 0 12px;
    padding:2px 0 2px 8px;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) :is(.navitem,.nav-folder-items .navitem,.navitem.document-module) {
    min-height:39px;
    gap:9px;
    padding:8px 9px;
    font-size:.81rem;
    line-height:1.3;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) :is(.navitem,.nav-folder-items .navitem) svg {
    width:16px;
    height:16px;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) :is(.nav-folder-toggle,.navitem):focus-visible {
    outline:2px solid var(--brass-bright);
    outline-offset:2px;
  }

  /* Match the reference's calm header without shrinking actions and text. */
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .global-search-shell {
    min-height:62px;
    padding:9px 18px;
    gap:13px;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) :is(.desktop-sidebar-toggle,.global-search-input,.sw-header-user-label) {
    font-size:.8rem;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .global-search-control {
    min-height:39px;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .sw-header-user-label small {
    font-size:.69rem;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .topbar {
    top:62px;
    padding:17px 24px;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .topbar h1 {
    font-size:1.34rem;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .topbar .sub {
    font-size:.8rem;
    line-height:1.5;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .content {
    padding:20px 24px 44px;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) :is(.btn,.icon-btn) {
    font-size:.79rem;
    line-height:1.3;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .field label {
    font-size:.78rem;
    line-height:1.35;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .table-wrap thead th {
    font-size:.75rem;
    line-height:1.35;
  }
  html[data-sw-color-scheme] body:not([data-tenant="weko"]) .table-wrap tbody td {
    font-size:.81rem;
    line-height:1.4;
  }

  /* Design C: fit the board to the viewport and scroll only individual data
     tables. IDs, dates, prices and statuses are never cut off. */
  .sw-design-c {
    gap:15px;
    line-height:1.45;
  }
  .swc-title h2 { font-size:1.48rem; }
  .swc-title p { font-size:.85rem; }
  .swc-title-side>span { font-size:.8rem; }
  .swc-title-side small { font-size:.72rem; }
  .swc-title-side button { min-height:39px;padding:8px 12px;font-size:.78rem; }
  .swc-kpis { gap:11px; }
  .swc-kpis>button { min-height:99px;padding:15px;gap:12px; }
  .swc-kpi-icon { flex-basis:40px;width:40px;height:40px;font-size:1.35rem; }
  .swc-kpis small { font-size:.78rem;white-space:normal; }
  .swc-kpis strong { font-size:1.7rem; }
  .swc-kpis em { font-size:.7rem;white-space:normal;overflow:visible; }
  .swc-tabs { gap:5px;overflow-x:auto; }
  .swc-tabs button { min-height:41px;padding:9px 12px;font-size:.77rem; }
  .swc-grid { gap:12px; }
  .swc-card { padding:14px 15px; }
  .swc-card-head { margin-bottom:10px;padding-bottom:9px; }
  .swc-card-head h3 { font-size:.92rem;white-space:normal;overflow:visible; }
  .swc-card-head button,.swc-inline-link { font-size:.76rem; }
  .swc-table-wrap table,
  .swc-side .swc-table-wrap table,
  .swc-third .swc-table-wrap table {
    width:max-content;
    min-width:100%;
    table-layout:auto;
    font-size:.77rem;
  }
  .swc-table-wrap th,.swc-table-wrap td {
    max-width:none;
    padding:8px 10px;
    overflow:visible;
    text-overflow:clip;
    line-height:1.35;
  }
  .swc-pill { max-width:none;padding:4px 7px;font-size:.72rem;overflow:visible;text-overflow:clip; }
  .swc-progress>span { flex-basis:38px; }
  .swc-section-label { margin:13px 0 8px;font-size:.77rem; }
  .swc-machine { grid-template-columns:minmax(0,1.2fr) minmax(35px,1fr) auto;gap:7px;font-size:.7rem; }
  .swc-machine>span { white-space:normal;overflow:visible; }
  .swc-tasks li { gap:8px;padding:8px 0;font-size:.74rem; }
  .swc-tasks li>span:nth-child(2) { white-space:normal;overflow:visible; }
  .swc-tasks small { font-size:.68rem; }
  .swc-footer { font-size:.71rem; }
  .swc-empty { font-size:.76rem; }

  /* The dashboard uses the same readable scale, not demo-sized captions. */
  .sw-dashboard-hero h2 { font-size:1.46rem; }
  .sw-dashboard-hero p,.sw-dashboard-date { font-size:.81rem; }
  .sw-dashboard-card-head h3 { font-size:.88rem; }
  .sw-dashboard-link { font-size:.76rem; }
  .sw-dashboard-tabs { overflow-x:auto; }
  .sw-dashboard-tabs span { flex:0 0 auto;font-size:.72rem;padding:7px 9px; }
  .sw-dashboard-table { width:max-content;min-width:100%;table-layout:auto;font-size:.76rem; }
  .sw-dashboard-table th,.sw-dashboard-table td { padding:8px 10px;overflow:visible;text-overflow:clip; }
  .sw-dashboard-status { font-size:.7rem;padding:4px 7px; }
  .sw-dashboard-task-list li { font-size:.74rem; }
  .sw-dashboard-task-list small { font-size:.68rem; }

  @media (max-width:1100px) {
    html[data-sw-color-scheme] body:not([data-tenant="weko"]) .global-search-shell { padding-inline:11px; }
    .swc-machines { grid-template-columns:1fr; }
  }
  @media (max-width:767px) {
    html[data-sw-color-scheme] body:not([data-tenant="weko"]) .sidebar { width:min(320px,88vw); }
    html[data-sw-color-scheme] body:not([data-tenant="weko"]) .topbar { top:0;padding:14px; }
    html[data-sw-color-scheme] body:not([data-tenant="weko"]) .content { padding:15px 12px 38px; }
    .swc-title h2 { font-size:1.28rem; }
    .swc-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .swc-kpis>button { min-height:100px;padding:11px; }
    .swc-kpi-icon { flex-basis:30px;width:30px;height:30px;font-size:1rem; }
    .swc-kpis strong { font-size:1.4rem; }
    .swc-card { padding:12px; }
  }
  @media (max-width:480px) {
    .swc-kpis>button { align-items:flex-start;gap:7px; }
    .swc-kpis small { font-size:.72rem; }
    .swc-kpis em { font-size:.65rem; }
    .swc-footer span { margin-bottom:3px; }
  }
}
