
    :root {
      --primary: #1463ff;
      --primary-dark: #0f3fb3;
      --accent: #ff8a00;
      --success: #10b981;
      --danger: #ef4444;
      --navy: #0f172a;
      --navy-2: #111c34;
      --surface: #1e293b;
      --surface-2: #263449;
      --bg: #f4f7fb;
      --card: #ffffff;
      --text: #111827;
      --muted: #64748b;
      --border: #dbe3ef;
      --soft: #eef4ff;
      --shadow: 0 16px 45px rgba(15, 23, 42, 0.12);
      --radius: 22px;
    }

    * {
      box-sizing: border-box;
    }

    html, body {
      margin: 0;
      min-height: 100%;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--bg);
      color: var(--text);
    }

    body {
      display: flex;
      overflow: hidden;
    }

    .app-shell {
      display: flex;
      width: 100vw;
      height: 100vh;
      overflow: hidden;
    }

    .sidebar {
      width: 324px;
      min-width: 324px;
      height: 100vh;
      background: linear-gradient(180deg, var(--navy) 0%, #08111f 100%);
      color: #fff;
      padding: 22px 18px;
      display: flex;
      flex-direction: column;
      gap: 18px;
      overflow-y: auto;
      box-shadow: 8px 0 28px rgba(15, 23, 42, 0.22);
      z-index: 2;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px 8px 18px;
      border-bottom: 1px solid rgba(255,255,255,.11);
    }

    .logo-mark {
      width: 44px;
      height: 44px;
      border-radius: 14px;
      background: linear-gradient(135deg, var(--primary), #7aa7ff);
      display: grid;
      place-items: center;
      font-weight: 900;
      letter-spacing: -0.05em;
      box-shadow: 0 10px 24px rgba(20, 99, 255, .42);
    }

    .brand h1 {
      margin: 0;
      font-size: 18px;
      line-height: 1.05;
      letter-spacing: .02em;
    }

    .brand span {
      display: block;
      color: #b7c6dc;
      font-size: 12px;
      margin-top: 4px;
      font-weight: 600;
    }

    .side-search {
      position: sticky;
      top: 0;
      background: linear-gradient(180deg, rgba(15,23,42,1), rgba(15,23,42,.94));
      padding: 4px 0 8px;
      z-index: 3;
    }

    .side-search input {
      width: 100%;
      padding: 12px 14px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,.12);
      background: rgba(255,255,255,.08);
      color: #fff;
      outline: none;
      font-weight: 600;
    }

    .side-search input::placeholder {
      color: #94a3b8;
    }

    .nav-group-title {
      margin: 16px 8px 8px;
      font-size: 11px;
      text-transform: uppercase;
      color: #8fa7c8;
      letter-spacing: .12em;
      font-weight: 900;
    }

    .nav-btn {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      text-align: left;
      background: rgba(255,255,255,.055);
      color: #dbeafe;
      border: 1px solid rgba(255,255,255,.08);
      border-radius: 14px;
      padding: 12px 12px;
      margin: 6px 0;
      cursor: pointer;
      transition: .16s ease;
      font-size: 14px;
      font-weight: 750;
    }

    .nav-btn:hover {
      transform: translateX(3px);
      background: rgba(20,99,255,.20);
      border-color: rgba(122,167,255,.35);
    }

    .nav-btn.active {
      color: #fff;
      background: linear-gradient(135deg, var(--primary), #0b4ed5);
      box-shadow: 0 12px 30px rgba(20, 99, 255, .28);
      border-color: rgba(255,255,255,.22);
    }

    .nav-btn small {
      min-width: 28px;
      height: 24px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      background: rgba(255,255,255,.10);
      color: #cbd5e1;
      font-size: 11px;
      font-weight: 900;
    }

    .nav-btn.active small {
      background: rgba(255,255,255,.22);
      color: #fff;
    }

    .main {
      flex: 1;
      height: 100vh;
      overflow-y: auto;
      padding: 28px;
      position: relative;
    }

    .topbar {
      display: flex;
      justify-content: space-between;
      gap: 18px;
      align-items: center;
      margin-bottom: 22px;
    }

    .page-title h2 {
      margin: 0;
      font-size: clamp(28px, 4vw, 44px);
      letter-spacing: -0.04em;
      color: var(--navy);
    }

    .page-title p {
      margin: 8px 0 0;
      color: var(--muted);
      max-width: 800px;
      line-height: 1.5;
      font-weight: 550;
    }

    .status-pill {
      white-space: nowrap;
      background: #fff;
      border: 1px solid var(--border);
      padding: 10px 14px;
      border-radius: 999px;
      font-weight: 850;
      color: var(--navy);
      box-shadow: 0 8px 22px rgba(15,23,42,.07);
    }

    .hero {
      background: linear-gradient(135deg, var(--navy) 0%, #153b75 52%, var(--primary) 100%);
      color: #fff;
      border-radius: var(--radius);
      padding: 26px;
      box-shadow: var(--shadow);
      margin-bottom: 24px;
      position: relative;
      overflow: hidden;
    }

    .hero::after {
      content: "";
      position: absolute;
      right: -90px;
      top: -90px;
      width: 270px;
      height: 270px;
      border-radius: 50%;
      background: rgba(255,255,255,.10);
    }

    .hero h3 {
      margin: 0 0 8px;
      font-size: 26px;
      letter-spacing: -0.02em;
    }

    .hero p {
      margin: 0;
      max-width: 900px;
      line-height: 1.55;
      color: #dbeafe;
      font-weight: 550;
    }

    .hero-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 18px;
    }

    .hero-badges span {
      border-radius: 999px;
      background: rgba(255,255,255,.13);
      border: 1px solid rgba(255,255,255,.14);
      color: #fff;
      padding: 8px 12px;
      font-size: 13px;
      font-weight: 800;
    }

    .method-hero {
      margin-bottom: 24px;
      position: relative;
      z-index: 0;
    }

    .method-hero h3,
    .method-hero p,
    .method-hero .hero-badges,
    .method-info-grid {
      position: relative;
      z-index: 1;
    }

    .method-hero p strong {
      color: #fff;
    }

    .method-info-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      margin-top: 18px;
    }

    .method-info-box {
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.16);
      border-radius: 18px;
      padding: 14px 16px;
      backdrop-filter: blur(8px);
    }

    .method-info-box b {
      display: block;
      color: #fff;
      font-size: 13px;
      letter-spacing: .02em;
      text-transform: uppercase;
      margin-bottom: 6px;
    }

    .method-info-box span {
      display: block;
      color: #dbeafe;
      line-height: 1.5;
      font-weight: 550;
    }

    .main-mobile-toggle {
      margin-bottom: 16px;
    }

    .card {
      display: none;
      animation: fadeIn .18s ease;
    }

    .card.active {
      display: block;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(6px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .tool-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
      margin-bottom: 28px;
    }

    .tool-head {
      background: linear-gradient(135deg, var(--navy), var(--surface));
      color: #fff;
      padding: 24px;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 18px;
      align-items: center;
    }

    .tool-head h3 {
      margin: 0;
      font-size: clamp(24px, 3vw, 36px);
      letter-spacing: -0.035em;
    }

    .tool-head p {
      margin: 8px 0 0;
      color: #cbd5e1;
      max-width: 850px;
      line-height: 1.45;
      font-weight: 550;
    }

    .tool-number {
      width: 58px;
      height: 58px;
      border-radius: 18px;
      background: rgba(255,255,255,.12);
      display: grid;
      place-items: center;
      font-size: 22px;
      font-weight: 950;
      border: 1px solid rgba(255,255,255,.16);
    }

    .tool-body {
      padding: 24px;
    }

    .empty-zone {
      min-height: 370px;
      border: 2px dashed #c8d5e6;
      border-radius: 20px;
      background: repeating-linear-gradient(135deg, #f8fbff 0, #f8fbff 12px, #eef4ff 12px, #eef4ff 24px);
      display: grid;
      place-items: center;
      padding: 24px;
      text-align: center;
    }

    .empty-zone strong {
      display: block;
      color: var(--navy);
      font-size: 22px;
      margin-bottom: 8px;
    }

    .empty-zone span {
      display: block;
      color: var(--muted);
      max-width: 640px;
      margin: 0 auto;
      line-height: 1.5;
      font-weight: 600;
    }

    .placeholder-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
      margin-top: 18px;
    }

    .placeholder-box {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 16px;
      min-height: 108px;
    }

    .placeholder-box b {
      display: block;
      color: var(--navy);
      margin-bottom: 6px;
    }

    .placeholder-box p {
      margin: 0;
      color: var(--muted);
      line-height: 1.45;
      font-size: 14px;
      font-weight: 560;
    }

    .integration-box {
      margin-top: 18px;
      border-radius: 18px;
      border: 1px solid rgba(20,99,255,.20);
      background: linear-gradient(135deg, #eef4ff, #ffffff);
      padding: 18px;
      display: none;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
    }

    .integration-box.show {
      display: flex;
    }

    .integration-box h4 {
      margin: 0 0 4px;
      color: var(--navy);
      font-size: 17px;
    }

    .integration-box p {
      margin: 0;
      color: var(--muted);
      font-weight: 600;
      line-height: 1.45;
    }

    .integration-box a {
      flex: 0 0 auto;
      text-decoration: none;
      border-radius: 999px;
      background: var(--primary);
      color: #fff;
      padding: 11px 15px;
      font-weight: 900;
      box-shadow: 0 10px 24px rgba(20,99,255,.22);
    }

    /* 5S interactive game */
    .five-s-tool {
      display: grid;
      gap: 18px;
    }

    .five-s-top {
      display: grid;
      grid-template-columns: minmax(0, 1.42fr) minmax(300px, .58fr);
      gap: 16px;
      align-items: stretch;
    }

    .five-s-panel {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(15,23,42,.06);
    }

    .five-s-panel.dark {
      background: linear-gradient(135deg, var(--navy), var(--surface));
      color: #fff;
      border-color: rgba(255,255,255,.12);
    }

    .five-s-panel h4 {
      margin: 0 0 8px;
      font-size: 19px;
      color: var(--navy);
    }

    .five-s-panel.dark h4 {
      color: #fff;
    }

    .five-s-panel.dark p,
    .five-s-panel.dark .five-s-muted,
    .five-s-panel.dark .five-s-stat span,
    .five-s-panel.dark .five-s-step-card p {
      color: #dbeafe;
    }

    .five-s-muted {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 600;
    }

    .five-s-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 14px;
    }

    .five-s-actions .is-hidden {
      display: none !important;
    }

    .five-s-stage-grid {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 10px;
      margin-top: 14px;
    }

    .five-s-step-card {
      border-radius: 16px;
      border: 1px solid var(--border);
      background: #f8fbff;
      padding: 12px;
      min-height: 112px;
      transition: .15s ease;
    }

    .five-s-step-card b {
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--navy);
      font-size: 13px;
      text-transform: uppercase;
      letter-spacing: .04em;
      margin-bottom: 7px;
    }

    .five-s-step-card b span {
      width: 26px;
      height: 26px;
      display: grid;
      place-items: center;
      border-radius: 9px;
      background: var(--navy);
      color: #fff;
      font-size: 12px;
      font-weight: 950;
    }

    .five-s-step-card p {
      margin: 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.4;
      font-weight: 650;
    }

    .five-s-step-card.active {
      background: linear-gradient(135deg, #eef4ff, #ffffff);
      border-color: rgba(20,99,255,.45);
      box-shadow: 0 10px 24px rgba(20,99,255,.12);
      transform: translateY(-1px);
    }

    .five-s-step-card.done {
      background: #ecfdf5;
      border-color: rgba(16,185,129,.35);
    }

    .five-s-stats {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin: 14px 0;
    }

    .five-s-stat {
      border-radius: 16px;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.16);
      padding: 12px;
    }

    .five-s-stat b {
      display: block;
      color: #fff;
      font-size: 24px;
      line-height: 1.05;
      letter-spacing: -.03em;
    }

    .five-s-stat span {
      display: block;
      margin-top: 5px;
      color: #dbeafe;
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .five-s-progress {
      height: 10px;
      border-radius: 999px;
      background: rgba(255,255,255,.16);
      overflow: hidden;
      border: 1px solid rgba(255,255,255,.12);
    }

    .five-s-progress span {
      display: block;
      width: var(--five-s-progress, 0%);
      height: 100%;
      background: linear-gradient(90deg, var(--success), #8bffcb);
      border-radius: inherit;
      transition: width .2s ease;
    }

    .five-s-message {
      margin-top: 14px;
      padding: 13px;
      border-radius: 16px;
      background: rgba(255,138,0,.13);
      border: 1px solid rgba(255,138,0,.28);
      color: #fff7ed;
      font-weight: 750;
      line-height: 1.45;
    }

    .five-s-board-panel {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: 24px;
      padding: 18px;
      box-shadow: 0 14px 34px rgba(15,23,42,.07);
    }

    .five-s-board-head {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      align-items: flex-start;
      margin-bottom: 14px;
    }

    .five-s-board-head h4 {
      margin: 0 0 5px;
      color: var(--navy);
      font-size: 20px;
    }

    .five-s-board-head p {
      margin: 0;
      color: var(--muted);
      font-weight: 650;
      line-height: 1.45;
    }

    .five-s-stage-pill {
      flex: 0 0 auto;
      border-radius: 999px;
      background: var(--navy);
      color: #fff;
      padding: 10px 13px;
      font-weight: 950;
      font-size: 13px;
      box-shadow: 0 10px 22px rgba(15,23,42,.16);
    }

    .five-s-board {
      position: relative;
      min-height: 610px;
      border-radius: 22px;
      overflow: hidden;
      background:
        linear-gradient(90deg, rgba(15,23,42,.045) 1px, transparent 1px),
        linear-gradient(0deg, rgba(15,23,42,.045) 1px, transparent 1px),
        radial-gradient(circle at 18% 15%, rgba(20,99,255,.09), transparent 28%),
        radial-gradient(circle at 86% 78%, rgba(255,138,0,.09), transparent 25%),
        #f8fbff;
      background-size: 34px 34px, 34px 34px, auto, auto, auto;
      border: 1px solid #dbe3ef;
    }

    .five-s-board.standardized {
      background:
        linear-gradient(90deg, rgba(20,99,255,.12) 1px, transparent 1px),
        linear-gradient(0deg, rgba(20,99,255,.12) 1px, transparent 1px),
        #f8fbff;
      background-size: calc(100% / 7) calc(100% / 7);
    }

    .five-s-standard-label {
      position: absolute;
      z-index: 1;
      font-size: 11px;
      font-weight: 950;
      color: rgba(15,23,42,.42);
      background: rgba(255,255,255,.78);
      border: 1px solid rgba(15,23,42,.08);
      border-radius: 999px;
      padding: 4px 7px;
      pointer-events: none;
    }

    .five-s-missing-slot {
      --tile-size: 56px;
      position: absolute;
      left: calc(var(--x) * 1%);
      top: calc(var(--y) * 1%);
      width: var(--tile-size);
      height: var(--tile-size);
      transform: translate(-50%, -50%);
      display: grid;
      place-items: center;
      border-radius: 16px;
      border: 2px dashed rgba(239,68,68,.9);
      background: rgba(254,226,226,.92);
      color: #991b1b;
      font-weight: 950;
      font-size: 11px;
      text-align: center;
      line-height: 1.08;
      box-shadow: 0 14px 28px rgba(239,68,68,.18);
      z-index: 3;
      pointer-events: none;
    }

    .five-s-tile {
      --tile-size: 46px;
      position: absolute;
      left: calc(var(--x) * 1%);
      top: calc(var(--y) * 1%);
      width: var(--tile-size);
      height: var(--tile-size);
      transform: translate(-50%, -50%) rotate(calc(var(--rot) * 1deg));
      opacity: var(--op);
      display: grid;
      place-items: center;
      border-radius: 15px;
      border: 1px solid rgba(15,23,42,.16);
      background: #ffffff;
      color: var(--navy);
      font-weight: 950;
      font-size: 18px;
      box-shadow: 0 10px 22px rgba(15,23,42,.13);
      cursor: pointer;
      user-select: none;
      transition: left .36s ease, top .36s ease, transform .36s ease, opacity .25s ease, background .15s ease, box-shadow .15s ease;
      z-index: 2;
    }

    .five-s-tile.large {
      --tile-size: 54px;
      font-size: 20px;
    }

    .five-s-tile.faint {
      filter: saturate(.65);
    }

    .five-s-tile.distractor {
      background: #fff7ed;
      color: #9a3412;
      border-color: rgba(255,138,0,.28);
    }

    .five-s-tile.target {
      background: #ffffff;
      color: var(--navy);
    }

    .five-s-tile.hidden {
      opacity: 0;
      transform: translate(-50%, -50%) rotate(calc(var(--rot) * 1deg)) scale(.55);
      pointer-events: none;
    }

    .five-s-tile.sorted {
      --tile-size: 52px;
      border-radius: 16px;
      transform: translate(-50%, -50%) rotate(0deg);
    }

    .five-s-tile.clean {
      opacity: 1 !important;
      background: #ffffff;
      border-color: rgba(20,99,255,.25);
      box-shadow: 0 10px 22px rgba(20,99,255,.13);
    }

    .five-s-tile.next {
      /* K0 does not use color highlighting for the requested number. The class remains only for backward compatibility with saved DOM state. */
    }

    .five-s-tile.done {
      background: #ecfdf5;
      color: #047857;
      border-color: rgba(16,185,129,.35);
      box-shadow: none;
    }

    .five-s-tile.wrong {
      animation: fiveSWrong .25s ease;
    }

    @keyframes fiveSWrong {
      0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
      25% { transform: translate(-55%, -50%) rotate(-3deg); }
      75% { transform: translate(-45%, -50%) rotate(3deg); }
    }

    .five-s-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 14px;
    }

    .five-s-legend span {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      border-radius: 999px;
      background: #eef4ff;
      color: var(--navy);
      border: 1px solid rgba(20,99,255,.14);
      padding: 7px 10px;
      font-size: 12px;
      font-weight: 850;
    }

    .five-s-legend i {
      width: 11px;
      height: 11px;
      border-radius: 4px;
      display: inline-block;
      background: var(--primary);
    }

    .five-s-legend i.orange { background: var(--accent); }
    .five-s-legend i.green { background: var(--success); }
    .five-s-legend i.red { background: var(--danger); }

    .five-s-print-note {
      color: var(--muted);
      font-size: 13px;
      font-weight: 650;
      margin: 10px 0 0;
    }

    @media (max-width: 1180px) {
      .five-s-top,
      .five-s-stage-grid {
        grid-template-columns: 1fr;
      }

      .five-s-board-head {
        flex-direction: column;
      }
    }

    @media (max-width: 760px) {
      .five-s-board {
        min-height: 520px;
      }

      .five-s-tile {
        --tile-size: 40px;
        font-size: 15px;
      }

      .five-s-tile.large,
      .five-s-tile.sorted {
        --tile-size: 44px;
      }

      .five-s-stats {
        grid-template-columns: 1fr;
      }
    }



    /* 5S visual standard and cleaning plan generator */
    .five-s-standard-generator {
      display: grid;
      gap: 18px;
      margin-top: 22px;
    }

    .five-s-standard-head {
      background: linear-gradient(135deg, var(--navy) 0%, #173d77 58%, var(--primary) 100%);
      color: #fff;
      border-radius: 24px;
      padding: 22px;
      box-shadow: var(--shadow);
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 18px;
      align-items: center;
    }

    .five-s-standard-head h4 {
      margin: 0 0 7px;
      color: #fff;
      font-size: 23px;
      letter-spacing: -.025em;
    }

    .five-s-standard-head p {
      margin: 0;
      max-width: 920px;
      color: #dbeafe;
      line-height: 1.5;
      font-weight: 600;
    }

    .five-s-standard-score {
      min-width: 150px;
      border-radius: 20px;
      padding: 16px;
      text-align: center;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.18);
    }

    .five-s-standard-score b {
      display: block;
      color: #fff;
      font-size: 32px;
      line-height: 1;
    }

    .five-s-standard-score span {
      display: block;
      margin-top: 7px;
      color: #dbeafe;
      font-size: 11px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: .07em;
    }

    .five-s-standard-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
      gap: 16px;
      align-items: start;
    }

    .five-s-standard-panel {
      min-width: 0;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(15,23,42,.06);
    }

    .five-s-standard-panel h5 {
      margin: 0 0 6px;
      color: var(--navy);
      font-size: 18px;
    }

    .five-s-standard-panel > p {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 600;
    }

    .five-s-standard-fields {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    .five-s-standard-field {
      display: grid;
      gap: 7px;
      min-width: 0;
    }

    .five-s-standard-field.span-2 { grid-column: span 2; }
    .five-s-standard-field.span-4 { grid-column: 1 / -1; }

    .five-s-standard-field label {
      color: var(--navy);
      font-size: 11px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .055em;
    }

    .five-s-standard-field input,
    .five-s-standard-field select,
    .five-s-standard-field textarea {
      width: 100%;
      min-height: 43px;
      border: 1px solid var(--border);
      border-radius: 13px;
      background: #f8fbff;
      color: var(--text);
      padding: 10px 11px;
      font: inherit;
      font-weight: 650;
      outline: none;
    }

    .five-s-standard-field textarea {
      min-height: 82px;
      resize: vertical;
    }

    .five-s-standard-field input:focus,
    .five-s-standard-field select:focus,
    .five-s-standard-field textarea:focus {
      border-color: rgba(20,99,255,.52);
      background: #fff;
      box-shadow: 0 0 0 4px rgba(20,99,255,.09);
    }

    .five-s-standard-template-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 9px;
      margin-top: 12px;
    }

    .five-s-standard-template {
      border: 1px solid rgba(20,99,255,.18);
      border-radius: 14px;
      background: #eef4ff;
      color: var(--navy);
      padding: 11px 12px;
      text-align: left;
      cursor: pointer;
      font: inherit;
      font-size: 13px;
      font-weight: 850;
      transition: .15s ease;
    }

    .five-s-standard-template:hover {
      transform: translateY(-1px);
      border-color: rgba(20,99,255,.42);
      background: #e4edff;
    }

    .five-s-standard-template small {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
    }

    .five-s-standard-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 9px;
      margin-top: 14px;
    }

    .five-s-standard-table-wrap {
      max-width: 100%;
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 17px;
      background: #fff;
      margin-top: 13px;
      scrollbar-color: #94a3b8 #e2e8f0;
      scrollbar-width: auto;
    }

    .five-s-standard-table-wrap::-webkit-scrollbar { height: 14px; }
    .five-s-standard-table-wrap::-webkit-scrollbar-track { background: #e2e8f0; border-radius: 999px; }
    .five-s-standard-table-wrap::-webkit-scrollbar-thumb { background: #94a3b8; border: 3px solid #e2e8f0; border-radius: 999px; }

    .five-s-standard-table {
      width: 100%;
      min-width: 1480px;
      border-collapse: collapse;
      font-size: 12px;
    }

    .five-s-standard-table th,
    .five-s-standard-table td {
      padding: 9px;
      border-bottom: 1px solid var(--border);
      text-align: left;
      vertical-align: top;
    }

    .five-s-standard-table th {
      position: sticky;
      top: 0;
      z-index: 1;
      background: #eef4ff;
      color: var(--navy);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .05em;
      font-weight: 950;
      white-space: nowrap;
    }

    .five-s-standard-table input,
    .five-s-standard-table select,
    .five-s-standard-table textarea {
      width: 100%;
      min-width: 110px;
      border: 1px solid #dbe3ef;
      border-radius: 9px;
      background: #f8fbff;
      padding: 7px 8px;
      font: inherit;
      font-weight: 650;
    }

    .five-s-standard-table textarea {
      min-height: 53px;
      resize: vertical;
    }

    .five-s-standard-empty {
      border: 2px dashed #c8d5e6;
      border-radius: 16px;
      background: #f8fbff;
      color: var(--muted);
      padding: 20px;
      text-align: center;
      font-weight: 700;
    }

    .five-s-standard-photo-upload {
      display: grid;
      place-items: center;
      min-height: 112px;
      border: 2px dashed rgba(20,99,255,.3);
      border-radius: 17px;
      background: #eef4ff;
      padding: 15px;
      text-align: center;
      cursor: pointer;
      color: var(--navy);
      font-weight: 850;
    }

    .five-s-standard-photo-upload input { display: none; }
    .five-s-standard-photo-upload small { display: block; margin-top: 4px; color: var(--muted); font-weight: 650; }

    .five-s-standard-photo-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 11px;
      margin-top: 13px;
    }

    .five-s-standard-photo-card {
      overflow: hidden;
      border: 1px solid var(--border);
      border-radius: 15px;
      background: #fff;
    }

    .five-s-standard-photo-card img {
      width: 100%;
      aspect-ratio: 4 / 3;
      object-fit: cover;
      display: block;
      background: #e2e8f0;
    }

    .five-s-standard-photo-body {
      display: grid;
      gap: 7px;
      padding: 10px;
    }

    .five-s-standard-photo-body input,
    .five-s-standard-photo-body select {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #f8fbff;
      padding: 8px 9px;
      font: inherit;
      font-size: 12px;
      font-weight: 650;
    }

    .five-s-standard-photo-meta {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 7px;
    }

    .five-s-standard-status {
      display: grid;
      gap: 8px;
      margin-top: 13px;
    }

    .five-s-standard-status-row {
      display: grid;
      grid-template-columns: 26px 1fr;
      gap: 8px;
      align-items: start;
      color: var(--navy);
      font-size: 12px;
      font-weight: 750;
    }

    .five-s-standard-status-row b {
      width: 24px;
      height: 24px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      background: #ecfdf5;
      color: #047857;
      font-size: 12px;
    }

    .five-s-standard-status-row.warn b {
      background: #fff7ed;
      color: #c2410c;
    }

    .five-s-standard-preview-shell {
      overflow-x: auto;
      border-radius: 22px;
      border: 1px solid var(--border);
      background: #dfe7f2;
      padding: 18px;
      box-shadow: 0 14px 34px rgba(15,23,42,.07);
    }

    .five-s-standard-preview {
      width: 1120px;
      min-height: 760px;
      margin: 0 auto;
      background: #fff;
      color: #111827;
      border-radius: 8px;
      box-shadow: 0 14px 34px rgba(15,23,42,.16);
      padding: 24px;
    }

    .five-s-standard-doc-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 360px;
      border: 2px solid #0f172a;
    }

    .five-s-standard-doc-title {
      padding: 18px;
      background: #0f172a;
      color: #fff;
    }

    .five-s-standard-doc-title small {
      display: block;
      color: #bfdbfe;
      font-weight: 850;
      text-transform: uppercase;
      letter-spacing: .08em;
    }

    .five-s-standard-doc-title h2 {
      margin: 7px 0 4px;
      color: #fff;
      font-size: 26px;
      line-height: 1.08;
    }

    .five-s-standard-doc-title p {
      margin: 0;
      color: #dbeafe;
      font-weight: 650;
    }

    .five-s-standard-doc-meta {
      display: grid;
      grid-template-columns: 1fr 1fr;
      background: #fff;
    }

    .five-s-standard-doc-meta div {
      padding: 9px 10px;
      border-left: 1px solid #0f172a;
      border-bottom: 1px solid #0f172a;
      font-size: 11px;
    }

    .five-s-standard-doc-meta b {
      display: block;
      color: #475569;
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: .05em;
      margin-bottom: 2px;
    }

    .five-s-standard-doc-section {
      margin-top: 16px;
    }

    .five-s-standard-doc-section h3 {
      margin: 0 0 9px;
      padding: 8px 11px;
      background: #eaf1ff;
      border-left: 6px solid #1463ff;
      color: #0f172a;
      font-size: 15px;
      text-transform: uppercase;
      letter-spacing: .035em;
    }

    .five-s-standard-doc-overview {
      display: grid;
      grid-template-columns: 1.25fr .75fr;
      gap: 12px;
    }

    .five-s-standard-doc-box {
      border: 1px solid #94a3b8;
      border-radius: 8px;
      padding: 11px;
      font-size: 11px;
      line-height: 1.45;
    }

    .five-s-standard-doc-box b {
      display: block;
      color: #0f172a;
      margin-bottom: 4px;
    }

    .five-s-standard-doc-photos {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .five-s-standard-doc-photo {
      border: 1px solid #94a3b8;
      border-radius: 8px;
      overflow: hidden;
      background: #fff;
    }

    .five-s-standard-doc-photo img {
      width: 100%;
      height: 150px;
      display: block;
      object-fit: cover;
      background: #e2e8f0;
    }

    .five-s-standard-doc-photo div {
      padding: 7px 8px;
      font-size: 10px;
      line-height: 1.35;
    }

    .five-s-standard-doc-photo strong {
      display: inline-block;
      margin-right: 5px;
      color: #0f172a;
    }

    .five-s-standard-doc-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 9.5px;
    }

    .five-s-standard-doc-table th,
    .five-s-standard-doc-table td {
      border: 1px solid #64748b;
      padding: 5px 6px;
      vertical-align: top;
      text-align: left;
    }

    .five-s-standard-doc-table th {
      background: #dbeafe;
      color: #0f172a;
      font-size: 8.5px;
      text-transform: uppercase;
      letter-spacing: .03em;
    }

    .five-s-standard-doc-check {
      display: inline-grid;
      place-items: center;
      width: 16px;
      height: 16px;
      border: 1px solid #334155;
      margin: 0 2px;
      color: transparent;
    }

    .five-s-standard-doc-footer {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 10px;
      margin-top: 16px;
    }

    .five-s-standard-doc-sign {
      min-height: 58px;
      border: 1px solid #64748b;
      padding: 7px;
      font-size: 9px;
    }

    .five-s-standard-doc-sign b { display: block; margin-bottom: 25px; }

    @media (max-width: 1180px) {
      .five-s-standard-grid,
      .five-s-standard-head {
        grid-template-columns: 1fr;
      }

      .five-s-standard-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .five-s-standard-field.span-4 { grid-column: 1 / -1; }
      .five-s-standard-score { width: 180px; }
    }

    @media (max-width: 760px) {
      .five-s-standard-fields,
      .five-s-standard-template-grid,
      .five-s-standard-photo-grid {
        grid-template-columns: 1fr;
      }

      .five-s-standard-field.span-2,
      .five-s-standard-field.span-4 { grid-column: auto; }
    }


    /* SMED interactive video analyzer */
    .smed-tool {
      display: grid;
      gap: 18px;
    }

    .smed-top {
      display: grid;
      grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
      gap: 16px;
      align-items: stretch;
    }

    .smed-panel {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(15,23,42,.06);
      min-width: 0;
    }

    .smed-panel.dark {
      background: linear-gradient(135deg, var(--navy), var(--surface));
      color: #fff;
      border-color: rgba(255,255,255,.12);
    }

    .smed-panel h4 {
      margin: 0 0 8px;
      color: var(--navy);
      font-size: 19px;
    }

    .smed-panel.dark h4 { color: #fff; }

    .smed-panel.dark p,
    .smed-panel.dark label,
    .smed-panel.dark .smed-muted,
    .smed-panel.dark .smed-kpi span,
    .smed-panel.dark .smed-section-label { color: #dbeafe; }

    .smed-muted {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 600;
    }

    .smed-section-label {
      display: block;
      margin: 18px 0 8px;
      color: var(--navy);
      font-size: 11px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .09em;
    }

    .smed-video-shell {
      border-radius: 22px;
      overflow: hidden;
      border: 1px solid var(--border);
      background: #0f172a;
      box-shadow: 0 14px 34px rgba(15,23,42,.10);
    }

    .smed-video {
      width: 100%;
      max-height: 520px;
      display: block;
      background: #0f172a;
    }

    .smed-video-empty {
      min-height: 320px;
      display: grid;
      place-items: center;
      color: #dbeafe;
      text-align: center;
      padding: 30px;
      background:
        radial-gradient(circle at 16% 18%, rgba(20,99,255,.22), transparent 30%),
        linear-gradient(135deg, #0f172a, #111c34);
    }

    .smed-video-empty b {
      display: block;
      color: #fff;
      font-size: 22px;
      margin-bottom: 8px;
    }

    .smed-controls,
    .smed-actions,
    .smed-record-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      margin-top: 14px;
    }

    .smed-controls .lean-btn,
    .smed-actions .lean-btn,
    .smed-record-actions .lean-btn {
      padding: 10px 13px;
    }

    .smed-controls select,
    .smed-record-actions select {
      border: 1px solid var(--border);
      border-radius: 999px;
      background: #fff;
      color: var(--navy);
      padding: 10px 13px;
      font: inherit;
      font-weight: 800;
      min-height: 42px;
    }

    .smed-file {
      width: 100%;
      border: 1px dashed rgba(20,99,255,.35);
      border-radius: 16px;
      background: #eef4ff;
      color: var(--navy);
      padding: 13px;
      font-weight: 800;
    }

    .smed-field-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-top: 14px;
    }

    .smed-field {
      display: grid;
      gap: 7px;
    }

    .smed-field label {
      color: var(--navy);
      font-size: 12px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .smed-field input,
    .smed-field select,
    .smed-field textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: #f8fbff;
      color: var(--text);
      padding: 11px 12px;
      min-height: 44px;
      font: inherit;
      font-weight: 650;
      outline: none;
    }

    .smed-field textarea {
      min-height: 76px;
      resize: vertical;
    }

    .smed-field input:focus,
    .smed-field select:focus,
    .smed-field textarea:focus {
      border-color: rgba(20,99,255,.55);
      background: #fff;
      box-shadow: 0 0 0 4px rgba(20,99,255,.10);
    }

    .smed-inline-finish {
      display: grid;
      grid-template-columns: minmax(220px, 1fr) auto;
      gap: 10px;
      margin-top: 10px;
      align-items: center;
    }

    .smed-inline-finish select {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: #f8fbff;
      color: var(--navy);
      padding: 11px 12px;
      min-height: 44px;
      font: inherit;
      font-weight: 750;
    }

    .smed-kpis {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin: 14px 0;
    }

    .smed-kpi {
      border-radius: 16px;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.16);
      padding: 12px;
      min-width: 0;
    }

    .smed-kpi b {
      display: block;
      color: #fff;
      font-size: 23px;
      line-height: 1.05;
      letter-spacing: -.03em;
      overflow-wrap: anywhere;
    }

    .smed-kpi span {
      display: block;
      margin-top: 5px;
      color: #dbeafe;
      font-size: 11px;
      font-weight: 850;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .smed-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 12px 0 2px;
    }

    .smed-legend span {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      border-radius: 999px;
      padding: 7px 10px;
      background: rgba(255,255,255,.10);
      border: 1px solid rgba(255,255,255,.14);
      color: #fff;
      font-size: 11px;
      font-weight: 850;
    }

    .smed-panel:not(.dark) .smed-legend span {
      background: #f8fbff;
      border-color: var(--border);
      color: var(--navy);
    }

    .smed-legend i {
      width: 11px;
      height: 11px;
      border-radius: 4px;
      background: var(--primary);
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
    }

    .smed-legend i.external { background: var(--success); }
    .smed-legend i.waiting { background: var(--accent); }
    .smed-legend i.waste { background: var(--danger); }
    .smed-legend i.running {
      background: repeating-linear-gradient(135deg, #ffffff 0 4px, var(--primary) 4px 8px);
    }

    .smed-chart {
      display: grid;
      gap: 9px;
      margin-top: 10px;
    }

    .smed-chart-row {
      display: grid;
      grid-template-columns: 145px minmax(80px, 1fr) 78px;
      gap: 9px;
      align-items: center;
      font-weight: 850;
      color: var(--navy);
      font-size: 12px;
    }

    .smed-panel.dark .smed-chart-row,
    .smed-panel.dark .smed-chart-row span,
    .smed-panel.dark .smed-chart-row strong {
      color: #ffffff;
    }

    .smed-chart-bar {
      height: 16px;
      border-radius: 999px;
      background: rgba(255,255,255,.14);
      overflow: hidden;
      border: 1px solid rgba(255,255,255,.13);
    }

    .smed-panel:not(.dark) .smed-chart-bar {
      background: #eef4ff;
      border-color: var(--border);
    }

    .smed-chart-bar span {
      display: block;
      height: 100%;
      width: var(--bar, 0%);
      background: linear-gradient(90deg, var(--primary), #7aa7ff);
      border-radius: inherit;
    }

    .smed-chart-bar span.external { background: linear-gradient(90deg, #059669, #6ee7b7); }
    .smed-chart-bar span.waiting { background: linear-gradient(90deg, #d97706, #fbbf24); }
    .smed-chart-bar span.waste { background: linear-gradient(90deg, #dc2626, #fb7185); }

    .smed-running-list {
      display: grid;
      gap: 8px;
      margin-top: 10px;
    }

    .smed-running-empty {
      border-radius: 14px;
      border: 1px dashed rgba(255,255,255,.20);
      color: #cbd5e1;
      padding: 12px;
      font-size: 12px;
      font-weight: 700;
    }

    .smed-running-card {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      border-radius: 15px;
      border: 1px solid rgba(255,255,255,.17);
      background: rgba(255,255,255,.10);
      padding: 10px 11px;
    }

    .smed-running-card strong {
      display: block;
      color: #fff;
      font-size: 13px;
      line-height: 1.3;
    }

    .smed-running-card small {
      display: block;
      color: #bfdbfe;
      margin-top: 4px;
      font-weight: 750;
    }

    .smed-running-card .lean-btn {
      padding: 8px 10px;
      font-size: 12px;
    }

    .smed-gantt-head {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      align-items: flex-start;
      flex-wrap: wrap;
    }

    .smed-gantt-insights {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .smed-gantt-insights span {
      border-radius: 999px;
      background: #eef4ff;
      border: 1px solid rgba(20,99,255,.17);
      color: var(--navy);
      padding: 8px 11px;
      font-size: 12px;
      font-weight: 900;
    }

    .smed-gantt-shell {
      margin-top: 14px;
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: #fff;
    }

    .smed-gantt {
      min-width: 980px;
    }

    .smed-gantt-scale-row,
    .smed-gantt-row {
      display: grid;
      grid-template-columns: 190px minmax(760px, 1fr);
    }

    .smed-gantt-scale-owner {
      padding: 12px 14px;
      background: var(--navy);
      color: #fff;
      font-size: 11px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .06em;
      border-right: 1px solid rgba(255,255,255,.13);
    }

    .smed-gantt-scale {
      position: relative;
      min-height: 42px;
      background: linear-gradient(135deg, var(--navy), var(--surface));
      color: #fff;
    }

    .smed-gantt-scale span {
      position: absolute;
      top: 50%;
      transform: translate(-50%, -50%);
      font-size: 11px;
      font-weight: 850;
      color: #dbeafe;
      white-space: nowrap;
    }

    .smed-gantt-row {
      border-top: 1px solid var(--border);
      min-height: 66px;
    }

    .smed-gantt-owner {
      padding: 13px 14px;
      background: #f8fbff;
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      justify-content: center;
      min-width: 0;
    }

    .smed-gantt-owner strong {
      color: var(--navy);
      font-size: 13px;
      overflow-wrap: anywhere;
    }

    .smed-gantt-owner small {
      color: var(--muted);
      margin-top: 4px;
      font-size: 11px;
      font-weight: 750;
    }

    .smed-gantt-track {
      position: relative;
      min-height: var(--track-height, 66px);
      background:
        linear-gradient(90deg, rgba(15,23,42,.08) 1px, transparent 1px),
        linear-gradient(180deg, #ffffff, #fbfdff);
      background-size: 10% 100%, auto;
      overflow: hidden;
    }

    .smed-gantt-bar {
      position: absolute;
      left: var(--left);
      width: var(--width);
      top: var(--top);
      min-width: 9px;
      height: 27px;
      border-radius: 9px;
      border: 1px solid rgba(255,255,255,.32);
      background: linear-gradient(135deg, var(--primary-dark), var(--primary));
      color: #fff;
      padding: 4px 8px;
      box-shadow: 0 6px 14px rgba(20,99,255,.20);
      cursor: pointer;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font: inherit;
      text-align: left;
      transition: transform .14s ease, filter .14s ease;
    }

    .smed-gantt-bar:hover {
      transform: translateY(-1px);
      filter: brightness(1.06);
      z-index: 5;
    }

    .smed-gantt-bar.external {
      background: linear-gradient(135deg, #047857, var(--success));
      box-shadow: 0 6px 14px rgba(16,185,129,.20);
    }

    .smed-gantt-bar.waiting {
      background: linear-gradient(135deg, #b45309, var(--accent));
      box-shadow: 0 6px 14px rgba(255,138,0,.20);
    }

    .smed-gantt-bar.waste {
      background: linear-gradient(135deg, #b91c1c, var(--danger));
      box-shadow: 0 6px 14px rgba(239,68,68,.20);
    }

    .smed-gantt-bar.running {
      background-image:
        repeating-linear-gradient(135deg, rgba(255,255,255,.23) 0 6px, transparent 6px 12px),
        linear-gradient(135deg, var(--primary-dark), var(--primary));
      outline: 2px solid rgba(20,99,255,.18);
      animation: smedRunningPulse 1.45s ease-in-out infinite;
    }

    .smed-gantt-bar.external.running {
      background-image:
        repeating-linear-gradient(135deg, rgba(255,255,255,.23) 0 6px, transparent 6px 12px),
        linear-gradient(135deg, #047857, var(--success));
    }

    .smed-gantt-bar.waiting.running {
      background-image:
        repeating-linear-gradient(135deg, rgba(255,255,255,.23) 0 6px, transparent 6px 12px),
        linear-gradient(135deg, #b45309, var(--accent));
    }

    .smed-gantt-bar.waste.running {
      background-image:
        repeating-linear-gradient(135deg, rgba(255,255,255,.23) 0 6px, transparent 6px 12px),
        linear-gradient(135deg, #b91c1c, var(--danger));
    }

    .smed-gantt-bar b {
      font-size: 11px;
      font-weight: 950;
    }

    @keyframes smedRunningPulse {
      0%, 100% { filter: brightness(1); }
      50% { filter: brightness(1.16); }
    }

    .smed-gantt-empty {
      min-height: 170px;
      display: grid;
      place-items: center;
      text-align: center;
      color: var(--muted);
      padding: 24px;
      font-weight: 750;
    }

    .smed-table-wrap {
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: #fff;
      margin-top: 14px;
    }

    .smed-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 1320px;
      font-size: 13px;
    }

    .smed-table th,
    .smed-table td {
      border-bottom: 1px solid var(--border);
      padding: 10px;
      text-align: left;
      vertical-align: top;
    }

    .smed-table th {
      background: #eef4ff;
      color: var(--navy);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: .05em;
      font-weight: 950;
      white-space: nowrap;
      position: sticky;
      top: 0;
      z-index: 1;
    }

    .smed-table td strong {
      color: var(--navy);
      font-weight: 950;
    }

    .smed-table input,
    .smed-table select,
    .smed-table textarea {
      width: 100%;
      border: 1px solid #dbe3ef;
      border-radius: 10px;
      background: #f8fbff;
      padding: 8px 9px;
      font: inherit;
      font-weight: 650;
      min-width: 96px;
    }

    .smed-table textarea {
      min-height: 52px;
      resize: vertical;
      min-width: 180px;
    }

    .smed-status {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border-radius: 999px;
      padding: 6px 9px;
      background: #ecfdf5;
      color: #047857;
      font-size: 11px;
      font-weight: 900;
      white-space: nowrap;
    }

    .smed-status.running {
      background: #eef4ff;
      color: var(--primary-dark);
    }

    .smed-status i {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: currentColor;
    }

    .smed-row-actions {
      display: grid;
      gap: 7px;
      min-width: 110px;
    }

    .smed-row-actions .lean-btn {
      justify-content: center;
      padding: 8px 10px;
      font-size: 11px;
    }

    .smed-recommendations {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      margin-top: 14px;
    }

    .smed-rec {
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 14px;
      background: #f8fbff;
    }

    .smed-rec b {
      display: block;
      color: var(--navy);
      margin-bottom: 6px;
    }

    .smed-rec p {
      margin: 0;
      color: var(--muted);
      line-height: 1.45;
      font-size: 13px;
      font-weight: 650;
    }

    @media (max-width: 1180px) {
      .smed-top,
      .smed-field-grid,
      .smed-recommendations {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 760px) {
      .smed-inline-finish {
        grid-template-columns: 1fr;
      }

      .smed-kpis {
        grid-template-columns: 1fr;
      }

      .smed-chart-row {
        grid-template-columns: 115px minmax(70px, 1fr) 68px;
      }
    }

    @media print {
      .smed-controls,
      .smed-actions,
      .smed-record-actions,
      .smed-inline-finish,
      .smed-file,
      .smed-video-shell,
      .smed-row-actions {
        display: none !important;
      }

      .smed-table-wrap,
      .smed-gantt-shell {
        overflow: visible;
      }

      .smed-table,
      .smed-gantt {
        min-width: 0;
        font-size: 9px;
      }

      .smed-gantt-scale-row,
      .smed-gantt-row {
        grid-template-columns: 120px 1fr;
      }

      .smed-gantt-bar {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
      }
    }




    /* Flowchart drag-and-drop editor */
    .flowchart-tool {
      display: grid;
      gap: 18px;
    }

    .flowchart-panel {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(15,23,42,.06);
      min-width: 0;
    }

    .flowchart-panel h4 {
      margin: 0 0 8px;
      color: var(--navy);
      font-size: 19px;
    }

    .flowchart-muted {
      margin: 0;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 600;
    }

    .flowchart-header-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(300px, .55fr);
      gap: 16px;
      align-items: stretch;
    }

    .flowchart-meta-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 12px;
      margin-top: 14px;
    }

    .flowchart-field {
      display: grid;
      gap: 7px;
    }

    .flowchart-field label {
      color: var(--navy);
      font-size: 12px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .flowchart-field input,
    .flowchart-field select,
    .flowchart-field textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: #f8fbff;
      color: var(--text);
      padding: 11px 12px;
      min-height: 44px;
      font: inherit;
      font-weight: 650;
      outline: none;
    }

    .flowchart-field textarea {
      min-height: 78px;
      resize: vertical;
    }

    .flowchart-field input:focus,
    .flowchart-field select:focus,
    .flowchart-field textarea:focus {
      background: #fff;
      border-color: rgba(20,99,255,.55);
      box-shadow: 0 0 0 4px rgba(20,99,255,.10);
    }

    .flowchart-summary {
      background: linear-gradient(135deg, var(--navy), var(--surface));
      color: #fff;
      border-color: rgba(255,255,255,.12);
    }

    .flowchart-summary h4 { color: #fff; }
    .flowchart-summary .flowchart-muted { color: #dbeafe; }

    .flowchart-kpis {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin-top: 14px;
    }

    .flowchart-kpi {
      border-radius: 16px;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.16);
      padding: 12px;
    }

    .flowchart-kpi b {
      display: block;
      color: #fff;
      font-size: 24px;
      line-height: 1.05;
      letter-spacing: -.03em;
    }

    .flowchart-kpi span {
      display: block;
      margin-top: 5px;
      color: #dbeafe;
      font-size: 11px;
      font-weight: 850;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .flowchart-status {
      margin-top: 12px;
      padding: 12px 13px;
      border-radius: 15px;
      background: rgba(20,99,255,.16);
      border: 1px solid rgba(122,167,255,.30);
      color: #eff6ff;
      font-weight: 750;
      line-height: 1.45;
    }

    .flowchart-workspace {
      display: grid;
      grid-template-columns: 220px minmax(0, 1fr) 270px;
      gap: 14px;
      align-items: start;
    }

    .flowchart-palette,
    .flowchart-inspector {
      position: sticky;
      top: 10px;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: #f8fbff;
      padding: 14px;
    }

    .flowchart-palette h5,
    .flowchart-inspector h5 {
      margin: 0 0 10px;
      color: var(--navy);
      font-size: 14px;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .flowchart-palette-grid {
      display: grid;
      gap: 8px;
    }

    .flowchart-shape-btn {
      width: 100%;
      border: 1px solid #d6e0ee;
      border-radius: 13px;
      background: #fff;
      color: var(--navy);
      padding: 10px 11px;
      cursor: pointer;
      font-weight: 850;
      text-align: left;
      display: flex;
      align-items: center;
      gap: 9px;
      transition: .15s ease;
    }

    .flowchart-shape-btn:hover {
      transform: translateY(-1px);
      border-color: rgba(20,99,255,.42);
      box-shadow: 0 8px 18px rgba(20,99,255,.10);
    }

    .flowchart-shape-icon {
      width: 30px;
      height: 22px;
      display: inline-grid;
      place-items: center;
      flex: 0 0 auto;
      font-size: 10px;
      color: var(--primary-dark);
      border: 2px solid var(--primary);
      background: #eef4ff;
    }

    .flowchart-shape-icon.terminator { border-radius: 999px; }
    .flowchart-shape-icon.decision { transform: rotate(45deg) scale(.72); }
    .flowchart-shape-icon.io { transform: skewX(-18deg); }
    .flowchart-shape-icon.document { border-radius: 2px 2px 8px 8px; }
    .flowchart-shape-icon.delay { border-radius: 3px 999px 999px 3px; }

    .flowchart-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
    }

    .flowchart-toolbar-group {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .flowchart-mini-btn {
      border: 1px solid var(--border);
      border-radius: 11px;
      background: #fff;
      color: var(--navy);
      padding: 8px 10px;
      cursor: pointer;
      font-weight: 850;
    }

    .flowchart-mini-btn:hover,
    .flowchart-mini-btn.active {
      border-color: rgba(20,99,255,.45);
      color: var(--primary-dark);
      background: #eef4ff;
    }

    .flowchart-mini-btn.danger {
      color: #b91c1c;
      background: #fff1f2;
      border-color: rgba(239,68,68,.22);
    }

    .flowchart-canvas-panel {
      min-width: 0;
    }

    .flowchart-canvas-shell {
      width: 100%;
      height: clamp(720px, 76vh, 1080px);
      min-height: 650px;
      max-height: none;
      overflow: auto;
      resize: vertical;
      border: 1px solid #cfdbea;
      border-radius: 18px;
      background: #edf3fa;
      box-shadow: inset 0 2px 10px rgba(15,23,42,.05);
      overscroll-behavior: contain;
      scrollbar-gutter: stable both-edges;
    }

    .flowchart-canvas {
      display: block;
      width: 2400px;
      height: 1600px;
      background: #fff;
      touch-action: none;
      user-select: none;
    }

    .flowchart-canvas-size {
      min-width: 122px;
      text-align: center;
      color: var(--muted);
      font-size: 11px;
      font-weight: 850;
      white-space: nowrap;
    }


    body.flowchart-maximized {
      overflow: hidden !important;
    }

    .flowchart-canvas-panel.is-maximized {
      position: fixed;
      inset: 10px;
      z-index: 120;
      margin: 0 !important;
      padding: 14px !important;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: #ffffff;
      box-shadow: 0 28px 80px rgba(15,23,42,.30);
    }

    .flowchart-canvas-panel.is-maximized .flowchart-toolbar {
      flex: 0 0 auto;
    }

    .flowchart-canvas-panel.is-maximized .flowchart-workspace {
      flex: 1 1 auto;
      min-height: 0;
      height: calc(100vh - 104px);
    }

    .flowchart-canvas-panel.is-maximized .flowchart-canvas-shell {
      height: 100%;
      min-height: 0;
      resize: none;
    }

    .flowchart-canvas-panel.is-maximized .flowchart-palette,
    .flowchart-canvas-panel.is-maximized .flowchart-inspector {
      position: relative;
      top: auto;
      max-height: 100%;
      overflow: auto;
    }

    .flowchart-canvas-panel.panels-hidden .flowchart-workspace {
      grid-template-columns: minmax(0, 1fr);
    }

    .flowchart-canvas-panel.panels-hidden .flowchart-palette,
    .flowchart-canvas-panel.panels-hidden .flowchart-inspector {
      display: none;
    }

    .flowchart-node {
      cursor: grab;
    }

    .flowchart-node:active { cursor: grabbing; }

    .flowchart-node .flowchart-node-shape {
      stroke: #24405f;
      stroke-width: 2.4;
      fill: #ffffff;
      filter: drop-shadow(0 6px 7px rgba(15,23,42,.12));
      transition: .12s ease;
    }

    .flowchart-node.process .flowchart-node-shape { fill: #eef4ff; stroke: #1463ff; }
    .flowchart-node.terminator .flowchart-node-shape { fill: #ecfdf5; stroke: #059669; }
    .flowchart-node.decision .flowchart-node-shape { fill: #fff7ed; stroke: #ea580c; }
    .flowchart-node.io .flowchart-node-shape { fill: #f5f3ff; stroke: #7c3aed; }
    .flowchart-node.document .flowchart-node-shape { fill: #f0f9ff; stroke: #0284c7; }
    .flowchart-node.delay .flowchart-node-shape { fill: #fff1f2; stroke: #e11d48; }

    .flowchart-node.selected .flowchart-node-shape,
    .flowchart-node.connect-source .flowchart-node-shape {
      stroke: #0f172a;
      stroke-width: 4;
      filter: drop-shadow(0 0 8px rgba(20,99,255,.45));
    }

    .flowchart-node.connect-source .flowchart-node-shape {
      stroke: #10b981;
    }

    .flowchart-node-title {
      fill: #0f172a;
      font-size: 16px;
      font-weight: 850;
      text-anchor: middle;
      pointer-events: none;
    }

    .flowchart-node-meta {
      fill: #64748b;
      font-size: 11px;
      font-weight: 700;
      text-anchor: middle;
      pointer-events: none;
    }

    .flowchart-edge-visible {
      fill: none;
      stroke: #334155;
      stroke-width: 2.6;
      marker-end: url(#flowchartArrow);
    }

    .flowchart-edge-hit {
      fill: none;
      stroke: transparent;
      stroke-width: 18;
      cursor: pointer;
    }

    .flowchart-edge.selected .flowchart-edge-visible {
      stroke: #1463ff;
      stroke-width: 4;
    }

    .flowchart-edge-label-bg {
      fill: #fff;
      stroke: #cbd5e1;
      stroke-width: 1;
      rx: 8;
    }

    .flowchart-edge-label {
      fill: #0f172a;
      font-size: 12px;
      font-weight: 850;
      text-anchor: middle;
      dominant-baseline: middle;
      pointer-events: none;
    }

    .flowchart-empty-hint {
      color: var(--muted);
      font-size: 12px;
      font-weight: 650;
      line-height: 1.45;
      margin-top: 10px;
    }

    .flowchart-inspector-empty {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.5;
      font-weight: 650;
      padding: 10px 0;
    }

    .flowchart-help-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      margin-top: 14px;
    }

    .flowchart-help-item {
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 14px;
      background: #f8fbff;
    }

    .flowchart-help-item b {
      display: block;
      color: var(--navy);
      margin-bottom: 6px;
    }

    .flowchart-help-item p {
      margin: 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
      font-weight: 650;
    }

    @media (max-width: 1250px) {
      .flowchart-workspace {
        grid-template-columns: 190px minmax(0, 1fr);
      }

      .flowchart-inspector {
        grid-column: 1 / -1;
        position: static;
      }
    }

    @media (max-width: 900px) {
      .flowchart-header-grid,
      .flowchart-workspace,
      .flowchart-meta-grid,
      .flowchart-help-grid {
        grid-template-columns: 1fr;
      }

      .flowchart-palette,
      .flowchart-inspector { position: static; }
      .flowchart-palette-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .flowchart-canvas-shell { min-height: 520px; }
    }

    @media print {
      body.flowchart-printing {
        background: #fff !important;
      }

      body.flowchart-printing .sidebar,
      body.flowchart-printing .topbar,
      body.flowchart-printing .footer-note,
      body.flowchart-printing .method-hero,
      body.flowchart-printing .tool-head,
      body.flowchart-printing .flowchart-header-grid,
      body.flowchart-printing .flowchart-palette,
      body.flowchart-printing .flowchart-inspector,
      body.flowchart-printing .flowchart-toolbar,
      body.flowchart-printing .flowchart-help-panel {
        display: none !important;
      }

      body.flowchart-printing .flowchart-tool {
        display: flex !important;
        flex-direction: column !important;
      }

      body.flowchart-printing .flowchart-print-title {
        order: -1;
      }

      body.flowchart-printing .main,
      body.flowchart-printing .tool-body,
      body.flowchart-printing .flowchart-panel,
      body.flowchart-printing .flowchart-canvas-panel,
      body.flowchart-printing .flowchart-workspace {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
      }

      body.flowchart-printing #flowchart {
        display: block !important;
      }

      body.flowchart-printing .flowchart-print-title {
        display: block !important;
      }

      body.flowchart-printing .flowchart-canvas-shell {
        overflow: visible !important;
        max-height: none !important;
        min-height: 0 !important;
        border: 0 !important;
        background: #fff !important;
      }

      body.flowchart-printing .flowchart-canvas {
        width: 100% !important;
        height: auto !important;
        max-height: 175mm !important;
      }
    }


    /* Spaghetti diagram editor */
    .spaghetti-tool {
      display: grid;
      gap: 18px;
    }

    .spaghetti-header-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr);
      gap: 16px;
      align-items: stretch;
    }

    .spaghetti-panel {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(15,23,42,.06);
    }

    .spaghetti-panel.dark {
      background: linear-gradient(135deg, var(--navy), var(--surface));
      color: #fff;
      border-color: rgba(255,255,255,.12);
    }

    .spaghetti-panel h4 {
      margin: 0 0 8px;
      color: var(--navy);
      font-size: 19px;
    }

    .spaghetti-panel.dark h4 { color: #fff; }

    .spaghetti-muted {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 600;
    }

    .spaghetti-panel.dark .spaghetti-muted,
    .spaghetti-panel.dark label { color: #dbeafe; }

    .spaghetti-meta-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .spaghetti-field {
      display: grid;
      gap: 7px;
    }

    .spaghetti-field label {
      color: var(--navy);
      font-size: 12px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .spaghetti-field input,
    .spaghetti-field select,
    .spaghetti-field textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 13px;
      background: #f8fbff;
      color: var(--text);
      padding: 10px 11px;
      min-height: 42px;
      font: inherit;
      font-weight: 650;
      outline: none;
    }

    .spaghetti-field textarea {
      min-height: 72px;
      resize: vertical;
    }

    .spaghetti-file {
      width: 100%;
      border: 1px dashed rgba(20,99,255,.35);
      border-radius: 15px;
      background: #eef4ff;
      color: var(--navy);
      padding: 12px;
      font-weight: 800;
    }

    .spaghetti-kpis {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin: 14px 0;
    }

    .spaghetti-kpi {
      border-radius: 16px;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.16);
      padding: 12px;
    }

    .spaghetti-kpi b {
      display: block;
      color: #fff;
      font-size: 24px;
      line-height: 1.05;
      letter-spacing: -.03em;
    }

    .spaghetti-kpi span {
      display: block;
      margin-top: 5px;
      color: #dbeafe;
      font-size: 11px;
      font-weight: 850;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .spaghetti-status {
      padding: 12px 13px;
      border-radius: 15px;
      background: rgba(20,99,255,.15);
      border: 1px solid rgba(122,167,255,.30);
      color: #eff6ff;
      font-weight: 750;
      line-height: 1.45;
    }

    .spaghetti-editor-panel {
      padding: 0;
      overflow: hidden;
    }

    .spaghetti-toolbar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 12px 14px;
      background: #f8fbff;
      border-bottom: 1px solid var(--border);
    }

    .spaghetti-toolbar-group {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
    }

    .spaghetti-mini-btn {
      border: 1px solid var(--border);
      background: #fff;
      color: var(--navy);
      border-radius: 11px;
      padding: 8px 10px;
      cursor: pointer;
      font: inherit;
      font-size: 12px;
      font-weight: 900;
      transition: .15s ease;
    }

    .spaghetti-mini-btn:hover {
      border-color: rgba(20,99,255,.45);
      transform: translateY(-1px);
    }

    .spaghetti-mini-btn.active {
      background: var(--primary);
      color: #fff;
      border-color: var(--primary);
      box-shadow: 0 8px 18px rgba(20,99,255,.20);
    }

    .spaghetti-mini-btn.danger {
      color: #b91c1c;
      background: #fff1f2;
      border-color: rgba(239,68,68,.22);
    }

    .spaghetti-editor-panel.is-maximized {
      position: fixed;
      inset: 12px;
      z-index: 100;
      background: #fff;
      border-radius: 20px;
      box-shadow: 0 28px 80px rgba(15,23,42,.35);
      display: flex;
      flex-direction: column;
    }

    .spaghetti-editor-panel.is-maximized .spaghetti-workspace {
      flex: 1;
      min-height: 0;
    }

    .spaghetti-editor-panel.is-maximized .spaghetti-canvas-shell {
      height: 100%;
      max-height: none;
    }

    .spaghetti-workspace {
      display: grid;
      grid-template-columns: 270px minmax(0, 1fr) 310px;
      min-height: 720px;
      background: #e9eff7;
    }

    .spaghetti-routes,
    .spaghetti-inspector {
      background: #fff;
      padding: 14px;
      overflow-y: auto;
    }

    .spaghetti-routes { border-right: 1px solid var(--border); }
    .spaghetti-inspector { border-left: 1px solid var(--border); }

    .spaghetti-routes h5,
    .spaghetti-inspector h5 {
      margin: 0 0 10px;
      color: var(--navy);
      font-size: 14px;
    }

    .spaghetti-route-list {
      display: grid;
      gap: 9px;
      margin-top: 10px;
    }

    .spaghetti-route-card {
      width: 100%;
      border: 1px solid var(--border);
      background: #f8fbff;
      border-radius: 14px;
      padding: 10px;
      text-align: left;
      cursor: pointer;
      transition: .15s ease;
    }

    .spaghetti-route-card:hover {
      transform: translateY(-1px);
      border-color: rgba(20,99,255,.35);
    }

    .spaghetti-route-card.active {
      background: #eef4ff;
      border-color: rgba(20,99,255,.55);
      box-shadow: 0 8px 18px rgba(20,99,255,.10);
    }

    .spaghetti-route-head {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 5px;
    }

    .spaghetti-route-color {
      width: 12px;
      height: 12px;
      border-radius: 4px;
      flex: 0 0 auto;
      background: var(--route-color, var(--primary));
      box-shadow: 0 0 0 3px rgba(15,23,42,.05);
    }

    .spaghetti-route-card strong {
      min-width: 0;
      flex: 1;
      color: var(--navy);
      font-size: 13px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .spaghetti-route-card small {
      display: block;
      color: var(--muted);
      font-weight: 700;
      line-height: 1.4;
    }

    .spaghetti-canvas-shell {
      position: relative;
      overflow: auto;
      min-width: 0;
      height: 720px;
      max-height: 78vh;
      background:
        linear-gradient(45deg, #dde6f0 25%, transparent 25%),
        linear-gradient(-45deg, #dde6f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #dde6f0 75%),
        linear-gradient(-45deg, transparent 75%, #dde6f0 75%),
        #edf2f7;
      background-size: 24px 24px;
      background-position: 0 0, 0 12px, 12px -12px, -12px 0;
      cursor: crosshair;
    }

    .spaghetti-canvas-shell.pan-mode { cursor: grab; }
    .spaghetti-canvas-shell.pan-mode.dragging { cursor: grabbing; }

    .spaghetti-canvas-stage {
      position: relative;
      display: inline-block;
      margin: 28px;
      box-shadow: 0 16px 38px rgba(15,23,42,.20);
      background: #fff;
      line-height: 0;
    }

    #spaghettiCanvas {
      display: block;
      background: #fff;
      touch-action: none;
    }

    .spaghetti-canvas-hint {
      position: sticky;
      left: 14px;
      top: 14px;
      z-index: 3;
      display: inline-flex;
      margin: 14px;
      max-width: 520px;
      padding: 9px 11px;
      border-radius: 12px;
      background: rgba(15,23,42,.88);
      color: #fff;
      font-size: 12px;
      font-weight: 750;
      line-height: 1.4;
      box-shadow: 0 10px 24px rgba(15,23,42,.18);
      pointer-events: none;
    }

    .spaghetti-calibration-box {
      border: 1px solid rgba(20,99,255,.20);
      border-radius: 15px;
      background: #eef4ff;
      padding: 12px;
      margin-bottom: 12px;
    }

    .spaghetti-calibration-box b {
      display: block;
      color: var(--navy);
      margin-bottom: 6px;
    }

    .spaghetti-scale-readout {
      margin-top: 9px;
      padding: 9px 10px;
      border-radius: 11px;
      background: #fff;
      color: var(--navy);
      font-size: 12px;
      font-weight: 850;
      line-height: 1.45;
      border: 1px solid var(--border);
    }

    .spaghetti-route-editor {
      display: grid;
      gap: 10px;
    }

    .spaghetti-inspector-empty {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.5;
      font-weight: 650;
      padding: 12px;
      border: 1px dashed var(--border);
      border-radius: 14px;
      background: #f8fbff;
    }

    .spaghetti-check {
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--navy);
      font-size: 13px;
      font-weight: 800;
    }

    .spaghetti-check input { width: auto; min-height: 0; }

    .spaghetti-route-summary {
      display: grid;
      gap: 8px;
      margin-top: 12px;
    }

    .spaghetti-summary-row {
      display: grid;
      grid-template-columns: 14px minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      padding: 9px 10px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #f8fbff;
      color: var(--navy);
      font-size: 12px;
      font-weight: 800;
    }

    .spaghetti-print-title,
    .spaghetti-print-summary { display: none; }

    .spaghetti-print-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 12px;
      font-size: 11px;
    }

    .spaghetti-print-table th,
    .spaghetti-print-table td {
      border: 1px solid #cbd5e1;
      padding: 6px 7px;
      text-align: left;
    }

    @media (max-width: 1260px) {
      .spaghetti-workspace {
        grid-template-columns: 230px minmax(0, 1fr);
      }
      .spaghetti-inspector {
        grid-column: 1 / -1;
        border-left: 0;
        border-top: 1px solid var(--border);
      }
    }

    @media (max-width: 900px) {
      .spaghetti-header-grid,
      .spaghetti-meta-grid,
      .spaghetti-workspace {
        grid-template-columns: 1fr;
      }
      .spaghetti-routes,
      .spaghetti-inspector {
        border: 0;
        border-bottom: 1px solid var(--border);
      }
      .spaghetti-canvas-shell { height: 600px; }
    }

    @media print {
      body.spaghetti-printing {
        background: #fff !important;
      }

      body.spaghetti-printing .sidebar,
      body.spaghetti-printing .topbar,
      body.spaghetti-printing .footer-note,
      body.spaghetti-printing .method-hero,
      body.spaghetti-printing .tool-head,
      body.spaghetti-printing .spaghetti-header-grid,
      body.spaghetti-printing .spaghetti-toolbar,
      body.spaghetti-printing .spaghetti-routes,
      body.spaghetti-printing .spaghetti-inspector,
      body.spaghetti-printing .spaghetti-canvas-hint {
        display: none !important;
      }

      body.spaghetti-printing #spaghetti-diagram {
        display: block !important;
      }

      body.spaghetti-printing .spaghetti-print-title,
      body.spaghetti-printing .spaghetti-print-summary {
        display: block !important;
      }

      body.spaghetti-printing .spaghetti-tool {
        display: flex !important;
        flex-direction: column !important;
      }

      body.spaghetti-printing .spaghetti-print-title { order: -2; }
      body.spaghetti-printing .spaghetti-editor-panel { order: 0; }
      body.spaghetti-printing .spaghetti-print-summary { order: 1; }
      body.spaghetti-printing .spaghetti-tool > .spaghetti-panel:not(.spaghetti-editor-panel) { display: none !important; }

      body.spaghetti-printing .main,
      body.spaghetti-printing .tool-body,
      body.spaghetti-printing .spaghetti-tool,
      body.spaghetti-printing .spaghetti-panel,
      body.spaghetti-printing .spaghetti-editor-panel,
      body.spaghetti-printing .spaghetti-workspace {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
      }

      body.spaghetti-printing .spaghetti-canvas-shell {
        display: block !important;
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
        background: #fff !important;
      }

      body.spaghetti-printing .spaghetti-canvas-stage {
        margin: 0 !important;
        box-shadow: none !important;
        width: 100% !important;
      }

      body.spaghetti-printing #spaghettiCanvas {
        width: 100% !important;
        height: auto !important;
        max-height: 175mm !important;
        object-fit: contain;
      }
    }


    /* PDCA interactive cycle */
    .pdca-tool {
      display: grid;
      gap: 18px;
    }

    .pdca-top {
      display: grid;
      grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr);
      gap: 16px;
      align-items: stretch;
    }

    .pdca-panel {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(15,23,42,.06);
    }

    .pdca-panel.dark {
      background: linear-gradient(135deg, var(--navy), var(--surface));
      color: #fff;
      border-color: rgba(255,255,255,.12);
    }

    .pdca-panel h4 {
      margin: 0 0 8px;
      color: var(--navy);
      font-size: 19px;
    }

    .pdca-panel.dark h4 { color: #fff; }
    .pdca-panel.dark .pdca-muted,
    .pdca-panel.dark label { color: #dbeafe; }

    .pdca-muted {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 600;
    }

    .pdca-meta-grid,
    .pdca-kpi-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }

    .pdca-meta-grid .wide,
    .pdca-kpi-grid .wide { grid-column: span 2; }

    .pdca-field {
      display: grid;
      gap: 7px;
    }

    .pdca-field label {
      color: var(--navy);
      font-size: 12px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .pdca-field input,
    .pdca-field select,
    .pdca-field textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 13px;
      background: #f8fbff;
      color: var(--text);
      padding: 10px 11px;
      min-height: 43px;
      font: inherit;
      font-weight: 650;
      outline: none;
      transition: .15s ease;
    }

    .pdca-field textarea {
      min-height: 104px;
      resize: vertical;
      line-height: 1.45;
    }

    .pdca-field input:focus,
    .pdca-field select:focus,
    .pdca-field textarea:focus {
      border-color: rgba(20,99,255,.55);
      background: #fff;
      box-shadow: 0 0 0 4px rgba(20,99,255,.10);
    }

    .pdca-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 14px;
    }

    .pdca-summary-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin: 14px 0;
    }

    .pdca-kpi-card {
      border-radius: 16px;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.16);
      padding: 12px;
    }

    .pdca-kpi-card b {
      display: block;
      color: #fff;
      font-size: 23px;
      line-height: 1.08;
      letter-spacing: -.03em;
    }

    .pdca-kpi-card span {
      display: block;
      margin-top: 5px;
      color: #dbeafe;
      font-size: 11px;
      font-weight: 850;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .pdca-progress {
      height: 11px;
      border-radius: 999px;
      background: rgba(255,255,255,.16);
      border: 1px solid rgba(255,255,255,.12);
      overflow: hidden;
      margin: 10px 0 12px;
    }

    .pdca-progress span {
      display: block;
      height: 100%;
      width: var(--pdca-progress, 0%);
      background: linear-gradient(90deg, var(--success), #8bffcb);
      border-radius: inherit;
      transition: width .2s ease;
    }

    .pdca-validation {
      display: grid;
      gap: 7px;
    }

    .pdca-validation-row {
      display: grid;
      grid-template-columns: 22px 1fr;
      gap: 8px;
      align-items: start;
      color: #dbeafe;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.4;
    }

    .pdca-validation-row i {
      width: 20px;
      height: 20px;
      border-radius: 7px;
      display: grid;
      place-items: center;
      background: rgba(255,138,0,.18);
      color: #fed7aa;
      font-style: normal;
      font-size: 11px;
      font-weight: 950;
    }

    .pdca-validation-row.ok i {
      background: rgba(16,185,129,.18);
      color: #a7f3d0;
    }

    .pdca-cycle-shell {
      display: grid;
      grid-template-columns: 320px minmax(0, 1fr);
      gap: 18px;
      align-items: start;
    }

    .pdca-wheel-card {
      position: sticky;
      top: 12px;
      display: grid;
      gap: 12px;
    }

    .pdca-wheel {
      position: relative;
      width: min(100%, 300px);
      aspect-ratio: 1;
      margin: 0 auto;
      border-radius: 50%;
      background: conic-gradient(
        #1463ff 0deg 90deg,
        #10b981 90deg 180deg,
        #ff8a00 180deg 270deg,
        #8b5cf6 270deg 360deg
      );
      box-shadow: 0 22px 48px rgba(15,23,42,.18);
    }

    .pdca-wheel::before {
      content: '';
      position: absolute;
      inset: 26%;
      border-radius: 50%;
      background: #fff;
      box-shadow: inset 0 0 0 1px var(--border);
      z-index: 1;
    }

    .pdca-wheel-center {
      position: absolute;
      inset: 33%;
      z-index: 3;
      display: grid;
      place-items: center;
      text-align: center;
      color: var(--navy);
      font-weight: 950;
      line-height: 1.1;
      pointer-events: none;
    }

    .pdca-wheel-center span {
      display: block;
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .08em;
      margin-top: 4px;
    }

    .pdca-wheel-btn {
      position: absolute;
      z-index: 2;
      border: 0;
      background: rgba(255,255,255,.94);
      color: var(--navy);
      min-width: 92px;
      border-radius: 14px;
      padding: 9px 10px;
      cursor: pointer;
      box-shadow: 0 10px 22px rgba(15,23,42,.15);
      font: inherit;
      text-align: left;
      transition: .15s ease;
    }

    .pdca-wheel-btn:hover { transform: translateY(-2px); }
    .pdca-wheel-btn.active {
      outline: 3px solid rgba(255,255,255,.92);
      box-shadow: 0 12px 28px rgba(15,23,42,.24);
      transform: scale(1.04);
    }

    .pdca-wheel-btn.done::after {
      content: '✓';
      position: absolute;
      right: -5px;
      top: -5px;
      width: 24px;
      height: 24px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      background: var(--success);
      color: #fff;
      font-weight: 950;
      border: 3px solid #fff;
    }

    .pdca-wheel-btn b { display: block; font-size: 13px; }
    .pdca-wheel-btn small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; font-weight: 700; }
    .pdca-wheel-btn.plan { left: 50%; top: 5%; transform: translateX(-50%); }
    .pdca-wheel-btn.do { right: 2%; top: 50%; transform: translateY(-50%); }
    .pdca-wheel-btn.check { left: 50%; bottom: 5%; transform: translateX(-50%); }
    .pdca-wheel-btn.act { left: 2%; top: 50%; transform: translateY(-50%); }
    .pdca-wheel-btn.plan:hover, .pdca-wheel-btn.plan.active { transform: translateX(-50%) translateY(-2px) scale(1.03); }
    .pdca-wheel-btn.do:hover, .pdca-wheel-btn.do.active { transform: translateY(-50%) translateY(-2px) scale(1.03); }
    .pdca-wheel-btn.check:hover, .pdca-wheel-btn.check.active { transform: translateX(-50%) translateY(-2px) scale(1.03); }
    .pdca-wheel-btn.act:hover, .pdca-wheel-btn.act.active { transform: translateY(-50%) translateY(-2px) scale(1.03); }

    .pdca-phase-legend {
      display: grid;
      gap: 8px;
    }

    .pdca-phase-legend-row {
      display: grid;
      grid-template-columns: 34px 1fr;
      gap: 9px;
      align-items: start;
      padding: 9px 10px;
      border: 1px solid var(--border);
      border-radius: 13px;
      background: #f8fbff;
      cursor: pointer;
    }

    .pdca-phase-legend-row span {
      width: 30px;
      height: 30px;
      display: grid;
      place-items: center;
      border-radius: 10px;
      background: var(--phase-color, var(--primary));
      color: #fff;
      font-size: 12px;
      font-weight: 950;
    }

    .pdca-phase-legend-row b { display: block; color: var(--navy); font-size: 12px; }
    .pdca-phase-legend-row small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 2px; font-weight: 650; }

    .pdca-phase-panel {
      display: none;
      border: 1px solid var(--border);
      border-radius: 20px;
      background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
      padding: 18px;
      box-shadow: 0 10px 24px rgba(15,23,42,.055);
    }

    .pdca-phase-panel.active { display: block; animation: fadeIn .18s ease; }

    .pdca-phase-head {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      align-items: flex-start;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 14px;
    }

    .pdca-phase-title {
      display: flex;
      gap: 11px;
      align-items: center;
    }

    .pdca-phase-badge {
      width: 46px;
      height: 46px;
      flex: 0 0 auto;
      display: grid;
      place-items: center;
      border-radius: 15px;
      background: var(--phase-color, var(--primary));
      color: #fff;
      font-size: 19px;
      font-weight: 950;
      box-shadow: 0 10px 20px rgba(15,23,42,.12);
    }

    .pdca-phase-title h4 { margin: 0 0 3px; font-size: 20px; }
    .pdca-phase-title p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; font-weight: 650; }

    .pdca-complete-toggle {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 9px 11px;
      border-radius: 12px;
      background: #ecfdf5;
      color: #047857;
      border: 1px solid rgba(16,185,129,.25);
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
      white-space: nowrap;
    }

    .pdca-complete-toggle input { width: auto; min-height: 0; }

    .pdca-phase-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .pdca-phase-grid .full { grid-column: 1 / -1; }

    .pdca-decision-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      margin-top: 6px;
    }

    .pdca-decision {
      position: relative;
      border: 1px solid var(--border);
      border-radius: 15px;
      background: #fff;
      padding: 12px;
      cursor: pointer;
      transition: .15s ease;
    }

    .pdca-decision:hover { transform: translateY(-1px); border-color: rgba(20,99,255,.40); }
    .pdca-decision.selected {
      background: #eef4ff;
      border-color: rgba(20,99,255,.55);
      box-shadow: 0 8px 18px rgba(20,99,255,.10);
    }
    .pdca-decision input { position: absolute; opacity: 0; pointer-events: none; }
    .pdca-decision b { display: block; color: var(--navy); margin-bottom: 4px; font-size: 13px; }
    .pdca-decision span { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; font-weight: 650; }

    .pdca-kpi-strip {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-top: 14px;
    }

    .pdca-kpi-result {
      border: 1px solid var(--border);
      border-radius: 15px;
      padding: 12px;
      background: #f8fbff;
    }

    .pdca-kpi-result b { display: block; color: var(--navy); font-size: 20px; }
    .pdca-kpi-result span { display: block; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
    .pdca-kpi-result.success { background: #ecfdf5; border-color: rgba(16,185,129,.28); }
    .pdca-kpi-result.warning { background: #fff7ed; border-color: rgba(255,138,0,.28); }

    .pdca-table-wrap {
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: #fff;
      margin-top: 14px;
    }

    .pdca-table {
      width: 100%;
      min-width: 1120px;
      border-collapse: collapse;
      font-size: 12px;
    }

    .pdca-table th,
    .pdca-table td {
      border-bottom: 1px solid var(--border);
      padding: 9px;
      text-align: left;
      vertical-align: top;
    }

    .pdca-table th {
      background: #eef4ff;
      color: var(--navy);
      text-transform: uppercase;
      letter-spacing: .05em;
      font-size: 10px;
      font-weight: 950;
      white-space: nowrap;
      position: sticky;
      top: 0;
      z-index: 1;
    }

    .pdca-table input,
    .pdca-table select,
    .pdca-table textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #f8fbff;
      padding: 8px 9px;
      min-height: 36px;
      font: inherit;
      font-weight: 650;
      min-width: 94px;
    }

    .pdca-table textarea { min-width: 210px; min-height: 54px; resize: vertical; }

    .pdca-status-pill {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      border-radius: 999px;
      padding: 6px 9px;
      background: #fff7ed;
      color: #b45309;
      font-size: 11px;
      font-weight: 900;
      white-space: nowrap;
    }

    .pdca-status-pill.done { background: #ecfdf5; color: #047857; }
    .pdca-status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

    .pdca-print-only { display: none; }

    @media (max-width: 1180px) {
      .pdca-top,
      .pdca-cycle-shell { grid-template-columns: 1fr; }
      .pdca-wheel-card { position: static; }
      .pdca-wheel { max-width: 320px; }
    }

    @media (max-width: 820px) {
      .pdca-meta-grid,
      .pdca-kpi-grid,
      .pdca-phase-grid,
      .pdca-decision-grid,
      .pdca-kpi-strip { grid-template-columns: 1fr; }
      .pdca-meta-grid .wide,
      .pdca-kpi-grid .wide,
      .pdca-phase-grid .full { grid-column: auto; }
      .pdca-phase-head { flex-direction: column; }
    }

    @media print {
      body.pdca-printing {
        background: #fff !important;
      }

      body.pdca-printing .sidebar,
      body.pdca-printing .topbar,
      body.pdca-printing .footer-note,
      body.pdca-printing .method-hero,
      body.pdca-printing .tool-head,
      body.pdca-printing .pdca-actions,
      body.pdca-printing .pdca-wheel-card,
      body.pdca-printing .pdca-complete-toggle,
      body.pdca-printing .pdca-table button {
        display: none !important;
      }

      body.pdca-printing #pdca {
        display: block !important;
      }

      body.pdca-printing .main,
      body.pdca-printing .tool-body,
      body.pdca-printing .pdca-tool,
      body.pdca-printing .pdca-panel,
      body.pdca-printing .pdca-cycle-shell {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
      }

      body.pdca-printing .pdca-top {
        display: grid !important;
        grid-template-columns: 1.2fr .8fr !important;
        gap: 8mm !important;
      }

      body.pdca-printing .pdca-phase-panel {
        display: block !important;
        page-break-inside: avoid;
        margin: 5mm 0 !important;
        box-shadow: none !important;
      }

      body.pdca-printing .pdca-print-only { display: block !important; }
      body.pdca-printing .pdca-table-wrap { overflow: visible !important; }
      body.pdca-printing .pdca-table { min-width: 0 !important; font-size: 8px !important; }
      body.pdca-printing .pdca-table input,
      body.pdca-printing .pdca-table select,
      body.pdca-printing .pdca-table textarea,
      body.pdca-printing .pdca-field input,
      body.pdca-printing .pdca-field select,
      body.pdca-printing .pdca-field textarea {
        border: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
      }
    }






    /* A3 Report interactive one-page editor */
    .a3-tool {
      display: grid;
      gap: 18px;
    }

    .a3-control-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
      gap: 16px;
      align-items: stretch;
    }

    .a3-panel {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(15,23,42,.06);
    }

    .a3-panel.dark {
      background: linear-gradient(135deg, var(--navy), var(--surface));
      color: #fff;
      border-color: rgba(255,255,255,.12);
    }

    .a3-panel h4 {
      margin: 0 0 8px;
      color: var(--navy);
      font-size: 19px;
    }

    .a3-panel.dark h4 { color: #fff; }
    .a3-panel.dark .a3-muted { color: #dbeafe; }

    .a3-muted {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 600;
    }

    .a3-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      margin-top: 14px;
    }

    .a3-meta-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }

    .a3-field {
      display: grid;
      gap: 6px;
    }

    .a3-field.wide { grid-column: span 2; }
    .a3-field.full { grid-column: 1 / -1; }

    .a3-field label,
    .a3-inline-label {
      color: var(--navy);
      font-size: 11px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .055em;
    }

    .a3-field input,
    .a3-field select,
    .a3-field textarea,
    .a3-section input,
    .a3-section select,
    .a3-section textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 11px;
      background: #f8fbff;
      color: var(--text);
      padding: 9px 10px;
      min-height: 39px;
      font: inherit;
      font-size: 12px;
      font-weight: 650;
      outline: none;
      transition: .15s ease;
    }

    .a3-field textarea,
    .a3-section textarea {
      resize: none;
      overflow: hidden;
      min-height: 76px;
      line-height: 1.42;
    }

    .a3-field input:focus,
    .a3-field select:focus,
    .a3-field textarea:focus,
    .a3-section input:focus,
    .a3-section select:focus,
    .a3-section textarea:focus {
      background: #fff;
      border-color: rgba(20,99,255,.55);
      box-shadow: 0 0 0 4px rgba(20,99,255,.09);
    }

    .a3-readiness {
      display: grid;
      grid-template-columns: 96px 1fr;
      gap: 16px;
      align-items: center;
    }

    .a3-score-ring {
      --score: 0deg;
      width: 92px;
      height: 92px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      background: conic-gradient(var(--success) var(--score), rgba(255,255,255,.13) 0);
      position: relative;
    }

    .a3-score-ring::after {
      content: '';
      position: absolute;
      inset: 9px;
      border-radius: 50%;
      background: #14213a;
    }

    .a3-score-ring strong {
      position: relative;
      z-index: 1;
      color: #fff;
      font-size: 23px;
      letter-spacing: -.04em;
    }

    .a3-check-list {
      display: grid;
      gap: 7px;
      max-height: 165px;
      overflow-y: auto;
      padding-right: 4px;
    }

    .a3-check-item {
      display: grid;
      grid-template-columns: 18px 1fr;
      gap: 8px;
      align-items: start;
      color: #dbeafe;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.35;
    }

    .a3-check-item i {
      width: 17px;
      height: 17px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      background: rgba(255,138,0,.18);
      color: #fdba74;
      font-style: normal;
      font-size: 10px;
      font-weight: 950;
    }

    .a3-check-item.done i {
      background: rgba(16,185,129,.18);
      color: #6ee7b7;
    }

    .a3-workspace {
      overflow: auto;
      border-radius: 22px;
      border: 1px solid var(--border);
      background:
        linear-gradient(45deg, #edf2f8 25%, transparent 25%),
        linear-gradient(-45deg, #edf2f8 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #edf2f8 75%),
        linear-gradient(-45deg, transparent 75%, #edf2f8 75%),
        #f7f9fc;
      background-size: 28px 28px;
      background-position: 0 0, 0 14px, 14px -14px, -14px 0;
      padding: 22px;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
    }

    .a3-sheet {
      width: 1480px;
      min-height: 980px;
      margin: 0 auto;
      background: #fff;
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      box-shadow: 0 22px 55px rgba(15,23,42,.18);
      padding: 18px;
      display: grid;
      grid-template-columns: repeat(12, minmax(0, 1fr));
      grid-auto-rows: min-content;
      gap: 10px;
      align-content: start;
    }

    .a3-report-header {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 16px;
      align-items: center;
      background: linear-gradient(135deg, var(--navy), #173b72 58%, var(--primary));
      color: #fff;
      border-radius: 14px;
      padding: 15px 17px;
      min-height: 88px;
    }

    .a3-report-title {
      display: grid;
      gap: 5px;
    }

    .a3-report-title input {
      border: 0;
      padding: 0;
      background: transparent;
      color: #fff;
      font-size: 24px;
      font-weight: 950;
      letter-spacing: -.03em;
      box-shadow: none;
      min-height: 32px;
    }

    .a3-report-title input::placeholder { color: rgba(255,255,255,.65); }

    .a3-report-subline {
      display: flex;
      flex-wrap: wrap;
      gap: 8px 14px;
      color: #dbeafe;
      font-size: 11px;
      font-weight: 750;
    }

    .a3-report-subline span { white-space: nowrap; }

    .a3-status-badge {
      min-width: 145px;
      border-radius: 999px;
      background: rgba(255,255,255,.14);
      border: 1px solid rgba(255,255,255,.18);
      color: #fff;
      padding: 10px 13px;
      text-align: center;
      font-size: 12px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .06em;
    }

    .a3-section {
      border: 1px solid #d7e0ec;
      border-radius: 14px;
      overflow: hidden;
      background: #fff;
      min-width: 0;
      display: flex;
      flex-direction: column;
    }

    .a3-section.s1 { grid-column: span 4; }
    .a3-section.s2 { grid-column: span 4; }
    .a3-section.s3 { grid-column: span 4; }
    .a3-section.s4 { grid-column: span 4; }
    .a3-section.s5 { grid-column: span 8; }
    .a3-section.s6 { grid-column: span 8; }
    .a3-section.s7 { grid-column: span 4; }
    .a3-section.s8 { grid-column: span 8; }
    .a3-section.s9 { grid-column: span 4; }

    .a3-section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      background: #eef4ff;
      border-bottom: 1px solid #d7e0ec;
      padding: 9px 11px;
      min-height: 39px;
    }

    .a3-section-head strong {
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--navy);
      font-size: 12px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .045em;
    }

    .a3-section-number {
      width: 23px;
      height: 23px;
      display: grid;
      place-items: center;
      border-radius: 8px;
      background: var(--navy);
      color: #fff;
      font-size: 10px;
      font-weight: 950;
    }

    .a3-section-head small {
      color: var(--muted);
      font-size: 10px;
      font-weight: 800;
    }

    .a3-section-body {
      flex: 1;
      padding: 10px;
      display: grid;
      gap: 9px;
      align-content: start;
    }

    .a3-section-body > textarea {
      border: 0;
      border-radius: 0;
      padding: 2px;
      background: transparent;
      box-shadow: none;
      min-height: 105px;
    }

    .a3-problem-statement {
      border-left: 4px solid var(--danger) !important;
      padding-left: 10px !important;
      font-size: 13px !important;
      font-weight: 750 !important;
    }

    .a3-goal-statement {
      border-left: 4px solid var(--success) !important;
      padding-left: 10px !important;
      font-size: 13px !important;
      font-weight: 750 !important;
    }

    .a3-image-zone {
      position: relative;
      min-height: 120px;
      border: 1px dashed #b9c8dc;
      border-radius: 11px;
      background: #f8fbff;
      overflow: hidden;
      display: grid;
      place-items: center;
      text-align: center;
      color: var(--muted);
      font-size: 11px;
      font-weight: 750;
    }

    .a3-image-zone.has-image { border-style: solid; background: #0f172a; }
    .a3-image-zone img { width: 100%; height: 145px; object-fit: contain; display: block; }

    .a3-image-zone input {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      z-index: 2;
    }

    .a3-image-remove {
      position: absolute;
      right: 7px;
      top: 7px;
      z-index: 3;
      border: 0;
      border-radius: 999px;
      background: rgba(15,23,42,.82);
      color: #fff;
      padding: 6px 9px;
      font-size: 10px;
      font-weight: 900;
      cursor: pointer;
    }

    .a3-kpi-box {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 7px;
      background: #f8fbff;
      border: 1px solid var(--border);
      border-radius: 11px;
      padding: 8px;
    }

    .a3-kpi-box .a3-field label { font-size: 9px; }
    .a3-kpi-box input,
    .a3-kpi-box select { min-height: 33px; padding: 6px 7px; font-size: 11px; }

    .a3-kpi-visual {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 7px;
      align-items: end;
      min-height: 110px;
      padding: 8px 10px 3px;
      border-radius: 11px;
      background: linear-gradient(180deg, #f8fbff, #fff);
      border: 1px solid var(--border);
    }

    .a3-kpi-column {
      display: grid;
      grid-template-rows: 1fr auto auto;
      gap: 4px;
      height: 90px;
      align-items: end;
      text-align: center;
      color: var(--muted);
      font-size: 9px;
      font-weight: 900;
      text-transform: uppercase;
    }

    .a3-kpi-bar {
      width: 56%;
      min-height: 5px;
      height: var(--bar, 5%);
      justify-self: center;
      border-radius: 6px 6px 2px 2px;
      background: #94a3b8;
      transition: height .2s ease;
    }

    .a3-kpi-column.target .a3-kpi-bar { background: var(--primary); }
    .a3-kpi-column.actual .a3-kpi-bar { background: var(--success); }
    .a3-kpi-column.actual.bad .a3-kpi-bar { background: var(--danger); }

    .a3-kpi-column b {
      color: var(--navy);
      font-size: 11px;
      text-transform: none;
    }

    .a3-kpi-result {
      border-radius: 10px;
      padding: 8px 10px;
      background: #fff7ed;
      border: 1px solid rgba(255,138,0,.24);
      color: #9a3412;
      font-size: 11px;
      font-weight: 800;
      line-height: 1.4;
    }

    .a3-kpi-result.good {
      background: #ecfdf5;
      border-color: rgba(16,185,129,.26);
      color: #047857;
    }

    .a3-mini-table-wrap {
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #fff;
    }

    .a3-mini-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 620px;
      font-size: 10px;
    }

    .a3-mini-table th,
    .a3-mini-table td {
      border-bottom: 1px solid var(--border);
      padding: 6px;
      text-align: left;
      vertical-align: top;
    }

    .a3-mini-table th {
      background: #f1f5f9;
      color: var(--navy);
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: .04em;
      font-weight: 950;
      white-space: nowrap;
    }

    .a3-mini-table input,
    .a3-mini-table select,
    .a3-mini-table textarea {
      min-height: 31px;
      padding: 5px 6px;
      border-radius: 7px;
      font-size: 10px;
      min-width: 75px;
    }

    .a3-mini-table textarea { min-width: 180px; min-height: 43px; }

    .a3-icon-btn {
      border: 0;
      background: transparent;
      color: #b91c1c;
      cursor: pointer;
      font-weight: 950;
      font-size: 12px;
      padding: 5px;
    }

    .a3-add-row {
      border: 1px dashed rgba(20,99,255,.35);
      border-radius: 9px;
      background: #eef4ff;
      color: var(--primary-dark);
      padding: 7px 10px;
      font-size: 10px;
      font-weight: 950;
      cursor: pointer;
      justify-self: start;
    }

    .a3-decision-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 7px;
    }

    .a3-decision {
      position: relative;
    }

    .a3-decision input {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .a3-decision span {
      display: grid;
      place-items: center;
      min-height: 54px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #f8fbff;
      color: var(--muted);
      padding: 7px;
      text-align: center;
      font-size: 10px;
      line-height: 1.25;
      font-weight: 900;
      cursor: pointer;
    }

    .a3-decision input:checked + span {
      border-color: rgba(20,99,255,.55);
      background: #eef4ff;
      color: var(--primary-dark);
      box-shadow: 0 0 0 3px rgba(20,99,255,.08);
    }

    .a3-footer-line {
      grid-column: 1 / -1;
      display: flex;
      justify-content: space-between;
      gap: 14px;
      padding: 6px 4px 0;
      color: #64748b;
      font-size: 9px;
      font-weight: 750;
    }

    @media (max-width: 1180px) {
      .a3-control-grid { grid-template-columns: 1fr; }
      .a3-workspace { padding: 12px; }
    }

    @media (max-width: 780px) {
      .a3-meta-grid { grid-template-columns: 1fr; }
      .a3-field.wide { grid-column: auto; }
    }

    @page a3landscape {
      size: A3 landscape;
      margin: 7mm;
    }

    @media print {
      body.a3-printing .sidebar,
      body.a3-printing .topbar,
      body.a3-printing .footer-note,
      body.a3-printing .method-hero,
      body.a3-printing .tool-head,
      body.a3-printing .a3-control-grid,
      body.a3-printing .a3-image-remove,
      body.a3-printing .a3-add-row,
      body.a3-printing .a3-icon-btn {
        display: none !important;
      }

      body.a3-printing,
      body.a3-printing .app-shell,
      body.a3-printing .main,
      body.a3-printing #a3-report,
      body.a3-printing .tool-card,
      body.a3-printing .tool-body,
      body.a3-printing .a3-tool,
      body.a3-printing .a3-workspace {
        display: block !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
      }

      body.a3-printing .card { display: none !important; }
      body.a3-printing #a3-report { display: block !important; }

      body.a3-printing .a3-sheet {
        page: a3landscape;
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 3mm !important;
        gap: 2.2mm !important;
        border: 0 !important;
        box-shadow: none !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
      }

      body.a3-printing .a3-section { break-inside: avoid; }
      body.a3-printing .a3-section-head { padding: 1.6mm 2mm !important; }
      body.a3-printing .a3-section-body { padding: 1.7mm !important; gap: 1.5mm !important; }
      body.a3-printing .a3-report-header { padding: 2.4mm 3mm !important; min-height: 17mm !important; }
      body.a3-printing .a3-report-title input { font-size: 17px !important; }
      body.a3-printing .a3-image-zone { min-height: 25mm !important; }
      body.a3-printing .a3-image-zone img { height: 28mm !important; }

      body.a3-printing input,
      body.a3-printing select,
      body.a3-printing textarea {
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        color: #111827 !important;
      }

      body.a3-printing .a3-report-title input { color: #fff !important; }
      body.a3-printing .a3-mini-table input,
      body.a3-printing .a3-mini-table select,
      body.a3-printing .a3-mini-table textarea { font-size: 8px !important; }
      body.a3-printing .a3-mini-table th,
      body.a3-printing .a3-mini-table td { padding: 1mm !important; }
      body.a3-printing .a3-section-body > textarea { min-height: 14mm !important; font-size: 9px !important; }
      body.a3-printing .a3-footer-line { font-size: 7px !important; }
    }


    /* Kanban interactive calculator and simulation */
    .kanban-tool {
      display: grid;
      gap: 18px;
    }

    .kanban-top {
      display: grid;
      grid-template-columns: minmax(0, 1.16fr) minmax(340px, .84fr);
      gap: 16px;
      align-items: stretch;
    }

    .kanban-panel {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(15,23,42,.06);
    }

    .kanban-panel.dark {
      background: linear-gradient(135deg, var(--navy), var(--surface));
      color: #fff;
      border-color: rgba(255,255,255,.12);
    }

    .kanban-panel h4 {
      margin: 0 0 8px;
      color: var(--navy);
      font-size: 19px;
    }

    .kanban-panel.dark h4 { color: #fff; }
    .kanban-panel.dark .kanban-muted,
    .kanban-panel.dark label { color: #dbeafe; }

    .kanban-muted {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 600;
    }

    .kanban-field-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    .kanban-field-grid .wide { grid-column: span 2; }

    .kanban-field {
      display: grid;
      gap: 7px;
    }

    .kanban-field label {
      color: var(--navy);
      font-size: 12px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .kanban-field input,
    .kanban-field select,
    .kanban-field textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 13px;
      background: #f8fbff;
      color: var(--text);
      padding: 10px 11px;
      min-height: 43px;
      font: inherit;
      font-weight: 650;
      outline: none;
      transition: .15s ease;
    }

    .kanban-field textarea { min-height: 82px; resize: vertical; }

    .kanban-field input:focus,
    .kanban-field select:focus,
    .kanban-field textarea:focus {
      border-color: rgba(20,99,255,.55);
      background: #fff;
      box-shadow: 0 0 0 4px rgba(20,99,255,.10);
    }

    .kanban-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      margin-top: 14px;
    }

    .kanban-summary-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin: 14px 0;
    }

    .kanban-kpi {
      border-radius: 16px;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.16);
      padding: 12px;
      min-width: 0;
    }

    .kanban-kpi b {
      display: block;
      color: #fff;
      font-size: 23px;
      line-height: 1.08;
      letter-spacing: -.03em;
      overflow-wrap: anywhere;
    }

    .kanban-kpi span {
      display: block;
      margin-top: 5px;
      color: #dbeafe;
      font-size: 11px;
      font-weight: 850;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .kanban-status {
      margin-top: 12px;
      border-radius: 15px;
      padding: 12px 13px;
      font-weight: 780;
      line-height: 1.45;
      border: 1px solid rgba(255,255,255,.16);
      background: rgba(255,255,255,.10);
      color: #eaf2ff;
    }

    .kanban-status.good { background: rgba(16,185,129,.16); border-color: rgba(16,185,129,.35); color: #d1fae5; }
    .kanban-status.warn { background: rgba(255,138,0,.16); border-color: rgba(255,138,0,.35); color: #ffedd5; }
    .kanban-status.bad { background: rgba(239,68,68,.16); border-color: rgba(239,68,68,.35); color: #fee2e2; }

    .kanban-formula {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 10px;
      margin-top: 14px;
    }

    .kanban-formula-card {
      border: 1px solid var(--border);
      border-radius: 16px;
      background: #f8fbff;
      padding: 12px;
      min-width: 0;
    }

    .kanban-formula-card b {
      display: block;
      color: var(--navy);
      font-size: 20px;
      line-height: 1.1;
      overflow-wrap: anywhere;
    }

    .kanban-formula-card span {
      display: block;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.35;
      font-weight: 850;
      text-transform: uppercase;
      letter-spacing: .05em;
      margin-top: 5px;
    }

    .kanban-formula-card.primary { background: #eef4ff; border-color: rgba(20,99,255,.28); }
    .kanban-formula-card.success { background: #ecfdf5; border-color: rgba(16,185,129,.28); }
    .kanban-formula-card.warning { background: #fff7ed; border-color: rgba(255,138,0,.28); }

    .kanban-equation {
      margin-top: 14px;
      border-radius: 16px;
      background: linear-gradient(135deg, #eef4ff, #fff);
      border: 1px solid rgba(20,99,255,.20);
      padding: 13px 15px;
      color: var(--navy);
      font-weight: 750;
      line-height: 1.55;
    }

    .kanban-equation code {
      display: inline-block;
      border-radius: 9px;
      padding: 4px 7px;
      background: var(--navy);
      color: #fff;
      font: 800 12px ui-monospace, SFMono-Regular, Menlo, monospace;
    }

    .kanban-sim-head {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      align-items: flex-start;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }

    .kanban-sim-controls {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .kanban-speed {
      border: 1px solid var(--border);
      border-radius: 999px;
      background: #fff;
      color: var(--navy);
      padding: 9px 12px;
      min-height: 40px;
      font: inherit;
      font-weight: 850;
    }

    .kanban-loop {
      display: grid;
      grid-template-columns: 220px 54px minmax(360px, 1fr) 54px 220px;
      gap: 10px;
      align-items: stretch;
      border: 1px solid var(--border);
      border-radius: 22px;
      padding: 14px;
      background:
        radial-gradient(circle at 20% 15%, rgba(20,99,255,.08), transparent 32%),
        linear-gradient(180deg, #fff, #f8fbff);
    }

    .kanban-loop-node {
      border: 1px solid var(--border);
      border-radius: 18px;
      background: #fff;
      padding: 14px;
      min-height: 184px;
      display: grid;
      align-content: start;
      gap: 9px;
      box-shadow: 0 9px 22px rgba(15,23,42,.055);
    }

    .kanban-loop-node b { color: var(--navy); font-size: 15px; }
    .kanban-loop-node p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; font-weight: 650; }

    .kanban-loop-icon {
      width: 48px;
      height: 48px;
      display: grid;
      place-items: center;
      border-radius: 15px;
      background: #eef4ff;
      color: var(--primary-dark);
      font-size: 22px;
      font-weight: 950;
    }

    .kanban-loop-value {
      margin-top: auto;
      border-radius: 13px;
      background: #f8fbff;
      border: 1px solid var(--border);
      padding: 10px;
    }

    .kanban-loop-value strong { display: block; color: var(--navy); font-size: 20px; }
    .kanban-loop-value span { display: block; color: var(--muted); margin-top: 3px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 850; }

    .kanban-loop-arrow {
      display: grid;
      place-items: center;
      color: var(--primary);
      font-size: 31px;
      font-weight: 950;
    }

    .kanban-supermarket {
      border: 1px solid var(--border);
      border-radius: 18px;
      background: #fff;
      padding: 13px;
      min-width: 0;
    }

    .kanban-supermarket-head {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
      margin-bottom: 10px;
    }

    .kanban-supermarket-head b { color: var(--navy); }

    .kanban-card-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
      gap: 9px;
      max-height: 360px;
      overflow-y: auto;
      padding-right: 3px;
    }

    .kanban-card-unit {
      position: relative;
      border: 2px solid rgba(20,99,255,.30);
      border-radius: 14px;
      background: linear-gradient(180deg, #fff, #eef4ff);
      padding: 10px;
      min-height: 100px;
      overflow: hidden;
      transition: .15s ease;
    }

    .kanban-card-unit::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 5px;
      background: var(--primary);
    }

    .kanban-card-unit.inuse { border-color: rgba(16,185,129,.45); background: linear-gradient(180deg, #fff, #ecfdf5); }
    .kanban-card-unit.inuse::before { background: var(--success); }
    .kanban-card-unit.replenishing { border-color: rgba(255,138,0,.45); background: linear-gradient(180deg, #fff, #fff7ed); }
    .kanban-card-unit.replenishing::before { background: var(--accent); }
    .kanban-card-unit.empty { border-color: rgba(239,68,68,.42); background: linear-gradient(180deg, #fff, #fff1f2); }
    .kanban-card-unit.empty::before { background: var(--danger); }

    .kanban-card-unit strong { display: block; color: var(--navy); font-size: 13px; }
    .kanban-card-unit small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; font-weight: 750; }
    .kanban-card-qty { font-size: 21px; color: var(--navy); font-weight: 950; margin-top: 8px; }
    .kanban-card-bar { height: 7px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-top: 7px; }
    .kanban-card-bar span { display: block; height: 100%; width: var(--fill, 0%); background: var(--primary); border-radius: inherit; }
    .kanban-card-unit.inuse .kanban-card-bar span { background: var(--success); }
    .kanban-card-unit.replenishing .kanban-card-bar span { background: var(--accent); }

    .kanban-sim-kpis {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 9px;
      margin: 12px 0;
    }

    .kanban-sim-kpi {
      border: 1px solid var(--border);
      border-radius: 14px;
      background: #f8fbff;
      padding: 10px;
      min-width: 0;
    }

    .kanban-sim-kpi b { display: block; color: var(--navy); font-size: 18px; overflow-wrap: anywhere; }
    .kanban-sim-kpi span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; font-weight: 850; margin-top: 4px; }
    .kanban-sim-kpi.bad { background: #fff1f2; border-color: rgba(239,68,68,.28); }
    .kanban-sim-kpi.good { background: #ecfdf5; border-color: rgba(16,185,129,.28); }

    .kanban-chart-shell {
      border: 1px solid var(--border);
      border-radius: 18px;
      background: #fff;
      padding: 12px;
      overflow-x: auto;
    }

    .kanban-chart-shell svg {
      display: block;
      width: 100%;
      min-width: 760px;
      height: 230px;
    }

    .kanban-chart-grid { stroke: #dbe3ef; stroke-width: 1; }
    .kanban-chart-axis { fill: #64748b; font-size: 11px; font-weight: 700; }
    .kanban-chart-stock { fill: none; stroke: #1463ff; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
    .kanban-chart-min { fill: none; stroke: #ef4444; stroke-width: 2; stroke-dasharray: 8 6; }
    .kanban-chart-area { fill: rgba(20,99,255,.10); }
    .kanban-chart-stockout { fill: rgba(239,68,68,.13); }

    .kanban-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
    }

    .kanban-legend span {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      border-radius: 999px;
      padding: 7px 9px;
      border: 1px solid var(--border);
      background: #f8fbff;
      color: var(--navy);
      font-size: 11px;
      font-weight: 850;
    }

    .kanban-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); }
    .kanban-legend i.inuse { background: var(--success); }
    .kanban-legend i.replenishing { background: var(--accent); }
    .kanban-legend i.stockout { background: var(--danger); }

    .kanban-event-log {
      display: grid;
      gap: 7px;
      max-height: 245px;
      overflow-y: auto;
      padding-right: 3px;
    }

    .kanban-event {
      display: grid;
      grid-template-columns: 68px 1fr;
      gap: 9px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #f8fbff;
      padding: 9px 10px;
      color: var(--navy);
      font-size: 11px;
      font-weight: 720;
    }

    .kanban-event time { color: var(--primary-dark); font-weight: 950; }
    .kanban-event.warn { background: #fff7ed; border-color: rgba(255,138,0,.25); }
    .kanban-event.bad { background: #fff1f2; border-color: rgba(239,68,68,.25); }
    .kanban-event.good { background: #ecfdf5; border-color: rgba(16,185,129,.25); }

    .kanban-bottom-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
      gap: 16px;
    }

    @media (max-width: 1280px) {
      .kanban-formula,
      .kanban-sim-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .kanban-loop { grid-template-columns: 170px 44px minmax(320px,1fr) 44px 170px; }
    }

    @media (max-width: 1060px) {
      .kanban-top,
      .kanban-bottom-grid { grid-template-columns: 1fr; }
      .kanban-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .kanban-loop { grid-template-columns: 1fr; }
      .kanban-loop-arrow { transform: rotate(90deg); min-height: 36px; }
    }

    @media (max-width: 680px) {
      .kanban-field-grid,
      .kanban-formula,
      .kanban-sim-kpis { grid-template-columns: 1fr; }
      .kanban-field-grid .wide { grid-column: auto; }
    }

    @media print {
      body.kanban-printing .sidebar,
      body.kanban-printing .topbar,
      body.kanban-printing .footer-note,
      body.kanban-printing .method-hero,
      body.kanban-printing .tool-head,
      body.kanban-printing .kanban-actions,
      body.kanban-printing .kanban-sim-controls {
        display: none !important;
      }

      body.kanban-printing #kanban { display: block !important; }
      body.kanban-printing .main,
      body.kanban-printing .tool-body,
      body.kanban-printing .kanban-tool,
      body.kanban-printing .kanban-panel {
        padding: 0 !important;
        margin: 0 0 5mm !important;
        box-shadow: none !important;
      }

      body.kanban-printing .kanban-panel { page-break-inside: avoid; }
      body.kanban-printing .kanban-loop { grid-template-columns: 42mm 10mm 1fr 10mm 42mm !important; }
      body.kanban-printing .kanban-card-grid { max-height: none !important; overflow: visible !important; }
      body.kanban-printing .kanban-chart-shell { overflow: visible !important; }
      body.kanban-printing .kanban-chart-shell svg { min-width: 0 !important; }
    }


    /* 5 Why interactive tool */
    .fivewhy-tool {
      display: grid;
      gap: 18px;
    }

    .fivewhy-panel {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(15,23,42,.06);
    }

    .fivewhy-panel.dark {
      background: linear-gradient(135deg, var(--navy), var(--surface));
      color: #fff;
      border-color: rgba(255,255,255,.12);
    }

    .fivewhy-panel.dark p,
    .fivewhy-panel.dark label,
    .fivewhy-panel.dark .fivewhy-muted {
      color: #dbeafe;
    }

    .fivewhy-top {
      display: grid;
      grid-template-columns: 1.2fr .8fr;
      gap: 16px;
      align-items: stretch;
    }

    .fivewhy-panel h4 {
      margin: 0 0 8px;
      font-size: 19px;
      color: var(--navy);
    }

    .fivewhy-panel.dark h4 {
      color: #fff;
    }

    .fivewhy-muted {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 600;
    }

    .fivewhy-field {
      display: grid;
      gap: 8px;
      margin-top: 12px;
    }

    .fivewhy-field label {
      color: var(--navy);
      font-size: 13px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .fivewhy-field input,
    .fivewhy-field textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: #f8fbff;
      color: var(--text);
      padding: 12px 13px;
      min-height: 46px;
      font: inherit;
      font-weight: 600;
      outline: none;
      resize: vertical;
      transition: .15s ease;
    }

    .fivewhy-field textarea {
      min-height: 96px;
    }

    .fivewhy-field input:focus,
    .fivewhy-field textarea:focus {
      border-color: rgba(20,99,255,.55);
      background: #fff;
      box-shadow: 0 0 0 4px rgba(20,99,255,.10);
    }

    .fivewhy-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 14px;
    }

    .lean-btn {
      border: 0;
      border-radius: 999px;
      padding: 11px 15px;
      cursor: pointer;
      font-weight: 950;
      font-size: 14px;
      transition: .15s ease;
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .lean-btn:hover {
      transform: translateY(-1px);
    }

    .lean-btn.primary {
      background: var(--primary);
      color: #fff;
      box-shadow: 0 10px 22px rgba(20,99,255,.22);
    }

    .lean-btn.secondary {
      background: #eef4ff;
      color: var(--primary-dark);
      border: 1px solid rgba(20,99,255,.18);
    }

    .lean-btn.danger {
      background: #fff1f2;
      color: #b91c1c;
      border: 1px solid rgba(239,68,68,.22);
    }

    .fivewhy-chain {
      display: grid;
      gap: 12px;
    }

    .fivewhy-step {
      position: relative;
      border: 1px solid var(--border);
      border-radius: 20px;
      background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
      padding: 18px;
      box-shadow: 0 10px 24px rgba(15,23,42,.055);
    }

    .fivewhy-step::before {
      content: '';
      position: absolute;
      left: 35px;
      top: -13px;
      width: 2px;
      height: 13px;
      background: #b8c8dc;
    }

    .fivewhy-step:first-child::before {
      display: none;
    }

    .fivewhy-step-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 10px;
    }

    .fivewhy-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border-radius: 999px;
      background: var(--navy);
      color: #fff;
      padding: 8px 11px;
      font-size: 13px;
      font-weight: 950;
    }

    .fivewhy-question {
      color: var(--navy);
      font-size: 18px;
      font-weight: 950;
      letter-spacing: -.015em;
    }

    .fivewhy-step-grid {
      display: grid;
      grid-template-columns: 1.1fr .9fr;
      gap: 14px;
    }

    .fivewhy-root-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border);
    }

    .fivewhy-root-row label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: var(--navy);
      font-weight: 850;
      cursor: pointer;
    }

    .fivewhy-remove {
      border: 0;
      background: transparent;
      color: #b91c1c;
      cursor: pointer;
      font-weight: 900;
    }

    .fivewhy-summary {
      display: grid;
      gap: 10px;
      margin-top: 10px;
    }

    .fivewhy-summary-item {
      display: grid;
      grid-template-columns: 34px 1fr;
      gap: 10px;
      align-items: start;
      color: #eaf2ff;
      font-weight: 650;
      line-height: 1.45;
    }

    .fivewhy-summary-item b {
      width: 28px;
      height: 28px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      background: rgba(255,255,255,.16);
      color: #fff;
      font-size: 12px;
    }

    .fivewhy-root-cause {
      margin-top: 14px;
      padding: 14px;
      border-radius: 16px;
      background: rgba(16,185,129,.14);
      border: 1px solid rgba(16,185,129,.35);
      color: #ecfdf5;
      font-weight: 750;
      line-height: 1.45;
    }

    .fivewhy-print-note {
      color: var(--muted);
      font-size: 13px;
      font-weight: 650;
      margin: 10px 0 0;
    }



    /* Ishikawa / Fishbone interactive tool */
    .ishikawa-tool {
      display: grid;
      gap: 18px;
    }

    .ishikawa-panel {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(15,23,42,.06);
    }

    .ishikawa-panel.dark {
      background: linear-gradient(135deg, var(--navy), var(--surface));
      color: #fff;
      border-color: rgba(255,255,255,.12);
    }

    .ishikawa-panel h4 {
      margin: 0 0 8px;
      color: var(--navy);
      font-size: 19px;
    }

    .ishikawa-panel.dark h4 {
      color: #fff;
    }

    .ishikawa-panel.dark p,
    .ishikawa-panel.dark label,
    .ishikawa-panel.dark .ishikawa-muted {
      color: #dbeafe;
    }

    .ishikawa-muted {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 600;
    }

    .ishikawa-top {
      display: grid;
      grid-template-columns: 1.15fr .85fr;
      gap: 16px;
      align-items: stretch;
    }

    .ishikawa-field {
      display: grid;
      gap: 8px;
      margin-top: 12px;
    }

    .ishikawa-field label {
      color: var(--navy);
      font-size: 13px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .ishikawa-field input,
    .ishikawa-field textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: #f8fbff;
      color: var(--text);
      padding: 12px 13px;
      min-height: 46px;
      font: inherit;
      font-weight: 600;
      outline: none;
      resize: vertical;
      transition: .15s ease;
    }

    .ishikawa-field textarea {
      min-height: 96px;
    }

    .ishikawa-field input:focus,
    .ishikawa-field textarea:focus {
      border-color: rgba(20,99,255,.55);
      background: #fff;
      box-shadow: 0 0 0 4px rgba(20,99,255,.10);
    }

    .ishikawa-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 14px;
    }

    .ishikawa-summary {
      display: grid;
      gap: 10px;
      margin-top: 10px;
    }

    .ishikawa-summary-item {
      display: grid;
      grid-template-columns: 32px 1fr;
      gap: 10px;
      align-items: start;
      color: #eaf2ff;
      font-weight: 650;
      line-height: 1.45;
    }

    .ishikawa-summary-item b {
      width: 28px;
      height: 28px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      background: rgba(255,255,255,.16);
      color: #fff;
      font-size: 12px;
    }

    .ishikawa-root-cause {
      margin-top: 14px;
      padding: 14px;
      border-radius: 16px;
      background: rgba(255,138,0,.14);
      border: 1px solid rgba(255,138,0,.35);
      color: #fff7ed;
      font-weight: 750;
      line-height: 1.45;
    }

    .fishbone-wrap {
      position: relative;
      overflow: hidden;
      background:
        radial-gradient(circle at 12% 20%, rgba(20,99,255,.08), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
      border: 1px solid var(--border);
      border-radius: 24px;
      padding: 24px;
      box-shadow: 0 14px 34px rgba(15,23,42,.07);
    }

    .fishbone-canvas {
      position: relative;
      min-height: 620px;
      display: grid;
      grid-template-columns: 1fr 260px;
      gap: 22px;
      align-items: center;
    }

    .fishbone-lines {
      position: absolute;
      inset: 22px 235px 22px 22px;
      pointer-events: none;
      z-index: 0;
    }

    .fishbone-lines svg {
      width: 100%;
      height: 100%;
      overflow: visible;
    }

    .fishbone-line {
      stroke: #0f172a;
      stroke-width: 4;
      stroke-linecap: round;
      fill: none;
    }

    .fishbone-bone {
      stroke: #1463ff;
      stroke-width: 3;
      stroke-linecap: round;
      fill: none;
    }

    .fishbone-arrow {
      fill: #0f172a;
    }

    .fishbone-categories {
      position: relative;
      z-index: 1;
      display: grid;
      grid-template-columns: repeat(3, minmax(180px, 1fr));
      grid-template-rows: 1fr 1fr;
      gap: 34px 18px;
      height: 100%;
      align-items: start;
    }

    .fishbone-category {
      background: rgba(255,255,255,.94);
      border: 1px solid rgba(20,99,255,.18);
      border-radius: 18px;
      padding: 14px;
      box-shadow: 0 10px 28px rgba(15,23,42,.075);
      min-height: 245px;
      backdrop-filter: blur(8px);
    }

    .fishbone-category:nth-child(n+4) {
      align-self: end;
    }

    .fishbone-cat-head {
      display: flex;
      gap: 8px;
      align-items: center;
      margin-bottom: 10px;
    }

    .fishbone-cat-number {
      flex: 0 0 auto;
      width: 32px;
      height: 32px;
      display: grid;
      place-items: center;
      border-radius: 10px;
      background: var(--navy);
      color: #fff;
      font-weight: 950;
      font-size: 12px;
    }

    .fishbone-cat-title {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #eef4ff;
      color: var(--navy);
      padding: 9px 10px;
      font: inherit;
      font-weight: 950;
      outline: none;
    }

    .fishbone-causes {
      display: grid;
      gap: 8px;
    }

    .fishbone-cause {
      display: grid;
      gap: 6px;
      padding: 10px;
      border: 1px solid #dbe3ef;
      border-radius: 14px;
      background: #f8fbff;
    }

    .fishbone-cause textarea {
      width: 100%;
      min-height: 54px;
      border: 0;
      background: transparent;
      color: var(--text);
      resize: vertical;
      font: inherit;
      font-size: 13px;
      font-weight: 700;
      outline: none;
      padding: 0;
    }

    .fishbone-cause-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      justify-content: space-between;
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
    }

    .fishbone-root-label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      color: var(--navy);
    }

    .fishbone-remove {
      border: 0;
      background: transparent;
      color: #b91c1c;
      cursor: pointer;
      font-weight: 900;
      padding: 0;
      font-size: 12px;
    }

    .fishbone-add {
      width: 100%;
      margin-top: 10px;
      border: 1px dashed rgba(20,99,255,.35);
      border-radius: 13px;
      background: #eef4ff;
      color: var(--primary-dark);
      padding: 9px 10px;
      font-weight: 950;
      cursor: pointer;
    }

    .fishbone-effect {
      position: relative;
      z-index: 1;
      background: linear-gradient(135deg, var(--navy), var(--primary));
      color: #fff;
      border-radius: 22px;
      padding: 18px;
      box-shadow: 0 18px 38px rgba(20,99,255,.22);
      min-height: 260px;
      display: grid;
      align-content: center;
      gap: 10px;
    }

    .fishbone-effect::before {
      content: '';
      position: absolute;
      left: -22px;
      top: 50%;
      width: 0;
      height: 0;
      transform: translateY(-50%);
      border-top: 24px solid transparent;
      border-bottom: 24px solid transparent;
      border-right: 24px solid var(--primary);
    }

    .fishbone-effect strong {
      font-size: 13px;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: #bfdbfe;
    }

    .fishbone-effect-output {
      font-size: 18px;
      font-weight: 950;
      line-height: 1.35;
      word-break: break-word;
    }

    .fishbone-effect small {
      color: #dbeafe;
      font-weight: 700;
      line-height: 1.45;
    }

    .ishikawa-print-note {
      color: var(--muted);
      font-size: 13px;
      font-weight: 650;
      margin: 10px 0 0;
    }

    @media (max-width: 1180px) {
      .fishbone-canvas {
        grid-template-columns: 1fr;
      }

      .fishbone-lines {
        display: none;
      }

      .fishbone-categories {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
      }

      .fishbone-effect::before {
        display: none;
      }
    }

    @media (max-width: 760px) {
      .fishbone-categories {
        grid-template-columns: 1fr;
      }

      .fishbone-category:nth-child(n+4) {
        align-self: start;
      }
    }

    @media (max-width: 1080px) {
      .fivewhy-top,
      .ishikawa-top,
      .fivewhy-step-grid {
        grid-template-columns: 1fr;
      }
    }

    @media print {
      body {
        display: block;
        overflow: visible;
        background: #fff;
      }

      .app-shell,
      .main {
        display: block;
        height: auto;
        overflow: visible;
        padding: 0;
      }

      .sidebar,
      .topbar,
      .hero,
      .footer-note,
      .five-s-actions,
      .fivewhy-actions,
      .ishikawa-actions,
      .fishbone-remove,
      .fishbone-add,
      .fivewhy-remove,
      .integration-box {
        display: none !important;
      }

      .card {
        display: none !important;
      }

      .card.active {
        display: block !important;
      }

      .tool-card,
      .five-s-panel,
      .five-s-board-panel,
      .fivewhy-panel,
      .ishikawa-panel,
      .fishbone-wrap,
      .fishbone-category,
      .fishbone-effect,
      .fivewhy-step {
        box-shadow: none !important;
      }

      .tool-head {
        background: #0f172a !important;
        color: #fff !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
      }

      .five-s-panel.dark,
      .fivewhy-panel.dark,
      .ishikawa-panel.dark {
        background: #0f172a !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
      }
    }

    .footer-note {
      color: #667085;
      text-align: center;
      font-size: 13px;
      margin: 24px 0 8px;
      font-weight: 600;
    }

    .mobile-toggle {
      display: none;
      border: 0;
      background: var(--navy);
      color: #fff;
      border-radius: 12px;
      padding: 10px 12px;
      font-weight: 900;
      cursor: pointer;
    }

    @media (max-width: 920px) {
      body {
        overflow: auto;
      }

      .app-shell {
        display: block;
        height: auto;
      }

      .sidebar {
        position: fixed;
        left: -340px;
        top: 0;
        transition: .2s ease;
        z-index: 10;
      }

      .sidebar.open {
        left: 0;
      }

      .main {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding: 18px;
      }

      .mobile-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
      }

      .topbar {
        align-items: flex-start;
        flex-direction: column;
      }

      .status-pill {
        white-space: normal;
      }

      .tool-head {
        grid-template-columns: 1fr;
      }

      .placeholder-grid {
        grid-template-columns: 1fr;
      }


      .method-info-grid {
        grid-template-columns: 1fr;
      }

      .integration-box.show {
        align-items: flex-start;
        flex-direction: column;
      }
    }



    /* Value Stream Mapping / VSM editor */
    .vsm-tool { display:grid; gap:18px; }
    .vsm-top { display:grid; grid-template-columns:1.18fr .82fr; gap:16px; align-items:stretch; }
    .vsm-panel { background:#fff; border:1px solid var(--border); border-radius:20px; padding:18px; box-shadow:0 10px 26px rgba(15,23,42,.06); }
    .vsm-panel.dark { background:linear-gradient(135deg,var(--navy),var(--surface)); color:#fff; border-color:rgba(255,255,255,.12); }
    .vsm-panel h4 { margin:0 0 8px; color:var(--navy); font-size:19px; }
    .vsm-panel.dark h4 { color:#fff; }
    .vsm-panel.dark .vsm-muted, .vsm-panel.dark p, .vsm-panel.dark label { color:#dbeafe; }
    .vsm-muted { margin:0 0 14px; color:var(--muted); line-height:1.5; font-weight:600; }
    .vsm-meta-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:11px; }
    .vsm-field { display:grid; gap:6px; }
    .vsm-field.wide { grid-column:span 2; }
    .vsm-field.full { grid-column:1/-1; }
    .vsm-field label { color:var(--navy); font-size:11px; text-transform:uppercase; letter-spacing:.055em; font-weight:950; }
    .vsm-field input,.vsm-field select,.vsm-field textarea { width:100%; border:1px solid var(--border); border-radius:12px; background:#f8fbff; color:var(--text); padding:10px 11px; min-height:42px; font:inherit; font-weight:650; outline:none; }
    .vsm-field textarea { min-height:74px; resize:vertical; }
    .vsm-field input:focus,.vsm-field select:focus,.vsm-field textarea:focus { background:#fff; border-color:rgba(20,99,255,.55); box-shadow:0 0 0 4px rgba(20,99,255,.09); }
    .vsm-kpis { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin-top:12px; }
    .vsm-kpi { border-radius:15px; padding:11px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.15); min-height:76px; }
    .vsm-kpi b { display:block; color:#fff; font-size:21px; letter-spacing:-.025em; line-height:1.05; }
    .vsm-kpi span { display:block; color:#dbeafe; margin-top:5px; font-size:10px; text-transform:uppercase; letter-spacing:.055em; font-weight:900; line-height:1.25; }
    .vsm-comparison { margin-top:11px; border-radius:15px; padding:12px; background:rgba(16,185,129,.12); border:1px solid rgba(16,185,129,.28); color:#ecfdf5; font-weight:750; line-height:1.45; }
    .vsm-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:13px; }
    .vsm-view-tabs { display:flex; gap:7px; padding:5px; border-radius:999px; background:#eef4ff; border:1px solid rgba(20,99,255,.14); }
    .vsm-view-tab { border:0; border-radius:999px; padding:9px 14px; background:transparent; color:var(--primary-dark); font-weight:950; cursor:pointer; }
    .vsm-view-tab.active { background:var(--primary); color:#fff; box-shadow:0 8px 18px rgba(20,99,255,.2); }
    .vsm-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
    .vsm-actions .lean-btn { padding:9px 12px; font-size:12px; }
    .vsm-workspace { display:grid; grid-template-columns:210px minmax(0,1fr) 310px; gap:12px; align-items:stretch; }
    .vsm-palette,.vsm-inspector { border:1px solid var(--border); border-radius:17px; background:#f8fbff; padding:13px; min-height:640px; }
    .vsm-palette h5,.vsm-inspector h5 { margin:0 0 10px; color:var(--navy); font-size:14px; }
    .vsm-palette-grid { display:grid; gap:8px; }
    .vsm-palette-btn { width:100%; border:1px solid #dbe3ef; border-radius:13px; padding:10px; background:#fff; color:var(--navy); cursor:pointer; display:flex; align-items:center; gap:9px; text-align:left; font:inherit; font-size:12px; font-weight:850; transition:.15s ease; }
    .vsm-palette-btn:hover { transform:translateY(-1px); border-color:rgba(20,99,255,.42); box-shadow:0 7px 17px rgba(20,99,255,.08); }
    .vsm-palette-icon { width:29px; height:29px; border-radius:9px; display:grid; place-items:center; background:#eef4ff; color:var(--primary-dark); font-weight:950; }
    .vsm-palette-note { color:var(--muted); font-size:11px; line-height:1.45; font-weight:650; margin:12px 0 0; }
    .vsm-legend { display:grid; gap:7px; margin-top:13px; border-top:1px solid var(--border); padding-top:12px; }
    .vsm-legend span { display:flex; align-items:center; gap:7px; color:var(--navy); font-size:11px; font-weight:850; }
    .vsm-legend i { width:14px; height:8px; border-radius:3px; display:inline-block; }
    .vsm-legend .material { background:var(--navy); }
    .vsm-legend .info { background:var(--primary); }
    .vsm-legend .pull { background:var(--success); }
    .vsm-map-viewport { position:relative; min-width:0; min-height:640px; overflow:auto; border:1px solid var(--border); border-radius:18px; background:#e8eef7; resize:vertical; }
    .vsm-map-stage { min-width:1800px; min-height:650px; transform-origin:top left; padding:20px; }
    .vsm-map { position:relative; width:var(--vsm-width,1800px); min-height:610px; border-radius:16px; border:1px solid #cbd7e7; background:
      linear-gradient(90deg,rgba(15,23,42,.035) 1px,transparent 1px),
      linear-gradient(0deg,rgba(15,23,42,.035) 1px,transparent 1px),#fff;
      background-size:28px 28px; overflow:hidden; }
    .vsm-info-row { height:180px; padding:20px 24px; display:grid; grid-template-columns:210px 1fr 210px; align-items:start; gap:20px; border-bottom:1px dashed #bdc9d8; background:linear-gradient(180deg,#f8fbff,#fff); }
    .vsm-external { border:2px solid var(--navy); border-radius:7px; padding:10px; background:#fff; text-align:center; box-shadow:0 8px 17px rgba(15,23,42,.08); min-height:86px; display:grid; align-content:center; }
    .vsm-external .factory { font-size:27px; line-height:1; }
    .vsm-external b { color:var(--navy); font-size:13px; margin-top:5px; }
    .vsm-external small { color:var(--muted); font-weight:700; line-height:1.3; }
    .vsm-control { justify-self:center; width:260px; border:2px solid var(--primary); border-radius:5px; padding:10px; background:#eef4ff; text-align:center; box-shadow:0 8px 17px rgba(20,99,255,.09); }
    .vsm-control b { color:var(--primary-dark); font-size:14px; }
    .vsm-control small { display:block; color:var(--muted); font-weight:700; margin-top:5px; }
    .vsm-info-links { position:absolute; left:220px; right:220px; top:92px; height:60px; pointer-events:none; }
    .vsm-info-line { position:absolute; top:12px; height:0; border-top:3px dashed var(--primary); }
    .vsm-info-line.left { left:0; width:calc(50% - 145px); }
    .vsm-info-line.right { right:0; width:calc(50% - 145px); }
    .vsm-info-line::after { content:'▶'; position:absolute; right:-7px; top:-11px; color:var(--primary); font-size:13px; }
    .vsm-info-caption { position:absolute; top:-18px; color:var(--primary-dark); font-size:10px; font-weight:900; background:#fff; padding:2px 6px; border-radius:999px; }
    .vsm-info-line.left .vsm-info-caption { left:12px; }
    .vsm-info-line.right .vsm-info-caption { right:12px; }
    .vsm-flow-row { min-height:300px; padding:34px 28px 22px; display:flex; align-items:flex-start; gap:34px; position:relative; overflow:visible; }
    .vsm-flow-end { flex:0 0 120px; min-height:118px; border:2px solid var(--navy); background:#fff; border-radius:7px; padding:9px; display:grid; place-items:center; text-align:center; color:var(--navy); font-size:12px; font-weight:900; position:relative; }
    .vsm-flow-end::after,.vsm-item::after { content:'➜'; position:absolute; right:-30px; top:47px; color:var(--navy); font-size:22px; font-weight:950; }
    .vsm-flow-end.customer::after { display:none; }
    .vsm-items { display:flex; align-items:flex-start; gap:34px; }
    .vsm-item { flex:0 0 auto; position:relative; cursor:pointer; user-select:none; }
    .vsm-item.selected { filter:drop-shadow(0 0 0.45rem rgba(20,99,255,.34)); }
    .vsm-item.dragging { opacity:.45; }
    .vsm-item.drop-before::before { content:''; position:absolute; left:-19px; top:-12px; bottom:-70px; width:4px; border-radius:999px; background:var(--primary); z-index:8; }
    .vsm-process { width:178px; }
    .vsm-process-box { min-height:78px; border:2px solid var(--navy); background:#fff; border-radius:4px; padding:9px; display:grid; align-content:center; text-align:center; position:relative; }
    .vsm-process-box b { color:var(--navy); font-size:13px; line-height:1.25; }
    .vsm-process-box small { color:var(--muted); font-weight:700; margin-top:4px; }
    .vsm-process-box.bottleneck { border-color:var(--danger); box-shadow:inset 0 0 0 2px rgba(239,68,68,.12); }
    .vsm-process-box.pacemaker { border-color:var(--success); box-shadow:inset 0 0 0 2px rgba(16,185,129,.13); }
    .vsm-data-box { margin-top:8px; border:2px solid var(--navy); background:#fff; border-radius:3px; overflow:hidden; font-size:10px; color:var(--navy); }
    .vsm-data-box div { display:flex; justify-content:space-between; gap:7px; padding:3px 6px; border-bottom:1px solid #dbe3ef; }
    .vsm-data-box div:last-child { border-bottom:0; }
    .vsm-data-box span { color:var(--muted); font-weight:800; }
    .vsm-data-box b { font-weight:950; }
    .vsm-signal { position:absolute; top:-25px; left:50%; transform:translateX(-50%); border-radius:999px; padding:4px 8px; font-size:9px; text-transform:uppercase; letter-spacing:.05em; font-weight:950; white-space:nowrap; }
    .vsm-signal.push { background:#fff1f2; color:#b91c1c; border:1px solid rgba(239,68,68,.25); }
    .vsm-signal.pull { background:#ecfdf5; color:#047857; border:1px solid rgba(16,185,129,.28); }
    .vsm-signal.pacemaker { background:#eef4ff; color:var(--primary-dark); border:1px solid rgba(20,99,255,.24); }
    .vsm-inventory { width:96px; min-height:160px; display:grid; justify-items:center; align-content:start; padding-top:10px; }
    .vsm-triangle { width:0; height:0; border-left:34px solid transparent; border-right:34px solid transparent; border-bottom:56px solid var(--navy); position:relative; }
    .vsm-triangle::after { content:''; position:absolute; left:-29px; top:5px; width:0; height:0; border-left:29px solid transparent; border-right:29px solid transparent; border-bottom:47px solid #fff; }
    .vsm-inventory b { margin-top:6px; color:var(--navy); font-size:11px; text-align:center; }
    .vsm-inventory small { color:var(--muted); font-weight:800; text-align:center; line-height:1.25; }
    .vsm-supermarket { width:110px; min-height:145px; padding-top:7px; display:grid; justify-items:center; align-content:start; }
    .vsm-shelves { width:73px; height:62px; border:3px solid var(--navy); background:repeating-linear-gradient(0deg,#fff 0,#fff 17px,var(--navy) 17px,var(--navy) 20px); position:relative; }
    .vsm-shelves::after { content:''; position:absolute; left:22px; top:0; bottom:0; border-left:3px solid var(--navy); box-shadow:23px 0 0 var(--navy); }
    .vsm-supermarket b,.vsm-fifo b,.vsm-transport b { margin-top:6px; color:var(--navy); font-size:11px; text-align:center; }
    .vsm-supermarket small,.vsm-fifo small,.vsm-transport small { color:var(--muted); font-weight:800; text-align:center; line-height:1.25; }
    .vsm-fifo { width:125px; min-height:145px; padding-top:14px; display:grid; justify-items:center; align-content:start; }
    .vsm-fifo-lane { width:106px; height:36px; border-top:3px solid var(--navy); border-bottom:3px solid var(--navy); position:relative; display:grid; place-items:center; color:var(--navy); font-size:10px; font-weight:950; }
    .vsm-fifo-lane::after { content:'▶'; position:absolute; right:-8px; top:6px; font-size:17px; }
    .vsm-transport { width:118px; min-height:145px; padding-top:10px; display:grid; justify-items:center; align-content:start; }
    .vsm-truck { font-size:45px; line-height:1; filter:grayscale(1); }
    .vsm-kaizen { position:absolute; right:-16px; top:-19px; width:57px; height:57px; background:#fff7ed; border:2px solid var(--accent); clip-path:polygon(50% 0,61% 28%,86% 14%,76% 40%,100% 50%,75% 61%,88% 86%,61% 75%,50% 100%,39% 75%,14% 87%,25% 61%,0 50%,25% 39%,13% 14%,39% 28%); display:grid; place-items:center; color:#9a3412; font-size:8px; font-weight:950; text-align:center; z-index:6; }
    .vsm-timeline { min-height:112px; border-top:1px solid #cbd7e7; background:#f8fbff; padding:12px 28px 16px; }
    .vsm-timeline-title { color:var(--navy); font-size:11px; font-weight:950; text-transform:uppercase; letter-spacing:.055em; margin-bottom:8px; }
    .vsm-time-track { display:flex; align-items:stretch; gap:2px; min-height:55px; overflow-x:auto; }
    .vsm-time-segment { min-width:74px; flex:1 0 74px; border-radius:8px; padding:7px; display:grid; align-content:center; text-align:center; border:1px solid var(--border); }
    .vsm-time-segment.wait { background:#fff7ed; color:#9a3412; }
    .vsm-time-segment.va { background:#ecfdf5; color:#047857; }
    .vsm-time-segment.other { background:#eef4ff; color:var(--primary-dark); }
    .vsm-time-segment b { font-size:11px; }
    .vsm-time-segment small { font-size:9px; font-weight:800; }
    .vsm-inspector-empty { min-height:330px; display:grid; place-items:center; text-align:center; color:var(--muted); font-size:12px; line-height:1.5; font-weight:700; padding:20px; }
    .vsm-inspector .vsm-field { margin-bottom:9px; }
    .vsm-inspector-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; padding-top:11px; border-top:1px solid var(--border); }
    .vsm-inspector-actions .lean-btn { padding:8px 10px; font-size:11px; }
    .vsm-diagnostics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
    .vsm-diagnostic { border:1px solid var(--border); border-radius:15px; padding:12px; background:#f8fbff; }
    .vsm-diagnostic b { display:block; color:var(--navy); margin-bottom:5px; }
    .vsm-diagnostic p { margin:0; color:var(--muted); line-height:1.45; font-size:12px; font-weight:650; }
    .vsm-diagnostic.warn { background:#fff7ed; border-color:rgba(255,138,0,.27); }
    .vsm-diagnostic.good { background:#ecfdf5; border-color:rgba(16,185,129,.27); }
    .vsm-drop-end { flex:0 0 40px; min-height:190px; border:2px dashed transparent; border-radius:12px; }
    .vsm-drop-end.active { border-color:var(--primary); background:rgba(20,99,255,.07); }
    @media(max-width:1300px){.vsm-workspace{grid-template-columns:190px minmax(0,1fr)}.vsm-inspector{grid-column:1/-1;min-height:auto}.vsm-inspector-empty{min-height:100px}.vsm-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:980px){.vsm-top,.vsm-diagnostics{grid-template-columns:1fr}.vsm-workspace{grid-template-columns:1fr}.vsm-palette,.vsm-inspector{min-height:auto}.vsm-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.vsm-meta-grid{grid-template-columns:1fr}.vsm-field.wide{grid-column:auto}}
    @media print {
      .vsm-toolbar,.vsm-palette,.vsm-inspector,.vsm-top .vsm-panel:first-child,.vsm-actions { display:none !important; }
      .vsm-workspace { display:block !important; }
      .vsm-map-viewport { overflow:visible !important; min-height:0 !important; border:0 !important; resize:none !important; }
      .vsm-map-stage { transform:none !important; min-width:0 !important; min-height:0 !important; padding:0 !important; }
      .vsm-map { width:100% !important; min-height:0 !important; overflow:visible !important; box-shadow:none !important; }
      .vsm-panel { box-shadow:none !important; border:0 !important; padding:8px !important; }
      .vsm-panel.dark { display:block !important; background:#0f172a !important; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
      @page { size:A3 landscape; margin:8mm; }
    }

    /* Process Mapping / swimlane editor */
    .pm-tool { display: grid; gap: 18px; }
    .pm-panel { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 18px; box-shadow: 0 10px 26px rgba(15,23,42,.06); }
    .pm-panel.dark { background: linear-gradient(135deg, var(--navy), var(--surface)); color: #fff; border-color: rgba(255,255,255,.12); }
    .pm-panel h4 { margin: 0 0 8px; color: var(--navy); font-size: 19px; }
    .pm-panel.dark h4 { color: #fff; }
    .pm-muted { margin: 0; color: var(--muted); line-height: 1.5; font-weight: 600; }
    .pm-panel.dark .pm-muted, .pm-panel.dark label { color: #dbeafe; }
    .pm-top { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(360px,.65fr); gap: 16px; }
    .pm-meta-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 14px; }
    .pm-field { display: grid; gap: 6px; }
    .pm-field.wide { grid-column: 1 / -1; }
    .pm-field label { color: var(--navy); font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: .055em; }
    .pm-field input, .pm-field select, .pm-field textarea { width: 100%; border: 1px solid var(--border); border-radius: 12px; background: #f8fbff; color: var(--text); padding: 10px 11px; min-height: 42px; font: inherit; font-weight: 650; outline: none; }
    .pm-field textarea { min-height: 70px; resize: vertical; }
    .pm-field input:focus, .pm-field select:focus, .pm-field textarea:focus { border-color: rgba(20,99,255,.55); background: #fff; box-shadow: 0 0 0 4px rgba(20,99,255,.09); }
    .pm-kpis { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-top: 14px; }
    .pm-kpi { border-radius: 15px; padding: 11px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.14); min-height: 78px; }
    .pm-kpi b { display: block; color: #fff; font-size: 21px; line-height: 1.05; letter-spacing: -.03em; }
    .pm-kpi span { display: block; color: #dbeafe; margin-top: 5px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 900; }
    .pm-comparison { margin-top: 12px; padding: 12px; border-radius: 15px; background: rgba(20,99,255,.16); border: 1px solid rgba(122,167,255,.28); color: #eaf2ff; line-height: 1.45; font-weight: 700; font-size: 13px; }
    .pm-viewbar, .pm-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
    .pm-viewbar { justify-content: space-between; margin-bottom: 12px; }
    .pm-view-tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: #eef4ff; border: 1px solid rgba(20,99,255,.14); }
    .pm-view-tab { border: 0; border-radius: 999px; padding: 9px 14px; background: transparent; color: var(--primary-dark); font-weight: 950; cursor: pointer; }
    .pm-view-tab.active { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(20,99,255,.2); }
    .pm-workspace { display: grid; grid-template-columns: 205px minmax(620px,1fr) 330px; gap: 12px; align-items: start; }
    .pm-palette, .pm-inspector { border: 1px solid var(--border); border-radius: 17px; background: #f8fbff; padding: 13px; }
    .pm-palette h5, .pm-inspector h5 { margin: 0 0 9px; color: var(--navy); font-size: 14px; }
    .pm-palette-grid { display: grid; gap: 8px; }
    .pm-palette-btn { width: 100%; border: 1px solid var(--border); background: #fff; color: var(--navy); border-radius: 12px; padding: 10px; display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 850; text-align: left; }
    .pm-palette-btn:hover { border-color: rgba(20,99,255,.4); transform: translateY(-1px); }
    .pm-palette-icon { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: #eef4ff; color: var(--primary-dark); font-weight: 950; flex: 0 0 auto; }
    .pm-palette-note { margin-top: 11px; color: var(--muted); font-size: 12px; line-height: 1.45; font-weight: 650; }
    .pm-map-viewport { position: relative; overflow: auto; height: 680px; resize: vertical; min-height: 440px; max-height: 88vh; border: 1px solid var(--border); border-radius: 18px; background: #dfe7f2; box-shadow: inset 0 2px 10px rgba(15,23,42,.05); }
    .pm-map-stage { position: relative; }
    .pm-map { position: absolute; left: 0; top: 0; transform-origin: top left; background: #fff; overflow: hidden; box-shadow: 0 12px 30px rgba(15,23,42,.1); }
    .pm-map::after { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(15,23,42,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(15,23,42,.035) 1px, transparent 1px); background-size: 20px 20px; z-index: 0; }
    .pm-lane { position: absolute; left: 0; right: 0; border-bottom: 1px solid #cbd5e1; background: rgba(248,251,255,.72); z-index: 1; }
    .pm-lane:nth-child(even) { background: rgba(238,244,255,.68); }
    .pm-lane-header { position: absolute; left: 0; top: 0; bottom: 0; width: 175px; padding: 12px; border-right: 2px solid #94a3b8; background: linear-gradient(135deg,#0f172a,#1e293b); display: grid; align-content: center; gap: 8px; z-index: 3; }
    .pm-lane-header input { width: 100%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.09); color: #fff; border-radius: 10px; padding: 8px; font: inherit; font-weight: 850; }
    .pm-lane-tools { display: flex; gap: 6px; }
    .pm-mini-btn { border: 0; border-radius: 8px; padding: 5px 7px; background: rgba(255,255,255,.12); color: #fff; font-size: 11px; font-weight: 900; cursor: pointer; }
    .pm-time-axis { position: absolute; left: 175px; right: 0; top: 0; height: 28px; border-bottom: 1px solid #cbd5e1; background: rgba(255,255,255,.94); z-index: 4; display: flex; align-items: center; padding-left: 18px; color: #64748b; font-size: 11px; font-weight: 850; }
    .pm-time-axis span { margin-right: 160px; white-space: nowrap; }
    .pm-connectors { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: visible; }
    .pm-connector { fill: none; stroke: #334155; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
    .pm-step-card { position: absolute; width: 184px; min-height: 88px; border: 2px solid #94a3b8; border-radius: 15px; background: #fff; box-shadow: 0 10px 22px rgba(15,23,42,.12); z-index: 5; cursor: grab; user-select: none; transition: box-shadow .15s ease, border-color .15s ease; overflow: hidden; }
    .pm-step-card:active { cursor: grabbing; }
    .pm-step-card.selected { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(20,99,255,.13), 0 14px 28px rgba(15,23,42,.15); z-index: 8; }
    .pm-step-card.va { border-left: 7px solid #10b981; }
    .pm-step-card.bva { border-left: 7px solid #f59e0b; }
    .pm-step-card.nva { border-left: 7px solid #ef4444; }
    .pm-step-top { display: flex; gap: 8px; align-items: center; padding: 8px 9px 5px; }
    .pm-step-seq { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 950; }
    .pm-step-type { flex: 0 0 auto; font-size: 17px; }
    .pm-step-name { color: var(--navy); font-weight: 950; font-size: 13px; line-height: 1.2; word-break: break-word; }
    .pm-step-meta { display: flex; flex-wrap: wrap; gap: 5px; padding: 3px 9px 8px; }
    .pm-step-meta span { border-radius: 999px; background: #eef4ff; color: #334155; padding: 4px 7px; font-size: 9px; font-weight: 900; white-space: nowrap; }
    .pm-step-meta .va { background: #d1fae5; color: #047857; }
    .pm-step-meta .bva { background: #fef3c7; color: #92400e; }
    .pm-step-meta .nva { background: #fee2e2; color: #991b1b; }
    .pm-inspector { max-height: 680px; overflow: auto; }
    .pm-inspector-empty { min-height: 280px; display: grid; place-items: center; text-align: center; color: var(--muted); font-weight: 700; line-height: 1.5; }
    .pm-inspector-grid { display: grid; gap: 10px; }
    .pm-inspector-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
    .pm-validation { margin-top: 13px; display: grid; gap: 7px; }
    .pm-validation-item { border-radius: 12px; padding: 9px 10px; background: #f8fbff; border: 1px solid var(--border); color: #475569; font-size: 12px; line-height: 1.4; font-weight: 700; }
    .pm-validation-item.ok { background: #ecfdf5; border-color: rgba(16,185,129,.3); color: #047857; }
    .pm-validation-item.warn { background: #fff7ed; border-color: rgba(245,158,11,.3); color: #9a3412; }
    .pm-legend { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
    .pm-legend span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 6px 9px; color: #475569; font-size: 11px; font-weight: 850; background: #fff; }
    .pm-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
    .pm-dot.va { background: #10b981; } .pm-dot.bva { background: #f59e0b; } .pm-dot.nva { background: #ef4444; }
    .pm-breakdown { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
    .pm-break-card { border: 1px solid var(--border); border-radius: 16px; background: #f8fbff; padding: 13px; }
    .pm-break-card b { display: block; color: var(--navy); margin-bottom: 5px; }
    .pm-break-card p { margin: 0; color: var(--muted); font-weight: 650; font-size: 13px; line-height: 1.45; }
    @media (max-width: 1450px) { .pm-workspace { grid-template-columns: 190px minmax(580px,1fr); } .pm-inspector { grid-column: 1 / -1; max-height: none; } .pm-inspector-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } .pm-inspector-grid .pm-field.wide { grid-column: span 2; } }
    @media (max-width: 1050px) { .pm-top, .pm-workspace { grid-template-columns: 1fr; } .pm-meta-grid, .pm-inspector-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .pm-palette-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } .pm-palette-btn { justify-content: center; } .pm-map-viewport { height: 620px; } }
    @media (max-width: 680px) { .pm-meta-grid, .pm-inspector-grid, .pm-breakdown { grid-template-columns: 1fr; } .pm-palette-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .pm-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); } }
    @media print {
      @page { size: A3 landscape; margin: 8mm; }
      .pm-tool .pm-actions, .pm-tool .pm-view-tabs, .pm-palette, .pm-inspector, .pm-tool .pm-print-hide, .pm-lane-tools { display: none !important; }
      .pm-top { grid-template-columns: 1.15fr .85fr !important; }
      .pm-workspace { display: block !important; }
      .pm-map-viewport { height: auto !important; min-height: 0 !important; overflow: visible !important; resize: none !important; border: 0 !important; background: #fff !important; }
      .pm-map-stage { width: calc(var(--pm-map-width, 1800px) * var(--pm-print-scale, .65)) !important; height: calc(var(--pm-map-height, 650px) * var(--pm-print-scale, .65)) !important; }
      .pm-map { transform: scale(var(--pm-print-scale, .65)) !important; box-shadow: none !important; border: 1px solid #94a3b8 !important; }
      .pm-panel { box-shadow: none !important; break-inside: avoid; }
      .pm-lane-header input { border: 0 !important; background: transparent !important; }
      .pm-breakdown { display: none !important; }
    }


    /* SIPOC interactive editor */
    .sipoc-tool { display:grid; gap:18px; }
    .sipoc-top { display:grid; grid-template-columns:1.18fr .82fr; gap:16px; align-items:stretch; }
    .sipoc-panel { background:#fff; border:1px solid var(--border); border-radius:20px; padding:18px; box-shadow:0 10px 26px rgba(15,23,42,.06); }
    .sipoc-panel.dark { background:linear-gradient(135deg,var(--navy),var(--surface)); color:#fff; border-color:rgba(255,255,255,.12); }
    .sipoc-panel h4 { margin:0 0 8px; color:var(--navy); font-size:19px; }
    .sipoc-panel.dark h4 { color:#fff; }
    .sipoc-panel.dark .sipoc-muted,.sipoc-panel.dark p,.sipoc-panel.dark label { color:#dbeafe; }
    .sipoc-muted { margin:0 0 14px; color:var(--muted); line-height:1.5; font-weight:600; }
    .sipoc-meta-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:11px; }
    .sipoc-field { display:grid; gap:6px; }
    .sipoc-field.wide { grid-column:span 2; }
    .sipoc-field.full { grid-column:1/-1; }
    .sipoc-field label { color:var(--navy); font-size:11px; text-transform:uppercase; letter-spacing:.055em; font-weight:950; }
    .sipoc-field input,.sipoc-field select,.sipoc-field textarea { width:100%; border:1px solid var(--border); border-radius:12px; background:#f8fbff; color:var(--text); padding:10px 11px; min-height:42px; font:inherit; font-weight:650; outline:none; }
    .sipoc-field textarea { min-height:76px; resize:vertical; }
    .sipoc-field input:focus,.sipoc-field select:focus,.sipoc-field textarea:focus { background:#fff; border-color:rgba(20,99,255,.55); box-shadow:0 0 0 4px rgba(20,99,255,.09); }
    .sipoc-kpis { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin-top:12px; }
    .sipoc-kpi { border-radius:15px; padding:11px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.15); min-height:76px; }
    .sipoc-kpi b { display:block; color:#fff; font-size:21px; letter-spacing:-.025em; line-height:1.05; }
    .sipoc-kpi span { display:block; color:#dbeafe; margin-top:5px; font-size:10px; text-transform:uppercase; letter-spacing:.055em; font-weight:900; line-height:1.25; }
    .sipoc-health { margin-top:11px; border-radius:15px; padding:12px; background:rgba(20,99,255,.15); border:1px solid rgba(122,167,255,.28); color:#eaf2ff; font-weight:750; line-height:1.45; }
    .sipoc-toolbar { display:flex; justify-content:space-between; align-items:center; gap:11px; flex-wrap:wrap; margin-bottom:13px; }
    .sipoc-toolbar-title { display:flex; align-items:center; gap:10px; color:var(--navy); font-weight:950; }
    .sipoc-toolbar-title span { padding:7px 10px; border-radius:999px; background:#eef4ff; color:var(--primary-dark); font-size:11px; text-transform:uppercase; letter-spacing:.05em; }
    .sipoc-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
    .sipoc-actions .lean-btn { padding:9px 12px; font-size:12px; }
    .sipoc-workspace { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:12px; align-items:start; }
    .sipoc-board-viewport { position:relative; overflow:auto; min-height:660px; max-height:82vh; resize:vertical; border:1px solid var(--border); border-radius:18px; background:#dfe7f2; }
    .sipoc-board-stage { position:relative; transform-origin:top left; padding:18px; min-width:1510px; }
    .sipoc-board { position:relative; width:1470px; min-height:620px; border:1px solid #cbd7e7; border-radius:17px; background:#fff; overflow:hidden; box-shadow:0 12px 30px rgba(15,23,42,.09); }
    .sipoc-board::before { content:''; position:absolute; inset:0; pointer-events:none; background-image:linear-gradient(rgba(15,23,42,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(15,23,42,.025) 1px,transparent 1px); background-size:24px 24px; z-index:0; }
    .sipoc-columns { position:relative; z-index:2; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); min-height:620px; }
    .sipoc-column { min-width:0; border-right:1px solid #cbd5e1; background:rgba(248,251,255,.78); display:flex; flex-direction:column; }
    .sipoc-column:last-child { border-right:0; }
    .sipoc-column:nth-child(even) { background:rgba(238,244,255,.72); }
    .sipoc-column-head { min-height:82px; padding:12px 11px; display:flex; justify-content:space-between; align-items:center; gap:8px; color:#fff; position:sticky; top:0; z-index:5; box-shadow:0 6px 14px rgba(15,23,42,.11); }
    .sipoc-column[data-column="suppliers"] .sipoc-column-head { background:linear-gradient(135deg,#334155,#0f172a); }
    .sipoc-column[data-column="inputs"] .sipoc-column-head { background:linear-gradient(135deg,#0f5ac7,#1463ff); }
    .sipoc-column[data-column="process"] .sipoc-column-head { background:linear-gradient(135deg,#0f766e,#10b981); }
    .sipoc-column[data-column="outputs"] .sipoc-column-head { background:linear-gradient(135deg,#c66a00,#ff8a00); }
    .sipoc-column[data-column="customers"] .sipoc-column-head { background:linear-gradient(135deg,#7c3aed,#a855f7); }
    .sipoc-column-title { display:grid; gap:2px; }
    .sipoc-column-title b { font-size:19px; letter-spacing:.02em; }
    .sipoc-column-title small { color:rgba(255,255,255,.8); font-size:10px; font-weight:800; line-height:1.25; }
    .sipoc-add-btn { width:32px; height:32px; flex:0 0 auto; border-radius:10px; border:1px solid rgba(255,255,255,.28); background:rgba(255,255,255,.15); color:#fff; font-size:20px; line-height:1; font-weight:900; cursor:pointer; }
    .sipoc-add-btn:hover { background:rgba(255,255,255,.26); }
    .sipoc-card-list { display:grid; gap:12px; padding:14px 12px 70px; align-content:start; min-height:500px; position:relative; }
    .sipoc-card-list.drag-over { background:rgba(20,99,255,.08); outline:3px dashed rgba(20,99,255,.3); outline-offset:-6px; }
    .sipoc-card { position:relative; border:1px solid #d6e0ed; border-left:6px solid #94a3b8; border-radius:14px; background:#fff; box-shadow:0 8px 18px rgba(15,23,42,.09); padding:11px 10px 10px; cursor:grab; user-select:none; transition:.15s ease; z-index:3; }
    .sipoc-card:hover { transform:translateY(-1px); box-shadow:0 11px 22px rgba(15,23,42,.12); }
    .sipoc-card:active { cursor:grabbing; }
    .sipoc-card.selected { border-color:var(--primary); box-shadow:0 0 0 4px rgba(20,99,255,.13),0 13px 25px rgba(15,23,42,.14); z-index:6; }
    .sipoc-card.dragging { opacity:.4; }
    .sipoc-card.drop-before::before { content:''; position:absolute; left:-7px; right:-1px; top:-8px; height:4px; border-radius:999px; background:var(--primary); }
    .sipoc-card.critical { border-left-color:var(--danger); }
    .sipoc-card.connected { border-left-color:var(--success); }
    .sipoc-card.critical.connected { border-left-color:var(--danger); }
    .sipoc-card-top { display:flex; align-items:flex-start; gap:8px; }
    .sipoc-card-index { width:25px; height:25px; flex:0 0 auto; display:grid; place-items:center; border-radius:8px; background:#eef4ff; color:var(--primary-dark); font-size:10px; font-weight:950; }
    .sipoc-card-title { min-width:0; color:var(--navy); font-size:12px; line-height:1.3; font-weight:950; word-break:break-word; }
    .sipoc-card-detail { margin:7px 0 0 33px; color:var(--muted); font-size:10px; line-height:1.35; font-weight:650; word-break:break-word; }
    .sipoc-card-tags { display:flex; flex-wrap:wrap; gap:5px; margin:8px 0 0 33px; }
    .sipoc-card-tags span { border-radius:999px; padding:4px 7px; background:#eef4ff; color:#475569; font-size:8px; text-transform:uppercase; letter-spacing:.04em; font-weight:950; }
    .sipoc-card-tags .critical { background:#fee2e2; color:#991b1b; }
    .sipoc-card-tags .linked { background:#d1fae5; color:#047857; }
    .sipoc-card-tags .unlinked { background:#fff7ed; color:#9a3412; }
    .sipoc-connectors { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:1; overflow:visible; }
    .sipoc-link { fill:none; stroke:#64748b; stroke-width:2; opacity:.5; }
    .sipoc-link.critical { stroke:#ef4444; stroke-width:2.6; opacity:.7; }
    .sipoc-link-arrow { fill:#64748b; }
    .sipoc-inspector { border:1px solid var(--border); border-radius:17px; background:#f8fbff; padding:13px; min-height:660px; max-height:82vh; overflow:auto; position:sticky; top:10px; }
    .sipoc-inspector h5 { margin:0 0 10px; color:var(--navy); font-size:14px; }
    .sipoc-inspector-empty { min-height:430px; display:grid; place-items:center; text-align:center; color:var(--muted); line-height:1.5; font-weight:700; }
    .sipoc-inspector-actions { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:11px; }
    .sipoc-link-editor { margin-top:12px; padding-top:12px; border-top:1px solid var(--border); }
    .sipoc-link-editor h6 { margin:0 0 8px; color:var(--navy); font-size:12px; text-transform:uppercase; letter-spacing:.05em; }
    .sipoc-link-options { display:grid; gap:7px; }
    .sipoc-link-option { display:flex; gap:8px; align-items:flex-start; padding:8px; border:1px solid var(--border); border-radius:11px; background:#fff; color:#334155; font-size:11px; line-height:1.35; font-weight:750; cursor:pointer; }
    .sipoc-link-option input { margin-top:2px; }
    .sipoc-validation { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:12px; }
    .sipoc-validation-item { border:1px solid var(--border); border-radius:14px; padding:11px; background:#f8fbff; color:#475569; font-size:12px; line-height:1.4; font-weight:700; }
    .sipoc-validation-item b { display:block; color:var(--navy); margin-bottom:4px; }
    .sipoc-validation-item.ok { background:#ecfdf5; border-color:rgba(16,185,129,.3); color:#047857; }
    .sipoc-validation-item.warn { background:#fff7ed; border-color:rgba(245,158,11,.3); color:#9a3412; }
    .sipoc-validation-item.bad { background:#fff1f2; border-color:rgba(239,68,68,.25); color:#991b1b; }
    .sipoc-legend { display:flex; flex-wrap:wrap; gap:9px; margin-top:12px; }
    .sipoc-legend span { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border); border-radius:999px; background:#fff; padding:6px 9px; color:#475569; font-size:11px; font-weight:850; }
    .sipoc-legend i { width:10px; height:10px; border-radius:3px; display:inline-block; }
    .sipoc-legend .crit { background:#ef4444; } .sipoc-legend .link { background:#10b981; } .sipoc-legend .miss { background:#f59e0b; }
    @media (max-width:1350px) { .sipoc-workspace { grid-template-columns:1fr; } .sipoc-inspector { min-height:0; max-height:none; position:static; } .sipoc-inspector .sipoc-inspector-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; } .sipoc-inspector-grid .sipoc-field.full { grid-column:1/-1; } }
    @media (max-width:1050px) { .sipoc-top { grid-template-columns:1fr; } .sipoc-meta-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .sipoc-validation { grid-template-columns:repeat(2,minmax(0,1fr)); } }
    @media (max-width:650px) { .sipoc-meta-grid,.sipoc-validation,.sipoc-inspector .sipoc-inspector-grid { grid-template-columns:1fr; } .sipoc-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } }
    @media print {
      @page { size:A3 landscape; margin:8mm; }
      .sipoc-tool .sipoc-actions,.sipoc-tool .sipoc-inspector,.sipoc-tool .sipoc-print-hide,.sipoc-add-btn { display:none !important; }
      .sipoc-top { grid-template-columns:1.2fr .8fr !important; }
      .sipoc-workspace { display:block !important; }
      .sipoc-board-viewport { height:auto !important; min-height:0 !important; max-height:none !important; overflow:visible !important; resize:none !important; border:0 !important; background:#fff !important; }
      .sipoc-board-stage { width:1470px !important; padding:0 !important; transform:scale(.68) !important; transform-origin:top left !important; height:430px !important; }
      .sipoc-board { box-shadow:none !important; }
      .sipoc-panel { box-shadow:none !important; break-inside:avoid; }
      .sipoc-column-head { position:static !important; }
      .sipoc-card { box-shadow:none !important; }
    }



    /* Yamazumi Chart / line balancing editor */
    .yam-tool { display:grid; gap:18px; }
    .yam-panel { background:#fff; border:1px solid var(--border); border-radius:20px; padding:18px; box-shadow:0 10px 26px rgba(15,23,42,.06); }
    .yam-panel.dark { background:linear-gradient(135deg,var(--navy),var(--surface)); color:#fff; border-color:rgba(255,255,255,.12); }
    .yam-panel h4 { margin:0 0 8px; color:var(--navy); font-size:19px; }
    .yam-panel.dark h4 { color:#fff; }
    .yam-muted { margin:0 0 14px; color:var(--muted); line-height:1.5; font-weight:600; }
    .yam-panel.dark .yam-muted, .yam-panel.dark label { color:#dbeafe; }
    .yam-top { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(330px,.85fr); gap:16px; align-items:stretch; }
    .yam-fields { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
    .yam-field { display:grid; gap:6px; min-width:0; }
    .yam-field.wide { grid-column:span 2; }
    .yam-field label { color:var(--navy); font-size:11px; font-weight:950; text-transform:uppercase; letter-spacing:.055em; }
    .yam-field input,.yam-field select,.yam-field textarea { width:100%; min-height:42px; border:1px solid var(--border); border-radius:12px; background:#f8fbff; color:var(--text); padding:9px 10px; font:inherit; font-weight:700; outline:none; }
    .yam-field textarea { min-height:72px; resize:vertical; }
    .yam-field input:focus,.yam-field select:focus,.yam-field textarea:focus { background:#fff; border-color:rgba(20,99,255,.55); box-shadow:0 0 0 4px rgba(20,99,255,.09); }
    .yam-actions { display:flex; flex-wrap:wrap; gap:9px; align-items:center; margin-top:13px; }
    .yam-actions .lean-btn { padding:10px 13px; }
    .yam-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
    .yam-tab { border:1px solid rgba(20,99,255,.18); background:#eef4ff; color:var(--primary-dark); border-radius:999px; padding:9px 13px; font-weight:950; cursor:pointer; }
    .yam-tab.active { background:var(--primary); color:#fff; box-shadow:0 8px 18px rgba(20,99,255,.22); }
    .yam-kpis { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
    .yam-kpi { border:1px solid rgba(255,255,255,.15); background:rgba(255,255,255,.10); border-radius:15px; padding:11px; min-width:0; }
    .yam-kpi b { display:block; color:#fff; font-size:22px; line-height:1.05; letter-spacing:-.03em; overflow:hidden; text-overflow:ellipsis; }
    .yam-kpi span { display:block; color:#dbeafe; margin-top:5px; font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.05em; }
    .yam-summary-note { margin-top:12px; border:1px solid rgba(255,138,0,.28); background:rgba(255,138,0,.13); color:#fff7ed; border-radius:15px; padding:12px; line-height:1.45; font-weight:750; }
    .yam-workspace { display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:14px; align-items:start; }
    .yam-chart-shell { min-width:0; border:1px solid var(--border); border-radius:20px; overflow:auto; background:#f8fbff; min-height:620px; position:relative; }
    .yam-chart-toolbar { position:sticky; left:0; top:0; z-index:9; display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px; padding:12px 14px; background:rgba(255,255,255,.96); border-bottom:1px solid var(--border); backdrop-filter:blur(10px); }
    .yam-chart-toolbar strong { color:var(--navy); }
    .yam-legend { display:flex; flex-wrap:wrap; gap:8px; font-size:11px; font-weight:850; color:var(--muted); }
    .yam-legend span { display:inline-flex; align-items:center; gap:5px; }
    .yam-legend i { width:10px; height:10px; border-radius:3px; display:inline-block; }
    .yam-legend .va { background:#10b981; }.yam-legend .bva { background:#1463ff; }.yam-legend .nva { background:#ef4444; }.yam-legend .takt { background:#ff8a00; }
    .yam-chart { --yam-scale:5; position:relative; min-width:920px; padding:28px 24px 24px 76px; display:flex; gap:18px; align-items:flex-end; min-height:570px; }
    .yam-axis { position:absolute; left:0; top:28px; bottom:68px; width:68px; border-right:1px solid #94a3b8; pointer-events:none; }
    .yam-axis-mark { position:absolute; right:7px; transform:translateY(50%); color:#64748b; font-size:10px; font-weight:850; }
    .yam-grid-line { position:absolute; left:68px; right:18px; border-top:1px dashed rgba(100,116,139,.25); pointer-events:none; z-index:0; }
    .yam-takt-line { position:absolute; left:68px; right:18px; border-top:3px solid var(--accent); z-index:5; pointer-events:none; }
    .yam-takt-label { position:absolute; right:18px; transform:translateY(-100%); background:var(--accent); color:#fff; border-radius:999px; padding:4px 8px; font-size:10px; font-weight:950; z-index:6; }
    .yam-station { width:150px; flex:0 0 150px; position:relative; z-index:2; display:grid; grid-template-rows:auto 1fr auto; align-self:stretch; }
    .yam-station-head { display:flex; justify-content:space-between; align-items:center; gap:7px; margin-bottom:8px; min-height:42px; }
    .yam-station-head button { border:0; background:#eef4ff; color:var(--primary-dark); border-radius:9px; padding:6px 7px; cursor:pointer; font-weight:950; }
    .yam-station-title { min-width:0; }
    .yam-station-title b { display:block; color:var(--navy); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .yam-station-title small { color:var(--muted); font-weight:800; }
    .yam-stack-zone { display:flex; flex-direction:column-reverse; justify-content:flex-start; min-height:440px; border:2px dashed #cbd5e1; border-radius:16px 16px 7px 7px; background:rgba(255,255,255,.78); padding:6px; transition:.15s ease; }
    .yam-stack-zone.dragover { border-color:var(--primary); background:#eef4ff; box-shadow:inset 0 0 0 3px rgba(20,99,255,.08); }
    .yam-task-block { position:relative; min-height:28px; border-radius:9px; padding:6px 7px; display:flex; flex-direction:column; justify-content:center; cursor:grab; user-select:none; color:#fff; box-shadow:inset 0 -1px 0 rgba(0,0,0,.08); overflow:hidden; border:2px solid transparent; }
    .yam-task-block:active { cursor:grabbing; }
    .yam-task-block.va { background:#10b981; }.yam-task-block.bva { background:#1463ff; }.yam-task-block.nva { background:#ef4444; }
    .yam-task-block.selected { border-color:#0f172a; box-shadow:0 0 0 3px rgba(15,23,42,.16); }
    .yam-task-block.locked::after { content:'🔒'; position:absolute; right:4px; top:3px; font-size:10px; }
    .yam-task-block b { font-size:11px; line-height:1.15; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding-right:13px; }
    .yam-task-block small { font-size:9px; font-weight:900; opacity:.92; }
    .yam-station-foot { margin-top:8px; border-radius:12px; padding:8px; text-align:center; background:#ecfdf5; border:1px solid rgba(16,185,129,.25); }
    .yam-station.over .yam-station-foot { background:#fff1f2; border-color:rgba(239,68,68,.3); color:#b91c1c; }
    .yam-station-foot b { display:block; font-size:15px; color:var(--navy); }.yam-station.over .yam-station-foot b { color:#b91c1c; }
    .yam-station-foot small { display:block; font-size:10px; font-weight:900; color:var(--muted); }
    .yam-inspector { position:sticky; top:10px; display:grid; gap:12px; }
    .yam-inspector-empty { border:2px dashed #cbd5e1; border-radius:16px; padding:22px; color:var(--muted); text-align:center; line-height:1.5; font-weight:700; }
    .yam-table-wrap { overflow:auto; border:1px solid var(--border); border-radius:17px; margin-top:12px; }
    .yam-table { width:100%; border-collapse:collapse; min-width:980px; font-size:12px; }
    .yam-table th,.yam-table td { padding:9px; border-bottom:1px solid var(--border); text-align:left; vertical-align:middle; }
    .yam-table th { background:#eef4ff; color:var(--navy); text-transform:uppercase; font-size:10px; letter-spacing:.05em; white-space:nowrap; }
    .yam-chip { display:inline-flex; border-radius:999px; padding:4px 7px; font-size:10px; font-weight:950; color:#fff; }.yam-chip.va{background:#10b981}.yam-chip.bva{background:#1463ff}.yam-chip.nva{background:#ef4444}
    .yam-compare { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:12px; }
    .yam-compare-card { border:1px solid var(--border); border-radius:15px; padding:12px; background:#f8fbff; }
    .yam-compare-card b { display:block; color:var(--navy); font-size:20px; }.yam-compare-card span{color:var(--muted);font-size:11px;font-weight:850;}
    .yam-validation { display:grid; gap:8px; margin-top:12px; }
    .yam-check { display:flex; gap:9px; align-items:flex-start; border-radius:13px; padding:10px 11px; border:1px solid var(--border); background:#f8fbff; color:var(--navy); font-size:12px; font-weight:750; line-height:1.4; }
    .yam-check.ok { background:#ecfdf5; border-color:rgba(16,185,129,.28); }.yam-check.warn { background:#fff7ed; border-color:rgba(255,138,0,.28); }.yam-check.bad { background:#fff1f2; border-color:rgba(239,68,68,.28); }
    .yam-check b { flex:0 0 auto; }
    @media(max-width:1180px){.yam-top,.yam-workspace{grid-template-columns:1fr}.yam-inspector{position:static}.yam-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.yam-compare{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:700px){.yam-fields,.yam-kpis,.yam-compare{grid-template-columns:1fr}.yam-field.wide{grid-column:auto}.yam-chart{padding-left:58px}.yam-axis{width:51px}.yam-grid-line,.yam-takt-line{left:51px}}
    @media print {
      #yamazumi-chart .method-hero,.yam-top .yam-panel:first-child,.yam-chart-toolbar,.yam-inspector,.yam-actions,.yam-table-wrap,.yam-validation-panel { display:none!important; }
      #yamazumi-chart .tool-body { padding:0!important; }
      .yam-top { display:block!important; }.yam-top .yam-panel.dark { display:block!important; margin-bottom:10px; }
      .yam-workspace { display:block!important; }.yam-chart-shell { overflow:visible!important; min-height:0!important; border:0!important; }
      .yam-chart { min-width:0!important; width:100%!important; min-height:520px!important; }
      .yam-station { min-width:0!important; flex:1 1 0!important; }
      .yam-panel { box-shadow:none!important; break-inside:avoid; }
    }

  

    /* Line Balancing editor */
    .lb-tool{display:grid;gap:18px}.lb-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06)}
    .lb-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .lb-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}.lb-panel.dark h4{color:#fff}.lb-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}.lb-panel.dark .lb-muted,.lb-panel.dark label{color:#dbeafe}
    .lb-top{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(340px,.82fr);gap:16px;align-items:stretch}.lb-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.lb-tab{border:1px solid var(--border);background:#f8fbff;color:var(--navy);border-radius:999px;padding:9px 13px;font-weight:900;cursor:pointer}.lb-tab.active{background:var(--primary);border-color:var(--primary);color:#fff;box-shadow:0 8px 18px rgba(20,99,255,.20)}
    .lb-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.lb-field{display:grid;gap:6px;min-width:0}.lb-field.wide{grid-column:span 2}.lb-field label{color:var(--navy);font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.055em}.lb-field input,.lb-field select,.lb-field textarea{width:100%;min-height:42px;border:1px solid var(--border);border-radius:12px;background:#f8fbff;color:var(--text);padding:9px 10px;font:inherit;font-weight:650;outline:none}.lb-field textarea{min-height:74px;resize:vertical}.lb-field input:focus,.lb-field select:focus,.lb-field textarea:focus{border-color:rgba(20,99,255,.55);background:#fff;box-shadow:0 0 0 3px rgba(20,99,255,.10)}
    .lb-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.lb-actions .lean-btn{padding:9px 12px;font-size:13px}.lb-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}.lb-kpi{border-radius:15px;padding:12px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.15)}.lb-kpi b{display:block;color:#fff;font-size:23px;line-height:1.05}.lb-kpi span{display:block;margin-top:5px;color:#dbeafe;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.045em}.lb-summary-note{margin-top:12px;padding:12px;border-radius:14px;background:rgba(20,99,255,.18);border:1px solid rgba(122,167,255,.28);color:#eff6ff;font-weight:700;line-height:1.45}
    .lb-compare{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-top:14px}.lb-compare-item{border:1px solid var(--border);background:#f8fbff;border-radius:15px;padding:12px}.lb-compare-item small{display:block;color:var(--muted);font-weight:850;text-transform:uppercase;letter-spacing:.04em}.lb-compare-item b{display:block;color:var(--navy);font-size:19px;margin-top:5px}.lb-compare-item em{display:block;font-style:normal;font-size:12px;font-weight:850;margin-top:4px}.lb-good{color:#047857!important}.lb-warn{color:#b45309!important}.lb-bad{color:#b91c1c!important}
    .lb-workspace{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px;align-items:start}.lb-main{display:grid;gap:14px;min-width:0}.lb-inspector{position:sticky;top:16px}.lb-inspector-empty{min-height:220px;display:grid;place-items:center;text-align:center;color:var(--muted);font-weight:700;border:2px dashed var(--border);border-radius:16px;padding:18px}.lb-pred-list{display:grid;gap:7px;max-height:210px;overflow:auto;border:1px solid var(--border);background:#f8fbff;border-radius:12px;padding:9px}.lb-pred-item{display:flex;align-items:flex-start;gap:8px;color:var(--navy);font-size:12px;font-weight:750}.lb-pred-item input{width:auto;min-height:0;margin-top:2px}
    .lb-board-shell{overflow:auto;border:1px solid var(--border);border-radius:18px;background:#edf3fa;min-height:520px}.lb-board-toolbar{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;align-items:center;padding:12px 14px;background:#fff;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:5}.lb-board-toolbar strong{color:var(--navy)}.lb-legend{display:flex;flex-wrap:wrap;gap:8px}.lb-legend span{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:11px;font-weight:800}.lb-dot{width:10px;height:10px;border-radius:3px;background:#1463ff}.lb-dot.auto{background:#8b5cf6}.lb-dot.walk{background:#f59e0b}.lb-dot.inspect{background:#10b981}.lb-dot.wait{background:#ef4444}
    .lb-board{display:flex;gap:14px;align-items:stretch;min-width:max-content;padding:18px;min-height:465px}.lb-station{width:255px;min-width:255px;background:#fff;border:1px solid #cbd8e8;border-radius:18px;display:flex;flex-direction:column;box-shadow:0 10px 24px rgba(15,23,42,.07);overflow:hidden}.lb-station.over{border-color:#ef4444;box-shadow:0 0 0 3px rgba(239,68,68,.12),0 10px 24px rgba(15,23,42,.07)}.lb-station-head{padding:12px;background:linear-gradient(135deg,#eef4ff,#fff);border-bottom:1px solid var(--border)}.lb-station-head-row{display:flex;justify-content:space-between;gap:8px;align-items:center}.lb-station-name{border:0;background:transparent;font:inherit;font-weight:950;color:var(--navy);width:150px;padding:0}.lb-station-time{font-size:17px;font-weight:950;color:var(--navy)}.lb-station.over .lb-station-time{color:#b91c1c}.lb-loadbar{height:9px;background:#dbe6f3;border-radius:999px;overflow:hidden;margin-top:8px}.lb-loadbar span{display:block;height:100%;width:var(--load,0%);background:linear-gradient(90deg,#1463ff,#7aa7ff);border-radius:inherit}.lb-station.over .lb-loadbar span{background:linear-gradient(90deg,#ef4444,#fb7185)}.lb-station-meta{display:flex;justify-content:space-between;gap:6px;margin-top:7px;color:var(--muted);font-size:11px;font-weight:800}.lb-station-body{display:grid;align-content:start;gap:8px;padding:10px;min-height:305px;flex:1}.lb-station-body.drag-over{background:#eef4ff;box-shadow:inset 0 0 0 2px rgba(20,99,255,.30)}.lb-station-foot{padding:9px 11px;border-top:1px solid var(--border);background:#f8fbff;color:var(--muted);font-size:11px;font-weight:800;text-align:center}
    .lb-task{border:1px solid var(--border);border-left:5px solid #1463ff;background:#fff;border-radius:13px;padding:9px;cursor:grab;box-shadow:0 5px 12px rgba(15,23,42,.055);user-select:none}.lb-task[data-category="automatic"]{border-left-color:#8b5cf6}.lb-task[data-category="walking"]{border-left-color:#f59e0b}.lb-task[data-category="inspection"]{border-left-color:#10b981}.lb-task[data-category="waiting"]{border-left-color:#ef4444}.lb-task.selected{box-shadow:0 0 0 3px rgba(20,99,255,.18)}.lb-task.dragging{opacity:.45}.lb-task-top{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}.lb-task-name{color:var(--navy);font-size:12px;font-weight:900;line-height:1.3}.lb-task-time{color:var(--navy);font-size:13px;font-weight:950;white-space:nowrap}.lb-task-code{display:inline-block;margin-top:5px;padding:3px 6px;border-radius:7px;background:#eef4ff;color:#0f3fb3;font-size:10px;font-weight:950}.lb-task-preds{margin-top:5px;color:var(--muted);font-size:10px;font-weight:750;line-height:1.3}.lb-lock{color:#b45309;font-size:11px}
    .lb-graph-shell{overflow:auto;border:1px solid var(--border);border-radius:18px;background:linear-gradient(180deg,#fff,#f8fbff)}.lb-graph-head{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--border)}.lb-graph-head h5{margin:0;color:var(--navy);font-size:15px}.lb-graph{min-width:900px;min-height:340px;display:block}.lb-graph-node{cursor:pointer}.lb-graph-node rect{fill:#fff;stroke:#9db5d0;stroke-width:1.5}.lb-graph-node.selected rect{stroke:#1463ff;stroke-width:3}.lb-graph-node.invalid rect{stroke:#ef4444;stroke-width:2.5}.lb-graph-node text{font-family:Inter,Arial,sans-serif;fill:#0f172a;font-size:11px;font-weight:800}.lb-graph-edge{stroke:#7c93ad;stroke-width:1.8;fill:none}.lb-graph-edge.invalid{stroke:#ef4444;stroke-width:2.5}
    .lb-table-wrap{overflow:auto;border:1px solid var(--border);border-radius:18px}.lb-table{width:100%;border-collapse:collapse;min-width:1060px;font-size:12px}.lb-table th,.lb-table td{padding:9px;border-bottom:1px solid var(--border);text-align:left;vertical-align:top}.lb-table th{background:#eef4ff;color:var(--navy);font-size:11px;text-transform:uppercase;letter-spacing:.045em;font-weight:950;white-space:nowrap}.lb-table tr[data-lb-row]{cursor:pointer}.lb-table tr[data-lb-row]:hover{background:#f8fbff}.lb-table tr.selected{background:#eef4ff}.lb-chip{display:inline-flex;align-items:center;border-radius:999px;padding:4px 7px;font-size:10px;font-weight:900;background:#eef4ff;color:#0f3fb3;margin:1px}.lb-validation{display:grid;gap:8px}.lb-check{display:flex;gap:9px;align-items:flex-start;padding:10px 12px;border-radius:13px;background:#f8fbff;border:1px solid var(--border);font-size:12px;font-weight:750;line-height:1.4;color:var(--navy)}.lb-check b{width:22px;height:22px;display:grid;place-items:center;flex:0 0 auto;border-radius:50%;background:#ecfdf5;color:#047857}.lb-check.warn b{background:#fff7ed;color:#b45309}.lb-check.bad b{background:#fff1f2;color:#b91c1c}
    .lb-hidden{display:none!important}
    @media(max-width:1180px){.lb-top,.lb-workspace{grid-template-columns:1fr}.lb-inspector{position:static}.lb-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.lb-compare{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:700px){.lb-fields,.lb-kpis,.lb-compare{grid-template-columns:1fr}.lb-field.wide{grid-column:auto}.lb-station{width:220px;min-width:220px}}
    @media print{
      #line-balancing .method-hero,.lb-top .lb-panel:first-child,.lb-actions,.lb-inspector,.lb-table-wrap,.lb-validation-panel,.lb-board-toolbar .lb-actions{display:none!important}
      #line-balancing .tool-body{padding:0!important}.lb-top{display:block!important}.lb-top .lb-panel.dark{display:block!important;margin-bottom:10px}.lb-workspace{display:block!important}.lb-board-shell,.lb-graph-shell{overflow:visible!important;border:0!important}.lb-board{min-width:0!important;width:100%!important;gap:7px;padding:8px}.lb-station{min-width:0!important;width:auto!important;flex:1 1 0!important;box-shadow:none!important}.lb-panel{box-shadow:none!important;break-inside:avoid}.lb-graph{min-width:0!important;width:100%!important}.lb-task{padding:6px;font-size:9px}.lb-task-name{font-size:9px}.lb-task-time{font-size:10px}
    }



    /* Poka-Yoke design and validation tool */
    .py-tool{display:grid;gap:18px}.py-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06)}
    .py-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}.py-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}.py-panel.dark h4{color:#fff}.py-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}.py-panel.dark .py-muted,.py-panel.dark label{color:#dbeafe}
    .py-top{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(340px,.82fr);gap:16px;align-items:stretch}.py-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.py-field{display:grid;gap:6px;min-width:0}.py-field.wide{grid-column:span 2}.py-field.full{grid-column:1/-1}.py-field label{color:var(--navy);font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.055em}.py-field input,.py-field select,.py-field textarea{width:100%;min-height:42px;border:1px solid var(--border);border-radius:12px;background:#f8fbff;color:var(--text);padding:9px 10px;font:inherit;font-weight:650;outline:none}.py-field textarea{min-height:74px;resize:vertical}.py-field input:focus,.py-field select:focus,.py-field textarea:focus{border-color:rgba(20,99,255,.55);background:#fff;box-shadow:0 0 0 3px rgba(20,99,255,.10)}
    .py-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.py-actions .lean-btn{padding:9px 12px;font-size:13px}.py-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}.py-kpi{border-radius:15px;padding:12px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.15)}.py-kpi b{display:block;color:#fff;font-size:23px;line-height:1.05}.py-kpi span{display:block;margin-top:5px;color:#dbeafe;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.045em}.py-summary-note{margin-top:12px;padding:12px;border-radius:14px;background:rgba(20,99,255,.18);border:1px solid rgba(122,167,255,.28);color:#eff6ff;font-weight:700;line-height:1.45}
    .py-path{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr));gap:26px;align-items:stretch;margin-top:14px;overflow:auto;padding:4px 2px 12px}.py-path-step{position:relative;border:1px solid var(--border);border-radius:16px;background:#f8fbff;padding:13px;min-height:114px}.py-path-step:not(:last-child)::after{content:'→';position:absolute;right:-22px;top:50%;transform:translateY(-50%);font-size:25px;font-weight:950;color:#7c93ad}.py-path-step b{display:block;color:var(--navy);font-size:12px;text-transform:uppercase;letter-spacing:.045em;margin-bottom:6px}.py-path-step span{display:block;color:var(--muted);font-size:12px;line-height:1.4;font-weight:700}.py-path-step.control{background:#eef4ff;border-color:rgba(20,99,255,.32);box-shadow:0 8px 20px rgba(20,99,255,.10)}.py-path-step.stop{background:#ecfdf5;border-color:rgba(16,185,129,.35)}.py-path-step.escape{background:#fff1f2;border-color:rgba(239,68,68,.30)}
    .py-mode-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}.py-mode{border:1px solid var(--border);border-radius:16px;background:#f8fbff;padding:13px;cursor:pointer;text-align:left;transition:.15s ease}.py-mode:hover{transform:translateY(-1px);border-color:rgba(20,99,255,.35)}.py-mode.active{background:linear-gradient(135deg,#eef4ff,#fff);border-color:var(--primary);box-shadow:0 0 0 3px rgba(20,99,255,.10)}.py-mode strong{display:block;color:var(--navy);font-size:13px}.py-mode span{display:block;color:var(--muted);font-size:11px;font-weight:700;line-height:1.35;margin-top:5px}.py-mode .py-rank{width:28px;height:28px;display:grid;place-items:center;border-radius:9px;background:var(--navy);color:#fff;font-weight:950;margin-bottom:8px}
    .py-library{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}.py-lib-card{border:1px solid var(--border);border-radius:15px;background:#fff;padding:12px;cursor:pointer;transition:.15s}.py-lib-card:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(15,23,42,.07)}.py-lib-card.active{border-color:var(--primary);background:#eef4ff}.py-lib-card b{display:block;color:var(--navy);font-size:12px}.py-lib-card span{display:block;color:var(--muted);font-size:11px;font-weight:700;line-height:1.35;margin-top:5px}
    .py-design-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:16px}.py-checks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:10px}.py-check{display:flex;align-items:flex-start;gap:8px;border:1px solid var(--border);border-radius:13px;background:#f8fbff;padding:10px;color:var(--navy);font-size:12px;font-weight:750;line-height:1.35}.py-check input{margin-top:2px;accent-color:var(--primary)}
    .py-risk-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.py-risk-card{border:1px solid var(--border);border-radius:17px;padding:14px;background:#f8fbff}.py-risk-card.after{background:#ecfdf5;border-color:rgba(16,185,129,.30)}.py-risk-card h5{margin:0 0 10px;color:var(--navy);font-size:14px}.py-risk-row{display:grid;grid-template-columns:1fr 90px;gap:8px;align-items:center;margin-top:8px;color:var(--navy);font-size:12px;font-weight:800}.py-risk-row input{width:100%;border:1px solid var(--border);border-radius:10px;padding:8px;background:#fff;font:inherit;font-weight:800}.py-risk-score{margin-top:12px;border-radius:14px;background:var(--navy);color:#fff;padding:12px;display:flex;justify-content:space-between;align-items:center;gap:10px}.py-risk-score b{font-size:22px}.py-risk-score span{font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.04em;color:#dbeafe}
    .py-sim-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px}.py-sim{border:1px solid var(--border);border-radius:16px;background:#f8fbff;padding:13px;cursor:pointer;text-align:left}.py-sim:hover{border-color:rgba(20,99,255,.35)}.py-sim b{display:block;color:var(--navy);font-size:12px}.py-sim span{display:block;color:var(--muted);font-size:11px;font-weight:700;margin-top:4px;line-height:1.35}.py-sim-result{margin-top:9px;padding:8px 9px;border-radius:10px;background:#eef4ff;color:#0f3fb3;font-size:11px;font-weight:900}.py-sim-result.good{background:#ecfdf5;color:#047857}.py-sim-result.warn{background:#fff7ed;color:#b45309}.py-sim-result.bad{background:#fff1f2;color:#b91c1c}
    .py-table-wrap{overflow:auto;border:1px solid var(--border);border-radius:18px;margin-top:12px}.py-table{width:100%;border-collapse:collapse;min-width:1050px;font-size:12px}.py-table th,.py-table td{padding:9px;border-bottom:1px solid var(--border);text-align:left;vertical-align:top}.py-table th{background:#eef4ff;color:var(--navy);font-size:11px;text-transform:uppercase;letter-spacing:.045em;font-weight:950;white-space:nowrap}.py-table input,.py-table select,.py-table textarea{width:100%;border:1px solid var(--border);border-radius:9px;background:#f8fbff;padding:7px 8px;font:inherit;font-weight:650}.py-table textarea{min-height:48px;resize:vertical}.py-status{display:inline-flex;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:950}.py-status.pass{background:#ecfdf5;color:#047857}.py-status.fail{background:#fff1f2;color:#b91c1c}.py-status.open{background:#fff7ed;color:#b45309}.py-status.na{background:#eef4ff;color:#0f3fb3}
    .py-validation{display:grid;gap:8px}.py-validation-item{display:flex;gap:9px;align-items:flex-start;padding:10px 12px;border-radius:13px;background:#f8fbff;border:1px solid var(--border);font-size:12px;font-weight:750;line-height:1.4;color:var(--navy)}.py-validation-item b{width:22px;height:22px;display:grid;place-items:center;flex:0 0 auto;border-radius:50%;background:#ecfdf5;color:#047857}.py-validation-item.warn b{background:#fff7ed;color:#b45309}.py-validation-item.bad b{background:#fff1f2;color:#b91c1c}.py-maturity{height:12px;border-radius:999px;background:#dbe6f3;overflow:hidden;margin-top:10px}.py-maturity span{display:block;height:100%;width:var(--py-score,0%);background:linear-gradient(90deg,#ef4444,#f59e0b,#10b981);border-radius:inherit;transition:width .2s ease}
    @media(max-width:1180px){.py-top,.py-design-grid{grid-template-columns:1fr}.py-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.py-mode-grid,.py-library{grid-template-columns:repeat(2,minmax(0,1fr))}.py-path{grid-template-columns:repeat(5,180px)}}
    @media(max-width:700px){.py-fields,.py-mode-grid,.py-library,.py-risk-grid,.py-sim-grid,.py-checks,.py-kpis{grid-template-columns:1fr}.py-field.wide{grid-column:auto}.py-field.full{grid-column:auto}}
    @media print{
      #poka-yoke .method-hero,.py-actions,.py-library,.py-table button,.py-import-control{display:none!important}
      #poka-yoke .tool-body{padding:0!important}.py-panel{box-shadow:none!important;break-inside:avoid}.py-top,.py-design-grid{grid-template-columns:1fr 1fr!important}.py-path{grid-template-columns:repeat(5,1fr)!important;overflow:visible}.py-mode-grid{grid-template-columns:repeat(4,1fr)!important}.py-table-wrap{overflow:visible}.py-table{min-width:0;font-size:9px}.py-table th,.py-table td{padding:5px}.py-field input,.py-field select,.py-field textarea,.py-table input,.py-table select,.py-table textarea{border:0!important;background:transparent!important;padding:0!important}.py-sim-grid{grid-template-columns:repeat(3,1fr)!important}
    }



    /* Process FMEA interactive tool */
    .fmea-tool{display:grid;gap:18px}.fmea-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06)}
    .fmea-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}.fmea-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}.fmea-panel.dark h4{color:#fff}.fmea-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}.fmea-panel.dark .fmea-muted,.fmea-panel.dark label{color:#dbeafe}
    .fmea-top{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(350px,.65fr);gap:16px;align-items:stretch}.fmea-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.fmea-field{display:grid;gap:6px;min-width:0}.fmea-field.wide{grid-column:span 2}.fmea-field.full{grid-column:1/-1}.fmea-field label{color:var(--navy);font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.055em}.fmea-field input,.fmea-field select,.fmea-field textarea{width:100%;min-height:42px;border:1px solid var(--border);border-radius:12px;background:#f8fbff;color:var(--text);padding:9px 10px;font:inherit;font-weight:650;outline:none}.fmea-field textarea{min-height:72px;resize:vertical}.fmea-field input:focus,.fmea-field select:focus,.fmea-field textarea:focus{border-color:rgba(20,99,255,.55);background:#fff;box-shadow:0 0 0 3px rgba(20,99,255,.10)}
    .fmea-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.fmea-actions .lean-btn{padding:9px 12px;font-size:13px}.fmea-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}.fmea-kpi{border-radius:15px;padding:12px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.15)}.fmea-kpi b{display:block;color:#fff;font-size:23px;line-height:1.05}.fmea-kpi span{display:block;margin-top:5px;color:#dbeafe;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.045em}.fmea-summary-note{margin-top:12px;padding:12px;border-radius:14px;background:rgba(20,99,255,.18);border:1px solid rgba(122,167,255,.28);color:#eff6ff;font-weight:700;line-height:1.45}
    .fmea-toolbar{display:flex;flex-wrap:wrap;gap:9px;align-items:center;margin:12px 0}.fmea-toolbar input,.fmea-toolbar select{min-height:39px;border:1px solid var(--border);border-radius:11px;background:#f8fbff;padding:8px 10px;font:inherit;font-size:12px;font-weight:700;color:var(--navy)}.fmea-toolbar input{min-width:230px;flex:1}.fmea-view-toggle{display:inline-flex;border:1px solid var(--border);border-radius:12px;overflow:hidden;background:#f8fbff}.fmea-view-toggle button{border:0;background:transparent;padding:9px 11px;color:var(--navy);font-weight:850;cursor:pointer}.fmea-view-toggle button.active{background:var(--navy);color:#fff}
    .fmea-tool,.fmea-top,.fmea-risk-grid,.fmea-panel,#fmeaTablePanel{min-width:0;max-width:100%}
    #fmeaTablePanel{overflow:hidden}
    .fmea-scroll-help{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0 6px;color:var(--muted);font-size:11px;font-weight:750}
    .fmea-scroll-help strong{color:var(--primary-dark)}
    .fmea-top-scroll{width:100%;max-width:100%;height:19px;overflow-x:scroll;overflow-y:hidden;border:1px solid var(--border);border-radius:10px 10px 0 0;background:#f8fbff;scrollbar-gutter:stable}
    .fmea-top-scroll>div{height:1px;width:2600px}
    .fmea-table-wrap{width:100%;max-width:100%;min-width:0;overflow-x:scroll;overflow-y:auto;border:1px solid var(--border);border-top:0;border-radius:0 0 18px 18px;background:#fff;max-height:720px;scrollbar-gutter:stable both-edges;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
    .fmea-top-scroll::-webkit-scrollbar,.fmea-table-wrap::-webkit-scrollbar{height:14px;width:12px}
    .fmea-top-scroll::-webkit-scrollbar-track,.fmea-table-wrap::-webkit-scrollbar-track{background:#e8eef7;border-radius:999px}
    .fmea-top-scroll::-webkit-scrollbar-thumb,.fmea-table-wrap::-webkit-scrollbar-thumb{background:#64748b;border:3px solid #e8eef7;border-radius:999px}
    .fmea-top-scroll::-webkit-scrollbar-thumb:hover,.fmea-table-wrap::-webkit-scrollbar-thumb:hover{background:#334155}
    .fmea-table{width:2600px;max-width:none;border-collapse:separate;border-spacing:0;min-width:2600px;font-size:11px}.fmea-table th,.fmea-table td{padding:7px;border-right:1px solid #e4ebf4;border-bottom:1px solid #e4ebf4;text-align:left;vertical-align:top}.fmea-table th{position:sticky;top:0;z-index:4;background:#dfeaff;color:var(--navy);font-size:10px;text-transform:uppercase;letter-spacing:.035em;font-weight:950;white-space:nowrap}.fmea-table thead tr:first-child th{background:var(--navy);color:#fff;text-align:center;top:0}.fmea-table thead tr:nth-child(2) th{top:31px}.fmea-table td:first-child,.fmea-table th:first-child{position:sticky;left:0;z-index:3;background:#fff}.fmea-table th:first-child{background:var(--navy);color:#fff;z-index:6}.fmea-table thead tr:nth-child(2) th:first-child{background:#dfeaff;color:var(--navy)}.fmea-table tbody tr:hover td{background:#f8fbff}.fmea-table tbody tr:hover td:first-child{background:#eef4ff}.fmea-table input,.fmea-table select,.fmea-table textarea{width:100%;border:1px solid #dbe3ef;border-radius:8px;background:#f8fbff;padding:6px 7px;font:inherit;font-weight:650;color:var(--text);outline:none}.fmea-table textarea{min-height:58px;resize:vertical}.fmea-table input:focus,.fmea-table select:focus,.fmea-table textarea:focus{border-color:var(--primary);background:#fff;box-shadow:0 0 0 2px rgba(20,99,255,.10)}.fmea-table .fmea-num{width:54px;min-width:54px;text-align:center;font-weight:900}.fmea-table .fmea-score{font-size:14px;font-weight:950;text-align:center;border-radius:9px;padding:8px 5px;display:block;min-width:50px}.fmea-score.low{background:#ecfdf5;color:#047857}.fmea-score.medium{background:#fff7ed;color:#b45309}.fmea-score.high{background:#fff1f2;color:#b91c1c}.fmea-ap{display:inline-grid;place-items:center;width:32px;height:27px;border-radius:9px;font-weight:950}.fmea-ap.H{background:#fee2e2;color:#991b1b}.fmea-ap.M{background:#fef3c7;color:#92400e}.fmea-ap.L{background:#d1fae5;color:#065f46}.fmea-row-actions{display:flex;flex-direction:column;gap:5px}.fmea-mini-btn{border:1px solid var(--border);border-radius:8px;background:#fff;color:var(--navy);padding:6px;cursor:pointer;font-weight:900;font-size:10px}.fmea-mini-btn.danger{color:#b91c1c;background:#fff1f2;border-color:#fecdd3}.fmea-row-overdue td{box-shadow:inset 0 2px #ef4444}.fmea-row-high td{background-image:linear-gradient(rgba(254,242,242,.38),rgba(254,242,242,.38))}.fmea-empty{text-align:center;padding:28px!important;color:var(--muted);font-weight:750}
    .fmea-compact .fmea-detail-col{display:none}.fmea-compact .fmea-table{min-width:1480px}.fmea-risk-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(310px,.65fr);gap:16px}.fmea-bars{display:grid;gap:11px}.fmea-bar-row{display:grid;grid-template-columns:115px 1fr 60px;gap:9px;align-items:center;color:var(--navy);font-size:12px;font-weight:850}.fmea-bar{height:14px;border-radius:999px;background:#edf2f8;overflow:hidden}.fmea-bar span{display:block;height:100%;width:var(--w,0%);border-radius:inherit}.fmea-bar.high span{background:#ef4444}.fmea-bar.medium span{background:#f59e0b}.fmea-bar.low span{background:#10b981}.fmea-validation{display:grid;gap:8px}.fmea-validation-item{display:flex;gap:9px;align-items:flex-start;padding:10px 12px;border-radius:13px;background:#f8fbff;border:1px solid var(--border);font-size:12px;font-weight:750;line-height:1.4;color:var(--navy)}.fmea-validation-item b{width:22px;height:22px;display:grid;place-items:center;flex:0 0 auto;border-radius:50%;background:#ecfdf5;color:#047857}.fmea-validation-item.warn b{background:#fff7ed;color:#b45309}.fmea-validation-item.bad b{background:#fff1f2;color:#b91c1c}.fmea-legend{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.fmea-legend span{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);border-radius:999px;padding:6px 9px;background:#f8fbff;color:var(--navy);font-size:11px;font-weight:800}.fmea-legend i{width:10px;height:10px;border-radius:3px}.fmea-legend .h{background:#ef4444}.fmea-legend .m{background:#f59e0b}.fmea-legend .l{background:#10b981}.fmea-small-note{font-size:11px;color:var(--muted);font-weight:650;line-height:1.45;margin-top:9px}
    @media(max-width:1180px){.fmea-top,.fmea-risk-grid{grid-template-columns:1fr}.fmea-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:700px){.fmea-fields,.fmea-kpis{grid-template-columns:1fr}.fmea-field.wide,.fmea-field.full{grid-column:auto}.fmea-toolbar{align-items:stretch}.fmea-toolbar input{min-width:0;width:100%}}
    @media print{
      @page{size:A3 landscape;margin:7mm}#fmea .method-hero,.fmea-actions,.fmea-toolbar,.fmea-row-actions,.fmea-validation-panel,.fmea-top-scroll,.fmea-scroll-help{display:none!important}#fmea .tool-body{padding:0!important}.fmea-panel{box-shadow:none!important;border-radius:0!important;padding:7px!important;break-inside:avoid}.fmea-top{grid-template-columns:1.35fr .65fr!important}.fmea-table-wrap{overflow:visible!important;max-height:none!important;border:0!important}.fmea-table{min-width:0!important;width:100%!important;font-size:6.2px;table-layout:fixed}.fmea-table th,.fmea-table td{position:static!important;padding:2px!important}.fmea-table th{font-size:5.7px!important}.fmea-table input,.fmea-table select,.fmea-table textarea{border:0!important;padding:0!important;background:transparent!important;font-size:6.2px!important;min-height:0!important}.fmea-table textarea{height:26px!important}.fmea-score{font-size:7px!important;padding:2px!important;min-width:0!important}.fmea-ap{width:20px;height:14px;font-size:6px}.fmea-detail-col{display:table-cell!important}.fmea-risk-grid{grid-template-columns:1fr 1fr!important}.fmea-panel.dark{print-color-adjust:exact;-webkit-print-color-adjust:exact}
    }

  

    /* Muda Analysis interactive tool */
    .muda-tool{display:grid;gap:18px;min-width:0}
    .muda-top{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr);gap:16px;align-items:stretch;min-width:0}
    .muda-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .muda-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .muda-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}.muda-panel.dark h4{color:#fff}
    .muda-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}.muda-panel.dark .muda-muted,.muda-panel.dark label{color:#dbeafe}
    .muda-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.muda-field{display:grid;gap:7px;min-width:0}.muda-field.wide{grid-column:span 2}.muda-field.full{grid-column:1/-1}
    .muda-field label{color:var(--navy);font-size:12px;font-weight:950;text-transform:uppercase;letter-spacing:.05em}
    .muda-field input,.muda-field select,.muda-field textarea,.muda-toolbar input,.muda-toolbar select{width:100%;border:1px solid var(--border);border-radius:13px;background:#f8fbff;color:var(--text);padding:10px 11px;min-height:42px;font:inherit;font-weight:650;outline:none}
    .muda-field textarea{min-height:82px;resize:vertical}.muda-field input:focus,.muda-field select:focus,.muda-field textarea:focus,.muda-toolbar input:focus,.muda-toolbar select:focus{border-color:rgba(20,99,255,.55);background:#fff;box-shadow:0 0 0 4px rgba(20,99,255,.09)}
    .muda-actions{display:flex;flex-wrap:wrap;gap:9px;align-items:center;margin-top:14px}
    .muda-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}.muda-kpi{border-radius:16px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);padding:12px}.muda-kpi b{display:block;color:#fff;font-size:23px;line-height:1.08;letter-spacing:-.03em}.muda-kpi span{display:block;margin-top:5px;color:#dbeafe;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
    .muda-summary-note{padding:13px;border-radius:15px;background:rgba(255,138,0,.14);border:1px solid rgba(255,138,0,.3);color:#fff7ed;font-weight:750;line-height:1.45}
    .muda-assumptions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:12px}
    .muda-category-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:14px}
    .muda-category{border:1px solid var(--border);border-radius:17px;background:linear-gradient(180deg,#fff,#f8fbff);padding:14px;text-align:left;cursor:pointer;transition:.16s ease;min-height:142px;display:grid;align-content:start;gap:7px;position:relative;overflow:hidden}.muda-category:hover{transform:translateY(-2px);border-color:rgba(20,99,255,.38);box-shadow:0 10px 22px rgba(15,23,42,.08)}.muda-category.active{border-color:var(--primary);box-shadow:0 0 0 3px rgba(20,99,255,.10),0 12px 28px rgba(20,99,255,.12);background:linear-gradient(135deg,#eef4ff,#fff)}
    .muda-category-code{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:var(--navy);color:#fff;font-size:12px;font-weight:950}.muda-category strong{color:var(--navy);font-size:15px}.muda-category small{color:var(--muted);font-weight:650;line-height:1.35}.muda-category-stats{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto}.muda-category-stats span{border-radius:999px;background:#eef4ff;color:var(--primary-dark);padding:5px 8px;font-size:11px;font-weight:900}.muda-category.active .muda-category-code{background:var(--primary)}
    .muda-editor-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(260px,.65fr);gap:16px;align-items:start}.muda-photo-box{border:2px dashed #c8d5e6;border-radius:17px;background:#f8fbff;min-height:220px;display:grid;place-items:center;overflow:hidden;position:relative;text-align:center;padding:14px}.muda-photo-box img{width:100%;height:100%;max-height:300px;object-fit:contain;border-radius:12px}.muda-photo-empty{color:var(--muted);font-weight:700;line-height:1.45}.muda-photo-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
    .muda-toolbar{display:grid;grid-template-columns:minmax(220px,1fr) repeat(3,minmax(150px,auto));gap:10px;margin:12px 0}.muda-observation-list{display:grid;gap:12px}.muda-empty{border:2px dashed #c8d5e6;border-radius:18px;background:#f8fbff;padding:28px;text-align:center;color:var(--muted);font-weight:700}
    .muda-observation{border:1px solid var(--border);border-radius:18px;background:#fff;box-shadow:0 8px 20px rgba(15,23,42,.05);overflow:hidden}.muda-observation-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:12px;align-items:start;padding:14px 15px;border-bottom:1px solid var(--border);background:#f8fbff}.muda-observation-code{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:var(--navy);color:#fff;font-weight:950;font-size:12px}.muda-observation-title strong{display:block;color:var(--navy);font-size:16px}.muda-observation-title span{display:block;color:var(--muted);font-size:12px;font-weight:700;margin-top:3px}.muda-status{border-radius:999px;padding:6px 9px;font-size:11px;font-weight:950;white-space:nowrap;background:#eef4ff;color:var(--primary-dark)}.muda-status.done{background:#ecfdf5;color:#047857}.muda-status.action{background:#fff7ed;color:#9a3412}.muda-status.analysis{background:#fef3c7;color:#92400e}
    .muda-observation-body{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;padding:14px 15px}.muda-observation-text{color:#334155;font-weight:650;line-height:1.45}.muda-observation-text p{margin:0 0 8px}.muda-observation-text small{color:var(--muted);font-weight:700}.muda-observation-photo{width:120px;height:88px;border-radius:12px;object-fit:cover;border:1px solid var(--border);background:#f8fbff}.muda-metrics{display:grid;grid-template-columns:repeat(5,minmax(100px,1fr));gap:8px;margin-top:11px}.muda-metric{border:1px solid var(--border);border-radius:12px;padding:9px;background:#f8fbff}.muda-metric b{display:block;color:var(--navy);font-size:14px}.muda-metric span{display:block;color:var(--muted);font-size:10px;font-weight:850;text-transform:uppercase;margin-top:3px}.muda-observation-footer{display:flex;gap:8px;flex-wrap:wrap;justify-content:space-between;align-items:center;padding:11px 15px;border-top:1px solid var(--border)}.muda-row-actions{display:flex;gap:7px;flex-wrap:wrap}.muda-mini-btn{border:1px solid var(--border);border-radius:999px;background:#fff;color:var(--navy);padding:7px 10px;font-weight:850;font-size:12px;cursor:pointer}.muda-mini-btn:hover{border-color:rgba(20,99,255,.35);color:var(--primary)}.muda-mini-btn.danger{color:#b91c1c;background:#fff1f2;border-color:rgba(239,68,68,.2)}
    .muda-analysis-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);gap:16px}.muda-chart{display:grid;gap:9px;margin-top:14px}.muda-pareto-row{display:grid;grid-template-columns:minmax(160px,1.1fr) minmax(180px,2fr) 100px 70px;gap:9px;align-items:center}.muda-pareto-label{min-width:0}.muda-pareto-label strong{display:block;color:var(--navy);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.muda-pareto-label small{color:var(--muted);font-weight:700}.muda-pareto-bar{height:19px;border-radius:999px;background:#eef4ff;border:1px solid var(--border);overflow:hidden}.muda-pareto-bar span{display:block;height:100%;width:var(--w,0%);background:linear-gradient(90deg,var(--primary),#7aa7ff);border-radius:inherit}.muda-pareto-value{font-weight:900;color:var(--navy);text-align:right}.muda-cumulative{border-radius:999px;background:#eef4ff;color:var(--primary-dark);padding:5px 7px;font-size:11px;font-weight:900;text-align:center}
    .muda-mix{display:grid;gap:9px;margin-top:14px}.muda-mix-row{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:9px;align-items:center;border:1px solid var(--border);border-radius:13px;padding:9px;background:#f8fbff}.muda-mix-code{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:var(--navy);color:#fff;font-size:11px;font-weight:950}.muda-mix-row strong{display:block;color:var(--navy)}.muda-mix-row small{display:block;color:var(--muted);font-weight:700;margin-top:2px}.muda-mix-row b{color:var(--primary-dark);white-space:nowrap}
    .muda-validation{display:grid;gap:9px;margin-top:12px}.muda-validation-item{display:grid;grid-template-columns:28px 1fr;gap:9px;align-items:start;padding:10px 11px;border-radius:13px;background:#ecfdf5;border:1px solid rgba(16,185,129,.24);color:#065f46;font-weight:700}.muda-validation-item.warn{background:#fff7ed;border-color:rgba(255,138,0,.25);color:#9a3412}.muda-validation-item.bad{background:#fff1f2;border-color:rgba(239,68,68,.24);color:#991b1b}.muda-validation-item b{width:24px;height:24px;border-radius:8px;background:rgba(255,255,255,.7);display:grid;place-items:center}
    .muda-priority{display:inline-flex;align-items:center;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:950}.muda-priority.high{background:#fee2e2;color:#991b1b}.muda-priority.medium{background:#fef3c7;color:#92400e}.muda-priority.low{background:#dcfce7;color:#166534}
    @media(max-width:1180px){.muda-top,.muda-editor-grid,.muda-analysis-grid{grid-template-columns:1fr}.muda-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.muda-fields,.muda-assumptions{grid-template-columns:repeat(2,minmax(0,1fr))}.muda-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.muda-toolbar{grid-template-columns:1fr 1fr}}
    @media(max-width:700px){.muda-category-grid,.muda-fields,.muda-assumptions,.muda-kpis,.muda-toolbar{grid-template-columns:1fr}.muda-field.wide{grid-column:auto}.muda-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.muda-observation-body{grid-template-columns:1fr}.muda-observation-photo{width:100%;height:160px}.muda-pareto-row{grid-template-columns:1fr}.muda-pareto-value{text-align:left}}
    @media print{.muda-actions,.muda-toolbar,.muda-photo-actions,.muda-row-actions,.muda-editor-panel{display:none!important}.muda-panel,.muda-observation{box-shadow:none!important;break-inside:avoid}.muda-category-grid{grid-template-columns:repeat(4,1fr)}.muda-observation-list{display:block}.muda-observation{margin-bottom:10px}.muda-analysis-grid{grid-template-columns:1.25fr .75fr}.muda-tool{font-size:10px}}



    /* Takt Time interactive capacity planner */
    .takt-tool{display:grid;gap:18px;min-width:0}
    .takt-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .takt-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .takt-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}.takt-panel.dark h4{color:#fff}
    .takt-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}.takt-panel.dark .takt-muted{color:#dbeafe}
    .takt-top{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);gap:16px;align-items:stretch}
    .takt-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
    .takt-field{display:grid;gap:7px;min-width:0}.takt-field.wide{grid-column:span 2}.takt-field.full{grid-column:1/-1}
    .takt-field label{color:var(--navy);font-size:12px;font-weight:950;text-transform:uppercase;letter-spacing:.05em}
    .takt-field input,.takt-field select,.takt-field textarea{width:100%;border:1px solid var(--border);border-radius:13px;background:#f8fbff;color:var(--text);padding:10px 11px;min-height:42px;font:inherit;font-weight:650;outline:none}
    .takt-field textarea{min-height:72px;resize:vertical}.takt-field input:focus,.takt-field select:focus,.takt-field textarea:focus{border-color:rgba(20,99,255,.55);background:#fff;box-shadow:0 0 0 4px rgba(20,99,255,.1)}
    .takt-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px;align-items:center}
    .takt-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
    .takt-kpi{border-radius:16px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);padding:12px;min-width:0}
    .takt-kpi b{display:block;color:#fff;font-size:24px;line-height:1.08;letter-spacing:-.03em;overflow-wrap:anywhere}.takt-kpi span{display:block;margin-top:5px;color:#dbeafe;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
    .takt-status{padding:13px;border-radius:16px;background:rgba(20,99,255,.15);border:1px solid rgba(122,167,255,.35);color:#eef6ff;font-weight:750;line-height:1.45}.takt-status.good{background:rgba(16,185,129,.15);border-color:rgba(16,185,129,.35)}.takt-status.warn{background:rgba(255,138,0,.15);border-color:rgba(255,138,0,.35)}.takt-status.bad{background:rgba(239,68,68,.16);border-color:rgba(239,68,68,.38)}
    .takt-formula{display:grid;grid-template-columns:1fr auto 1fr auto 1fr;gap:10px;align-items:center;margin-top:14px}.takt-formula-box{border-radius:15px;background:#eef4ff;border:1px solid rgba(20,99,255,.16);padding:12px;text-align:center}.takt-formula-box b{display:block;color:var(--navy);font-size:20px}.takt-formula-box span{display:block;color:var(--muted);font-size:11px;font-weight:850;text-transform:uppercase;margin-top:4px}.takt-formula-op{font-weight:950;color:var(--primary);font-size:22px}
    .takt-scenario-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.takt-scenario-card{border:1px solid var(--border);border-radius:17px;padding:14px;background:#f8fbff}.takt-scenario-card h5{margin:0 0 8px;color:var(--navy);font-size:14px}.takt-scenario-card b{display:block;font-size:22px;color:var(--navy)}.takt-scenario-card span{font-size:12px;color:var(--muted);font-weight:700}.takt-range{width:100%;accent-color:var(--primary)}
    .takt-chart-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:18px;background:#f8fbff;padding:16px;max-width:100%}.takt-chart{position:relative;display:flex;align-items:flex-end;gap:16px;min-width:760px;height:430px;padding:34px 18px 48px 56px;border-radius:14px;background:linear-gradient(0deg,rgba(15,23,42,.055) 1px,transparent 1px),#fff;background-size:100% 44px}
    .takt-axis{position:absolute;left:14px;top:24px;bottom:45px;width:38px;color:var(--muted);font-size:10px;font-weight:800}.takt-axis span{position:absolute;right:0;transform:translateY(50%)}
    .takt-line{position:absolute;left:55px;right:14px;border-top:3px dashed var(--danger);z-index:4}.takt-line-label{position:absolute;right:2px;transform:translateY(-110%);background:#fff1f2;color:#b91c1c;border:1px solid rgba(239,68,68,.25);border-radius:999px;padding:4px 8px;font-size:11px;font-weight:950}
    .takt-bar-group{flex:1;min-width:92px;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:stretch;position:relative}.takt-bar-stack{width:100%;display:flex;flex-direction:column-reverse;border-radius:12px 12px 4px 4px;overflow:hidden;box-shadow:0 7px 18px rgba(15,23,42,.12);min-height:2px;position:relative}.takt-bar-seg{min-height:2px;display:grid;place-items:center;color:#fff;font-size:10px;font-weight:950;text-shadow:0 1px 2px rgba(0,0,0,.2)}.takt-bar-seg.manual{background:#1463ff}.takt-bar-seg.auto{background:#10b981}.takt-bar-seg.walk{background:#ff8a00}.takt-bar-seg.wait{background:#ef4444}.takt-bar-seg.other{background:#64748b}.takt-bar-total{text-align:center;color:var(--navy);font-size:12px;font-weight:950;margin-bottom:5px}.takt-bar-label{text-align:center;color:var(--navy);font-size:12px;font-weight:900;margin-top:8px;line-height:1.2;white-space:normal}.takt-bar-cap{text-align:center;color:var(--muted);font-size:10px;font-weight:750;margin-top:3px}
    .takt-legend{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}.takt-legend span{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:12px;font-weight:800}.takt-legend i{width:11px;height:11px;border-radius:3px;background:#1463ff}.takt-legend i.auto{background:#10b981}.takt-legend i.walk{background:#ff8a00}.takt-legend i.wait{background:#ef4444}.takt-legend i.other{background:#64748b}.takt-legend i.line{height:0;width:18px;border-top:3px dashed var(--danger);border-radius:0;background:transparent}
    .takt-table-shell{max-width:100%;overflow:hidden;border:1px solid var(--border);border-radius:18px;background:#fff}.takt-table-scroll{overflow-x:auto;max-width:100%;scrollbar-color:#94a3b8 #e2e8f0;scrollbar-width:auto}.takt-table-scroll::-webkit-scrollbar{height:14px}.takt-table-scroll::-webkit-scrollbar-track{background:#e2e8f0}.takt-table-scroll::-webkit-scrollbar-thumb{background:#94a3b8;border-radius:999px;border:3px solid #e2e8f0}
    .takt-table{width:100%;min-width:1220px;border-collapse:collapse;font-size:12px}.takt-table th,.takt-table td{border-bottom:1px solid var(--border);padding:9px;text-align:left;vertical-align:middle}.takt-table th{background:#eef4ff;color:var(--navy);text-transform:uppercase;letter-spacing:.04em;font-size:11px;font-weight:950;white-space:nowrap;position:sticky;top:0;z-index:2}.takt-table input,.takt-table select{width:100%;min-width:82px;border:1px solid #dbe3ef;border-radius:10px;background:#f8fbff;padding:8px;font:inherit;font-weight:650}.takt-table .takt-name{min-width:150px}.takt-table .takt-note{min-width:180px}.takt-row-status{display:inline-flex;border-radius:999px;padding:5px 8px;font-size:10px;font-weight:950;white-space:nowrap}.takt-row-status.ok{background:#ecfdf5;color:#047857}.takt-row-status.near{background:#fff7ed;color:#9a3412}.takt-row-status.over{background:#fff1f2;color:#b91c1c}
    .takt-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.takt-summary-card{border:1px solid var(--border);border-radius:16px;padding:14px;background:#f8fbff}.takt-summary-card b{display:block;color:var(--navy);font-size:22px}.takt-summary-card span{display:block;color:var(--muted);font-size:12px;font-weight:800;margin-top:4px}.takt-summary-card small{display:block;color:var(--muted);margin-top:7px;line-height:1.35;font-weight:650}
    .takt-validation{display:grid;gap:9px}.takt-validation-item{display:grid;grid-template-columns:32px 1fr;gap:10px;align-items:start;border:1px solid var(--border);border-radius:14px;padding:11px;background:#f8fbff}.takt-validation-item b{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;background:#eef4ff;color:var(--primary-dark)}.takt-validation-item.ok b{background:#ecfdf5;color:#047857}.takt-validation-item.warn b{background:#fff7ed;color:#9a3412}.takt-validation-item.bad b{background:#fff1f2;color:#b91c1c}.takt-validation-item strong{display:block;color:var(--navy);font-size:13px}.takt-validation-item span{display:block;color:var(--muted);font-size:12px;font-weight:650;line-height:1.4;margin-top:2px}
    @media(max-width:1180px){.takt-top{grid-template-columns:1fr}.takt-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.takt-scenario-grid,.takt-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:720px){.takt-fields,.takt-scenario-grid,.takt-summary-grid,.takt-kpis{grid-template-columns:1fr}.takt-field.wide{grid-column:auto}.takt-formula{grid-template-columns:1fr}.takt-formula-op{transform:rotate(90deg);text-align:center}.takt-chart{height:370px}}
    @media print{.takt-actions,.takt-scenario-controls,.takt-table input,.takt-table select,.takt-table button{display:none!important}.takt-tool{gap:10px}.takt-panel{box-shadow:none!important;break-inside:avoid}.takt-chart-wrap,.takt-table-scroll{overflow:visible}.takt-table{min-width:0;font-size:8px}.takt-table th,.takt-table td{padding:4px}.takt-chart{min-width:0;height:300px}}

  
    /* Standard Work interactive editor */
    .sw-tool{display:grid;gap:18px;min-width:0}
    .sw-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .sw-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .sw-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}.sw-panel.dark h4{color:#fff}
    .sw-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}.sw-panel.dark .sw-muted{color:#dbeafe}
    .sw-top{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(330px,.82fr);gap:16px;align-items:stretch;min-width:0}
    .sw-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.sw-field{display:grid;gap:7px;min-width:0}.sw-field.wide{grid-column:span 2}
    .sw-field label{color:var(--navy);font-size:12px;font-weight:950;text-transform:uppercase;letter-spacing:.05em}
    .sw-field input,.sw-field select,.sw-field textarea,.sw-step-card input,.sw-step-card select,.sw-step-card textarea,.sw-wip-table input,.sw-wip-table textarea{width:100%;border:1px solid var(--border);border-radius:12px;background:#f8fbff;color:var(--text);padding:10px 11px;font:inherit;font-weight:650;outline:none;min-width:0}
    .sw-field textarea,.sw-step-card textarea,.sw-wip-table textarea{resize:vertical;min-height:68px}
    .sw-field input:focus,.sw-field select:focus,.sw-field textarea:focus,.sw-step-card input:focus,.sw-step-card select:focus,.sw-step-card textarea:focus,.sw-wip-table input:focus,.sw-wip-table textarea:focus{border-color:rgba(20,99,255,.55);background:#fff;box-shadow:0 0 0 3px rgba(20,99,255,.09)}
    .sw-actions{display:flex;flex-wrap:wrap;gap:9px;align-items:center;margin-top:14px}.sw-actions.compact{margin-top:0}
    .sw-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}.sw-kpi{border-radius:16px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);padding:12px}.sw-kpi b{display:block;color:#fff;font-size:24px;line-height:1.05;letter-spacing:-.03em}.sw-kpi span{display:block;margin-top:5px;color:#dbeafe;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
    .sw-status{padding:13px;border-radius:15px;background:rgba(20,99,255,.15);border:1px solid rgba(122,167,255,.3);color:#eff6ff;font-weight:800;line-height:1.45}.sw-status.ok{background:rgba(16,185,129,.15);border-color:rgba(16,185,129,.35)}.sw-status.warn{background:rgba(255,138,0,.16);border-color:rgba(255,138,0,.35)}.sw-status.bad{background:rgba(239,68,68,.16);border-color:rgba(239,68,68,.36)}
    .sw-progress{height:12px;border-radius:999px;background:rgba(255,255,255,.15);overflow:hidden;border:1px solid rgba(255,255,255,.12);margin-top:12px}.sw-progress span{height:100%;display:block;width:var(--sw-progress,0%);background:linear-gradient(90deg,var(--success),#8bffcb);border-radius:inherit;transition:width .2s ease}
    .sw-timeline-shell{overflow-x:auto;border:1px solid var(--border);border-radius:18px;background:#f8fbff;padding:14px;min-width:0}.sw-timeline{min-width:900px;display:grid;gap:8px;position:relative}
    .sw-time-axis{display:grid;grid-template-columns:150px 1fr;gap:10px;align-items:end}.sw-axis-label{font-size:11px;font-weight:900;color:var(--muted);text-transform:uppercase}.sw-axis-track{height:30px;position:relative;border-bottom:1px solid #b9c7d8}.sw-axis-tick{position:absolute;bottom:-6px;transform:translateX(-50%);font-size:10px;color:var(--muted);font-weight:850}.sw-axis-tick:before{content:"";position:absolute;left:50%;bottom:14px;width:1px;height:8px;background:#94a3b8}
    .sw-lane{display:grid;grid-template-columns:150px 1fr;gap:10px;align-items:center}.sw-lane-name{color:var(--navy);font-weight:900;font-size:13px}.sw-lane-track{height:54px;position:relative;border:1px solid #dbe3ef;border-radius:11px;background:repeating-linear-gradient(90deg,#fff 0,#fff 59px,#eef4ff 60px);overflow:visible}.sw-segment{position:absolute;top:7px;height:38px;min-width:12px;border-radius:9px;border:1px solid rgba(15,23,42,.18);box-shadow:0 4px 10px rgba(15,23,42,.1);padding:4px 7px;color:#fff;font-size:11px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.sw-segment.manual{background:#1463ff}.sw-segment.machine{background:#7c3aed}.sw-segment.walk{background:#f59e0b}.sw-segment.inspection{background:#10b981}.sw-segment.wait{background:#ef4444}.sw-segment.selected{outline:3px solid #0f172a;outline-offset:2px;z-index:5}
    .sw-takt-line{position:absolute;top:0;bottom:0;width:0;border-left:3px dashed #ef4444;z-index:7;pointer-events:none}.sw-takt-line span{position:absolute;top:-24px;transform:translateX(-50%);background:#fee2e2;color:#991b1b;border:1px solid #fecaca;border-radius:999px;padding:3px 7px;font-size:10px;font-weight:950;white-space:nowrap}
    .sw-legend{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}.sw-legend span{display:inline-flex;align-items:center;gap:6px;color:var(--navy);font-size:12px;font-weight:850}.sw-legend i{width:12px;height:12px;border-radius:4px;background:#1463ff}.sw-legend i.machine{background:#7c3aed}.sw-legend i.walk{background:#f59e0b}.sw-legend i.inspection{background:#10b981}.sw-legend i.wait{background:#ef4444}.sw-legend i.takt{width:18px;height:0;border-radius:0;background:none;border-top:3px dashed #ef4444}
    .sw-step-list{display:grid;gap:12px}.sw-step-card{border:1px solid var(--border);border-radius:18px;background:linear-gradient(180deg,#fff,#f8fbff);padding:14px;box-shadow:0 8px 20px rgba(15,23,42,.05);min-width:0}.sw-step-card.selected{border-color:rgba(20,99,255,.55);box-shadow:0 0 0 4px rgba(20,99,255,.08),0 10px 24px rgba(15,23,42,.07)}.sw-step-card.dragging{opacity:.5}
    .sw-step-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.sw-step-no{width:36px;height:36px;border-radius:11px;background:var(--navy);color:#fff;display:grid;place-items:center;font-weight:950;flex:0 0 auto}.sw-step-title{flex:1;color:var(--navy);font-weight:950;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sw-type-badge{padding:6px 9px;border-radius:999px;background:#e0ecff;color:#0f3fb3;font-size:11px;font-weight:950;text-transform:uppercase}.sw-step-tools{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.sw-icon-btn{border:1px solid var(--border);background:#fff;color:var(--navy);border-radius:9px;padding:7px 9px;font-weight:950;cursor:pointer}.sw-icon-btn.danger{color:#b91c1c;background:#fff1f2;border-color:#fecdd3}
    .sw-step-grid{display:grid;grid-template-columns:150px repeat(4,minmax(0,1fr));gap:10px;align-items:start}.sw-photo-box{grid-row:span 3;border:1px dashed #b8c8dc;border-radius:14px;background:#eef4ff;min-height:170px;display:grid;place-items:center;overflow:hidden;position:relative}.sw-photo-box img{width:100%;height:170px;object-fit:cover;display:block}.sw-photo-placeholder{padding:16px;text-align:center;color:var(--muted);font-size:12px;font-weight:800}.sw-photo-actions{position:absolute;left:6px;right:6px;bottom:6px;display:flex;gap:5px;justify-content:center}.sw-photo-actions button,.sw-photo-actions label{border:1px solid rgba(255,255,255,.5);background:rgba(15,23,42,.78);color:#fff;border-radius:8px;padding:5px 7px;font-size:10px;font-weight:900;cursor:pointer;backdrop-filter:blur(5px)}
    .sw-step-field{display:grid;gap:5px;min-width:0}.sw-step-field label{font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}.sw-step-field.span2{grid-column:span 2}.sw-step-field.span4{grid-column:span 4}
    .sw-keypoints{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:10px}.sw-keypoint{border-radius:13px;padding:10px;border:1px solid var(--border);background:#fff}.sw-keypoint.safety{border-left:5px solid #ef4444}.sw-keypoint.quality{border-left:5px solid #10b981}.sw-keypoint.parameter{border-left:5px solid #1463ff}.sw-keypoint label{display:block;font-size:10px;text-transform:uppercase;font-weight:950;letter-spacing:.05em;color:var(--muted);margin-bottom:5px}
    .sw-table-shell{max-width:100%;overflow:hidden;border:1px solid var(--border);border-radius:18px}.sw-table-scroll{overflow-x:auto;max-width:100%}.sw-wip-table{width:100%;min-width:920px;border-collapse:collapse;font-size:12px}.sw-wip-table th,.sw-wip-table td{border-bottom:1px solid var(--border);padding:9px;vertical-align:top;text-align:left}.sw-wip-table th{background:#eef4ff;color:var(--navy);font-size:10px;text-transform:uppercase;letter-spacing:.05em;font-weight:950;white-space:nowrap}.sw-wip-table textarea{min-height:48px}
    .sw-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.sw-summary-card{border:1px solid var(--border);border-radius:16px;padding:14px;background:#f8fbff}.sw-summary-card b{display:block;color:var(--navy);font-size:22px}.sw-summary-card span{display:block;color:var(--muted);font-size:11px;text-transform:uppercase;font-weight:900;margin-top:4px}.sw-summary-card small{display:block;color:var(--muted);line-height:1.4;margin-top:7px;font-weight:600}
    .sw-validation{display:grid;gap:9px}.sw-validation-item{display:grid;grid-template-columns:30px 1fr;gap:10px;align-items:start;border:1px solid var(--border);border-radius:14px;padding:11px;background:#f8fbff}.sw-validation-item>b{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#e2e8f0;color:#334155}.sw-validation-item.ok>b{background:#d1fae5;color:#047857}.sw-validation-item.warn>b{background:#ffedd5;color:#c2410c}.sw-validation-item.bad>b{background:#fee2e2;color:#b91c1c}.sw-validation-item strong{display:block;color:var(--navy)}.sw-validation-item span{display:block;color:var(--muted);font-size:12px;line-height:1.4;margin-top:3px;font-weight:600}
    .sw-empty{border:2px dashed #c8d5e6;border-radius:18px;background:#f8fbff;padding:26px;text-align:center;color:var(--muted);font-weight:700}
    @media(max-width:1250px){.sw-top{grid-template-columns:1fr}.sw-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.sw-step-grid{grid-template-columns:130px repeat(2,minmax(0,1fr))}.sw-step-field.span4{grid-column:span 2}.sw-keypoints{grid-template-columns:1fr}.sw-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:760px){.sw-fields{grid-template-columns:1fr}.sw-field.wide{grid-column:auto}.sw-kpis,.sw-summary-grid{grid-template-columns:1fr}.sw-step-grid{grid-template-columns:1fr}.sw-photo-box{grid-row:auto}.sw-step-field.span2,.sw-step-field.span4{grid-column:auto}.sw-step-head{align-items:flex-start;flex-wrap:wrap}.sw-step-title{min-width:180px}.sw-lane,.sw-time-axis{grid-template-columns:110px 1fr}.sw-timeline{min-width:760px}}
    @media print{.sw-actions,.sw-step-tools,.sw-photo-actions,.sw-validation,.sw-empty{display:none!important}.sw-panel{box-shadow:none!important;break-inside:avoid}.sw-top{grid-template-columns:1.2fr .8fr}.sw-step-card{box-shadow:none!important;break-inside:avoid}.sw-step-list{display:block}.sw-step-card{margin-bottom:8px}.sw-timeline-shell,.sw-table-scroll{overflow:visible!important}.sw-timeline{min-width:0}.sw-wip-table{min-width:0;font-size:9px}.sw-step-grid{grid-template-columns:110px repeat(4,minmax(0,1fr))}.sw-photo-box,.sw-photo-box img{min-height:115px;height:115px}.sw-keypoints{grid-template-columns:repeat(3,minmax(0,1fr))}}

  

    /* Gemba Walk interactive audit */
    .gemba-tool{display:grid;gap:18px;min-width:0}
    .gemba-top{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:16px;align-items:stretch;min-width:0}
    .gemba-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .gemba-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .gemba-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}.gemba-panel.dark h4{color:#fff}
    .gemba-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}.gemba-panel.dark .gemba-muted{color:#dbeafe}
    .gemba-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.gemba-field{display:grid;gap:7px;min-width:0}.gemba-field.wide{grid-column:span 2}.gemba-field.full{grid-column:1/-1}
    .gemba-field label{font-size:12px;font-weight:950;letter-spacing:.05em;text-transform:uppercase;color:var(--navy)}
    .gemba-field input,.gemba-field select,.gemba-field textarea{width:100%;min-width:0;border:1px solid var(--border);border-radius:13px;background:#f8fbff;color:var(--text);padding:10px 11px;font:inherit;font-weight:650;outline:none}.gemba-field textarea{min-height:76px;resize:vertical}
    .gemba-field input:focus,.gemba-field select:focus,.gemba-field textarea:focus{background:#fff;border-color:rgba(20,99,255,.55);box-shadow:0 0 0 4px rgba(20,99,255,.09)}
    .gemba-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}
    .gemba-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}.gemba-kpi{border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.12);border-radius:16px;padding:12px}.gemba-kpi b{display:block;color:#fff;font-size:25px;line-height:1.05}.gemba-kpi span{display:block;color:#dbeafe;font-size:11px;font-weight:900;letter-spacing:.05em;text-transform:uppercase;margin-top:5px}
    .gemba-status{padding:12px 14px;border-radius:15px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.09);color:#fff;font-weight:780;line-height:1.45}.gemba-status.ok{background:rgba(16,185,129,.18);border-color:rgba(16,185,129,.42)}.gemba-status.warn{background:rgba(255,138,0,.18);border-color:rgba(255,138,0,.42)}.gemba-status.bad{background:rgba(239,68,68,.18);border-color:rgba(239,68,68,.42)}
    .gemba-category-grid{display:grid;grid-template-columns:repeat(7,minmax(145px,1fr));gap:10px;overflow-x:auto;padding-bottom:5px}.gemba-category{border:1px solid var(--border);border-radius:17px;background:#f8fbff;padding:12px;cursor:pointer;transition:.15s;min-width:145px}.gemba-category:hover{transform:translateY(-1px);border-color:rgba(20,99,255,.38)}.gemba-category.active{background:linear-gradient(135deg,#eef4ff,#fff);border-color:rgba(20,99,255,.55);box-shadow:0 8px 20px rgba(20,99,255,.1)}.gemba-category-head{display:flex;justify-content:space-between;gap:8px;align-items:center}.gemba-category-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:11px;background:var(--navy);color:#fff;font-weight:950}.gemba-category-score{font-size:12px;font-weight:950;color:var(--primary-dark);background:#fff;border:1px solid var(--border);border-radius:999px;padding:5px 7px}.gemba-category strong{display:block;color:var(--navy);font-size:13px;margin-top:9px}.gemba-category small{display:block;color:var(--muted);font-weight:700;margin-top:4px;line-height:1.3}
    .gemba-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;margin-bottom:12px}.gemba-toolbar-group{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.gemba-toolbar input,.gemba-toolbar select{border:1px solid var(--border);border-radius:999px;background:#f8fbff;padding:9px 12px;font:inherit;font-weight:700;max-width:240px}
    .gemba-checklist{display:grid;gap:10px}.gemba-question{border:1px solid var(--border);border-radius:18px;background:#fff;padding:14px;display:grid;grid-template-columns:minmax(240px,1fr) auto;gap:14px;align-items:start}.gemba-question.nok{border-color:rgba(239,68,68,.45);background:#fff8f8}.gemba-question.observation{border-color:rgba(255,138,0,.45);background:#fffaf3}.gemba-question.ok{border-color:rgba(16,185,129,.35)}.gemba-q-main{min-width:0}.gemba-q-title{display:flex;gap:9px;align-items:flex-start}.gemba-q-number{flex:0 0 auto;width:30px;height:30px;display:grid;place-items:center;border-radius:10px;background:var(--navy);color:#fff;font-size:12px;font-weight:950}.gemba-q-title strong{color:var(--navy);font-size:15px;line-height:1.35}.gemba-q-title small{display:block;color:var(--muted);font-weight:650;margin-top:4px}.gemba-q-detail{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:10px}.gemba-q-detail textarea,.gemba-q-detail input{width:100%;border:1px solid var(--border);border-radius:12px;background:#f8fbff;padding:9px 10px;font:inherit;font-size:13px;font-weight:650;min-width:0}.gemba-q-detail textarea{min-height:55px;resize:vertical}.gemba-result-buttons{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;max-width:300px}.gemba-result-buttons button{border:1px solid var(--border);border-radius:999px;background:#fff;color:var(--muted);padding:8px 10px;font-weight:900;cursor:pointer}.gemba-result-buttons button.active[data-value="ok"]{background:#ecfdf5;color:#047857;border-color:rgba(16,185,129,.42)}.gemba-result-buttons button.active[data-value="nok"]{background:#fff1f2;color:#b91c1c;border-color:rgba(239,68,68,.42)}.gemba-result-buttons button.active[data-value="observation"]{background:#fff7ed;color:#9a3412;border-color:rgba(255,138,0,.42)}.gemba-result-buttons button.active[data-value="na"]{background:#f1f5f9;color:#475569}.gemba-q-actions{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end;margin-top:9px}.gemba-mini-btn{border:0;border-radius:999px;padding:7px 9px;font-size:12px;font-weight:900;cursor:pointer;background:#eef4ff;color:var(--primary-dark)}.gemba-mini-btn.danger{background:#fff1f2;color:#b91c1c}.gemba-photo-strip{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px}.gemba-photo{position:relative;width:92px;height:70px;border-radius:12px;overflow:hidden;border:1px solid var(--border);background:#eef4ff}.gemba-photo img{width:100%;height:100%;object-fit:cover}.gemba-photo button{position:absolute;right:4px;top:4px;border:0;width:22px;height:22px;border-radius:50%;background:rgba(15,23,42,.78);color:#fff;cursor:pointer;font-weight:900}
    .gemba-route{display:grid;gap:9px}.gemba-route-row{display:grid;grid-template-columns:44px minmax(150px,1fr) 105px minmax(180px,1.4fr) auto;gap:9px;align-items:center;border:1px solid var(--border);border-radius:15px;padding:10px;background:#f8fbff}.gemba-route-no{width:34px;height:34px;display:grid;place-items:center;border-radius:11px;background:var(--navy);color:#fff;font-weight:950}.gemba-route-row input{width:100%;border:1px solid var(--border);border-radius:11px;background:#fff;padding:9px;font:inherit;font-weight:650;min-width:0}
    .gemba-findings-shell{overflow-x:auto;border:1px solid var(--border);border-radius:18px}.gemba-findings{width:100%;min-width:1420px;border-collapse:collapse;font-size:12px}.gemba-findings th,.gemba-findings td{border-bottom:1px solid var(--border);padding:9px;text-align:left;vertical-align:top}.gemba-findings th{background:#eef4ff;color:var(--navy);font-size:11px;text-transform:uppercase;letter-spacing:.04em;font-weight:950;white-space:nowrap;position:sticky;top:0;z-index:1}.gemba-findings input,.gemba-findings select,.gemba-findings textarea{width:100%;border:1px solid var(--border);border-radius:9px;background:#f8fbff;padding:7px;font:inherit;font-size:12px;font-weight:650}.gemba-findings textarea{min-height:48px;resize:vertical}.gemba-priority{display:inline-flex;border-radius:999px;padding:5px 8px;font-weight:950}.gemba-priority.high{background:#fee2e2;color:#991b1b}.gemba-priority.medium{background:#ffedd5;color:#9a3412}.gemba-priority.low{background:#dcfce7;color:#166534}
    .gemba-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}.gemba-summary-card{border:1px solid var(--border);border-radius:17px;padding:13px;background:#f8fbff}.gemba-summary-card b{display:block;color:var(--navy);font-size:23px}.gemba-summary-card span{display:block;color:var(--primary-dark);font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.04em;margin-top:4px}.gemba-summary-card small{display:block;color:var(--muted);font-weight:650;line-height:1.4;margin-top:6px}
    .gemba-validation{display:grid;gap:9px}.gemba-validation-item{display:grid;grid-template-columns:32px 1fr;gap:10px;border:1px solid var(--border);border-radius:14px;padding:10px;background:#f8fbff}.gemba-validation-item>b{width:28px;height:28px;display:grid;place-items:center;border-radius:9px;background:#e2e8f0;color:#475569}.gemba-validation-item strong{display:block;color:var(--navy)}.gemba-validation-item span{display:block;color:var(--muted);font-size:13px;font-weight:650;margin-top:3px}.gemba-validation-item.ok>b{background:#d1fae5;color:#047857}.gemba-validation-item.warn>b{background:#ffedd5;color:#9a3412}.gemba-validation-item.bad>b{background:#fee2e2;color:#b91c1c}
    @media(max-width:1180px){.gemba-top{grid-template-columns:1fr}.gemba-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.gemba-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:760px){.gemba-fields,.gemba-q-detail,.gemba-summary-grid{grid-template-columns:1fr}.gemba-field.wide{grid-column:auto}.gemba-question{grid-template-columns:1fr}.gemba-result-buttons,.gemba-q-actions{justify-content:flex-start;max-width:none}.gemba-route-row{grid-template-columns:38px 1fr}.gemba-route-row>*:nth-child(n+3){grid-column:2}.gemba-kpis{grid-template-columns:1fr 1fr}}
    @media print{.gemba-actions,.gemba-toolbar,.gemba-q-actions,.gemba-mini-btn,.gemba-photo button,.gemba-route-row>button,.gemba-findings td:last-child,.gemba-findings th:last-child{display:none!important}.gemba-top{grid-template-columns:1.2fr .8fr}.gemba-panel{box-shadow:none!important;break-inside:avoid}.gemba-findings-shell{overflow:visible}.gemba-findings{min-width:0;font-size:8px}.gemba-question{break-inside:avoid}.gemba-category-grid{grid-template-columns:repeat(7,1fr);overflow:visible}.gemba-summary-grid{grid-template-columns:repeat(4,1fr)}}

  

    /* Kaizen proposal + Improve by getAVAILIX */
    .kaizen-tool{display:grid;gap:18px;min-width:0}
    .kaizen-grid{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(330px,.82fr);gap:16px;align-items:start;min-width:0}
    .kaizen-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .kaizen-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .kaizen-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}
    .kaizen-panel.dark h4{color:#fff}
    .kaizen-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}
    .kaizen-panel.dark .kaizen-muted,.kaizen-panel.dark label{color:#dbeafe}
    .kaizen-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
    .kaizen-field{display:grid;gap:7px;min-width:0}
    .kaizen-field.wide{grid-column:span 2}.kaizen-field.full{grid-column:1/-1}
    .kaizen-field label{color:var(--navy);font-size:12px;font-weight:950;text-transform:uppercase;letter-spacing:.05em}
    .kaizen-field input,.kaizen-field select,.kaizen-field textarea{width:100%;border:1px solid var(--border);border-radius:13px;background:#f8fbff;color:var(--text);padding:10px 11px;min-height:43px;font:inherit;font-weight:650;outline:none}
    .kaizen-field textarea{min-height:92px;resize:vertical;line-height:1.45}
    .kaizen-field input:focus,.kaizen-field select:focus,.kaizen-field textarea:focus{background:#fff;border-color:rgba(20,99,255,.55);box-shadow:0 0 0 4px rgba(20,99,255,.1)}
    .kaizen-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}
    .kaizen-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
    .kaizen-kpi{border-radius:16px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.15);padding:12px;min-width:0}
    .kaizen-kpi b{display:block;color:#fff;font-size:23px;line-height:1.08;letter-spacing:-.03em;overflow-wrap:anywhere}
    .kaizen-kpi span{display:block;color:#dbeafe;margin-top:5px;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
    .kaizen-status{padding:13px 14px;border-radius:16px;background:rgba(20,99,255,.14);border:1px solid rgba(122,167,255,.27);color:#eff6ff;line-height:1.45;font-weight:720}
    .kaizen-progress{height:10px;border-radius:999px;background:rgba(255,255,255,.15);overflow:hidden;margin-top:12px;border:1px solid rgba(255,255,255,.1)}
    .kaizen-progress span{display:block;height:100%;width:var(--kaizen-progress,0%);background:linear-gradient(90deg,var(--success),#8bffcb);transition:width .2s ease}
    .kaizen-section-title{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}
    .kaizen-section-title h4{margin:0}.kaizen-section-title p{margin:4px 0 0;color:var(--muted);font-weight:600;line-height:1.4}
    .kaizen-photo-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
    .kaizen-photo-box{border:1px solid var(--border);border-radius:18px;background:#f8fbff;overflow:hidden;min-width:0}
    .kaizen-photo-head{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:11px 12px;background:#eef4ff;border-bottom:1px solid var(--border)}
    .kaizen-photo-head b{color:var(--navy)}
    .kaizen-photo-stage{min-height:230px;display:grid;place-items:center;position:relative;background:repeating-linear-gradient(135deg,#f8fbff 0,#f8fbff 12px,#eef4ff 12px,#eef4ff 24px);overflow:hidden}
    .kaizen-photo-stage img{display:block;width:100%;height:100%;min-height:230px;max-height:420px;object-fit:contain;background:#fff}
    .kaizen-photo-placeholder{text-align:center;color:var(--muted);padding:24px;font-weight:700;line-height:1.45}
    .kaizen-photo-controls{display:flex;flex-wrap:wrap;gap:8px;padding:10px 12px;border-top:1px solid var(--border);background:#fff}
    .kaizen-photo-controls label{cursor:pointer}
    .kaizen-photo-controls input[type=file]{display:none}
    .kaizen-score-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
    .kaizen-score-card{border:1px solid var(--border);border-radius:17px;background:#f8fbff;padding:13px;display:grid;gap:9px;min-width:0}
    .kaizen-score-head{display:flex;justify-content:space-between;gap:8px;align-items:center}
    .kaizen-score-head b{color:var(--navy)}
    .kaizen-score-badge{min-width:34px;height:30px;padding:0 8px;border-radius:10px;display:grid;place-items:center;background:var(--navy);color:#fff;font-weight:950}
    .kaizen-score-card input[type=range]{width:100%}
    .kaizen-score-card small{color:var(--muted);line-height:1.4;font-weight:650}
    .kaizen-calc-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
    .kaizen-result-strip{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-top:14px}
    .kaizen-result{border:1px solid var(--border);border-radius:16px;background:linear-gradient(180deg,#fff,#f8fbff);padding:12px;min-width:0}
    .kaizen-result b{display:block;color:var(--navy);font-size:20px;overflow-wrap:anywhere}
    .kaizen-result span{display:block;color:var(--muted);margin-top:5px;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.04em}
    .kaizen-table-wrap{overflow:auto;border:1px solid var(--border);border-radius:17px;background:#fff}
    .kaizen-table{width:100%;border-collapse:collapse;min-width:980px;font-size:13px}
    .kaizen-table th,.kaizen-table td{padding:9px;border-bottom:1px solid var(--border);text-align:left;vertical-align:top}
    .kaizen-table th{background:#eef4ff;color:var(--navy);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:950;white-space:nowrap}
    .kaizen-table input,.kaizen-table select,.kaizen-table textarea{width:100%;border:1px solid var(--border);border-radius:10px;background:#f8fbff;padding:8px;font:inherit;font-weight:650;min-width:100px}
    .kaizen-table textarea{min-height:54px;resize:vertical}
    .kaizen-improve{position:relative;overflow:hidden;border-radius:24px;padding:24px;background:linear-gradient(135deg,#071226 0%,#123b7a 48%,#1463ff 100%);color:#fff;box-shadow:0 20px 48px rgba(20,99,255,.24)}
    .kaizen-improve:before,.kaizen-improve:after{content:"";position:absolute;border-radius:50%;background:rgba(255,255,255,.09)}
    .kaizen-improve:before{width:240px;height:240px;right:-80px;top:-100px}.kaizen-improve:after{width:150px;height:150px;left:45%;bottom:-100px}
    .kaizen-improve-content{position:relative;z-index:1;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(310px,.8fr);gap:20px;align-items:center}
    .kaizen-improve-eyebrow{display:inline-flex;align-items:center;gap:8px;padding:7px 10px;border-radius:999px;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.17);font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.06em}
    .kaizen-improve h4{color:#fff;font-size:27px;margin:13px 0 8px;letter-spacing:-.025em}
    .kaizen-improve p{color:#dbeafe;line-height:1.55;font-weight:600;margin:0}
    .kaizen-improve-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
    .kaizen-improve-primary,.kaizen-improve-secondary{display:inline-flex;align-items:center;gap:8px;text-decoration:none;border-radius:999px;padding:11px 15px;font-weight:950;cursor:pointer;border:0;font:inherit}
    .kaizen-improve-primary{background:#fff;color:#0f3fb3;box-shadow:0 12px 28px rgba(0,0,0,.18)}
    .kaizen-improve-secondary{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.18)}
    .kaizen-improve-flow{display:grid;gap:9px}
    .kaizen-improve-step{display:grid;grid-template-columns:34px 1fr;gap:10px;align-items:start;border-radius:15px;padding:11px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.14)}
    .kaizen-improve-step b{width:32px;height:32px;border-radius:10px;background:rgba(255,255,255,.16);display:grid;place-items:center;color:#fff}
    .kaizen-improve-step strong{display:block;color:#fff;font-size:13px}.kaizen-improve-step span{display:block;color:#dbeafe;font-size:12px;line-height:1.35;margin-top:3px;font-weight:600}
    .kaizen-report{display:grid;grid-template-columns:1fr 1fr;gap:14px}
    .kaizen-report-card{border:1px solid var(--border);border-radius:18px;padding:15px;background:#fff;min-width:0}
    .kaizen-report-card h5{margin:0 0 9px;color:var(--navy);font-size:15px}
    .kaizen-report-card p{margin:0;color:var(--muted);line-height:1.5;font-weight:620;white-space:pre-wrap;overflow-wrap:anywhere}
    .kaizen-validation{display:grid;gap:8px;margin-top:10px}
    .kaizen-validation-row{display:flex;gap:9px;align-items:flex-start;padding:9px 10px;border-radius:13px;background:#f8fbff;border:1px solid var(--border);font-weight:700;color:var(--navy)}
    .kaizen-validation-row.ok{background:#ecfdf5;border-color:rgba(16,185,129,.3);color:#047857}.kaizen-validation-row.warn{background:#fff7ed;border-color:rgba(255,138,0,.3);color:#9a3412}
    @media(max-width:1180px){.kaizen-grid,.kaizen-improve-content{grid-template-columns:1fr}.kaizen-fields,.kaizen-calc-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.kaizen-result-strip{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:760px){.kaizen-fields,.kaizen-calc-grid,.kaizen-photo-grid,.kaizen-score-grid,.kaizen-result-strip,.kaizen-report{grid-template-columns:1fr}.kaizen-field.wide{grid-column:auto}.kaizen-kpis{grid-template-columns:1fr}}
    @media print{
      .kaizen-actions,.kaizen-photo-controls,.kaizen-improve-actions,.kaizen-no-print{display:none!important}
      .kaizen-grid,.kaizen-improve-content,.kaizen-report{grid-template-columns:1fr 1fr!important}
      .kaizen-panel,.kaizen-improve,.kaizen-photo-box,.kaizen-score-card,.kaizen-result,.kaizen-report-card{box-shadow:none!important;break-inside:avoid}
      .kaizen-table-wrap{overflow:visible}.kaizen-table{min-width:0;font-size:9px}
      .kaizen-improve{background:#0f3fb3!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
    }




    /* JIT / Just In Time planner + getAVAILIX promotion */
    .jit-tool{display:grid;gap:18px;min-width:0}
    .jit-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .jit-panel h4{margin:0 0 8px;color:var(--navy);font-size:20px}
    .jit-muted{margin:0;color:var(--muted);font-weight:620;line-height:1.5}
    .jit-availix-hero{position:relative;overflow:hidden;border-radius:24px;padding:26px;background:linear-gradient(135deg,#08111f 0%,#0f3fb3 48%,#1463ff 100%);color:#fff;box-shadow:0 18px 44px rgba(20,99,255,.25)}
    .jit-availix-hero:before,.jit-availix-hero:after{content:"";position:absolute;border-radius:50%;background:rgba(255,255,255,.09);pointer-events:none}
    .jit-availix-hero:before{width:280px;height:280px;right:-90px;top:-130px}.jit-availix-hero:after{width:180px;height:180px;left:38%;bottom:-145px}
    .jit-availix-grid{position:relative;z-index:1;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);gap:22px;align-items:center}
    .jit-availix-kicker{display:inline-flex;border-radius:999px;padding:7px 11px;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.18);font-size:12px;font-weight:950;letter-spacing:.08em;text-transform:uppercase}
    .jit-availix-hero h4{margin:12px 0 9px;color:#fff;font-size:clamp(25px,3vw,38px);letter-spacing:-.035em;line-height:1.06}
    .jit-availix-hero p{margin:0;color:#dbeafe;line-height:1.55;font-weight:650;max-width:840px}
    .jit-availix-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
    .jit-availix-link{display:inline-flex;align-items:center;gap:8px;text-decoration:none;border-radius:999px;padding:12px 17px;background:#fff;color:#0f3fb3;font-weight:950;box-shadow:0 10px 26px rgba(0,0,0,.18)}
    .jit-availix-link.secondary{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.22);box-shadow:none}
    .jit-availix-features{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
    .jit-availix-feature{padding:14px;border-radius:17px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.16);font-weight:900;color:#fff}
    .jit-availix-feature small{display:block;margin-top:5px;color:#dbeafe;font-weight:600;line-height:1.35}
    .jit-top{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(360px,.88fr);gap:16px;align-items:stretch;min-width:0}
    .jit-dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .jit-dark h4{color:#fff}.jit-dark .jit-muted{color:#dbeafe}
    .jit-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-top:15px}
    .jit-field{display:grid;gap:6px;min-width:0}.jit-field.wide{grid-column:span 2}.jit-field.full{grid-column:1/-1}
    .jit-field label{font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.055em;color:var(--navy)}
    .jit-field input,.jit-field select,.jit-field textarea{width:100%;min-width:0;border:1px solid var(--border);border-radius:13px;background:#f8fbff;color:var(--text);padding:10px 11px;font:inherit;font-weight:650;outline:none}
    .jit-field textarea{min-height:72px;resize:vertical}.jit-field input:focus,.jit-field select:focus,.jit-field textarea:focus{border-color:rgba(20,99,255,.5);box-shadow:0 0 0 4px rgba(20,99,255,.09);background:#fff}
    .jit-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px;align-items:center}
    .jit-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}
    .jit-kpi{border-radius:16px;padding:13px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.15)}
    .jit-kpi b{display:block;color:#fff;font-size:25px;line-height:1.05;letter-spacing:-.035em}.jit-kpi span{display:block;margin-top:5px;color:#dbeafe;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}
    .jit-status{margin-top:12px;border-radius:15px;padding:12px 13px;background:rgba(16,185,129,.14);border:1px solid rgba(16,185,129,.32);color:#ecfdf5;font-weight:750;line-height:1.45}
    .jit-status.warn{background:rgba(255,138,0,.16);border-color:rgba(255,138,0,.36);color:#fff7ed}.jit-status.bad{background:rgba(239,68,68,.16);border-color:rgba(239,68,68,.38);color:#fee2e2}
    .jit-flow{display:grid;grid-template-columns:1fr 72px 1fr 72px 1fr 72px 1fr;gap:8px;align-items:center;margin-top:16px;min-width:900px}
    .jit-flow-wrap{overflow-x:auto;padding-bottom:4px}
    .jit-node{min-height:142px;border:1px solid var(--border);border-radius:18px;padding:15px;background:linear-gradient(180deg,#fff,#f8fbff);display:grid;align-content:center;text-align:center;box-shadow:0 8px 20px rgba(15,23,42,.055)}
    .jit-node i{font-style:normal;font-size:28px}.jit-node b{display:block;margin-top:7px;color:var(--navy);font-size:16px}.jit-node span{display:block;margin-top:4px;color:var(--muted);font-size:12px;font-weight:700;line-height:1.35}.jit-node strong{display:block;margin-top:9px;color:var(--primary-dark);font-size:18px}
    .jit-arrow{text-align:center;color:var(--primary);font-size:30px;font-weight:950}.jit-arrow small{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.05em}
    .jit-sim-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:16px;min-width:0}
    .jit-sim-controls{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}
    .jit-slider{display:grid;gap:6px}.jit-slider label{display:flex;justify-content:space-between;gap:8px;color:var(--navy);font-size:12px;font-weight:900}.jit-slider input{width:100%}
    .jit-chart{height:255px;margin-top:14px;border:1px solid var(--border);border-radius:17px;background:linear-gradient(180deg,#fff,#f8fbff);padding:12px;position:relative;overflow:hidden}
    .jit-chart svg{width:100%;height:100%;display:block}.jit-chart-empty{height:100%;display:grid;place-items:center;text-align:center;color:var(--muted);font-weight:750}
    .jit-sim-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}.jit-mini-kpi{padding:12px;border-radius:15px;background:#f8fbff;border:1px solid var(--border)}.jit-mini-kpi b{display:block;color:var(--navy);font-size:20px}.jit-mini-kpi span{display:block;color:var(--muted);font-size:11px;font-weight:850;text-transform:uppercase;margin-top:4px}
    .jit-events{max-height:310px;overflow:auto;display:grid;gap:8px;margin-top:12px}.jit-event{padding:10px 11px;border-radius:13px;background:#f8fbff;border:1px solid var(--border);font-size:12px;line-height:1.4;color:var(--text)}.jit-event b{color:var(--navy)}
    .jit-table-wrap{max-width:100%;overflow:auto;border:1px solid var(--border);border-radius:17px;margin-top:14px;background:#fff}
    .jit-table{width:100%;min-width:1180px;border-collapse:collapse;font-size:12px}.jit-table th,.jit-table td{padding:9px;border-bottom:1px solid var(--border);vertical-align:middle;text-align:left}.jit-table th{background:#eef4ff;color:var(--navy);font-size:11px;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;position:sticky;top:0;z-index:1}.jit-table input,.jit-table select{width:100%;min-width:90px;border:1px solid var(--border);border-radius:9px;background:#f8fbff;padding:7px;font:inherit;font-weight:650}.jit-table td strong{color:var(--navy)}
    .jit-plan-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-top:14px}.jit-plan-card{padding:12px;border-radius:15px;background:#f8fbff;border:1px solid var(--border)}.jit-plan-card b{display:block;font-size:20px;color:var(--navy)}.jit-plan-card span{display:block;margin-top:4px;font-size:11px;color:var(--muted);font-weight:850;text-transform:uppercase}
    .jit-plan-timeline{display:grid;gap:8px;margin-top:14px}.jit-plan-row{display:grid;grid-template-columns:160px 1fr 88px;gap:10px;align-items:center;font-size:12px;font-weight:850;color:var(--navy)}.jit-plan-track{height:24px;border-radius:999px;background:#eef4ff;border:1px solid var(--border);overflow:hidden}.jit-plan-bar{height:100%;width:var(--w,0%);background:linear-gradient(90deg,var(--primary),#7aa7ff);border-radius:inherit;display:flex;align-items:center;justify-content:flex-end;padding-right:8px;color:#fff;font-size:10px}.jit-plan-bar.late{background:linear-gradient(90deg,#ff8a00,#ef4444)}
    .jit-compare{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}.jit-compare-card{border:1px solid var(--border);border-radius:18px;padding:17px;background:#f8fbff}.jit-compare-card h5{margin:0 0 9px;color:var(--navy);font-size:17px}.jit-compare-card ul{margin:0;padding-left:19px;color:var(--muted);line-height:1.65;font-weight:650}.jit-compare-card.availix{background:linear-gradient(135deg,#0f172a,#1463ff);border-color:transparent;color:#fff;box-shadow:0 14px 34px rgba(20,99,255,.18)}.jit-compare-card.availix h5{color:#fff}.jit-compare-card.availix ul{color:#dbeafe}
    .jit-callout{margin-top:14px;padding:14px;border-radius:16px;background:#eef4ff;border:1px solid rgba(20,99,255,.2);color:var(--navy);font-weight:700;line-height:1.5}
    @media(max-width:1180px){.jit-availix-grid,.jit-top,.jit-sim-grid{grid-template-columns:1fr}.jit-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.jit-plan-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:760px){.jit-fields,.jit-sim-controls,.jit-kpis,.jit-sim-summary,.jit-plan-summary,.jit-compare,.jit-availix-features{grid-template-columns:1fr}.jit-field.wide{grid-column:auto}.jit-plan-row{grid-template-columns:110px 1fr 72px}.jit-availix-hero{padding:20px}}
    @media print{.jit-availix-actions,.jit-actions,.jit-sim-controls,.jit-table .jit-row-actions,#jitImportFile{display:none!important}.jit-panel,.jit-availix-hero{box-shadow:none!important}.jit-table-wrap{overflow:visible}.jit-table{min-width:0;font-size:8px}.jit-flow-wrap{overflow:visible}.jit-flow{min-width:0}.jit-chart{height:190px}}

    /* OEE interactive calculator + getAVAILIX promotion */
    .oee-tool{display:grid;gap:18px;min-width:0}
    .oee-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .oee-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .oee-panel h4{margin:0 0 7px;color:var(--navy);font-size:19px}.oee-panel.dark h4{color:#fff}
    .oee-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}.oee-panel.dark .oee-muted{color:#dbeafe}
    .oee-availix-hero{position:relative;overflow:hidden;background:linear-gradient(135deg,#08111f 0%,#0f3fb3 48%,#1463ff 100%);color:#fff;border:1px solid rgba(255,255,255,.16);border-radius:24px;padding:24px;box-shadow:0 18px 46px rgba(20,99,255,.25);display:grid;grid-template-columns:minmax(0,1.3fr) minmax(280px,.7fr);gap:22px;align-items:center}
    .oee-availix-hero:after{content:"";position:absolute;width:360px;height:360px;border-radius:50%;right:-160px;top:-180px;background:rgba(255,255,255,.11)}
    .oee-availix-copy,.oee-availix-side{position:relative;z-index:1}.oee-availix-kicker{display:inline-flex;align-items:center;gap:8px;padding:7px 11px;border-radius:999px;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.17);font-size:12px;font-weight:950;letter-spacing:.06em;text-transform:uppercase}
    .oee-availix-hero h4{margin:13px 0 9px;color:#fff;font-size:clamp(24px,3.2vw,38px);letter-spacing:-.035em}.oee-availix-hero p{margin:0;color:#dbeafe;line-height:1.55;font-weight:650;max-width:900px}
    .oee-availix-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:17px}.oee-availix-link{display:inline-flex;align-items:center;gap:9px;text-decoration:none;border-radius:999px;padding:12px 17px;background:#fff;color:#0f3fb3;font-weight:950;box-shadow:0 12px 28px rgba(0,0,0,.18)}
    .oee-availix-link.secondary{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.18);box-shadow:none}
    .oee-availix-side{display:grid;gap:9px}.oee-availix-feature{padding:11px 13px;border-radius:15px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.14);color:#fff;font-weight:800;line-height:1.35}.oee-availix-feature small{display:block;color:#bfdbfe;margin-top:3px;font-weight:650}
    .oee-top{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(330px,.9fr);gap:16px;align-items:stretch;min-width:0}
    .oee-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}.oee-field{display:grid;gap:6px;min-width:0}.oee-field.wide{grid-column:span 2}.oee-field.full{grid-column:1/-1}
    .oee-field label{color:var(--navy);font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.055em}.oee-field input,.oee-field select,.oee-field textarea{width:100%;min-width:0;border:1px solid var(--border);border-radius:13px;background:#f8fbff;color:var(--text);padding:10px 11px;min-height:42px;font:inherit;font-weight:700;outline:none}.oee-field textarea{min-height:72px;resize:vertical}.oee-field input:focus,.oee-field select:focus,.oee-field textarea:focus{border-color:rgba(20,99,255,.55);background:#fff;box-shadow:0 0 0 4px rgba(20,99,255,.09)}
    .oee-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px;align-items:center}.oee-import-label{cursor:pointer}
    .oee-main-score{display:grid;grid-template-columns:150px 1fr;gap:16px;align-items:center}.oee-gauge{--value:0;--gauge-color:#1463ff;width:145px;height:145px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--gauge-color) calc(var(--value)*1%),rgba(255,255,255,.13) 0);position:relative;box-shadow:0 15px 34px rgba(0,0,0,.18)}
    .oee-gauge:before{content:"";position:absolute;inset:13px;border-radius:50%;background:linear-gradient(145deg,#111c34,#0f172a);border:1px solid rgba(255,255,255,.12)}.oee-gauge-content{position:relative;z-index:1;text-align:center}.oee-gauge-content b{display:block;font-size:32px;line-height:1;color:#fff;letter-spacing:-.045em}.oee-gauge-content span{display:block;color:#bfdbfe;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;margin-top:7px}
    .oee-score-copy h5{margin:0;color:#fff;font-size:21px}.oee-score-copy p{margin:7px 0 0;color:#dbeafe;line-height:1.45;font-weight:650}.oee-gap-badge{display:inline-flex;margin-top:10px;padding:7px 10px;border-radius:999px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.14);font-weight:900}
    .oee-components{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:16px}.oee-component{border-radius:15px;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.13);padding:12px;min-width:0}.oee-component b{display:block;color:#fff;font-size:24px;letter-spacing:-.03em}.oee-component span{display:block;color:#dbeafe;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;margin-top:4px}.oee-mini-track{height:7px;border-radius:999px;background:rgba(255,255,255,.13);overflow:hidden;margin-top:9px}.oee-mini-track i{display:block;height:100%;width:var(--w,0%);background:#7aa7ff;border-radius:inherit}
    .oee-summary-box{margin-top:13px;padding:12px;border-radius:15px;background:rgba(16,185,129,.12);border:1px solid rgba(16,185,129,.27);color:#ecfdf5;font-weight:750;line-height:1.45}.oee-summary-box.warn{background:rgba(255,138,0,.12);border-color:rgba(255,138,0,.29);color:#fff7ed}#oeeLossReconciliation{color:#111827!important}
    .oee-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.oee-kpi{border-radius:16px;background:#f8fbff;border:1px solid var(--border);padding:13px}.oee-kpi b{display:block;color:var(--navy);font-size:23px;line-height:1.05;letter-spacing:-.03em}.oee-kpi span{display:block;color:var(--muted);font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;margin-top:5px}
    .oee-waterfall{display:grid;gap:9px;margin-top:12px}.oee-waterfall-row{display:grid;grid-template-columns:minmax(145px,210px) minmax(220px,1fr) 86px;gap:10px;align-items:center;color:var(--navy);font-size:13px;font-weight:850}.oee-waterfall-track{height:19px;border-radius:999px;background:#edf2f8;overflow:hidden;border:1px solid var(--border)}.oee-waterfall-track span{display:block;height:100%;width:var(--w,0%);border-radius:inherit;background:linear-gradient(90deg,#1463ff,#7aa7ff)}.oee-waterfall-row.loss .oee-waterfall-track span{background:linear-gradient(90deg,#ff8a00,#ffc46b)}.oee-waterfall-row.bad .oee-waterfall-track span{background:linear-gradient(90deg,#ef4444,#fb7185)}.oee-waterfall-row.good .oee-waterfall-track span{background:linear-gradient(90deg,#10b981,#6ee7b7)}
    .oee-two{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);gap:16px;min-width:0}.oee-table-wrap{width:100%;max-width:100%;overflow:auto;border:1px solid var(--border);border-radius:16px;background:#fff}.oee-table{border-collapse:collapse;width:100%;min-width:940px;font-size:12px}.oee-table th,.oee-table td{border-bottom:1px solid var(--border);padding:9px;vertical-align:top;text-align:left}.oee-table th{position:sticky;top:0;background:#eef4ff;color:var(--navy);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:950;z-index:1}.oee-table input,.oee-table select,.oee-table textarea{width:100%;min-width:90px;border:1px solid #dbe3ef;border-radius:9px;background:#f8fbff;padding:7px 8px;font:inherit;font-weight:650}.oee-table textarea{min-height:42px;resize:vertical}
    .oee-loss-summary{display:grid;gap:9px;margin-top:13px}.oee-loss-row{display:grid;grid-template-columns:120px 1fr 75px;gap:9px;align-items:center;font-weight:850;color:var(--navy);font-size:12px}.oee-loss-track{height:14px;border-radius:999px;background:#eef4ff;overflow:hidden}.oee-loss-track span{display:block;height:100%;width:var(--w,0%);background:linear-gradient(90deg,#1463ff,#7aa7ff);border-radius:inherit}.oee-loss-row.a .oee-loss-track span{background:linear-gradient(90deg,#ef4444,#fb7185)}.oee-loss-row.p .oee-loss-track span{background:linear-gradient(90deg,#ff8a00,#ffc46b)}.oee-loss-row.q .oee-loss-track span{background:linear-gradient(90deg,#8b5cf6,#c4b5fd)}
    .oee-scenario-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.oee-range{border:1px solid var(--border);border-radius:15px;background:#f8fbff;padding:12px}.oee-range label{display:flex;justify-content:space-between;gap:10px;color:var(--navy);font-size:12px;font-weight:900}.oee-range input{width:100%;margin-top:10px}.oee-scenario-result{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:13px}.oee-scenario-card{border-radius:15px;background:linear-gradient(135deg,#eef4ff,#fff);border:1px solid rgba(20,99,255,.18);padding:12px}.oee-scenario-card b{display:block;color:var(--primary-dark);font-size:22px}.oee-scenario-card span{display:block;color:var(--muted);font-size:11px;font-weight:900;text-transform:uppercase;margin-top:4px}
    .oee-history-toolbar{display:flex;flex-wrap:wrap;gap:9px;align-items:center;justify-content:space-between;margin-bottom:10px}.oee-history-table{width:100%;border-collapse:collapse;min-width:760px;font-size:12px}.oee-history-table th,.oee-history-table td{padding:9px;border-bottom:1px solid var(--border);text-align:left}.oee-history-table th{background:#eef4ff;color:var(--navy);font-size:11px;text-transform:uppercase;letter-spacing:.05em}
    .oee-comparison{display:grid;grid-template-columns:1fr 1fr;gap:12px}.oee-compare-card{border-radius:18px;padding:16px;border:1px solid var(--border);background:#f8fbff}.oee-compare-card.availix{background:linear-gradient(135deg,#0f172a,#0f3fb3);border-color:rgba(20,99,255,.35);color:#fff}.oee-compare-card h5{margin:0 0 10px;font-size:17px;color:var(--navy)}.oee-compare-card.availix h5{color:#fff}.oee-compare-card ul{margin:0;padding-left:18px;display:grid;gap:7px;color:var(--muted);font-weight:700;line-height:1.4}.oee-compare-card.availix ul{color:#dbeafe}
    @media(max-width:1180px){.oee-availix-hero,.oee-top,.oee-two{grid-template-columns:1fr}.oee-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.oee-kpis,.oee-scenario-result{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:720px){.oee-fields,.oee-components,.oee-kpis,.oee-scenario-grid,.oee-scenario-result,.oee-comparison{grid-template-columns:1fr}.oee-field.wide{grid-column:auto}.oee-main-score{grid-template-columns:1fr;text-align:center}.oee-gauge{margin:auto}.oee-waterfall-row{grid-template-columns:110px minmax(130px,1fr) 68px}.oee-availix-hero{padding:18px}}
    @media print{.oee-actions,.oee-availix-actions,.oee-table .lean-btn,.oee-history-toolbar .lean-btn{display:none!important}.oee-panel,.oee-availix-hero{box-shadow:none!important;break-inside:avoid}.oee-table-wrap{overflow:visible}.oee-table{min-width:0;font-size:9px}.oee-availix-hero{-webkit-print-color-adjust:exact;print-color-adjust:exact}.oee-two,.oee-top{grid-template-columns:1fr}.oee-history-table{min-width:0}}

  

    /* TPM / getAVAILIX maintenance planning */
    .tpm-tool{display:grid;gap:18px;min-width:0}
    .tpm-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .tpm-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}.tpm-muted{margin:0;color:var(--muted);font-weight:600;line-height:1.5}
    .tpm-availix-hero{position:relative;overflow:hidden;border-radius:24px;padding:24px;background:linear-gradient(135deg,#071427 0%,#123a74 52%,#1463ff 100%);color:#fff;box-shadow:0 18px 46px rgba(20,99,255,.23)}
    .tpm-availix-hero:after{content:"";position:absolute;width:360px;height:360px;border-radius:50%;right:-170px;top:-190px;background:rgba(255,255,255,.10)}
    .tpm-availix-grid{position:relative;z-index:1;display:grid;grid-template-columns:1.25fr .75fr;gap:20px;align-items:center}
    .tpm-availix-kicker{display:inline-flex;padding:7px 10px;border-radius:999px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.18);font-size:12px;font-weight:950;text-transform:uppercase;letter-spacing:.08em}
    .tpm-availix-hero h4{color:#fff;font-size:clamp(24px,3vw,38px);line-height:1.12;letter-spacing:-.035em;margin:13px 0 10px}.tpm-availix-hero p{color:#dbeafe;font-weight:650;line-height:1.55;margin:0;max-width:880px}
    .tpm-availix-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:17px}.tpm-availix-link{display:inline-flex;align-items:center;gap:8px;text-decoration:none;border-radius:999px;padding:11px 15px;background:#fff;color:#0f3fb3;font-weight:950;box-shadow:0 10px 28px rgba(0,0,0,.16)}.tpm-availix-link.secondary{background:rgba(255,255,255,.11);color:#fff;border:1px solid rgba(255,255,255,.22);box-shadow:none}
    .tpm-availix-features{display:grid;gap:10px}.tpm-availix-feature{padding:13px 14px;border-radius:16px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.16);font-weight:950}.tpm-availix-feature small{display:block;color:#dbeafe;font-weight:600;line-height:1.4;margin-top:4px}
    .tpm-top{display:grid;grid-template-columns:1.1fr .9fr;gap:16px}.tpm-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.tpm-field{display:grid;gap:6px}.tpm-field.wide{grid-column:span 2}.tpm-field label{font-size:11px;color:var(--navy);font-weight:950;text-transform:uppercase;letter-spacing:.055em}.tpm-field input,.tpm-field select,.tpm-field textarea{width:100%;border:1px solid var(--border);border-radius:13px;background:#f8fbff;color:var(--text);padding:10px 11px;font:inherit;font-weight:650;min-height:42px}.tpm-field textarea{min-height:70px;resize:vertical}
    .tpm-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.tpm-kpi{border:1px solid var(--border);border-radius:16px;background:linear-gradient(180deg,#fff,#f8fbff);padding:13px}.tpm-kpi b{display:block;font-size:24px;color:var(--navy);letter-spacing:-.035em}.tpm-kpi span{display:block;margin-top:5px;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:900}.tpm-kpi.good{background:#ecfdf5;border-color:#a7f3d0}.tpm-kpi.warn{background:#fff7ed;border-color:#fed7aa}.tpm-kpi.bad{background:#fff1f2;border-color:#fecdd3}
    .tpm-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}.tpm-section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:12px}.tpm-section-head h4{margin:0 0 5px}
    .tpm-machine-grid{display:grid;grid-template-columns:minmax(300px,.85fr) 1.15fr;gap:16px}.tpm-machine{position:relative;min-height:330px;border-radius:22px;border:1px solid var(--border);overflow:hidden;background:radial-gradient(circle at 25% 20%,rgba(20,99,255,.12),transparent 35%),linear-gradient(180deg,#f8fbff,#eef4ff);display:grid;place-items:center;padding:20px}
    .tpm-machine svg{width:95%;height:280px}.tpm-zone{cursor:pointer}.tpm-zone rect,.tpm-zone circle{stroke:#0f172a;stroke-width:2}.tpm-zone[data-status="ok"] rect,.tpm-zone[data-status="ok"] circle{fill:#d1fae5}.tpm-zone[data-status="due"] rect,.tpm-zone[data-status="due"] circle{fill:#ffedd5}.tpm-zone[data-status="issue"] rect,.tpm-zone[data-status="issue"] circle{fill:#fee2e2}.tpm-zone text{font-weight:900;fill:#0f172a;font-size:13px;pointer-events:none}
    .tpm-zone-list{display:grid;gap:9px}.tpm-zone-card{display:grid;grid-template-columns:10px 1fr auto;gap:10px;align-items:center;border:1px solid var(--border);border-radius:15px;padding:11px;background:#fff}.tpm-zone-card i{width:10px;height:40px;border-radius:999px;background:#10b981}.tpm-zone-card.due i{background:#ff8a00}.tpm-zone-card.issue i{background:#ef4444}.tpm-zone-card b{color:var(--navy)}.tpm-zone-card small{display:block;color:var(--muted);font-weight:650;margin-top:3px}.tpm-zone-card select{border:1px solid var(--border);border-radius:10px;padding:7px;background:#f8fbff;font-weight:800}
    .tpm-table-wrap{overflow:auto;max-width:100%;border:1px solid var(--border);border-radius:17px;background:#fff}.tpm-table{width:100%;border-collapse:collapse;min-width:1120px;font-size:12px}.tpm-table th,.tpm-table td{padding:9px;border-bottom:1px solid var(--border);vertical-align:top;text-align:left}.tpm-table th{position:sticky;top:0;z-index:1;background:#eef4ff;color:var(--navy);font-size:11px;text-transform:uppercase;letter-spacing:.045em;font-weight:950;white-space:nowrap}.tpm-table input,.tpm-table select,.tpm-table textarea{width:100%;min-width:90px;border:1px solid #dbe3ef;border-radius:9px;padding:7px;background:#f8fbff;font:inherit;font-weight:650}.tpm-table textarea{min-height:46px;resize:vertical}.tpm-table .tiny{min-width:65px}.tpm-table .wide{min-width:180px}
    .tpm-badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 8px;font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.04em}.tpm-badge.ok{background:#d1fae5;color:#047857}.tpm-badge.due{background:#ffedd5;color:#9a3412}.tpm-badge.overdue{background:#fee2e2;color:#b91c1c}.tpm-badge.open{background:#dbeafe;color:#1d4ed8}
    .tpm-calendar{display:grid;grid-template-columns:repeat(7,minmax(95px,1fr));gap:8px;overflow:auto;padding-bottom:5px}.tpm-day{min-height:116px;border:1px solid var(--border);border-radius:14px;background:#f8fbff;padding:9px}.tpm-day.today{border-color:#1463ff;box-shadow:0 0 0 2px rgba(20,99,255,.10)}.tpm-day-head{font-size:11px;font-weight:950;color:var(--navy);margin-bottom:7px}.tpm-event{border-radius:9px;padding:6px 7px;margin:4px 0;background:#dbeafe;color:#1e3a8a;font-size:10px;font-weight:850;line-height:1.25}.tpm-event.overdue{background:#fee2e2;color:#991b1b}.tpm-event.done{background:#d1fae5;color:#065f46}
    .tpm-chart{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.tpm-bar-list{display:grid;gap:9px}.tpm-bar-row{display:grid;grid-template-columns:150px 1fr 70px;gap:9px;align-items:center;color:var(--navy);font-weight:850;font-size:12px}.tpm-bar{height:16px;border-radius:999px;background:#eef4ff;border:1px solid var(--border);overflow:hidden}.tpm-bar span{display:block;height:100%;width:var(--w);background:linear-gradient(90deg,#1463ff,#7aa7ff);border-radius:inherit}.tpm-bar.orange span{background:linear-gradient(90deg,#ff8a00,#ffc266)}.tpm-bar.red span{background:linear-gradient(90deg,#ef4444,#fb7185)}
    .tpm-readiness{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.tpm-check{border:1px solid var(--border);border-radius:14px;padding:11px;background:#f8fbff;color:var(--navy);font-weight:800}.tpm-check.pass{background:#ecfdf5;border-color:#a7f3d0}.tpm-check.fail{background:#fff1f2;border-color:#fecdd3}.tpm-check small{display:block;color:var(--muted);font-weight:650;margin-top:4px;line-height:1.35}
    @media(max-width:1180px){.tpm-availix-grid,.tpm-top,.tpm-machine-grid{grid-template-columns:1fr}.tpm-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.tpm-chart{grid-template-columns:1fr}}
    @media(max-width:760px){.tpm-fields,.tpm-kpis,.tpm-readiness{grid-template-columns:1fr}.tpm-field.wide{grid-column:auto}.tpm-calendar{grid-template-columns:repeat(7,110px)}.tpm-bar-row{grid-template-columns:110px 1fr 60px}}
    @media print{.tpm-actions,.tpm-availix-actions,.tpm-table button,.tpm-zone-card select{display:none!important}.tpm-availix-hero{background:#0f172a!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tpm-table-wrap{overflow:visible}.tpm-table{font-size:8px;min-width:0}.tpm-table th,.tpm-table td{padding:4px}.tpm-calendar{grid-template-columns:repeat(7,1fr)}.tpm-day{min-height:80px}.tpm-panel{break-inside:avoid}}

  

    /* Pareto analysis */
    .pareto-tool{display:grid;gap:18px;min-width:0}
    .pareto-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .pareto-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .pareto-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}.pareto-panel.dark h4{color:#fff}
    .pareto-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}.pareto-panel.dark .pareto-muted{color:#dbeafe}
    .pareto-top{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(340px,.75fr);gap:16px;align-items:stretch}
    .pareto-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:14px}
    .pareto-field{display:grid;gap:7px;min-width:0}.pareto-field.wide{grid-column:span 2}
    .pareto-field label{color:var(--navy);font-size:12px;font-weight:950;text-transform:uppercase;letter-spacing:.05em}
    .pareto-field input,.pareto-field select,.pareto-field textarea{width:100%;border:1px solid var(--border);border-radius:13px;background:#f8fbff;color:var(--text);padding:10px 11px;font:inherit;font-weight:650;outline:none;min-width:0}
    .pareto-field textarea{min-height:112px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px}
    .pareto-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}
    .pareto-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
    .pareto-kpi{border-radius:16px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);padding:12px;min-width:0}
    .pareto-kpi b{display:block;color:#fff;font-size:23px;line-height:1.05;letter-spacing:-.03em;overflow-wrap:anywhere}
    .pareto-kpi span{display:block;margin-top:5px;color:#dbeafe;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
    .pareto-message{margin-top:12px;padding:13px;border-radius:15px;background:rgba(20,99,255,.16);border:1px solid rgba(122,167,255,.28);color:#eff6ff;font-weight:750;line-height:1.45}
    .pareto-chart-wrap{overflow-x:auto;overflow-y:hidden;border:1px solid var(--border);border-radius:18px;background:linear-gradient(180deg,#fff,#f8fbff);padding:10px;min-width:0}
    .pareto-chart-wrap svg{display:block;min-height:430px}
    .pareto-legend{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0 0}.pareto-legend span{display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border-radius:999px;background:#eef4ff;border:1px solid rgba(20,99,255,.14);font-size:12px;font-weight:850;color:var(--navy)}
    .pareto-legend i{width:12px;height:12px;border-radius:3px;background:#1463ff;display:inline-block}.pareto-legend i.line{height:3px;border-radius:999px;background:#ff8a00}.pareto-legend i.cut{height:3px;border-radius:999px;background:#ef4444}
    .pareto-table-wrap{overflow:auto;max-width:100%;border:1px solid var(--border);border-radius:18px;background:#fff}
    .pareto-table{width:100%;border-collapse:collapse;min-width:1050px;font-size:13px}
    .pareto-table th,.pareto-table td{border-bottom:1px solid var(--border);padding:9px;text-align:left;vertical-align:middle}
    .pareto-table th{background:#eef4ff;color:var(--navy);font-size:11px;text-transform:uppercase;letter-spacing:.04em;font-weight:950;white-space:nowrap;position:sticky;top:0;z-index:1}
    .pareto-table input,.pareto-table textarea{width:100%;border:1px solid #dbe3ef;border-radius:9px;background:#f8fbff;padding:8px;font:inherit;font-weight:650}.pareto-table textarea{min-height:44px;resize:vertical}
    .pareto-table input[type=number]{min-width:86px}.pareto-table .cat{min-width:210px}.pareto-table .note{min-width:240px}
    .pareto-rank{width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:var(--navy);color:#fff;font-weight:950}
    .pareto-vital{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#fff1f2;color:#b91c1c;border:1px solid rgba(239,68,68,.22);font-size:11px;font-weight:950}.pareto-trivial{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#ecfdf5;color:#047857;border:1px solid rgba(16,185,129,.22);font-size:11px;font-weight:950}
    .pareto-insights{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.pareto-insight{border:1px solid var(--border);border-radius:16px;background:#f8fbff;padding:14px}.pareto-insight b{display:block;color:var(--navy);margin-bottom:6px}.pareto-insight p{margin:0;color:var(--muted);font-size:13px;line-height:1.45;font-weight:650}
    .pareto-availix{background:linear-gradient(135deg,#071426 0%,#123d75 55%,#1463ff 100%);color:#fff;border-radius:24px;padding:24px;position:relative;overflow:hidden;box-shadow:0 18px 42px rgba(15,23,42,.20)}
    .pareto-availix:after{content:"";position:absolute;width:300px;height:300px;border-radius:50%;right:-110px;top:-130px;background:rgba(255,255,255,.10)}
    .pareto-availix-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:20px;position:relative;z-index:1;align-items:center}.pareto-availix h4{color:#fff;font-size:24px;margin:5px 0 9px}.pareto-availix p{color:#dbeafe;margin:0;line-height:1.55;font-weight:600}.pareto-availix-kicker{font-size:12px;text-transform:uppercase;letter-spacing:.12em;font-weight:950;color:#93c5fd}
    .pareto-availix-link{display:inline-flex;margin-top:16px;text-decoration:none;background:#fff;color:#0f3fb3;padding:12px 16px;border-radius:999px;font-weight:950;box-shadow:0 10px 24px rgba(0,0,0,.16)}
    .pareto-availix-features{display:grid;gap:9px}.pareto-availix-feature{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);border-radius:15px;padding:12px;font-weight:900}.pareto-availix-feature small{display:block;color:#dbeafe;margin-top:4px;line-height:1.35;font-weight:600}
    @media(max-width:1180px){.pareto-top,.pareto-availix-grid{grid-template-columns:1fr}.pareto-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.pareto-insights{grid-template-columns:1fr}}
    @media(max-width:680px){.pareto-fields,.pareto-kpis{grid-template-columns:1fr}.pareto-field.wide{grid-column:auto}}
    @media print{.pareto-actions,.pareto-availix{display:none!important}.pareto-chart-wrap,.pareto-table-wrap{overflow:visible}.pareto-table{min-width:0;font-size:9px}.pareto-panel{box-shadow:none}.pareto-chart-wrap svg{width:100%!important;min-height:0}}

  

    /* Histogram interactive analysis */
    .hist-tool{display:grid;gap:18px;min-width:0}
    .hist-top{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(320px,.82fr);gap:16px;align-items:stretch;min-width:0}
    .hist-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .hist-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .hist-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}
    .hist-panel.dark h4{color:#fff}
    .hist-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}
    .hist-panel.dark .hist-muted,.hist-panel.dark label{color:#dbeafe}
    .hist-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}
    .hist-field{display:grid;gap:6px;min-width:0}
    .hist-field.wide{grid-column:span 2}.hist-field.full{grid-column:1/-1}
    .hist-field label{color:var(--navy);font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.05em}
    .hist-field input,.hist-field select,.hist-field textarea{width:100%;border:1px solid var(--border);border-radius:13px;background:#f8fbff;color:var(--text);padding:10px 11px;min-height:42px;font:inherit;font-weight:650;outline:none}
    .hist-field textarea{min-height:112px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.45}
    .hist-field input:focus,.hist-field select:focus,.hist-field textarea:focus{border-color:rgba(20,99,255,.55);background:#fff;box-shadow:0 0 0 4px rgba(20,99,255,.09)}
    .hist-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:14px}
    .hist-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}
    .hist-kpi{border-radius:16px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);padding:12px;min-width:0}
    .hist-kpi b{display:block;color:#fff;font-size:22px;line-height:1.05;letter-spacing:-.03em;overflow-wrap:anywhere}
    .hist-kpi span{display:block;margin-top:5px;color:#dbeafe;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
    .hist-message{margin-top:12px;padding:13px;border-radius:15px;background:rgba(20,99,255,.14);border:1px solid rgba(122,167,255,.28);color:#eff6ff;line-height:1.45;font-weight:700}
    .hist-datasets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
    .hist-dataset{border:1px solid var(--border);border-radius:18px;background:linear-gradient(180deg,#fff,#f8fbff);padding:15px;min-width:0}
    .hist-dataset.hidden{display:none}
    .hist-dataset-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
    .hist-dataset-head h5{margin:0;color:var(--navy);font-size:16px}.hist-dataset-head span{font-size:12px;font-weight:900;color:var(--muted)}
    .hist-dataset-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px}
    .hist-chart-shell{overflow-x:auto;border:1px solid var(--border);border-radius:18px;background:#fff;padding:8px;max-width:100%}
    .hist-chart-svg{display:block;width:100%;min-width:920px;height:auto}
    .hist-legend{display:flex;gap:14px;flex-wrap:wrap;margin-top:12px;color:var(--muted);font-size:12px;font-weight:800}
    .hist-legend span{display:inline-flex;align-items:center;gap:7px}.hist-legend i{width:15px;height:10px;border-radius:3px;background:#1463ff}.hist-legend i.b{background:#10b981}.hist-legend i.curve{height:3px;border-radius:999px;background:#ff8a00}.hist-legend i.spec{height:12px;width:3px;background:#ef4444}.hist-legend i.target{height:12px;width:3px;background:#7c3aed}
    .hist-stat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
    .hist-stat-card{border:1px solid var(--border);border-radius:17px;background:#f8fbff;padding:14px;min-width:0}
    .hist-stat-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:10px}.hist-stat-head b{color:var(--navy);font-size:15px}.hist-stat-head span{font-size:11px;font-weight:900;border-radius:999px;padding:5px 8px;background:#eef4ff;color:var(--primary-dark)}
    .hist-stat-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.hist-stat{border-radius:12px;background:#fff;border:1px solid var(--border);padding:9px;min-width:0}.hist-stat b{display:block;color:var(--navy);font-size:15px;overflow-wrap:anywhere}.hist-stat span{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;font-weight:850;margin-top:4px}
    .hist-table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:17px;max-width:100%}
    .hist-table{width:100%;border-collapse:collapse;min-width:850px;font-size:12px}.hist-table th,.hist-table td{border-bottom:1px solid var(--border);padding:9px;text-align:right;white-space:nowrap}.hist-table th{background:#eef4ff;color:var(--navy);text-transform:uppercase;letter-spacing:.04em;font-size:10px;font-weight:950}.hist-table th:first-child,.hist-table td:first-child{text-align:left}.hist-table tr:last-child td{border-bottom:0}
    .hist-insights{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.hist-insight{border:1px solid var(--border);border-radius:16px;padding:14px;background:#f8fbff}.hist-insight b{display:block;color:var(--navy);margin-bottom:6px}.hist-insight p{margin:0;color:var(--muted);line-height:1.45;font-size:13px;font-weight:650}
    .hist-callout{margin-top:14px;border-radius:16px;border:1px solid rgba(255,138,0,.28);background:#fff7ed;color:#7c2d12;padding:13px;font-weight:700;line-height:1.45}
    .hist-toggle-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:10px}.hist-toggle{display:inline-flex;align-items:center;gap:7px;color:var(--navy);font-size:12px;font-weight:850}.hist-toggle input{accent-color:var(--primary)}
    @media(max-width:1180px){.hist-top,.hist-datasets,.hist-stat-grid{grid-template-columns:1fr}.hist-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:700px){.hist-fields,.hist-stat-list,.hist-insights{grid-template-columns:1fr}.hist-field.wide{grid-column:span 1}.hist-kpis{grid-template-columns:1fr}}
    @media print{.hist-actions,.hist-dataset-actions,#histImportA,#histImportB{display:none!important}.hist-chart-shell,.hist-table-wrap{overflow:visible}.hist-chart-svg{min-width:0}.hist-panel{box-shadow:none;break-inside:avoid}.hist-datasets{grid-template-columns:1fr 1fr}.hist-insights{grid-template-columns:repeat(3,1fr)}}

  



    /* Control Chart / SPC interactive analysis */
    .spc-tool{display:grid;gap:18px;min-width:0}
    .spc-top{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(340px,.8fr);gap:16px;align-items:stretch;min-width:0}
    .spc-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .spc-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .spc-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}.spc-panel.dark h4{color:#fff}
    .spc-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}.spc-panel.dark .spc-muted,.spc-panel.dark label{color:#dbeafe}
    .spc-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}.spc-field{display:grid;gap:6px;min-width:0}.spc-field.wide{grid-column:span 2}.spc-field.full{grid-column:1/-1}
    .spc-field label{color:var(--navy);font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.05em}
    .spc-field input,.spc-field select,.spc-field textarea{width:100%;border:1px solid var(--border);border-radius:13px;background:#f8fbff;color:var(--text);padding:10px 11px;min-height:42px;font:inherit;font-weight:650;outline:none;min-width:0}
    .spc-field textarea{min-height:145px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.45}
    .spc-field input:focus,.spc-field select:focus,.spc-field textarea:focus{border-color:rgba(20,99,255,.55);background:#fff;box-shadow:0 0 0 4px rgba(20,99,255,.09)}
    .spc-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:14px}.spc-actions.compact{margin-top:9px}
    .spc-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}
    .spc-kpi{border-radius:16px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);padding:12px;min-width:0}.spc-kpi b{display:block;color:#fff;font-size:21px;line-height:1.08;letter-spacing:-.03em;overflow-wrap:anywhere}.spc-kpi span{display:block;margin-top:5px;color:#dbeafe;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
    .spc-message{margin-top:12px;padding:13px;border-radius:15px;background:rgba(20,99,255,.14);border:1px solid rgba(122,167,255,.28);color:#eff6ff;line-height:1.45;font-weight:700}
    .spc-chart-stack{display:grid;gap:14px}.spc-chart-card{border:1px solid var(--border);border-radius:18px;background:#fff;padding:10px;overflow:auto;max-width:100%}.spc-chart-card h5{margin:2px 6px 4px;color:var(--navy);font-size:15px}.spc-chart-svg{display:block;width:100%;min-width:960px;height:auto}
    .spc-legend{display:flex;gap:14px;flex-wrap:wrap;margin-top:12px;color:var(--muted);font-size:12px;font-weight:800}.spc-legend span{display:inline-flex;align-items:center;gap:7px}.spc-legend i{width:18px;height:3px;border-radius:999px;background:#1463ff}.spc-legend i.cl{background:#0f172a}.spc-legend i.lim{background:#ef4444}.spc-legend i.spec{background:#7c3aed}.spc-legend i.bad{width:11px;height:11px;border-radius:50%;background:#ef4444}.spc-legend i.base{background:#10b981}
    .spc-table-wrap{overflow:auto;max-width:100%;border:1px solid var(--border);border-radius:18px;background:#fff;max-height:590px}
    .spc-table{width:100%;border-collapse:collapse;min-width:1280px;font-size:12px}.spc-table th,.spc-table td{border-bottom:1px solid var(--border);padding:8px;text-align:left;vertical-align:middle}.spc-table th{background:#eef4ff;color:var(--navy);font-size:10px;text-transform:uppercase;letter-spacing:.04em;font-weight:950;white-space:nowrap;position:sticky;top:0;z-index:2}
    .spc-table input,.spc-table select,.spc-table textarea{width:100%;border:1px solid #dbe3ef;border-radius:9px;background:#f8fbff;padding:8px;font:inherit;font-weight:650}.spc-table input[type=number]{min-width:90px}.spc-table .spc-label-input{min-width:130px}.spc-table .spc-values-input{min-width:310px}.spc-table .spc-note-input{min-width:220px}.spc-table .spc-phase-input{min-width:150px}.spc-table tr.spc-violation{background:#fff1f2}.spc-table tr.spc-selected{outline:2px solid rgba(20,99,255,.45);outline-offset:-2px}.spc-table small{display:block;color:var(--muted);margin-top:3px;font-weight:700}
    .spc-rule-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.spc-rule-card{border:1px solid var(--border);border-radius:16px;padding:14px;background:#f8fbff}.spc-rule-card b{display:block;color:var(--navy);margin-bottom:5px}.spc-rule-card p{margin:0;color:var(--muted);font-size:13px;line-height:1.45;font-weight:650}.spc-rule-card.active{border-color:rgba(239,68,68,.35);background:#fff1f2}.spc-rule-card.active b{color:#991b1b}
    .spc-insights{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.spc-insight{border:1px solid var(--border);border-radius:16px;padding:14px;background:#f8fbff}.spc-insight b{display:block;color:var(--navy);margin-bottom:6px}.spc-insight p{margin:0;color:var(--muted);line-height:1.45;font-size:13px;font-weight:650}
    .spc-callout{margin-top:14px;border-radius:16px;border:1px solid rgba(255,138,0,.28);background:#fff7ed;color:#7c2d12;padding:13px;font-weight:700;line-height:1.45}
    .spc-status-pill{display:inline-flex;align-items:center;gap:7px;border-radius:999px;padding:7px 10px;background:#ecfdf5;color:#047857;border:1px solid rgba(16,185,129,.28);font-size:12px;font-weight:950}.spc-status-pill.bad{background:#fff1f2;color:#b91c1c;border-color:rgba(239,68,68,.28)}
    @media(max-width:1180px){.spc-top{grid-template-columns:1fr}.spc-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.spc-rule-grid,.spc-insights{grid-template-columns:1fr}}
    @media(max-width:700px){.spc-fields{grid-template-columns:1fr}.spc-field.wide{grid-column:span 1}.spc-kpis{grid-template-columns:1fr}}
    @media print{.spc-actions,#spcImportJson,#spcFile{display:none!important}.spc-chart-card,.spc-table-wrap{overflow:visible}.spc-chart-svg{min-width:0}.spc-panel{box-shadow:none;break-inside:avoid}.spc-table{min-width:0;font-size:8px}.spc-rule-grid,.spc-insights{grid-template-columns:repeat(3,1fr)}}

    /* Scatter diagram interactive analysis */
    .scatter-tool{display:grid;gap:18px;min-width:0}
    .scatter-top{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(330px,.82fr);gap:16px;align-items:stretch;min-width:0}
    .scatter-panel{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06);min-width:0}
    .scatter-panel.dark{background:linear-gradient(135deg,var(--navy),var(--surface));color:#fff;border-color:rgba(255,255,255,.12)}
    .scatter-panel h4{margin:0 0 8px;color:var(--navy);font-size:19px}.scatter-panel.dark h4{color:#fff}
    .scatter-muted{margin:0 0 14px;color:var(--muted);line-height:1.5;font-weight:600}.scatter-panel.dark .scatter-muted,.scatter-panel.dark label{color:#dbeafe}
    .scatter-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}.scatter-field{display:grid;gap:6px;min-width:0}.scatter-field.wide{grid-column:span 2}.scatter-field.full{grid-column:1/-1}
    .scatter-field label{color:var(--navy);font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.05em}
    .scatter-field input,.scatter-field select,.scatter-field textarea{width:100%;border:1px solid var(--border);border-radius:13px;background:#f8fbff;color:var(--text);padding:10px 11px;min-height:42px;font:inherit;font-weight:650;outline:none;min-width:0}
    .scatter-field textarea{min-height:132px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.45}
    .scatter-field input:focus,.scatter-field select:focus,.scatter-field textarea:focus{border-color:rgba(20,99,255,.55);background:#fff;box-shadow:0 0 0 4px rgba(20,99,255,.09)}
    .scatter-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:14px}.scatter-actions.compact{margin-top:9px}
    .scatter-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}
    .scatter-kpi{border-radius:16px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);padding:12px;min-width:0}
    .scatter-kpi b{display:block;color:#fff;font-size:22px;line-height:1.05;letter-spacing:-.03em;overflow-wrap:anywhere}.scatter-kpi span{display:block;margin-top:5px;color:#dbeafe;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
    .scatter-message{margin-top:12px;padding:13px;border-radius:15px;background:rgba(20,99,255,.14);border:1px solid rgba(122,167,255,.28);color:#eff6ff;line-height:1.45;font-weight:700}
    .scatter-chart-shell{overflow:auto;border:1px solid var(--border);border-radius:18px;background:#fff;padding:8px;max-width:100%;position:relative}
    .scatter-chart-svg{display:block;width:100%;min-width:920px;height:auto}
    .scatter-legend{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px}.scatter-legend button{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border);background:#f8fbff;color:var(--navy);border-radius:999px;padding:7px 10px;font-size:12px;font-weight:850;cursor:pointer}.scatter-legend button.off{opacity:.38;text-decoration:line-through}.scatter-legend i{width:11px;height:11px;border-radius:50%;display:inline-block;background:var(--dot)}
    .scatter-table-wrap{overflow:auto;max-width:100%;border:1px solid var(--border);border-radius:18px;background:#fff;max-height:560px}
    .scatter-table{width:100%;border-collapse:collapse;min-width:1120px;font-size:13px}.scatter-table th,.scatter-table td{border-bottom:1px solid var(--border);padding:8px;text-align:left;vertical-align:middle}.scatter-table th{background:#eef4ff;color:var(--navy);font-size:11px;text-transform:uppercase;letter-spacing:.04em;font-weight:950;white-space:nowrap;position:sticky;top:0;z-index:2}
    .scatter-table input,.scatter-table select,.scatter-table textarea{width:100%;border:1px solid #dbe3ef;border-radius:9px;background:#f8fbff;padding:8px;font:inherit;font-weight:650}.scatter-table input[type=number]{min-width:100px}.scatter-table .scatter-label-input{min-width:170px}.scatter-table .scatter-group-input{min-width:130px}.scatter-table textarea{min-width:220px;min-height:42px;resize:vertical}
    .scatter-row-selected{background:#eef4ff}.scatter-outlier-badge{display:inline-flex;padding:5px 8px;border-radius:999px;background:#fff1f2;color:#b91c1c;border:1px solid rgba(239,68,68,.22);font-size:11px;font-weight:950}.scatter-ok-badge{display:inline-flex;padding:5px 8px;border-radius:999px;background:#ecfdf5;color:#047857;border:1px solid rgba(16,185,129,.22);font-size:11px;font-weight:950}
    .scatter-insights{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.scatter-insight{border:1px solid var(--border);border-radius:16px;background:#f8fbff;padding:14px}.scatter-insight b{display:block;color:var(--navy);margin-bottom:6px}.scatter-insight p{margin:0;color:var(--muted);font-size:13px;line-height:1.45;font-weight:650}
    .scatter-callout{border-radius:18px;padding:16px;background:#fff7ed;border:1px solid rgba(255,138,0,.28);color:#7c2d12;font-weight:700;line-height:1.5}
    .scatter-group-summary{display:grid;gap:9px;margin-top:12px}.scatter-group-card{display:grid;grid-template-columns:16px 1fr auto;gap:10px;align-items:center;border-radius:14px;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.14);padding:10px}.scatter-group-card i{width:12px;height:12px;border-radius:50%;background:var(--dot)}.scatter-group-card b{color:#fff}.scatter-group-card span{color:#dbeafe;font-size:12px;font-weight:750}
    @media(max-width:1180px){.scatter-top{grid-template-columns:1fr}.scatter-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.scatter-insights{grid-template-columns:1fr}}
    @media(max-width:680px){.scatter-fields,.scatter-kpis{grid-template-columns:1fr}.scatter-field.wide{grid-column:auto}}
    @media print{.scatter-actions,.scatter-table-wrap{display:none!important}.scatter-panel{box-shadow:none}.scatter-chart-shell{overflow:visible}.scatter-chart-svg{min-width:0;width:100%!important}.scatter-top{grid-template-columns:1.25fr .75fr}.scatter-insights{grid-template-columns:repeat(3,1fr)}}

    /* Compact getAVAILIX branding and informational footer */
    .brand {
      gap: 10px;
    }

    .brand-logo {
      width: 54px;
      height: 54px;
      flex: 0 0 54px;
      display: block;
      object-fit: contain;
      filter: drop-shadow(0 8px 16px rgba(20, 99, 255, .30));
    }

    .brand-copy {
      min-width: 0;
    }

    .site-footer {
      display: grid;
      justify-items: center;
      gap: 7px;
      line-height: 1.4;
    }

    .site-footer-links {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-items: center;
      gap: 7px;
      font-size: 12px;
    }

    .site-footer-links span {
      color: #a3afbf;
    }

    .site-footer-links button {
      appearance: none;
      border: 0;
      padding: 1px 2px;
      margin: 0;
      background: transparent;
      color: #475569;
      font: inherit;
      font-weight: 750;
      text-decoration: none;
      cursor: pointer;
    }

    .site-footer-links button:hover,
    .site-footer-links button:focus-visible {
      color: var(--primary-dark);
      text-decoration: underline;
      outline: none;
    }

    .legal-modal[hidden] {
      display: none !important;
    }

    .legal-modal {
      position: fixed;
      inset: 0;
      z-index: 10000;
      display: grid;
      place-items: center;
      padding: 22px;
    }

    .legal-modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(2, 8, 23, .72);
      backdrop-filter: blur(5px);
    }

    .legal-modal-dialog {
      position: relative;
      z-index: 1;
      width: min(760px, 100%);
      max-height: min(82vh, 760px);
      overflow: auto;
      border: 1px solid var(--border);
      border-radius: 22px;
      background: #fff;
      color: var(--text);
      box-shadow: 0 28px 80px rgba(2, 8, 23, .32);
      padding: 26px;
    }

    .legal-modal-dialog h2 {
      margin: 0 46px 14px 0;
      color: var(--navy);
      font-size: clamp(24px, 4vw, 34px);
      letter-spacing: -.03em;
    }

    .legal-modal-content {
      color: #475569;
      line-height: 1.65;
      font-weight: 580;
    }

    .legal-modal-content h3 {
      margin: 20px 0 6px;
      color: var(--navy);
      font-size: 16px;
    }

    .legal-modal-content p {
      margin: 8px 0;
    }

    .legal-modal-content ul {
      margin: 8px 0 12px;
      padding-left: 20px;
    }

    .legal-modal-content a {
      color: var(--primary-dark);
      font-weight: 850;
    }

    .legal-modal-note {
      margin-top: 18px !important;
      padding: 12px 14px;
      border-radius: 14px;
      background: #fff7ed;
      border: 1px solid rgba(255, 138, 0, .25);
      color: #7c2d12;
      font-size: 13px;
    }

    .legal-modal-close {
      position: absolute;
      top: 16px;
      right: 16px;
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #f8fafc;
      color: var(--navy);
      font-size: 25px;
      line-height: 1;
      cursor: pointer;
    }

    .legal-modal-close:hover {
      background: #eef4ff;
      color: var(--primary-dark);
    }

    @media (max-width: 520px) {
      .brand-logo {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
      }

      .legal-modal {
        padding: 10px;
      }

      .legal-modal-dialog {
        border-radius: 17px;
        padding: 21px 18px;
      }
    }

    @media print {
      .site-footer,
      .legal-modal {
        display: none !important;
      }
    }

  

    /* Language switcher */

    /* Homepage and sidebar navigation */
    .brand-home-button {
      width: 100%;
      appearance: none;
      font: inherit;
      text-align: left;
      background: transparent;
      color: inherit;
      border: 0;
      border-bottom: 1px solid rgba(255,255,255,.11);
      border-radius: 16px 16px 8px 8px;
      cursor: pointer;
      transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
    }

    .brand-home-button:hover,
    .brand-home-button:focus-visible,
    .brand-home-button.active {
      background: rgba(20,99,255,.16);
      outline: none;
    }

    .brand-home-button:hover,
    .brand-home-button:focus-visible {
      transform: translateY(-1px);
      box-shadow: 0 10px 24px rgba(0,0,0,.12);
    }

    .home-card {
      padding-bottom: 2px;
    }

    .home-hero {
      position: relative;
      overflow: hidden;
      display: grid;
      grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr);
      gap: 34px;
      align-items: center;
      min-height: 430px;
      padding: clamp(30px, 5vw, 64px);
      border-radius: 28px;
      background:
        radial-gradient(circle at 88% 18%, rgba(255,255,255,.18), transparent 24%),
        radial-gradient(circle at 72% 86%, rgba(255,138,0,.20), transparent 26%),
        linear-gradient(135deg, #071225 0%, #123365 48%, #1463ff 100%);
      color: #fff;
      box-shadow: var(--shadow);
    }

    .home-hero::after {
      content: "";
      position: absolute;
      width: 360px;
      height: 360px;
      right: -160px;
      top: -180px;
      border: 1px solid rgba(255,255,255,.16);
      border-radius: 50%;
      box-shadow: 0 0 0 55px rgba(255,255,255,.035), 0 0 0 110px rgba(255,255,255,.025);
      pointer-events: none;
    }

    .home-hero-copy,
    .home-hero-mark {
      position: relative;
      z-index: 1;
    }

    .home-eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 16px;
      padding: 8px 12px;
      border: 1px solid rgba(255,255,255,.16);
      border-radius: 999px;
      background: rgba(255,255,255,.10);
      color: #dbeafe;
      font-size: 12px;
      font-weight: 900;
      letter-spacing: .10em;
      text-transform: uppercase;
    }

    .home-hero h2 {
      margin: 0;
      max-width: 760px;
      color: #fff;
      font-size: clamp(38px, 6vw, 72px);
      line-height: .98;
      letter-spacing: -.055em;
    }

    .home-hero h2 span {
      display: block;
      margin-top: 8px;
      color: #a9c7ff;
      font-size: .52em;
      letter-spacing: -.025em;
    }

    .home-hero p {
      max-width: 760px;
      margin: 22px 0 0;
      color: #dbeafe;
      font-size: clamp(16px, 2vw, 19px);
      line-height: 1.65;
      font-weight: 560;
    }

    .home-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 28px;
    }

    .home-primary-action,
    .home-secondary-action {
      min-height: 48px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 12px 18px;
      border-radius: 14px;
      font: inherit;
      font-size: 14px;
      font-weight: 900;
      text-decoration: none;
      cursor: pointer;
      transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
    }

    .home-primary-action {
      border: 1px solid #fff;
      background: #fff;
      color: var(--primary-dark);
      box-shadow: 0 12px 28px rgba(0,0,0,.18);
    }

    .home-secondary-action {
      border: 1px solid rgba(255,255,255,.26);
      background: rgba(255,255,255,.10);
      color: #fff;
    }

    .home-primary-action:hover,
    .home-primary-action:focus-visible,
    .home-secondary-action:hover,
    .home-secondary-action:focus-visible {
      transform: translateY(-2px);
      outline: none;
      box-shadow: 0 14px 30px rgba(0,0,0,.20);
    }

    .home-secondary-action:hover,
    .home-secondary-action:focus-visible {
      background: rgba(255,255,255,.18);
    }

    .home-hero-mark {
      width: min(100%, 290px);
      aspect-ratio: 1;
      justify-self: center;
      display: grid;
      place-content: center;
      text-align: center;
      border: 1px solid rgba(255,255,255,.17);
      border-radius: 50%;
      background: rgba(255,255,255,.09);
      box-shadow: inset 0 0 0 18px rgba(255,255,255,.035), 0 24px 60px rgba(0,0,0,.18);
      backdrop-filter: blur(8px);
    }

    .home-hero-mark span {
      color: #fff;
      font-size: clamp(42px, 6vw, 70px);
      font-weight: 950;
      letter-spacing: -.07em;
      line-height: .85;
    }

    .home-hero-mark small {
      margin-top: 13px;
      color: #a9c7ff;
      font-size: 17px;
      font-weight: 900;
      letter-spacing: .12em;
      text-transform: uppercase;
    }

    .home-feature-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
      margin: 22px 0;
    }

    .home-feature {
      padding: 22px;
      border: 1px solid var(--border);
      border-radius: 20px;
      background: #fff;
      box-shadow: 0 10px 28px rgba(15,23,42,.07);
    }

    .home-feature-icon {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      margin-bottom: 15px;
      border-radius: 13px;
      background: var(--soft);
      color: var(--primary-dark);
      font-weight: 950;
      font-size: 18px;
    }

    .home-feature h3 {
      margin: 0 0 8px;
      color: var(--navy);
      font-size: 18px;
    }

    .home-feature p {
      margin: 0;
      color: var(--muted);
      line-height: 1.55;
      font-weight: 580;
    }

    .home-family {
      padding: clamp(24px, 4vw, 38px);
      border: 1px solid var(--border);
      border-radius: 26px;
      background: linear-gradient(135deg, #ffffff 0%, #f1f6ff 100%);
      box-shadow: 0 12px 34px rgba(15,23,42,.08);
    }

    .home-family-head {
      display: flex;
      align-items: end;
      justify-content: space-between;
      gap: 20px;
      margin-bottom: 20px;
    }

    .home-family-head h3 {
      margin: 0;
      color: var(--navy);
      font-size: clamp(26px, 4vw, 38px);
      letter-spacing: -.035em;
    }

    .home-family-head p {
      max-width: 650px;
      margin: 8px 0 0;
      color: var(--muted);
      line-height: 1.55;
      font-weight: 580;
    }

    .home-family-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .home-family-card {
      min-height: 180px;
      appearance: none;
      font: inherit;
      text-align: left;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      padding: 20px;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: #fff;
      color: inherit;
      text-decoration: none;
      transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
    }

    .home-family-card:hover,
    .home-family-card:focus-visible {
      transform: translateY(-3px);
      border-color: rgba(20,99,255,.42);
      box-shadow: 0 14px 30px rgba(20,99,255,.12);
      outline: none;
    }

    .home-family-card em {
      display: inline-flex;
      align-self: flex-start;
      margin-bottom: 15px;
      padding: 6px 9px;
      border-radius: 999px;
      background: var(--soft);
      color: var(--primary-dark);
      font-size: 11px;
      font-style: normal;
      font-weight: 900;
      letter-spacing: .06em;
      text-transform: uppercase;
    }

    .home-family-card strong {
      color: var(--navy);
      font-size: 21px;
    }

    .home-family-card span {
      display: block;
      margin: 8px 0 18px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 570;
    }

    .home-family-card b {
      margin-top: auto;
      color: var(--primary-dark);
      font-size: 13px;
    }

    @media (max-width: 1040px) {
      .home-hero {
        grid-template-columns: 1fr;
      }
      .home-hero-mark {
        display: none;
      }
    }

    @media (max-width: 760px) {
      .home-feature-grid,
      .home-family-grid {
        grid-template-columns: 1fr;
      }
      .home-family-head {
        align-items: flex-start;
        flex-direction: column;
      }
      .home-hero {
        min-height: 0;
        padding: 28px 22px;
        border-radius: 22px;
      }
    }


    .language-switcher {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      padding: 0 2px;
    }

    .language-switch-link {
      min-width: 0;
      min-height: 54px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      padding: 8px 6px;
      border: 1px solid rgba(255,255,255,.13);
      border-radius: 13px;
      background: rgba(255,255,255,.055);
      color: #cbd5e1;
      text-decoration: none;
      font-size: 11px;
      font-weight: 800;
      line-height: 1.1;
      transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease;
    }

    .language-switch-link:hover,
    .language-switch-link:focus-visible {
      transform: translateY(-1px);
      background: rgba(20,99,255,.22);
      border-color: rgba(147,197,253,.56);
      color: #fff;
      box-shadow: 0 10px 24px rgba(20,99,255,.14);
      outline: none;
    }

    .language-switch-link.active {
      background: #ffffff;
      border-color: #ffffff;
      color: var(--primary-dark);
      box-shadow: 0 9px 20px rgba(0,0,0,.16);
    }

    .language-switch-code {
      min-width: 30px;
      height: 23px;
      display: inline-grid;
      place-items: center;
      border-radius: 8px;
      background: rgba(255,255,255,.12);
      color: #ffffff;
      font-size: 11px;
      font-weight: 950;
      letter-spacing: .06em;
    }

    .language-switch-link.active .language-switch-code {
      background: var(--primary);
      color: #ffffff;
      box-shadow: 0 5px 12px rgba(20,99,255,.22);
    }

    @media print {
      .language-switcher {
        display: none !important;
      }
    }



    /* Andon / getAVAILIX Call System */
    .andon-tool { display: grid; gap: 18px; }
    .andon-availix-hero {
      border-radius: 24px;
      padding: 24px;
      color: #fff;
      background:
        radial-gradient(circle at 92% 10%, rgba(255,255,255,.16), transparent 25%),
        linear-gradient(135deg, #0f172a 0%, #123c75 52%, #1463ff 100%);
      box-shadow: 0 18px 44px rgba(15,23,42,.17);
      overflow: hidden;
    }
    .andon-availix-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); gap: 20px; align-items: stretch; }
    .andon-availix-kicker { display: inline-flex; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.16); color: #dbeafe; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
    .andon-availix-hero h4 { margin: 13px 0 9px; font-size: clamp(24px,3vw,36px); line-height: 1.08; letter-spacing: -.035em; }
    .andon-availix-hero p { margin: 0; max-width: 860px; color: #dbeafe; line-height: 1.58; font-weight: 560; }
    .andon-availix-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
    .andon-availix-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 15px; border-radius: 999px; background: #fff; color: #0f3fb3; text-decoration: none; font-weight: 950; box-shadow: 0 10px 24px rgba(0,0,0,.16); }
    .andon-availix-link.secondary { background: rgba(255,255,255,.11); color: #fff; border: 1px solid rgba(255,255,255,.2); box-shadow: none; }
    .andon-availix-features { display: grid; gap: 10px; }
    .andon-availix-feature { padding: 14px; border-radius: 17px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.15); color: #fff; font-weight: 900; }
    .andon-availix-feature small { display: block; margin-top: 5px; color: #dbeafe; font-size: 12px; line-height: 1.42; font-weight: 600; }

    .andon-grid { display: grid; grid-template-columns: minmax(320px,.78fr) minmax(0,1.22fr); gap: 16px; align-items: start; }
    .andon-panel { background: #fff; border: 1px solid var(--border); border-radius: 21px; padding: 18px; box-shadow: 0 12px 30px rgba(15,23,42,.065); }
    .andon-panel.dark { background: linear-gradient(135deg,var(--navy),var(--surface)); color: #fff; border-color: rgba(255,255,255,.1); }
    .andon-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
    .andon-section-head h4 { margin: 0 0 5px; color: var(--navy); font-size: 20px; }
    .andon-panel.dark .andon-section-head h4 { color: #fff; }
    .andon-section-head p { margin: 0; color: var(--muted); line-height: 1.45; font-weight: 600; }
    .andon-panel.dark .andon-section-head p { color: #cbd5e1; }
    .andon-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
    .andon-field { display: grid; gap: 6px; }
    .andon-field.wide { grid-column: 1/-1; }
    .andon-field label { color: var(--navy); font-size: 12px; font-weight: 900; }
    .andon-field input, .andon-field select, .andon-field textarea { width: 100%; border: 1px solid var(--border); border-radius: 13px; background: #fff; color: var(--text); padding: 11px 12px; font: inherit; outline: none; }
    .andon-field textarea { min-height: 86px; resize: vertical; }
    .andon-field input:focus, .andon-field select:focus, .andon-field textarea:focus { border-color: rgba(20,99,255,.62); box-shadow: 0 0 0 3px rgba(20,99,255,.1); }
    .andon-type-label { margin: 14px 0 7px; color: var(--navy); font-size: 12px; font-weight: 900; }
    .andon-type-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
    .andon-type-btn { min-height: 48px; border: 1px solid var(--border); border-radius: 14px; background: #f8fbff; color: var(--navy); cursor: pointer; font: inherit; font-size: 13px; font-weight: 900; transition: .15s ease; }
    .andon-type-btn:hover { transform: translateY(-1px); border-color: rgba(20,99,255,.4); }
    .andon-type-btn.active { color: #fff; background: linear-gradient(135deg,var(--primary),#0b4ed5); border-color: transparent; box-shadow: 0 9px 20px rgba(20,99,255,.2); }
    .andon-form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
    .andon-form-note { margin: 11px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; font-weight: 600; }

    .andon-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
    .andon-kpi { min-height: 100px; border-radius: 17px; padding: 14px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); }
    .andon-kpi b { display: block; color: #fff; font-size: 27px; line-height: 1; letter-spacing: -.035em; }
    .andon-kpi span { display: block; margin-top: 8px; color: #cbd5e1; font-size: 11px; line-height: 1.3; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
    .andon-filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
    .andon-filter-btn { border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(255,255,255,.07); color: #cbd5e1; padding: 8px 11px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 900; }
    .andon-filter-btn.active { background: #fff; color: var(--primary-dark); border-color: #fff; }

    .andon-board { display: grid; gap: 11px; }
    .andon-empty { padding: 30px 18px; text-align: center; border: 2px dashed #c8d5e6; border-radius: 18px; background: #f8fbff; color: var(--muted); font-weight: 700; line-height: 1.5; }
    .andon-call { --andon-accent:#1463ff; display: grid; grid-template-columns: 7px minmax(0,1fr); overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 9px 24px rgba(15,23,42,.055); }
    .andon-call::before { content:""; background: var(--andon-accent); }
    .andon-call.priority-stop { box-shadow: 0 12px 30px rgba(239,68,68,.13); }
    .andon-call-body { padding: 15px; }
    .andon-call-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
    .andon-call-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    .andon-call-title strong { color: var(--navy); font-size: 17px; }
    .andon-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border-radius: 999px; background: #eef4ff; color: #0f3fb3; font-size: 10px; font-weight: 950; text-transform: uppercase; letter-spacing: .05em; }
    .andon-badge.stop { background: #fee2e2; color: #991b1b; }
    .andon-status { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: .04em; }
    .andon-status.new { background: #fee2e2; color: #991b1b; }
    .andon-status.acknowledged { background: #fef3c7; color: #92400e; }
    .andon-status.in-progress { background: #dbeafe; color: #1e40af; }
    .andon-status.resolved { background: #d1fae5; color: #065f46; }
    .andon-call-description { margin: 9px 0 12px; color: #334155; line-height: 1.48; font-weight: 600; white-space: pre-wrap; }
    .andon-call-meta { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
    .andon-meta-box { border-radius: 12px; padding: 9px; background: #f8fbff; border: 1px solid #e5edf7; }
    .andon-meta-box b { display: block; color: var(--navy); font-size: 13px; }
    .andon-meta-box span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
    .andon-meta-box.late { background: #fff1f2; border-color: #fecdd3; }
    .andon-meta-box.late b, .andon-meta-box.late span { color: #9f1239; }
    .andon-call-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e7edf6; }
    .andon-mini-btn { border: 0; border-radius: 11px; padding: 9px 11px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 900; background: #eef4ff; color: #0f3fb3; }
    .andon-mini-btn.primary { background: var(--primary); color: #fff; }
    .andon-mini-btn.success { background: #d1fae5; color: #065f46; }
    .andon-mini-btn.danger { background: #fee2e2; color: #991b1b; margin-left: auto; }

    .andon-guidance-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
    .andon-rule-list { display: grid; gap: 9px; margin-top: 12px; }
    .andon-rule { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; padding: 11px; border-radius: 14px; background: #f8fbff; border: 1px solid var(--border); }
    .andon-rule b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--navy); color: #fff; font-size: 12px; }
    .andon-rule strong { display: block; color: var(--navy); margin-bottom: 3px; }
    .andon-rule span { color: var(--muted); font-size: 13px; line-height: 1.4; font-weight: 600; }
    .andon-cta-panel { background: linear-gradient(135deg,#eef4ff,#fff); border-color: rgba(20,99,255,.25); }
    .andon-cta-panel ul { margin: 13px 0 0; padding-left: 20px; color: #334155; line-height: 1.6; font-weight: 650; }
    .andon-cta-panel .andon-availix-link { margin-top: 15px; background: var(--primary); color: #fff; }

    @media (max-width: 1100px) {
      .andon-availix-grid, .andon-grid { grid-template-columns: 1fr; }
      .andon-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
    }
    @media (max-width: 720px) {
      .andon-fields, .andon-guidance-grid { grid-template-columns: 1fr; }
      .andon-call-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
      .andon-type-grid { grid-template-columns: 1fr; }
    }
    @media print {
      .andon-availix-actions, .andon-form-actions, .andon-filter-row, .andon-call-actions { display:none !important; }
      .andon-grid, .andon-guidance-grid, .andon-availix-grid { grid-template-columns:1fr !important; }
      .andon-call { break-inside:avoid; }
    }



    /* 5S audit form generator */
    .five-s-audit-generator {
      display: grid;
      gap: 18px;
      margin-top: 24px;
    }

    .five-s-audit-head {
      background: linear-gradient(135deg, #0f172a 0%, #174079 58%, #1463ff 100%);
      color: #fff;
      border-radius: 24px;
      padding: 22px;
      box-shadow: var(--shadow);
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 18px;
      align-items: center;
    }

    .five-s-audit-head h4 {
      margin: 0 0 7px;
      color: #fff;
      font-size: 23px;
      letter-spacing: -.025em;
    }

    .five-s-audit-head p {
      margin: 0;
      max-width: 940px;
      color: #dbeafe;
      line-height: 1.5;
      font-weight: 600;
    }

    .five-s-audit-readiness {
      min-width: 150px;
      border-radius: 20px;
      padding: 16px;
      text-align: center;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.18);
    }

    .five-s-audit-readiness b {
      display: block;
      color: #fff;
      font-size: 32px;
      line-height: 1;
    }

    .five-s-audit-readiness span {
      display: block;
      margin-top: 7px;
      color: #dbeafe;
      font-size: 11px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: .07em;
    }

    .five-s-audit-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
      gap: 16px;
      align-items: start;
    }

    .five-s-audit-panel {
      min-width: 0;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(15,23,42,.06);
    }

    .five-s-audit-panel h5 {
      margin: 0 0 6px;
      color: var(--navy);
      font-size: 18px;
    }

    .five-s-audit-panel > p {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.5;
      font-weight: 600;
    }

    .five-s-audit-fields {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    .five-s-audit-field {
      display: grid;
      gap: 7px;
      min-width: 0;
    }

    .five-s-audit-field.span-2 { grid-column: span 2; }
    .five-s-audit-field.span-4 { grid-column: 1 / -1; }

    .five-s-audit-field label {
      color: var(--navy);
      font-size: 11px;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .055em;
    }

    .five-s-audit-field input,
    .five-s-audit-field select,
    .five-s-audit-field textarea {
      width: 100%;
      min-height: 43px;
      border: 1px solid var(--border);
      border-radius: 13px;
      background: #f8fbff;
      color: var(--text);
      padding: 10px 11px;
      font: inherit;
      font-weight: 650;
      outline: none;
    }

    .five-s-audit-field textarea {
      min-height: 78px;
      resize: vertical;
    }

    .five-s-audit-field input:focus,
    .five-s-audit-field select:focus,
    .five-s-audit-field textarea:focus {
      border-color: rgba(20,99,255,.52);
      background: #fff;
      box-shadow: 0 0 0 4px rgba(20,99,255,.09);
    }

    .five-s-audit-template-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 9px;
      margin-top: 12px;
    }

    .five-s-audit-template {
      border: 1px solid rgba(20,99,255,.18);
      border-radius: 14px;
      background: #eef4ff;
      color: var(--navy);
      padding: 11px 12px;
      text-align: left;
      cursor: pointer;
      font: inherit;
      font-size: 13px;
      font-weight: 850;
      transition: .15s ease;
    }

    .five-s-audit-template:hover {
      transform: translateY(-1px);
      border-color: rgba(20,99,255,.42);
      background: #e4edff;
    }

    .five-s-audit-template small {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
    }

    .five-s-audit-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 9px;
      margin-top: 14px;
    }

    .five-s-audit-status {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 14px;
    }

    .five-s-audit-status span {
      border-radius: 999px;
      padding: 7px 10px;
      background: #f1f5f9;
      border: 1px solid var(--border);
      color: var(--navy);
      font-size: 11px;
      font-weight: 900;
    }

    .five-s-audit-status span.good {
      background: #ecfdf5;
      border-color: rgba(16,185,129,.3);
      color: #047857;
    }

    .five-s-audit-status span.warn {
      background: #fff7ed;
      border-color: rgba(249,115,22,.3);
      color: #c2410c;
    }

    .five-s-audit-table-wrap {
      max-width: 100%;
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 17px;
      background: #fff;
      margin-top: 13px;
      scrollbar-color: #94a3b8 #e2e8f0;
      scrollbar-width: auto;
    }

    .five-s-audit-table-wrap::-webkit-scrollbar { height: 14px; }
    .five-s-audit-table-wrap::-webkit-scrollbar-track { background: #e2e8f0; border-radius: 999px; }
    .five-s-audit-table-wrap::-webkit-scrollbar-thumb { background: #94a3b8; border: 3px solid #e2e8f0; border-radius: 999px; }

    .five-s-audit-table {
      width: 100%;
      min-width: 1240px;
      border-collapse: collapse;
      font-size: 12px;
    }

    .five-s-audit-table th,
    .five-s-audit-table td {
      padding: 9px;
      border-bottom: 1px solid var(--border);
      text-align: left;
      vertical-align: top;
    }

    .five-s-audit-table th {
      position: sticky;
      top: 0;
      z-index: 1;
      background: #eef4ff;
      color: var(--navy);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .05em;
      font-weight: 950;
      white-space: nowrap;
    }

    .five-s-audit-table input,
    .five-s-audit-table select,
    .five-s-audit-table textarea {
      width: 100%;
      min-height: 38px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #f8fbff;
      color: var(--text);
      padding: 8px;
      font: inherit;
      font-size: 12px;
      font-weight: 650;
      outline: none;
    }

    .five-s-audit-table textarea {
      min-height: 58px;
      resize: vertical;
    }

    .five-s-audit-row-actions {
      display: flex;
      gap: 5px;
      flex-wrap: wrap;
      min-width: 108px;
    }

    .five-s-audit-row-actions button {
      width: 31px;
      height: 31px;
      border: 1px solid var(--border);
      border-radius: 9px;
      background: #fff;
      color: var(--navy);
      cursor: pointer;
      font-weight: 950;
    }

    .five-s-audit-row-actions button:hover { background: #eef4ff; }
    .five-s-audit-row-actions button.danger { color: #b91c1c; background: #fff1f2; }

    .five-s-audit-preview-shell {
      border-radius: 18px;
      padding: 13px;
      background: #dce6f3;
      overflow-x: auto;
    }

    .five-s-audit-preview {
      min-width: 1040px;
      background: #fff;
      color: #0f172a;
      border-radius: 8px;
      padding: 22px;
      box-shadow: 0 12px 30px rgba(15,23,42,.14);
    }

    .five-s-audit-empty {
      min-height: 230px;
      border: 2px dashed #94a3b8;
      border-radius: 12px;
      display: grid;
      place-items: center;
      text-align: center;
      color: #475569;
      padding: 24px;
      font-weight: 700;
    }

    .five-s-audit-doc-head {
      display: grid;
      grid-template-columns: minmax(0, 1.35fr) minmax(390px, .65fr);
      border: 2px solid #0f172a;
    }

    .five-s-audit-doc-title {
      padding: 15px 17px;
      background: #0f172a;
      color: #fff;
    }

    .five-s-audit-doc-title small {
      display: block;
      color: #bfdbfe;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .08em;
    }

    .five-s-audit-doc-title h2 {
      margin: 7px 0 4px;
      color: #fff;
      font-size: 26px;
    }

    .five-s-audit-doc-title p {
      margin: 0;
      color: #dbeafe;
      font-weight: 650;
    }

    .five-s-audit-doc-meta {
      display: grid;
      grid-template-columns: 1fr 1fr;
    }

    .five-s-audit-doc-meta div {
      padding: 8px 9px;
      border-left: 1px solid #0f172a;
      border-bottom: 1px solid #0f172a;
      font-size: 10px;
    }

    .five-s-audit-doc-meta b {
      display: block;
      color: #475569;
      font-size: 8px;
      text-transform: uppercase;
      margin-bottom: 2px;
    }

    .five-s-audit-doc-section {
      margin-top: 12px;
    }

    .five-s-audit-doc-section h3 {
      margin: 0 0 7px;
      padding: 7px 10px;
      background: #eaf1ff;
      border-left: 6px solid #1463ff;
      color: #0f172a;
      font-size: 13px;
      text-transform: uppercase;
    }

    .five-s-audit-score-legend {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 6px;
    }

    .five-s-audit-score-legend div {
      border: 1px solid #64748b;
      border-radius: 5px;
      padding: 6px;
      font-size: 8px;
      line-height: 1.3;
    }

    .five-s-audit-score-legend b {
      display: block;
      font-size: 13px;
      margin-bottom: 2px;
    }

    .five-s-audit-doc-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 7.4px;
    }

    .five-s-audit-doc-table th,
    .five-s-audit-doc-table td {
      border: 1px solid #64748b;
      padding: 3px 4px;
      vertical-align: top;
      text-align: left;
    }

    .five-s-audit-doc-table th {
      background: #dbeafe;
      color: #0f172a;
      font-size: 6.8px;
      text-transform: uppercase;
    }

    .five-s-audit-score-boxes {
      white-space: nowrap;
      line-height: 1.8;
      font-size: 7px;
    }

    .five-s-audit-score-boxes i {
      display: inline-block;
      width: 10px;
      height: 10px;
      border: 1px solid #334155;
      vertical-align: middle;
      margin: 0 1px 0 3px;
    }

    .five-s-audit-writing-lines {
      min-height: 34px;
      background: repeating-linear-gradient(to bottom, transparent 0, transparent 12px, #cbd5e1 13px);
    }

    .five-s-audit-summary {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 7px;
    }

    .five-s-audit-summary div,
    .five-s-audit-signatures div {
      border: 1px solid #64748b;
      padding: 6px;
      min-height: 43px;
      font-size: 8px;
    }

    .five-s-audit-summary b,
    .five-s-audit-signatures b {
      display: block;
      margin-bottom: 5px;
      text-transform: uppercase;
      color: #475569;
      font-size: 7px;
    }

    .five-s-audit-signatures {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 7px;
      margin-top: 10px;
    }

    .five-s-audit-note {
      margin: 11px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      font-weight: 600;
    }

    @media (max-width: 1120px) {
      .five-s-audit-grid { grid-template-columns: 1fr; }
    }

    @media (max-width: 760px) {
      .five-s-audit-head { grid-template-columns: 1fr; }
      .five-s-audit-readiness { min-width: 0; }
      .five-s-audit-fields { grid-template-columns: 1fr; }
      .five-s-audit-field.span-2,
      .five-s-audit-field.span-4 { grid-column: auto; }
      .five-s-audit-template-grid { grid-template-columns: 1fr; }
    }

    /* Capacity & Production Balancer */
    .cpb-tool { display: grid; gap: 18px; }
    .cpb-hero,
    .cpb-panel,
    .cpb-result-panel,
    .cpb-method {
      border: 1px solid var(--border);
      border-radius: 20px;
      background: #fff;
      box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
    }
    .cpb-hero {
      padding: 24px;
      display: grid;
      grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
      gap: 18px;
      background: linear-gradient(135deg, #0f172a 0%, #173d85 58%, #1463ff 100%);
      color: #fff;
      overflow: hidden;
      position: relative;
    }
    .cpb-hero::after {
      content: "";
      position: absolute;
      width: 280px;
      height: 280px;
      border-radius: 50%;
      right: -90px;
      top: -120px;
      background: rgba(255,255,255,.09);
    }
    .cpb-eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 11px;
      border-radius: 999px;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.18);
      text-transform: uppercase;
      letter-spacing: .08em;
      font-size: 11px;
      font-weight: 900;
    }
    .cpb-hero h4 { margin: 14px 0 8px; font-size: clamp(24px, 3vw, 38px); line-height: 1.06; }
    .cpb-hero p { margin: 0; color: #dbeafe; line-height: 1.7; max-width: 820px; }
    .cpb-hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
    .cpb-hero .lean-btn.secondary { color: #fff; border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.1); }
    .cpb-hero-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: center; position: relative; z-index: 1; }
    .cpb-hero-kpi { padding: 15px; border-radius: 16px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(8px); }
    .cpb-hero-kpi b { display: block; font-size: 23px; line-height: 1; }
    .cpb-hero-kpi span { display: block; color: #bfdbfe; font-size: 11px; margin-top: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
    .cpb-panel { padding: 20px; }
    .cpb-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
    .cpb-section-head h4 { margin: 0 0 5px; font-size: 18px; color: var(--navy); }
    .cpb-section-head p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 13px; }
    .cpb-section-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
    .cpb-meta-grid,
    .cpb-settings-grid { display: grid; gap: 12px; }
    .cpb-meta-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
    .cpb-settings-grid { grid-template-columns: repeat(8, minmax(120px, 1fr)); }
    .cpb-field { display: grid; gap: 6px; }
    .cpb-field label { color: #334155; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .055em; }
    .cpb-field input,
    .cpb-field select,
    .cpb-field textarea,
    .cpb-table input,
    .cpb-table select {
      width: 100%;
      border: 1px solid #cbd5e1;
      border-radius: 11px;
      background: #fff;
      color: var(--text);
      padding: 10px 11px;
      outline: none;
      font: inherit;
      font-size: 13px;
    }
    .cpb-field input:focus,
    .cpb-field select:focus,
    .cpb-table input:focus,
    .cpb-table select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20,99,255,.11); }
    .cpb-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 15px; }
    .cpb-table { width: 100%; border-collapse: collapse; min-width: 1050px; background: #fff; }
    .cpb-table th { position: sticky; top: 0; z-index: 1; padding: 10px 9px; background: #eef4ff; color: #334155; font-size: 10px; text-transform: uppercase; letter-spacing: .055em; text-align: left; border-bottom: 1px solid #cbd5e1; white-space: nowrap; }
    .cpb-table td { padding: 8px 7px; border-bottom: 1px solid #e5e7eb; vertical-align: middle; }
    .cpb-table tr:last-child td { border-bottom: 0; }
    .cpb-table tr:hover td { background: #f8fafc; }
    .cpb-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
    .cpb-row-index { width: 34px; text-align: center; color: #64748b; font-weight: 900; }
    .cpb-col-name { min-width: 160px; }
    .cpb-col-codes { min-width: 175px; }
    .cpb-col-note { min-width: 180px; }
    .cpb-mini-btn { border: 0; border-radius: 9px; padding: 8px 10px; cursor: pointer; font-weight: 900; background: #fee2e2; color: #b91c1c; }
    .cpb-input-help { margin-top: 10px; color: #64748b; font-size: 12px; line-height: 1.55; }
    .cpb-run-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-radius: 16px; border: 1px solid #bfdbfe; background: #eff6ff; }
    .cpb-run-strip strong { display: block; color: #1e3a8a; font-size: 14px; }
    .cpb-run-strip span { display: block; color: #475569; font-size: 12px; margin-top: 4px; }
    .cpb-run-strip .lean-btn { min-width: 180px; }
    .cpb-status-banner { padding: 18px; border-radius: 17px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; border: 1px solid; }
    .cpb-status-banner.good { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
    .cpb-status-banner.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
    .cpb-status-banner.bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
    .cpb-status-banner.empty { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
    .cpb-status-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.68); font-size: 23px; font-weight: 900; }
    .cpb-status-banner h4 { margin: 0 0 4px; font-size: 18px; }
    .cpb-status-banner p { margin: 0; line-height: 1.5; font-size: 13px; }
    .cpb-status-chip { padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.72); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
    .cpb-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(130px,1fr)); gap: 11px; margin-top: 14px; }
    .cpb-kpi { border: 1px solid var(--border); border-radius: 15px; padding: 14px; background: #fff; }
    .cpb-kpi b { display: block; color: var(--navy); font-size: 21px; line-height: 1.1; }
    .cpb-kpi span { display: block; color: #64748b; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; margin-top: 7px; }
    .cpb-result-grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(320px,.9fr); gap: 16px; margin-top: 16px; }
    .cpb-result-panel { padding: 18px; box-shadow: none; }
    .cpb-result-panel h5 { margin: 0 0 13px; color: var(--navy); font-size: 15px; }
    .cpb-load-list { display: grid; gap: 12px; }
    .cpb-load-card { border: 1px solid var(--border); border-radius: 14px; padding: 13px; background: #fff; }
    .cpb-load-card.over { border-color: #fecaca; background: #fff7f7; }
    .cpb-load-card.risk { border-color: #fde68a; background: #fffdf4; }
    .cpb-load-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
    .cpb-load-head strong { color: var(--navy); }
    .cpb-load-head b { font-size: 14px; }
    .cpb-load-sub { color: #64748b; font-size: 11px; margin-top: 4px; }
    .cpb-bar { height: 11px; border-radius: 999px; background: #e2e8f0; position: relative; overflow: hidden; margin-top: 10px; }
    .cpb-bar span { display: block; height: 100%; width: min(100%, var(--cpb-width)); border-radius: inherit; background: linear-gradient(90deg, #1463ff, #60a5fa); }
    .cpb-load-card.risk .cpb-bar span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
    .cpb-load-card.over .cpb-bar span { background: linear-gradient(90deg, #dc2626, #fb7185); }
    .cpb-bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--cpb-target); width: 2px; background: #0f172a; opacity: .65; }
    .cpb-job-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
    .cpb-job-tag { display: inline-flex; padding: 5px 7px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 10px; font-weight: 800; }
    .cpb-insights { display: grid; gap: 9px; }
    .cpb-insight { display: grid; grid-template-columns: 28px 1fr; gap: 9px; align-items: start; padding: 11px; border-radius: 12px; border: 1px solid #e2e8f0; background: #f8fafc; }
    .cpb-insight b { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: #e0e7ff; color: #3730a3; }
    .cpb-insight strong { display: block; color: #1e293b; font-size: 12px; }
    .cpb-insight span { display: block; color: #64748b; font-size: 11px; line-height: 1.45; margin-top: 3px; }
    .cpb-output-table { min-width: 900px; }
    .cpb-output-table td { font-size: 12px; }
    .cpb-util { font-weight: 900; }
    .cpb-util.good { color: #047857; }
    .cpb-util.warn { color: #b45309; }
    .cpb-util.bad { color: #b91c1c; }
    .cpb-matrix { min-width: max-content; }
    .cpb-matrix th:first-child,
    .cpb-matrix td:first-child { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 180px; }
    .cpb-matrix th:first-child { background: #eef4ff; z-index: 3; }
    .cpb-matrix td:not(:first-child), .cpb-matrix th:not(:first-child) { text-align: center; min-width: 82px; }
    .cpb-compat-yes { color: #047857; font-weight: 1000; }
    .cpb-compat-no { color: #cbd5e1; }
    .cpb-compat-off { color: #dc2626; font-weight: 900; }
    .cpb-method { padding: 18px; background: #f8fafc; box-shadow: none; }
    .cpb-method summary { cursor: pointer; font-weight: 900; color: #1e293b; }
    .cpb-method-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 14px; }
    .cpb-method-card { border: 1px solid #dbe3ef; border-radius: 13px; background: #fff; padding: 13px; }
    .cpb-method-card b { display: block; color: #1e3a8a; margin-bottom: 5px; }
    .cpb-method-card span { color: #64748b; line-height: 1.5; font-size: 12px; }
    .cpb-empty { padding: 28px; text-align: center; color: #64748b; border: 1px dashed #cbd5e1; border-radius: 14px; background: #f8fafc; }
    .cpb-hidden-file { display: none; }
    @media (max-width: 1250px) {
      .cpb-settings-grid { grid-template-columns: repeat(4,1fr); }
      .cpb-kpi-grid { grid-template-columns: repeat(3,1fr); }
      .cpb-meta-grid { grid-template-columns: 2fr 1fr 1fr; }
      .cpb-meta-grid .cpb-field:last-child { grid-column: 1 / -1; }
    }
    @media (max-width: 850px) {
      .cpb-hero, .cpb-result-grid { grid-template-columns: 1fr; }
      .cpb-settings-grid, .cpb-meta-grid, .cpb-method-grid { grid-template-columns: 1fr 1fr; }
      .cpb-kpi-grid { grid-template-columns: 1fr 1fr; }
      .cpb-section-head, .cpb-run-strip { flex-direction: column; }
      .cpb-section-actions { justify-content: flex-start; }
      .cpb-run-strip .lean-btn { width: 100%; }
    }
    @media (max-width: 560px) {
      .cpb-settings-grid, .cpb-meta-grid, .cpb-method-grid, .cpb-kpi-grid, .cpb-hero-kpis { grid-template-columns: 1fr; }
      .cpb-panel { padding: 15px; }
    }
    @media print {
      #capacity-production-balancer .method-intro,
      #capacity-production-balancer .cpb-hero-actions,
      #capacity-production-balancer .cpb-section-actions,
      #capacity-production-balancer .cpb-run-strip,
      #capacity-production-balancer .cpb-mini-btn,
      #capacity-production-balancer .cpb-input-help,
      #capacity-production-balancer .cpb-hidden-file { display: none !important; }
      #capacity-production-balancer .cpb-hero,
      #capacity-production-balancer .cpb-panel,
      #capacity-production-balancer .cpb-result-panel,
      #capacity-production-balancer .cpb-method { box-shadow: none; break-inside: avoid; }
      #capacity-production-balancer .cpb-table-wrap { overflow: visible; }
      #capacity-production-balancer .cpb-table { min-width: 0; font-size: 8px; }
      #capacity-production-balancer .cpb-table input,
      #capacity-production-balancer .cpb-table select { border: 0; padding: 2px; font-size: 8px; }
    }


    /* Universal constraint editor additions */
    .cpb-callout { margin: 0 0 15px; padding: 13px 15px; border: 1px solid #bfdbfe; border-radius: 13px; background: #eff6ff; color: #1e3a8a; font-size: 12px; line-height: 1.55; }
    .cpb-factor-list, .cpb-entity-list { display: grid; gap: 13px; }
    .cpb-factor-card, .cpb-entity-card { border: 1px solid #dbe3ef; border-radius: 16px; background: #fff; padding: 15px; }
    .cpb-factor-card.is-off, .cpb-entity-card.is-off { opacity: .62; background: #f8fafc; }
    .cpb-factor-card { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: start; }
    .cpb-factor-number, .cpb-entity-title > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #e0e7ff; color: #3730a3; font-weight: 900; flex: 0 0 auto; }
    .cpb-factor-fields { display: grid; grid-template-columns: minmax(220px,.8fr) minmax(320px,1.6fr); gap: 10px; }
    .cpb-factor-side { display: flex; gap: 8px; align-items: center; }
    .cpb-factor-rule-help { grid-column: 2 / -1; padding: 9px 11px; border-radius: 10px; background: #f8fafc; color: #64748b; font-size: 11px; line-height: 1.5; }
    .cpb-switch { display: inline-flex; align-items: center; gap: 7px; color: #475569; font-size: 11px; font-weight: 900; white-space: nowrap; }
    .cpb-switch input { width: 18px; height: 18px; accent-color: var(--primary); }
    .cpb-entity-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #e5e7eb; }
    .cpb-entity-title { display: flex; align-items: center; gap: 10px; min-width: 240px; flex: 1; }
    .cpb-entity-title input { width: min(430px,100%); border: 1px solid #cbd5e1; border-radius: 11px; padding: 10px 11px; font: inherit; font-weight: 900; color: var(--navy); }
    .cpb-entity-actions { display: flex; align-items: center; gap: 10px; }
    .cpb-entity-base, .cpb-job-base { display: grid; gap: 10px; margin-top: 13px; }
    .cpb-entity-base { grid-template-columns: 140px 160px minmax(220px,1fr); }
    .cpb-job-base { grid-template-columns: repeat(6,minmax(120px,1fr)) minmax(220px,1.6fr); }
    .cpb-grow { min-width: 0; }
    .cpb-factor-section-title { margin: 15px 0 8px; color: #1e3a8a; font-size: 11px; font-weight: 1000; text-transform: uppercase; letter-spacing: .07em; }
    .cpb-capability-grid { display: grid; grid-template-columns: repeat(3,minmax(220px,1fr)); gap: 10px; padding: 13px; border-radius: 13px; background: #f8fafc; border: 1px solid #e2e8f0; }
    .cpb-capability-grid label small { display: block; margin-top: 3px; color: #94a3b8; font-weight: 700; text-transform: none; letter-spacing: 0; line-height: 1.3; }
    .cpb-factor-value { display: flex; align-items: center; }
    .cpb-factor-value input { border-radius: 11px 0 0 11px !important; }
    .cpb-factor-value span { align-self: stretch; display: grid; place-items: center; min-width: 48px; padding: 0 9px; border: 1px solid #cbd5e1; border-left: 0; border-radius: 0 11px 11px 0; background: #eef2f7; color: #475569; font-size: 11px; font-weight: 900; }

    .cpb-coded-editor { display: grid; gap: 7px; }
    .cpb-slot-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(130px,.48fr); gap: 8px; align-items: end; }
    .cpb-subfield { display: grid; gap: 4px; margin: 0; }
    .cpb-subfield > span { color: #64748b; font-size: 10px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; }
    .cpb-position-subfield .cpb-factor-value input { min-width: 72px; }
    .cpb-option-hint { display: grid; gap: 5px; }
    .cpb-option-hint > span, .cpb-free-option-hint { color: #64748b; font-size: 10px; font-weight: 700; line-height: 1.35; }
    .cpb-option-chips { display: flex; flex-wrap: wrap; gap: 5px; }
    .cpb-option-chip { border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; color: #475569; padding: 4px 8px; font-size: 10px; font-weight: 900; cursor: pointer; }
    .cpb-option-chip:hover { border-color: #94a3b8; background: #f8fafc; }
    .cpb-option-chip.active { border-color: #1463ff; background: #eaf1ff; color: #0b4dcc; box-shadow: inset 0 0 0 1px rgba(20,99,255,.08); }
    .cpb-result-wide { margin-top: 16px; }
    @media (max-width: 1250px) { .cpb-factor-fields { grid-template-columns: 1fr 1fr; } .cpb-job-base { grid-template-columns: repeat(3,1fr); } .cpb-capability-grid { grid-template-columns: repeat(2,1fr); } }
    @media (max-width: 850px) { .cpb-factor-card { grid-template-columns: 34px 1fr; } .cpb-factor-side { grid-column: 2; } .cpb-factor-rule-help { grid-column: 1 / -1; } .cpb-factor-fields, .cpb-entity-base, .cpb-job-base, .cpb-capability-grid { grid-template-columns: 1fr 1fr; } }
    @media (max-width: 560px) { .cpb-slot-row { grid-template-columns: 1fr; } .cpb-factor-card { grid-template-columns: 1fr; } .cpb-factor-number, .cpb-factor-side { grid-column: 1; } .cpb-factor-fields, .cpb-entity-base, .cpb-job-base, .cpb-capability-grid { grid-template-columns: 1fr; } .cpb-entity-head { align-items: flex-start; flex-direction: column; } .cpb-entity-actions { width: 100%; justify-content: space-between; } }


    /* Capacity balancer: keep workstation/job cards inside the visible content width */
    .main { min-width: 0; overflow-x: hidden; }
    #capacity-production-balancer,
    #capacity-production-balancer .tool-card,
    #capacity-production-balancer .tool-body,
    #capacity-production-balancer .cpb-tool,
    #capacity-production-balancer .cpb-panel,
    #capacity-production-balancer .cpb-factor-list,
    #capacity-production-balancer .cpb-entity-list,
    #capacity-production-balancer .cpb-factor-card,
    #capacity-production-balancer .cpb-entity-card,
    #capacity-production-balancer .cpb-factor-fields,
    #capacity-production-balancer .cpb-entity-base,
    #capacity-production-balancer .cpb-job-base,
    #capacity-production-balancer .cpb-capability-grid,
    #capacity-production-balancer .cpb-field,
    #capacity-production-balancer .cpb-coded-editor,
    #capacity-production-balancer .cpb-slot-row,
    #capacity-production-balancer .cpb-subfield {
      min-width: 0;
      max-width: 100%;
    }
    #capacity-production-balancer .cpb-entity-card { overflow: hidden; }
    #capacity-production-balancer .cpb-entity-head { flex-wrap: wrap; }
    #capacity-production-balancer .cpb-entity-title { min-width: min(240px, 100%); }
    #capacity-production-balancer .cpb-entity-actions { flex-wrap: wrap; }
    #capacity-production-balancer input,
    #capacity-production-balancer select,
    #capacity-production-balancer textarea { min-width: 0; max-width: 100%; }
    #capacity-production-balancer .cpb-entity-base {
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    }
    #capacity-production-balancer .cpb-job-base {
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));
    }
    #capacity-production-balancer .cpb-capability-grid {
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    }
    #capacity-production-balancer .cpb-slot-row {
      grid-template-columns: minmax(0, 1fr) minmax(105px, 140px);
    }
    #capacity-production-balancer .cpb-option-chip {
      max-width: 100%;
      overflow-wrap: anywhere;
    }
    @media (max-width: 560px) {
      #capacity-production-balancer .cpb-slot-row { grid-template-columns: 1fr; }
    }




    /* Capacity balancer: fixed versus variable factors */
    #capacity-production-balancer .cpb-factor-content { min-width: 0; display: grid; gap: 9px; }
    #capacity-production-balancer .cpb-factor-fields { grid-template-columns: minmax(170px,.75fr) minmax(165px,.62fr) minmax(125px,.42fr) minmax(260px,1.35fr); }
    #capacity-production-balancer .cpb-factor-mode-help { display: flex; align-items: flex-start; gap: 8px; padding: 9px 11px; border-radius: 11px; font-size: 11px; line-height: 1.45; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0; }
    #capacity-production-balancer .cpb-factor-mode-help.variable { background: #f0fdfa; border-color: #99f6e4; color: #115e59; }
    #capacity-production-balancer .cpb-mode-badge { flex: 0 0 auto; display: inline-flex; padding: 4px 7px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-size: 9px; font-weight: 1000; text-transform: uppercase; letter-spacing: .04em; }
    #capacity-production-balancer .cpb-mode-badge.variable { background: #ccfbf1; color: #0f766e; }
    #capacity-production-balancer .cpb-variable-machine-editor { display: grid; grid-template-columns: minmax(130px,180px) minmax(0,1fr); align-items: end; gap: 10px; }
    #capacity-production-balancer .cpb-variable-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:8px; }
    #capacity-production-balancer .cpb-not-used-btn { border-color:#cbd5e1; background:#f8fafc; color:#475569; }
    #capacity-production-balancer .cpb-factor-unused { border:1px dashed #cbd5e1; border-radius:12px; padding:10px; background:#f8fafc; }
    #capacity-production-balancer .cpb-position-subfield input[readonly] { background:#eef2f7; color:#334155; font-weight:900; cursor:default; }
    #capacity-production-balancer .cpb-unused-note { color:#64748b; font-size:12px; font-weight:700; }
    #capacity-production-balancer .cpb-auto-assign-note { min-height: 42px; display: flex; align-items: center; padding: 9px 11px; border-radius: 10px; background: #ecfeff; color: #155e75; border: 1px solid #a5f3fc; font-size: 10px; font-weight: 800; line-height: 1.35; }
    @media (max-width: 1000px) { #capacity-production-balancer .cpb-factor-fields { grid-template-columns: 1fr 1fr; } #capacity-production-balancer .cpb-factor-fields .cpb-field:last-child { grid-column: 1 / -1; } }
    @media (max-width: 620px) { #capacity-production-balancer .cpb-factor-fields, #capacity-production-balancer .cpb-variable-machine-editor { grid-template-columns: 1fr; } #capacity-production-balancer .cpb-factor-fields .cpb-field:last-child { grid-column: auto; } }

    /* Shared print branding for LEAN Toolbox reports */
    .lean-print-brand { display: none; }
    .cpb-report-only { display: none; }
    .cpb-print-report-head {
      border: 2px solid #0f172a;
      border-radius: 16px;
      overflow: hidden;
      background: #fff;
      margin-bottom: 14px;
    }
    .cpb-print-report-title {
      display: grid;
      grid-template-columns: minmax(0,1fr) auto;
      gap: 18px;
      align-items: center;
      padding: 18px 20px;
      background: #0f172a;
      color: #fff;
    }
    .cpb-print-report-title small { display: block; color: #93c5fd; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; }
    .cpb-print-report-title h2 { margin: 5px 0 2px; color: #fff; font-size: 24px; }
    .cpb-print-report-title p { margin: 0; color: #dbeafe; font-weight: 650; }
    .cpb-print-report-brand { text-align: right; font-weight: 1000; white-space: nowrap; }
    .cpb-print-report-brand span { display: block; color: #93c5fd; font-size: 11px; margin-top: 3px; }
    .cpb-print-meta-grid { display: grid; grid-template-columns: 1.5fr 1fr .7fr 1.5fr; }
    .cpb-print-meta-grid > div { padding: 9px 11px; border-top: 1px solid #94a3b8; border-right: 1px solid #cbd5e1; min-height: 48px; }
    .cpb-print-meta-grid > div:last-child { border-right: 0; }
    .cpb-print-meta-grid b, .cpb-print-block h3 { display: block; color: #475569; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
    .cpb-print-meta-grid span { color: #0f172a; font-size: 12px; font-weight: 750; line-height: 1.35; }
    .cpb-print-report-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; margin-bottom: 14px; }
    .cpb-print-block { border: 1px solid #cbd5e1; border-radius: 13px; padding: 12px; background: #fff; }
    .cpb-print-block h3 { margin: 0 0 8px; color: #0f172a; font-size: 11px; }
    .cpb-print-settings { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
    .cpb-print-setting { border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px; background: #f8fafc; }
    .cpb-print-setting b { display: block; color: #64748b; font-size: 7px; text-transform: uppercase; margin-bottom: 3px; }
    .cpb-print-setting span { color: #0f172a; font-size: 11px; font-weight: 850; }
    .cpb-print-factor-list { display: grid; gap: 6px; }
    .cpb-print-factor-row { display: grid; grid-template-columns: minmax(90px,.35fr) minmax(0,1fr); gap: 8px; border-bottom: 1px solid #e2e8f0; padding-bottom: 5px; }
    .cpb-print-factor-row:last-child { border-bottom: 0; padding-bottom: 0; }
    .cpb-print-factor-row b { color: #1e3a8a; font-size: 10px; }
    .cpb-print-factor-row span { color: #334155; font-size: 10px; line-height: 1.35; }

    #capacity-production-balancer .cpb-output-table th { line-height: 1.25; vertical-align: middle; }
    #capacity-production-balancer .cpb-priority-value { display:inline-flex; align-items:center; justify-content:center; min-width:34px; padding:4px 6px; border-radius:999px; background:#eef2ff; color:#3730a3; font-weight:950; white-space:nowrap; }
    #capacity-production-balancer .cpb-priority-help { margin-top:6px; color:#64748b; font-size:10px; line-height:1.4; }

    @media print {
      .card { animation: none !important; opacity: 1 !important; transform: none !important; }
      .main-mobile-toggle, .mobile-toggle { display: none !important; }
      .lean-print-brand {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        color: #0f172a;
        font-family: Arial, Helvetica, sans-serif;
      }
      .lean-print-brand-header {
        margin: 0 0 6mm;
        padding: 0 0 3mm;
        border-bottom: 2px solid #1463ff;
      }
      .lean-print-brand-footer {
        margin: 6mm 0 0;
        padding: 3mm 0 0;
        border-top: 1px solid #94a3b8;
        font-size: 8px;
        color: #475569;
        break-inside: avoid;
      }
      .lean-print-brand-logo { font-size: 17px; font-weight: 1000; letter-spacing: -.02em; }
      .lean-print-brand-logo small { display: block; margin-top: 1px; color: #1463ff; font-size: 8px; text-transform: uppercase; letter-spacing: .11em; }
      .lean-print-brand-report { text-align: right; }
      .lean-print-brand-report strong { display: block; font-size: 11px; color: #0f172a; }
      .lean-print-brand-report span { display: block; margin-top: 2px; color: #64748b; font-size: 8px; }
      body.a3-printing .lean-print-brand { display: none !important; }

      body.cpb-printing .sidebar,
      body.cpb-printing .topbar,
      body.cpb-printing .footer-note,
      body.cpb-printing #capacity-production-balancer > .method-hero,
      body.cpb-printing #capacity-production-balancer > .tool-card > .tool-head,
      body.cpb-printing #capacity-production-balancer .cpb-hero,
      body.cpb-printing #capacity-production-balancer .cpb-report-source,
      body.cpb-printing #capacity-production-balancer #capResultsSection > .cpb-section-head,
      body.cpb-printing #capacity-production-balancer .cpb-section-actions {
        display: none !important;
      }
      body.cpb-printing #capacity-production-balancer,
      body.cpb-printing #capacity-production-balancer .tool-card,
      body.cpb-printing #capacity-production-balancer .tool-body,
      body.cpb-printing #capacity-production-balancer .cpb-tool,
      body.cpb-printing #capacity-production-balancer #capResultsSection {
        display: block !important;
        break-inside: auto !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
      }
      body.cpb-printing #capacity-production-balancer .cpb-report-only { display: block !important; }
      body.cpb-printing #capacity-production-balancer .cpb-print-report-head,
      body.cpb-printing #capacity-production-balancer .cpb-print-block,
      body.cpb-printing #capacity-production-balancer .cpb-status-banner,
      body.cpb-printing #capacity-production-balancer .cpb-kpi,
      body.cpb-printing #capacity-production-balancer .cpb-load-card,
      body.cpb-printing #capacity-production-balancer .cpb-insight,
      body.cpb-printing #capacity-production-balancer .cpb-result-panel {
        box-shadow: none !important;
        break-inside: avoid;
      }
      body.cpb-printing #capacity-production-balancer .cpb-print-report-title,
      body.cpb-printing #capacity-production-balancer .cpb-status-banner,
      body.cpb-printing #capacity-production-balancer .cpb-bar span,
      body.cpb-printing #capacity-production-balancer .cpb-kpi,
      body.cpb-printing #capacity-production-balancer .cpb-load-card,
      body.cpb-printing #capacity-production-balancer .cpb-job-tag {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }
      body.cpb-printing #capacity-production-balancer .cpb-kpi-grid { grid-template-columns: repeat(4,1fr) !important; gap: 6px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-kpi { padding: 8px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-kpi b { font-size: 15px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-kpi span { font-size: 7px !important; line-height:1.2 !important; white-space:normal !important; overflow-wrap:normal !important; }
      body.cpb-printing #capacity-production-balancer .cpb-result-grid { grid-template-columns: 1.05fr .95fr !important; gap: 9px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-result-panel { padding: 10px !important; margin-top: 9px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-load-list { gap: 6px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-load-card { padding: 7px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-load-sub,
      body.cpb-printing #capacity-production-balancer .cpb-insight span { font-size: 7px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-insight { padding: 6px !important; grid-template-columns: 20px 1fr !important; gap: 6px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-insight b { width: 20px !important; height: 20px !important; font-size: 9px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-insight strong { font-size: 8px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-table-wrap { overflow: visible !important; border-radius: 0 !important; }
      body.cpb-printing #capacity-production-balancer .cpb-table { width: 100% !important; min-width: 0 !important; table-layout: fixed !important; font-size: 6.4px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-table th,
      body.cpb-printing #capacity-production-balancer .cpb-table td { position: static !important; padding: 2.5px 3px !important; overflow-wrap: anywhere; }
      body.cpb-printing #capacity-production-balancer .cpb-table th { font-size: 5.5px !important; white-space: normal !important; overflow-wrap: normal !important; word-break: normal !important; hyphens: auto; line-height: 1.12 !important; text-align: center !important; vertical-align: middle !important; }
      body.cpb-printing #capacity-production-balancer .cpb-machine-table { font-size: 5.75px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-job-table { font-size: 6.1px !important; }
      body.cpb-printing #capacity-production-balancer .cpb-machine-table td:nth-child(n+5):nth-child(-n+13),
      body.cpb-printing #capacity-production-balancer .cpb-job-table td:nth-child(n+4):nth-child(-n+7) { text-align:center; }
      body.cpb-printing #capacity-production-balancer .cpb-table thead { display: table-header-group; }
      body.cpb-printing #capacity-production-balancer .cpb-table tr { break-inside: avoid; }
      body.cpb-printing #capacity-production-balancer .cpb-matrix th:first-child,
      body.cpb-printing #capacity-production-balancer .cpb-matrix td:first-child { position: static !important; min-width: 0 !important; }
    }
  

/* Crawlable guide links and SEO navigation */
.side-seo-hub{margin:12px 14px 8px;padding:12px;border:1px solid rgba(255,255,255,.14);border-radius:14px;background:rgba(255,255,255,.06)}
.side-seo-hub>a{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 11px;border-radius:10px;background:#1463ff;color:#fff;text-decoration:none;font-weight:850;font-size:13px}.side-seo-hub>a:hover{background:#2a73ff}.side-seo-hub details{margin-top:8px}.side-seo-hub summary{cursor:pointer;color:#dce8f7;font-size:12px;font-weight:800;padding:7px}.side-guide-list{display:grid;gap:4px;max-height:270px;overflow:auto;padding:5px}.side-guide-list a{display:block;padding:6px 8px;border-radius:8px;color:#c8d5e6;text-decoration:none;font-size:11px}.side-guide-list a:hover{background:rgba(255,255,255,.09);color:#fff}.nav-item-row{display:grid;grid-template-columns:minmax(0,1fr) 30px;align-items:center;gap:4px}.nav-item-row .nav-btn{min-width:0}.nav-guide-link{height:30px;display:grid;place-items:center;border-radius:9px;color:#a9bed8;text-decoration:none;font-size:12px;font-weight:950}.nav-guide-link:hover{background:rgba(255,255,255,.1);color:#fff}.app-seo-footer-links{display:flex;gap:12px;flex-wrap:wrap}.app-seo-footer-links a{color:inherit;text-decoration:underline}


/* ========================================================================
   LEAN Toolbox UX / orientation release — 2026-08-22
   Keeps calculation modules intact; improves discovery, navigation and focus.
   ======================================================================== */
.sidebar{gap:12px;padding:18px 14px;width:316px;min-width:316px}
.brand{padding:6px 6px 12px}.language-switcher{padding:0}.side-seo-hub{margin:2px 0 0;padding:0;border:0;background:transparent}.side-seo-hub>a{padding:10px 12px;border:1px solid rgba(255,255,255,.11);background:rgba(255,255,255,.06)}.side-seo-hub>a:hover{background:rgba(20,99,255,.22)}.side-seo-hub>a>span:first-child{display:grid;gap:2px}.side-seo-hub b{font-size:12px}.side-seo-hub small{font-size:10px;color:#9fb2cc;font-weight:700}.side-search{position:sticky;top:-18px;margin:0 -2px;padding:10px 2px 8px}.side-search label{display:block;margin:0 3px 6px;color:#91a8c8;font-size:10px;font-weight:900;letter-spacing:.09em;text-transform:uppercase}.side-search input{padding:11px 12px;border-radius:12px}.side-search-meta{margin:6px 4px 0;color:#7f96b5;font-size:10px;font-weight:800;text-align:right}.nav-list{display:grid;gap:7px;padding-bottom:18px}.nav-group{border:1px solid rgba(255,255,255,.08);border-radius:13px;background:rgba(255,255,255,.035);overflow:hidden}.nav-group>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;cursor:pointer;color:#dce8f7;font-size:12px;font-weight:900;line-height:1.25}.nav-group>summary::-webkit-details-marker{display:none}.nav-group>summary:before{content:'›';width:16px;color:#7ba7ff;font-size:18px;line-height:1;transition:transform .16s ease}.nav-group[open]>summary:before{transform:rotate(90deg)}.nav-group>summary>span{flex:1}.nav-group>summary>small{display:grid;place-items:center;min-width:24px;height:22px;border-radius:999px;background:rgba(255,255,255,.08);color:#91a8c8;font-size:10px}.nav-group[open]>summary{background:rgba(255,255,255,.04);border-bottom:1px solid rgba(255,255,255,.07)}.nav-group-body{padding:5px}.nav-item-row{grid-template-columns:minmax(0,1fr) 48px;gap:3px}.nav-item-row .nav-btn{margin:2px 0;padding:9px 10px;border-radius:10px;background:transparent;border-color:transparent;font-size:12px}.nav-item-row .nav-btn:hover{transform:none;background:rgba(20,99,255,.16)}.nav-item-row .nav-btn.active{background:linear-gradient(135deg,var(--primary),#0b4ed5)}.nav-btn small{min-width:25px;height:21px;font-size:9px}.nav-guide-link{height:32px;font-size:9px;font-weight:900;border-radius:9px}.nav-empty{padding:16px 12px;border:1px dashed rgba(255,255,255,.13);border-radius:12px;color:#9fb2cc;font-size:12px;line-height:1.5}

.sidebar-backdrop{display:none}.tool-orientation{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;padding:0 2px;color:#64748b;font-size:12px}.tool-breadcrumb{display:flex;align-items:center;gap:7px;min-width:0;white-space:nowrap;overflow:hidden}.tool-breadcrumb button{appearance:none;border:0;background:transparent;padding:0;color:#0f3fb3;font:inherit;font-weight:850;cursor:pointer}.tool-breadcrumb span,.tool-breadcrumb strong{overflow:hidden;text-overflow:ellipsis}.tool-breadcrumb strong{color:#334155}.tool-orientation-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}.tool-position{padding:6px 9px;border:1px solid var(--border);border-radius:999px;background:#fff;color:#64748b;font-size:10px;font-weight:900}.tool-guide-button,.tool-step{height:32px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:10px;background:#fff;color:#173a6c;text-decoration:none;font:inherit;font-size:11px;font-weight:900;cursor:pointer}.tool-guide-button{padding:0 10px}.tool-step{width:32px;padding:0}.tool-guide-button:hover,.tool-step:not(:disabled):hover{border-color:#aac7f6;background:#eef5ff}.tool-step:disabled{opacity:.35;cursor:default}

.method-hero.method-details{margin:0 0 14px;border:1px solid var(--border);border-radius:16px;background:#fff;box-shadow:0 8px 22px rgba(15,23,42,.05);overflow:hidden}.method-details>summary{list-style:none;display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:11px;align-items:center;padding:12px 14px;cursor:pointer}.method-details>summary::-webkit-details-marker{display:none}.method-summary-icon{width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:#eef4ff;color:#0f3fb3;font-weight:950}.method-summary-copy{display:grid;gap:2px;min-width:0}.method-summary-copy small{color:#64748b;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.07em}.method-summary-copy strong{color:#334155;font-size:12px;line-height:1.4;font-weight:650}.method-summary-toggle{padding:6px 9px;border-radius:9px;background:#f4f7fb;color:#0f3fb3;font-size:10px;font-weight:900}.method-details[open] .method-summary-toggle{font-size:0}.method-details[open] .method-summary-toggle:after{content:'Hide';font-size:10px}.method-details-body{padding:0 14px 14px}.method-details .method-info-grid{margin:0;gap:10px}.method-details .method-info-box{padding:12px 13px;border:1px solid var(--border);border-radius:12px;background:#f8fbff;backdrop-filter:none}.method-details .method-info-box b{color:#19365e;font-size:10px}.method-details .method-info-box span{color:#53657b;font-size:12px;line-height:1.45}.method-details .hero-badges{margin-top:10px;gap:6px}.method-details .hero-badges span{padding:5px 8px;border:1px solid #dce7f6;background:#f2f6fc;color:#53657b;font-size:10px}
.tool-card{margin-bottom:22px}.tool-head{padding:18px 22px}.tool-head h3{font-size:clamp(22px,2.5vw,32px)}.tool-head p{margin-top:5px;font-size:13px}.tool-number{width:48px;height:48px;border-radius:14px;font-size:17px}.tool-body{padding:20px}

.home-card{max-width:1380px;margin:auto}.home-hero-v2{min-height:350px;grid-template-columns:minmax(0,1.5fr) minmax(200px,.5fr)}.home-hero-v2 .home-hero-mark{width:min(100%,220px)}.home-hero-v2 .home-hero-mark span{font-size:64px}.home-hero-v2 .home-hero-mark small{max-width:130px;margin:10px auto 0;font-size:12px;line-height:1.3}.home-hero-v2 h2{font-size:clamp(38px,5vw,66px)}.home-hero-v2 h2 span{font-size:.42em;line-height:1.15}.home-finder,.home-quick{margin:22px 0;padding:clamp(20px,3vw,30px);border:1px solid var(--border);border-radius:24px;background:#fff;box-shadow:0 10px 28px rgba(15,23,42,.06)}.home-section-head{display:flex;justify-content:space-between;align-items:end;gap:18px;margin-bottom:18px}.home-section-head h3{margin:4px 0 0;color:var(--navy);font-size:clamp(24px,3vw,34px);letter-spacing:-.035em}.home-section-kicker{color:#0f3fb3;font-size:10px;font-weight:950;letter-spacing:.09em;text-transform:uppercase}.home-all-tools{appearance:none;border:1px solid #cbd9ef;border-radius:12px;background:#f5f8fd;color:#0f3fb3;padding:10px 13px;font:inherit;font-size:12px;font-weight:900;cursor:pointer;white-space:nowrap}.home-all-tools:hover{background:#eaf2ff}.home-goal-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.home-goal-card{padding:18px;border:1px solid var(--border);border-radius:18px;background:linear-gradient(180deg,#fff,#f8fbff)}.home-goal-card>span{display:grid;place-items:center;width:34px;height:34px;border-radius:11px;background:#eef4ff;color:#0f3fb3;font-size:11px;font-weight:950}.home-goal-card h4{margin:13px 0 7px;color:#172b4d;font-size:17px}.home-goal-card p{margin:0;color:#64748b;font-size:12px;line-height:1.55;font-weight:570}.home-tool-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}.home-tool-chips button{appearance:none;border:1px solid #d8e4f5;border-radius:999px;background:#fff;color:#244b7f;padding:6px 8px;font:inherit;font-size:10px;font-weight:850;cursor:pointer}.home-tool-chips button:hover{border-color:#8db5f4;background:#edf4ff}.home-quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.home-quick-grid button{appearance:none;display:grid;gap:4px;text-align:left;padding:15px;border:1px solid var(--border);border-radius:14px;background:#f9fbfe;font:inherit;cursor:pointer}.home-quick-grid button:hover{border-color:#9dbcf0;background:#eef5ff}.home-quick-grid strong{color:#173a6c;font-size:14px}.home-quick-grid span{color:#64748b;font-size:11px}.home-family-v2{margin-top:22px;box-shadow:0 10px 28px rgba(15,23,42,.06)}

.main-mobile-toggle{position:sticky;top:8px;z-index:7;max-width:100%;box-shadow:0 8px 20px rgba(15,23,42,.18)}.mobile-toggle small{max-width:55vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#bdd2ef;font-size:10px;font-weight:750}.mobile-toggle-label{font-size:12px}
@media(max-width:1180px){.home-goal-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:920px){.sidebar{left:-330px;width:min(316px,88vw);min-width:0}.sidebar-backdrop{position:fixed;inset:0;z-index:9;border:0;background:rgba(3,9,20,.48);backdrop-filter:blur(2px)}body.sidebar-open .sidebar-backdrop{display:block}.main{padding:14px}.main-mobile-toggle{margin-bottom:12px}.tool-orientation{align-items:flex-start;flex-direction:column}.tool-orientation-actions{width:100%}.tool-position{margin-right:auto}.tool-breadcrumb{width:100%}.method-details>summary{grid-template-columns:34px minmax(0,1fr)}.method-summary-toggle{display:none}.tool-body{padding:15px}.tool-head{padding:16px}.home-hero-v2{padding:26px 22px}.home-section-head{align-items:flex-start;flex-direction:column}.home-all-tools{width:100%}.home-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.home-goal-grid,.home-quick-grid{grid-template-columns:1fr}.home-finder,.home-quick{padding:16px;border-radius:18px}.tool-position{display:none}.tool-breadcrumb span:nth-of-type(2),.tool-breadcrumb strong{display:none}.tool-guide-button{margin-left:auto}.method-summary-copy strong{font-size:11px}.home-hero-v2 .home-eyebrow{font-size:10px}.home-hero-v2 h2{font-size:39px}.home-hero-v2 p{font-size:15px}.home-family{padding:20px}}
@media print{.tool-orientation,.method-details{display:none!important}}

html[lang="sk"] .method-details[open] .method-summary-toggle:after{content:'Skryť'}

/* Mobile orientation refinement */
@media(max-width:920px){
  .tool-orientation{align-items:center;flex-direction:row;gap:8px}
  .tool-breadcrumb{width:auto;flex:1}
  .tool-breadcrumb span,.tool-breadcrumb strong{display:none}
  .tool-orientation-actions{width:auto;flex:0 0 auto}
  .tool-head{grid-template-columns:minmax(0,1fr) auto;align-items:start}
  .tool-number{width:42px;height:42px;border-radius:12px;font-size:15px}
  .method-details>summary{grid-template-columns:34px minmax(0,1fr) 28px}
  .method-details>summary::after{content:'+';display:grid;place-items:center;width:26px;height:26px;border-radius:9px;background:#f3f6fb;color:#0f3fb3;font-size:17px;font-weight:900}
  .method-details[open]>summary::after{content:'−'}
}


/* ==========================================================================\n   2026-08-25 · Professional card design system\n   Visual hierarchy and orientation layer. Tool calculations remain unchanged.\n   ========================================================================== */
.tool-section{--tool-accent:#1463ff;--tool-accent-soft:#eef5ff}
.tool-section.category-improve{--tool-accent:#7c3aed;--tool-accent-soft:#f5f0ff}
.tool-section.category-quality{--tool-accent:#c56a08;--tool-accent-soft:#fff7e8}
.tool-section.category-flow{--tool-accent:#1463ff;--tool-accent-soft:#edf5ff}
.tool-section.category-daily{--tool-accent:#0b8a6a;--tool-accent-soft:#eafaf5}

.tool-section .tool-card{position:relative;border:1px solid #d8e2ef;border-radius:24px;background:#fff;box-shadow:0 18px 46px rgba(15,23,42,.08);overflow:hidden}
.tool-section .tool-card::before{content:"";position:absolute;inset:0 auto auto 0;width:100%;height:4px;background:var(--tool-accent);z-index:2}
.tool-section .tool-head{position:relative;padding:20px 22px 17px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);border-bottom:1px solid #e2e8f0}
.tool-head-copy{min-width:0}
.tool-head-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.tool-type-badge,.tool-group-label{display:inline-flex;align-items:center;min-height:24px;border-radius:999px;padding:4px 8px;font-size:9px;font-weight:950;letter-spacing:.065em;text-transform:uppercase;line-height:1}
.tool-type-badge{background:var(--tool-accent-soft);color:var(--tool-accent);border:1px solid color-mix(in srgb,var(--tool-accent) 22%,transparent)}
.tool-group-label{background:#f3f6fa;color:#68788e;border:1px solid #e3e9f1}
.tool-section .tool-head h3{margin:0;color:#10233f;letter-spacing:-.035em}
.tool-section .tool-head p{max-width:900px;color:#63738a;line-height:1.55}
.tool-section .tool-number{background:var(--tool-accent-soft);color:var(--tool-accent);border:1px solid color-mix(in srgb,var(--tool-accent) 22%,transparent);box-shadow:none}

.tool-workflow-strip{display:grid;grid-template-columns:auto minmax(0,1fr);gap:14px;align-items:center;padding:11px 20px 12px;background:#f8fafc;border-bottom:1px solid #e2e8f0}
.tool-workflow-label{color:#7a899d;font-size:9px;font-weight:950;letter-spacing:.085em;text-transform:uppercase;white-space:nowrap}
.tool-workflow-strip ol{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.tool-workflow-strip li{position:relative;display:grid;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:7px;min-width:0;padding:7px 9px;border:1px solid #e1e8f0;border-radius:10px;background:#fff;color:#41536b}
.tool-workflow-strip li:not(:last-child)::after{content:"›";position:absolute;right:-7px;top:50%;transform:translateY(-50%);z-index:2;width:12px;height:18px;display:grid;place-items:center;background:#f8fafc;color:#9aabc0;font-weight:900}
.tool-workflow-strip li span{width:24px;height:24px;border-radius:8px;display:grid;place-items:center;background:var(--tool-accent-soft);color:var(--tool-accent);font-size:9px;font-weight:950}
.tool-workflow-strip li b{overflow:hidden;text-overflow:ellipsis;color:#42546b;font-size:10px;line-height:1.2;font-weight:850}

.tool-section .tool-body{padding:20px;background:#f5f8fc}
.tool-section .tool-body>div{min-width:0}
.tool-section .tool-body [class$="-panel"]:not(.dark),
.tool-section .tool-body [class*="-panel "]:not(.dark){border-color:#dce5ef;box-shadow:0 7px 20px rgba(15,23,42,.045)}
.tool-section .tool-body h4{letter-spacing:-.015em}
.tool-section .tool-body h5{letter-spacing:-.01em}
.tool-section .tool-body p[class$="-muted"],.tool-section .tool-body .muted{color:#68788e}

/* Inputs read as professional worksheets rather than demo controls. */
.tool-section .tool-body input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.tool-section .tool-body select,
.tool-section .tool-body textarea{border-color:#ccd8e6;background:#fff;box-shadow:inset 0 1px 0 rgba(15,23,42,.015)}
.tool-section .tool-body input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):focus,
.tool-section .tool-body select:focus,
.tool-section .tool-body textarea:focus{border-color:var(--tool-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--tool-accent) 12%,transparent);background:#fff}
.tool-section .tool-body label{letter-spacing:.025em}

/* More restrained controls; primary action remains obvious. */
.lean-btn{border-radius:11px;padding:10px 14px;font-size:13px;line-height:1.1;box-shadow:none!important}
.lean-btn:hover{transform:none;filter:brightness(.985)}
.lean-btn.primary{background:var(--tool-accent,#1463ff);box-shadow:0 7px 16px color-mix(in srgb,var(--tool-accent,#1463ff) 20%,transparent)!important}
.lean-btn.secondary{background:#fff;color:#31527c;border-color:#ccd9e9}
.lean-btn.danger{background:#fff;color:#b4232d;border-color:#f1c4c8}

/* Tables and dense registers */
.tool-section .tool-body table{font-variant-numeric:tabular-nums;background:#fff}
.tool-section .tool-body table th{background:#edf3f9;color:#42536b;font-size:10px;letter-spacing:.055em}
.tool-section .tool-body table tbody tr:nth-child(even) td{background:rgba(248,250,252,.72)}
.tool-section .tool-body table tbody tr:hover td{background:#f1f6fc}

/* Visual editors get a neutral engineering workspace. */
#flowchart .flowchart-canvas,#process-mapping .pm-map,#value-stream-mapping-vsm .vsm-map,#spaghetti-diagram .spaghetti-canvas-stage{
  background-color:#f7f9fc;
  background-image:linear-gradient(rgba(98,116,140,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(98,116,140,.07) 1px,transparent 1px);
  background-size:24px 24px;
}

/* 5S is effectively three tools; make that structure obvious. */
.five-s-module-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:10px;border:1px solid #dce5ef;border-radius:16px;background:#fff;box-shadow:0 7px 20px rgba(15,23,42,.04)}
.five-s-module-nav button{appearance:none;display:grid;grid-template-columns:30px minmax(0,1fr);gap:9px;align-items:center;text-align:left;padding:10px 12px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc;color:#31445f;font:inherit;cursor:pointer}
.five-s-module-nav button:hover{border-color:#b8ccef;background:#f1f6ff}
.five-s-module-nav span{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:#eef4ff;color:#0f4fbf;font-size:10px;font-weight:950}
.five-s-module-nav b{font-size:12px}

/* OEE/JIT/TPM/Andon: do the work first, promotion after the working module. */
#oee .oee-availix-hero,#jit-just-in-time .jit-availix-hero,#tpm .tpm-availix-hero,#andon .andon-availix-hero{order:90;margin-top:4px;min-height:0!important;padding:18px 20px!important;border-radius:18px!important;box-shadow:none!important}
#oee .oee-availix-hero h4,#jit-just-in-time .jit-availix-hero h4,#tpm .tpm-availix-hero h4,#andon .andon-availix-hero h4{font-size:19px!important;line-height:1.2!important}
#oee .oee-availix-hero p,#jit-just-in-time .jit-availix-hero p,#tpm .tpm-availix-hero p,#andon .andon-availix-hero p{font-size:12px!important;line-height:1.5!important}
#oee .oee-availix-side,#jit-just-in-time .jit-availix-features,#tpm .tpm-availix-features,#andon .andon-availix-features{gap:7px!important}
#oee .oee-availix-feature,#jit-just-in-time .jit-availix-feature,#tpm .tpm-availix-feature,#andon .andon-availix-feature{padding:10px!important;font-size:11px!important}

/* Raw-feeling analytical cards receive stronger result hierarchy. */
#pareto-analysis .pareto-top>*.dark,#histogram .hist-top>*.dark,#scatter-diagram .scatter-top>*.dark,#control-chart-spc .spc-top>*.dark,
#pareto-analyza .pareto-top>*.dark{box-shadow:0 14px 30px rgba(15,23,42,.12)}
#fmea .fmea-table-wrap,#standard-work .sw-table-wrap,#gemba-walk .gemba-table-wrap,#capacity-production-balancer .cpb-table-wrap{box-shadow:inset 0 0 0 1px rgba(255,255,255,.35)}

/* Compact, clearer orientation on smaller screens. */
@media(max-width:980px){
  .tool-workflow-strip{grid-template-columns:1fr;gap:7px;padding:10px 14px}
  .tool-workflow-strip ol{display:flex;overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:2px}
  .tool-workflow-strip li{min-width:185px;scroll-snap-align:start}
  .tool-workflow-strip li::after{display:none!important}
  .tool-section .tool-body{padding:14px}
}
@media(max-width:640px){
  .tool-section .tool-card{border-radius:18px}
  .tool-section .tool-head{padding:16px 15px 14px}
  .tool-head-meta{margin-bottom:6px}
  .tool-group-label{display:none}
  .tool-type-badge{font-size:8px}
  .tool-workflow-strip{padding:9px 12px}
  .tool-workflow-label{display:none}
  .tool-workflow-strip li{min-width:165px;padding:6px 8px}
  .tool-section .tool-body{padding:11px}
  .lean-btn{min-height:40px}
  .five-s-module-nav{grid-template-columns:1fr;padding:8px}
}
@media print{.tool-workflow-strip,.five-s-module-nav{display:none!important}.tool-section .tool-card{box-shadow:none!important}.tool-section .tool-body{background:#fff!important}}

/* ======================================================================
   Topic-first information architecture · 2026-09-17
   Home -> 4 topic hubs -> tool grid -> individual tool
   ====================================================================== */
.home-hero-v3{
  min-height:330px;
  grid-template-columns:minmax(0,1.45fr) minmax(190px,.55fr);
  padding:clamp(30px,4.5vw,58px);
  border:1px solid #dce5f1;
  background:
    radial-gradient(circle at 92% 8%,rgba(20,99,255,.10),transparent 28%),
    radial-gradient(circle at 74% 100%,rgba(255,138,0,.08),transparent 26%),
    linear-gradient(145deg,#ffffff 0%,#f7faff 100%);
  color:var(--navy);
  box-shadow:0 18px 48px rgba(15,23,42,.08);
}
.home-hero-v3::after{border-color:rgba(20,99,255,.09);box-shadow:0 0 0 55px rgba(20,99,255,.025),0 0 0 110px rgba(20,99,255,.016)}
.home-hero-v3 .home-eyebrow{border-color:#d7e5fb;background:#edf5ff;color:#0f4fc4}
.home-hero-v3 h2{max-width:850px;color:#0b1f3a;font-size:clamp(38px,5.4vw,68px)}
.home-hero-v3 h2 span{color:#3569b5;font-size:.48em;line-height:1.18;margin-top:12px}
.home-hero-v3 p{max-width:830px;color:#52657e;font-size:clamp(15px,1.7vw,18px);line-height:1.68}
.home-hero-v3 .home-primary-action{border-color:#145fe8;background:#145fe8;color:#fff;box-shadow:0 12px 26px rgba(20,95,232,.20)}
.home-hero-v3 .home-secondary-action{border-color:#cddcf0;background:#fff;color:#173a6c;box-shadow:none}
.home-hero-v3 .home-secondary-action:hover,.home-hero-v3 .home-secondary-action:focus-visible{background:#f1f6ff;border-color:#9ebced}
.home-hero-v3 .home-hero-mark{border-color:#c9dcfb;background:linear-gradient(145deg,#f2f7ff,#e7f0ff);box-shadow:inset 0 0 0 18px rgba(255,255,255,.58),0 20px 44px rgba(20,99,255,.12);backdrop-filter:none}
.home-hero-v3 .home-hero-mark span{color:#145fe8}
.home-hero-v3 .home-hero-mark small{color:#3c659c}

.home-topic-hub{margin:22px 0;padding:clamp(22px,3vw,32px);border:1px solid var(--border);border-radius:26px;background:#fff;box-shadow:0 12px 34px rgba(15,23,42,.06)}
.home-topic-head{margin-bottom:22px}
.home-topic-head>div{max-width:880px}
.home-topic-head p{max-width:820px;margin:8px 0 0;color:#64748b;font-size:13px;line-height:1.6;font-weight:570}
.home-topic-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.home-topic-button{--topic-accent:#1463ff;--topic-soft:#eef5ff;appearance:none;position:relative;overflow:hidden;display:grid;grid-template-columns:52px minmax(0,1fr);grid-template-rows:1fr auto;column-gap:16px;min-height:230px;padding:22px;border:1px solid #dce4ef;border-radius:21px;background:linear-gradient(145deg,#fff 0%,#fbfdff 100%);text-align:left;font:inherit;cursor:pointer;box-shadow:0 7px 18px rgba(15,23,42,.035);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,background .18s ease}
.home-topic-button::before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:var(--topic-accent);opacity:.82}
.home-topic-button::after{content:"";position:absolute;width:150px;height:150px;right:-70px;top:-80px;border-radius:50%;background:var(--topic-soft);transition:transform .22s ease}
.home-topic-button:hover,.home-topic-button:focus-visible{transform:translateY(-3px);border-color:color-mix(in srgb,var(--topic-accent) 35%,#dce4ef);box-shadow:0 16px 32px rgba(15,23,42,.09);outline:none}
.home-topic-button:hover::after,.home-topic-button:focus-visible::after{transform:scale(1.14)}
.home-topic-button.topic-improve{--topic-accent:#1463ff;--topic-soft:#eaf2ff}
.home-topic-button.topic-quality{--topic-accent:#6b55d9;--topic-soft:#f0edff}
.home-topic-button.topic-flow{--topic-accent:#e98416;--topic-soft:#fff3e4}
.home-topic-button.topic-daily{--topic-accent:#12806d;--topic-soft:#e8f7f3}
.home-topic-number{position:relative;z-index:1;display:grid;place-items:center;width:48px;height:48px;border-radius:15px;background:var(--topic-soft);color:var(--topic-accent);font-size:12px;font-weight:950;letter-spacing:.06em}
.home-topic-copy{position:relative;z-index:1;display:flex;flex-direction:column;min-width:0}
.home-topic-copy small{color:var(--topic-accent);font-size:10px;font-weight:950;letter-spacing:.085em;text-transform:uppercase}
.home-topic-copy strong{margin-top:7px;color:#142a49;font-size:clamp(19px,2vw,25px);line-height:1.12;letter-spacing:-.025em}
.home-topic-copy em{max-width:600px;margin-top:10px;color:#61738b;font-size:12px;font-style:normal;font-weight:570;line-height:1.58}
.home-topic-footer{position:relative;z-index:1;grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;padding-top:14px;border-top:1px solid #e8edf4}
.home-topic-footer b{color:#52657e;font-size:11px;font-weight:850}
.home-topic-footer i{color:var(--topic-accent);font-size:12px;font-style:normal;font-weight:950}

.topic-home{--topic-accent:#1463ff;--topic-soft:#edf5ff;--topic-rgb:20,99,255;max-width:1380px;margin:auto}
.topic-home.topic-quality{--topic-accent:#6b55d9;--topic-soft:#f0edff;--topic-rgb:107,85,217}
.topic-home.topic-flow{--topic-accent:#e98416;--topic-soft:#fff3e4;--topic-rgb:233,132,22}
.topic-home.topic-daily{--topic-accent:#12806d;--topic-soft:#e8f7f3;--topic-rgb:18,128,109}
.topic-home.active{animation:topicPageReveal .24s ease both}
@keyframes topicPageReveal{from{opacity:.45;transform:translateY(8px)}to{opacity:1;transform:none}}
.topic-breadcrumb{display:flex;align-items:center;gap:8px;margin:0 2px 12px;color:#6b7c93;font-size:12px;font-weight:750}
.topic-breadcrumb button{appearance:none;border:0;background:transparent;padding:0;color:#0f3fb3;font:inherit;font-weight:900;cursor:pointer}
.topic-breadcrumb strong{color:#334155}
.topic-hero{position:relative;overflow:hidden;display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,.5fr);gap:22px;padding:clamp(26px,4vw,42px);border:1px solid #dbe4ef;border-radius:26px;background:linear-gradient(145deg,#fff 0%,color-mix(in srgb,var(--topic-soft) 55%,#fff) 100%);box-shadow:0 14px 36px rgba(15,23,42,.07)}
.topic-hero::after{content:"";position:absolute;width:260px;height:260px;right:-120px;top:-120px;border-radius:50%;background:rgba(var(--topic-rgb),.07);box-shadow:0 0 0 46px rgba(var(--topic-rgb),.025)}
.topic-hero-main{position:relative;z-index:1;display:grid;grid-template-columns:66px minmax(0,1fr);gap:20px;align-items:start}
.topic-number{display:grid;place-items:center;width:62px;height:62px;border-radius:19px;background:var(--topic-soft);color:var(--topic-accent);font-size:15px;font-weight:950;letter-spacing:.07em;box-shadow:inset 0 0 0 1px rgba(var(--topic-rgb),.12)}
.topic-hero-main small{color:var(--topic-accent);font-size:10px;font-weight:950;letter-spacing:.10em;text-transform:uppercase}
.topic-hero h2{margin:7px 0 10px;color:#0c2342;font-size:clamp(30px,4vw,48px);line-height:1.02;letter-spacing:-.045em}
.topic-hero-main p{max-width:760px;margin:0;color:#586b84;font-size:14px;line-height:1.68;font-weight:570}
.topic-hero-aside{position:relative;z-index:1;align-self:stretch;display:flex;flex-direction:column;justify-content:center;padding:20px;border:1px solid rgba(var(--topic-rgb),.15);border-radius:20px;background:rgba(255,255,255,.78)}
.topic-hero-aside b{color:var(--topic-accent);font-size:42px;line-height:.9;letter-spacing:-.05em}
.topic-hero-aside>span{margin-top:7px;color:#425975;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.07em}
.topic-hero-aside p{margin:14px 0 0;padding-top:14px;border-top:1px solid #e3eaf3;color:#65758b;font-size:11px;line-height:1.55;font-weight:600}
.topic-focus-strip{display:flex;flex-wrap:wrap;gap:8px;margin:13px 0 22px;padding:0 3px}
.topic-focus-strip span{display:inline-flex;align-items:center;min-height:31px;padding:7px 11px;border:1px solid rgba(var(--topic-rgb),.16);border-radius:999px;background:var(--topic-soft);color:color-mix(in srgb,var(--topic-accent) 82%,#142a49);font-size:10px;font-weight:900}
.topic-tools-section{padding:clamp(20px,3vw,30px);border:1px solid var(--border);border-radius:25px;background:#fff;box-shadow:0 10px 28px rgba(15,23,42,.055)}
.topic-section-head{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:18px}
.topic-section-head>div>span{color:var(--topic-accent);font-size:10px;font-weight:950;letter-spacing:.10em;text-transform:uppercase}
.topic-section-head h3{margin:4px 0 0;color:#132a49;font-size:clamp(24px,3vw,33px);letter-spacing:-.035em}
.topic-section-head>small{color:#738399;font-size:11px;font-weight:750;text-align:right}
.topic-tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.topic-tool-card{position:relative;overflow:hidden;display:flex;flex-direction:column;min-width:0;border:1px solid #dde5ef;border-radius:18px;background:linear-gradient(180deg,#fff,#fbfcfe);box-shadow:0 5px 14px rgba(15,23,42,.025);animation:topicToolReveal .28s ease both;animation-delay:var(--topic-delay,0ms);transition:border-color .17s ease,transform .17s ease,box-shadow .17s ease}
@keyframes topicToolReveal{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
.topic-tool-card:hover{transform:translateY(-2px);border-color:rgba(var(--topic-rgb),.34);box-shadow:0 12px 25px rgba(15,23,42,.075)}
.topic-tool-open{appearance:none;display:flex;flex:1;flex-direction:column;align-items:stretch;width:100%;padding:17px;border:0;background:transparent;text-align:left;font:inherit;cursor:pointer}
.topic-tool-top{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:12px}
.topic-tool-top b{display:grid;place-items:center;min-width:31px;height:29px;padding:0 7px;border-radius:9px;background:var(--topic-soft);color:var(--topic-accent);font-size:10px;font-weight:950}
.topic-tool-top em{overflow:hidden;color:#8592a4;font-size:9px;font-style:normal;font-weight:850;text-overflow:ellipsis;white-space:nowrap}
.topic-tool-open>strong{color:#193250;font-size:16px;line-height:1.2}
.topic-tool-open>p{min-height:55px;margin:7px 0 12px;color:#66778d;font-size:11px;line-height:1.5;font-weight:570}
.topic-tool-tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:auto}
.topic-tool-tags span{padding:4px 7px;border:1px solid #e1e8f1;border-radius:999px;background:#f8fafc;color:#6d7d91;font-size:8px;font-weight:800}
.topic-tool-cta{margin-top:13px;color:var(--topic-accent);font-size:11px;font-weight:950}
.topic-tool-guide{display:flex;align-items:center;justify-content:space-between;min-height:36px;padding:8px 17px;border-top:1px solid #e6ebf2;color:#60748f;font-size:9px;font-weight:900;text-decoration:none;background:#fafcff}
.topic-tool-guide::after{content:'↗';color:var(--topic-accent)}
.topic-tool-guide:hover{background:var(--topic-soft);color:var(--topic-accent)}

.nav-group>summary>span{display:grid;gap:2px;min-width:0}
.nav-group>summary>span>b{overflow:hidden;color:inherit;font-size:inherit;text-overflow:ellipsis;white-space:nowrap}
.nav-group>summary>span>em{overflow:hidden;color:#7890b1;font-size:8px;font-style:normal;font-weight:750;text-overflow:ellipsis;white-space:nowrap;text-transform:none;letter-spacing:0}
.nav-group.topic-active{border-color:rgba(93,151,255,.34);box-shadow:inset 3px 0 0 #5d97ff}
.nav-group.topic-active>summary{background:rgba(20,99,255,.13);color:#fff}
.nav-group.topic-active>summary>span>em{color:#aac8f5}
.nav-group[open] .nav-group-body{animation:navGroupReveal .18s ease both;transform-origin:top}
@keyframes navGroupReveal{from{opacity:.25;transform:translateY(-4px)}to{opacity:1;transform:none}}

.tool-breadcrumb button+span{flex:0 0 auto}
.tool-breadcrumb button{max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

@media(max-width:1180px){
  .topic-tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:920px){
  .home-hero-v3{grid-template-columns:1fr;min-height:0}
  .home-hero-v3 .home-hero-mark{display:none}
  .topic-hero{grid-template-columns:1fr}
  .topic-hero-aside{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:5px 12px}
  .topic-hero-aside p{grid-column:1/-1}
  .topic-section-head{align-items:flex-start;flex-direction:column}
  .topic-section-head>small{text-align:left}
}
@media(max-width:720px){
  .home-topic-grid,.topic-tool-grid{grid-template-columns:1fr}
  .home-topic-button{min-height:0;grid-template-columns:43px minmax(0,1fr);padding:17px;column-gap:13px}
  .home-topic-number{width:42px;height:42px;border-radius:13px}
  .home-topic-footer{grid-column:1/-1;margin-top:13px}
  .topic-hero{padding:21px;border-radius:20px}
  .topic-hero-main{grid-template-columns:48px minmax(0,1fr);gap:13px}
  .topic-number{width:46px;height:46px;border-radius:14px;font-size:12px}
  .topic-hero h2{font-size:31px}
  .topic-tools-section{padding:15px;border-radius:19px}
  .topic-tool-open>p{min-height:0}
}
@media(max-width:620px){
  .home-hero-v3{padding:24px 20px;border-radius:20px}
  .home-hero-v3 h2{font-size:36px}
  .home-hero-v3 h2 span{font-size:.53em}
  .home-topic-hub{padding:16px;border-radius:19px}
  .home-topic-copy strong{font-size:19px}
  .home-topic-copy em{font-size:11px}
  .topic-breadcrumb{font-size:11px}
}
@media print{
  .topic-home{display:none!important}
}


/* Capacity & Production Balancer v7 — consolidation + manual final allocation */
.cpb-manual-panel{margin-top:18px;border:1px solid #dbe4f0;background:linear-gradient(180deg,#fff,#f8fbff)}
.cpb-manual-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,.9fr);gap:16px;align-items:start;margin:14px 0 16px;padding:14px 16px;border:1px solid #dce6f2;border-radius:14px;background:#f7faff}
.cpb-manual-toolbar>div{display:flex;flex-direction:column;gap:5px}.cpb-manual-toolbar>div>b{font-size:14px;color:#16365f}.cpb-manual-toolbar>div>span{font-size:12px;line-height:1.45;color:#60748d}
.cpb-manual-override{display:flex;gap:10px;align-items:flex-start;padding:11px 12px;border:1px solid #f1c67a;border-radius:12px;background:#fffaf0;cursor:pointer}.cpb-manual-override input{margin-top:3px}.cpb-manual-override span{display:flex;flex-direction:column;gap:3px}.cpb-manual-override strong{font-size:13px;color:#6b4600}.cpb-manual-override small{font-size:11px;line-height:1.4;color:#7c6844}
.cpb-plan-source{display:inline-flex;align-items:center;padding:7px 10px;border-radius:999px;background:#edf7ee;color:#26713a;font-size:12px;font-weight:800}.cpb-plan-source.edited{background:#fff4dd;color:#8a5a00}
.cpb-manual-warning{display:flex;gap:10px;align-items:flex-start;margin:0 0 14px;padding:12px 14px;border:1px solid #efb4aa;border-radius:12px;background:#fff1ef;color:#842c20}.cpb-manual-warning strong{white-space:nowrap}.cpb-manual-warning span{font-size:12px;line-height:1.45}
.cpb-manual-board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(245px,285px);gap:12px;overflow-x:auto;padding:4px 2px 12px;scroll-snap-type:x proximity}
.cpb-manual-column{scroll-snap-align:start;border:1px solid #d8e2ef;border-radius:14px;background:#fff;min-height:170px;overflow:hidden;transition:.18s ease}.cpb-manual-column.is-free{border-style:dashed;background:#f8fcf9}.cpb-manual-column.special{background:#fbf9ff}.cpb-manual-column.drag-over{border-color:#1463ff;box-shadow:0 0 0 3px rgba(20,99,255,.12);transform:translateY(-2px)}
.cpb-manual-column-head{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:11px 12px;background:#f3f7fc;border-bottom:1px solid #e0e8f2}.cpb-manual-column-head strong{font-size:13px;color:#203a59}.cpb-manual-column-head span{font-size:12px;font-weight:800;color:#4b637e}
.cpb-manual-column-body{display:flex;flex-direction:column;gap:9px;padding:10px;min-height:120px}.cpb-manual-empty{display:flex;align-items:center;justify-content:center;min-height:92px;padding:12px;border:1px dashed #cfe0d3;border-radius:10px;color:#4b7b57;font-size:12px;text-align:center}
.cpb-manual-job{display:flex;flex-direction:column;gap:7px;padding:10px;border:1px solid #dce5ef;border-radius:11px;background:#fff;box-shadow:0 2px 8px rgba(23,45,75,.05);cursor:grab}.cpb-manual-job.dragging{opacity:.45}.cpb-manual-job.conflict{border-color:#e99d8f;background:#fff7f5}.cpb-manual-job-top{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}.cpb-manual-job-top strong{font-size:13px;color:#183758}.cpb-manual-job-top span{font-size:11px;color:#63778f;text-align:right}.cpb-manual-job>small{font-size:10px;color:#8191a5}.cpb-manual-job label{display:flex;flex-direction:column;gap:4px}.cpb-manual-job label>span{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#6d8198}.cpb-manual-job select{width:100%;min-width:0;padding:7px 8px;border:1px solid #cfd9e5;border-radius:8px;background:#fff;font-size:11px;color:#263e59}
@media(max-width:900px){.cpb-manual-toolbar{grid-template-columns:1fr}.cpb-manual-board{grid-auto-columns:minmax(230px,82vw)}}
@media print{.cpb-manual-toolbar,.cpb-manual-board .cpb-manual-job label,.cpb-manual-job>small{display:none!important}.cpb-manual-board{display:block;overflow:visible}.cpb-manual-column{display:inline-block;vertical-align:top;width:31%;margin:0 1% 8px 0;min-height:0}.cpb-manual-column-body{min-height:0}.cpb-manual-job{box-shadow:none;break-inside:avoid}}

/* SMED + Video Work Analysis v3 — local-first video analysis */
.smed-v3-hero{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,.65fr);gap:18px;align-items:stretch;background:#fff;border:1px solid #dbe5f0;border-radius:22px;padding:24px;box-shadow:0 14px 34px rgba(15,23,42,.07)}
.smed-v3-hero h3{margin:4px 0 8px;font-size:clamp(24px,3vw,38px);line-height:1.05;color:var(--navy)}
.smed-v3-hero p{margin:0;max-width:920px;color:#475569;font-weight:650;line-height:1.6}
.smed-v3-eyebrow{display:inline-flex;padding:6px 10px;border-radius:999px;background:#e8f1ff;color:#0f4c81;font-size:11px;font-weight:900;letter-spacing:.12em}
.smed-local-badge{display:flex;flex-direction:column;justify-content:center;gap:6px;padding:18px;border-radius:18px;background:linear-gradient(135deg,#ecfdf5,#eff6ff);border:1px solid #bbf7d0;color:#064e3b}
.smed-local-badge b{font-size:15px}.smed-local-badge span{font-size:12px;line-height:1.5;color:#36566a;font-weight:650}
.smed-panel-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}.smed-live-time{flex:0 0 auto;font:900 20px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#0f4c81;background:#eff6ff;border:1px solid #bfdbfe;border-radius:12px;padding:10px 12px}
.smed-precision-controls{gap:7px}.smed-precision-controls .lean-btn{padding-left:10px;padding-right:10px;min-width:0}.smed-seek-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:end;margin:10px 0 18px;padding:12px 14px;border:1px solid #dbe5f0;border-radius:14px;background:#f8fafc}.smed-seek-row span{display:flex;flex-direction:column;gap:3px;color:#334155}.smed-seek-row small{font-size:11px;color:#64748b;font-weight:650}.smed-seek-row label{font-size:11px;font-weight:850;color:#475569}.smed-seek-row input{display:block;width:110px;margin-top:4px;border:1px solid #cbd5e1;border-radius:9px;padding:8px 9px;font:800 13px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:white;color:#0f172a}
.smed-loss-panel{overflow:hidden}.smed-loss-layout{display:grid;grid-template-columns:minmax(300px,.9fr) minmax(380px,1.1fr);gap:20px;align-items:start}.smed-loss-editor,.smed-loss-dashboard{min-width:0}.smed-loss-mark-row{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.smed-loss-marker{border:1px dashed #f59e0b;background:#fffbeb;color:#92400e;border-radius:12px;padding:11px 12px;font-weight:750;font-size:12px}.smed-v3-note{margin-top:12px;padding:12px 14px;border-left:4px solid #60a5fa;background:#eff6ff;border-radius:0 12px 12px 0;color:#334155;font-size:12px;line-height:1.55;font-weight:650}
.smed-loss-kpis{grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:14px}.smed-loss-dashboard .smed-kpi{background:#f8fafc;border-color:#e2e8f0}.smed-loss-dashboard .smed-kpi b{color:#0f172a}.smed-loss-dashboard .smed-kpi span{color:#64748b}
.smed-improvement-chart{display:grid;gap:10px;margin-bottom:18px}.smed-compare-bar-row{display:grid;grid-template-columns:155px minmax(0,1fr) 92px;align-items:center;gap:10px;font-size:12px;font-weight:800;color:#334155}.smed-compare-bar-row>div{height:13px;border-radius:999px;background:#e2e8f0;overflow:hidden}.smed-compare-bar-row i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#2563eb,#60a5fa)}.smed-compare-bar-row.improved i{background:linear-gradient(90deg,#059669,#34d399)}.smed-compare-bar-row b{text-align:right;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#0f172a}
.smed-loss-timeline{margin:8px 0 18px}.smed-loss-track{position:relative;height:44px;border-radius:13px;background:linear-gradient(180deg,#eef2f7,#f8fafc);border:1px solid #dbe5f0;overflow:hidden}.smed-loss-timeline-bar{position:absolute;top:7px;height:24px;border:0;border-radius:7px;background:linear-gradient(180deg,#ef4444,#be123c);box-shadow:0 3px 8px rgba(190,18,60,.2);cursor:pointer;min-width:4px}.smed-loss-timeline-bar:hover{filter:brightness(1.05);transform:translateY(-1px)}.smed-loss-track .start,.smed-loss-track .end{position:absolute;bottom:1px;font-size:9px;font-weight:800;color:#64748b}.smed-loss-track .start{left:5px}.smed-loss-track .end{right:5px}.smed-loss-timeline-empty{padding:16px;border:1px dashed #cbd5e1;border-radius:12px;color:#64748b;font-size:12px;text-align:center;background:#f8fafc}
.smed-loss-list{display:grid;gap:8px}.smed-loss-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:12px;align-items:center;padding:11px 12px;border:1px solid #e2e8f0;border-radius:13px;background:#fff}.smed-loss-index{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:#fee2e2;color:#991b1b;font-weight:900}.smed-loss-row>div:nth-child(2){min-width:0;display:grid;gap:3px}.smed-loss-row small{color:#64748b;font-weight:750}.smed-loss-row p{margin:2px 0 0;color:#475569;font-size:12px}.smed-preview-status span{display:inline-flex;padding:7px 10px;border-radius:999px;background:#f1f5f9;color:#475569;font-size:11px;font-weight:850}.smed-preview-status span.active{background:#dcfce7;color:#166534}
.smed-compare-panel{overflow:hidden}.smed-compare-mode{display:flex;gap:7px}.smed-mode-btn{border:1px solid #cbd5e1;background:#fff;border-radius:10px;padding:8px 11px;color:#475569;font-size:11px;font-weight:850;cursor:pointer}.smed-mode-btn.active{background:#0f4c81;color:#fff;border-color:#0f4c81}.smed-compare-loaders{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}.smed-compare-loaders>div{display:flex;flex-direction:column;gap:6px;padding:11px 12px;border:1px solid #e2e8f0;border-radius:13px;background:#f8fafc}.smed-compare-loaders b{font-size:11px;color:#0f172a}.smed-compare-loaders span{font-size:11px;color:#64748b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.smed-compare-stage{position:relative;display:grid;grid-template-columns:1fr 1fr;gap:10px;min-height:260px;background:#0b1220;border-radius:16px;padding:10px;overflow:hidden}.smed-compare-video-card{position:relative;min-width:0;border-radius:11px;overflow:hidden;background:#020617;display:grid;place-items:center}.smed-compare-video-card video{display:block;width:100%;max-height:440px;background:#000}.smed-compare-video-card>span{position:absolute;z-index:2;top:9px;left:9px;padding:5px 7px;border-radius:7px;background:rgba(15,23,42,.78);color:#fff;font-size:10px;font-weight:900;letter-spacing:.07em}.smed-compare-stage.pip{display:block;min-height:420px}.smed-compare-stage.pip .smed-compare-video-card:first-child{height:100%}.smed-compare-stage.pip .smed-compare-video-card:first-child video{width:100%;height:100%;max-height:none;object-fit:contain}.smed-compare-stage.pip .smed-compare-video-card.after{position:absolute;z-index:4;right:22px;bottom:22px;width:min(36%,420px);height:auto;border:3px solid rgba(255,255,255,.92);box-shadow:0 16px 42px rgba(0,0,0,.42)}.smed-compare-controls{display:flex;flex-wrap:wrap;gap:9px;align-items:center;margin-top:12px}.smed-compare-controls label{display:flex;align-items:center;gap:7px;color:#475569;font-size:11px;font-weight:800}.smed-compare-controls input[type=number]{width:95px;border:1px solid #cbd5e1;border-radius:9px;padding:8px 9px}.smed-check input{accent-color:#0f4c81}
@media(max-width:980px){.smed-v3-hero,.smed-loss-layout{grid-template-columns:1fr}.smed-compare-stage.side,.smed-compare-loaders{grid-template-columns:1fr}.smed-compare-stage.pip{min-height:330px}.smed-compare-stage.pip .smed-compare-video-card.after{width:42%;right:12px;bottom:12px}.smed-seek-row{grid-template-columns:1fr auto}.smed-seek-row>span{grid-column:1/-1}}
@media(max-width:640px){.smed-v3-hero{padding:17px;border-radius:16px}.smed-v3-hero h3{font-size:25px}.smed-panel-head{display:grid}.smed-live-time{justify-self:start}.smed-loss-kpis{grid-template-columns:1fr 1fr}.smed-compare-bar-row{grid-template-columns:115px 1fr 78px}.smed-loss-row{grid-template-columns:30px 1fr}.smed-loss-row .smed-row-actions{grid-column:2}.smed-seek-row{grid-template-columns:1fr}.smed-seek-row>span{grid-column:auto}.smed-seek-row label{display:flex;align-items:center;justify-content:space-between;gap:8px}.smed-compare-stage.pip{min-height:250px}.smed-compare-stage.pip .smed-compare-video-card.after{width:48%}}

@media print{.smed-v3-hero,.smed-precision-controls,.smed-seek-row,.smed-loss-mark-row,.smed-compare-loaders,.smed-compare-controls,.smed-compare-mode,.smed-preview-status{display:none!important}.smed-compare-stage{min-height:220px!important}.smed-loss-panel,.smed-compare-panel{break-inside:avoid}}

/* SMED + Video Work Analysis v5 — video-first marking, editor timeline and live step register */
.smed-video-interactive{position:relative;cursor:crosshair;user-select:none}
.smed-video-interactive .smed-video{cursor:crosshair}
.smed-video-interaction-hint{position:absolute;z-index:5;left:14px;bottom:14px;display:flex;flex-direction:column;gap:2px;max-width:min(680px,calc(100% - 28px));padding:9px 12px;border:1px solid rgba(255,255,255,.15);border-radius:11px;background:rgba(2,6,23,.76);backdrop-filter:blur(7px);color:#e2e8f0;pointer-events:none;box-shadow:0 8px 22px rgba(0,0,0,.22)}
.smed-video-interaction-hint b{font-size:11px;letter-spacing:.07em;color:#fff}.smed-video-interaction-hint span{font-size:10px;font-weight:700;line-height:1.35;color:#cbd5e1}
.smed-video-click-flash{position:absolute;z-index:8;left:50%;top:50%;transform:translate(-50%,-50%) scale(.94);max-width:80%;padding:10px 14px;border-radius:12px;background:rgba(15,76,129,.93);color:#fff;font-size:12px;font-weight:900;box-shadow:0 14px 38px rgba(0,0,0,.32);opacity:0;pointer-events:none}
.smed-video-click-flash.show{animation:smedMarkerFlash .95s ease both}@keyframes smedMarkerFlash{0%{opacity:0;transform:translate(-50%,-50%) scale(.92)}15%{opacity:1;transform:translate(-50%,-50%) scale(1)}72%{opacity:1}100%{opacity:0;transform:translate(-50%,-58%) scale(1)}}
.smed-quick-capture-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:12px;padding:12px 14px;border:1px solid #cbdcf1;border-radius:14px;background:linear-gradient(135deg,#f7fbff,#eef6ff)}
.smed-quick-capture-bar>div{display:flex;flex-direction:column;gap:3px;min-width:0}.smed-quick-capture-bar b{font-size:12px;color:#0f4c81}.smed-quick-capture-bar span{font-size:11px;line-height:1.45;font-weight:650;color:#475569}.smed-quick-capture-bar .lean-btn{flex:0 0 auto;white-space:nowrap}
.smed-timeline-toolbar{display:flex;align-items:end;justify-content:space-between;gap:16px;margin:18px 0 8px}.smed-timeline-toolbar>div{display:flex;flex-direction:column;gap:3px}.smed-timeline-toolbar b{font-size:12px;color:#0f172a}.smed-timeline-toolbar span{font-size:10px;font-weight:700;color:#64748b;line-height:1.4}.smed-timeline-toolbar label{display:flex;align-items:center;gap:8px;white-space:nowrap;color:#475569;font-size:10px;font-weight:850}.smed-timeline-toolbar input[type=range]{width:110px;accent-color:#1463ff}.smed-timeline-toolbar output{min-width:28px;text-align:right;color:#0f4c81;font-weight:900}
.smed-editor-timeline{position:relative;overflow-x:auto;overflow-y:hidden;border:1px solid #cbd5e1;border-radius:16px;background:#f8fafc;box-shadow:inset 0 1px 0 rgba(255,255,255,.7);touch-action:none;cursor:ew-resize;scrollbar-width:thin}
.smed-editor-timeline-canvas{position:relative;min-width:100%;transition:width .16s ease;background:linear-gradient(180deg,#f8fafc 0,#f8fafc 31px,#fff 31px,#fff calc(100% - 20px),#fff7f7 calc(100% - 20px));overflow:hidden}
.smed-editor-ruler{position:relative;height:31px;border-bottom:1px solid #dbe3ed;background:linear-gradient(180deg,#f8fafc,#eef2f7)}
.smed-editor-ruler>span{position:absolute;top:0;height:100%;transform:translateX(-1px);pointer-events:none}.smed-editor-ruler i{display:block;width:1px;height:9px;background:#94a3b8}.smed-editor-ruler b{position:absolute;top:11px;left:4px;white-space:nowrap;font-size:9px;color:#64748b;font-weight:800;transform:translateX(-50%)}.smed-editor-ruler>span:first-child b{transform:none}.smed-editor-ruler>span:last-child b{transform:translateX(-100%)}
.smed-editor-steps{position:relative;min-height:54px;background-image:linear-gradient(to right,rgba(148,163,184,.12) 1px,transparent 1px);background-size:10% 100%}
.smed-editor-step{position:absolute;height:31px;min-width:5px;border:0;border-radius:7px;padding:4px 7px;display:flex;align-items:center;justify-content:space-between;gap:7px;overflow:hidden;background:linear-gradient(135deg,#0f4c81,#1463ff);color:#fff;box-shadow:0 4px 10px rgba(20,99,255,.18);cursor:pointer;text-align:left;transition:transform .12s ease,box-shadow .12s ease,outline-color .12s ease;z-index:2}
.smed-editor-step:hover{transform:translateY(-1px);box-shadow:0 7px 16px rgba(15,23,42,.2);z-index:5}.smed-editor-step.selected{outline:3px solid #0f172a;outline-offset:2px;z-index:6}.smed-editor-step.external{background:linear-gradient(135deg,#047857,#10b981)}.smed-editor-step.waiting{background:linear-gradient(135deg,#b45309,#f59e0b)}.smed-editor-step.waste{background:linear-gradient(135deg,#b91c1c,#ef4444)}.smed-editor-step.running{background-image:repeating-linear-gradient(135deg,rgba(255,255,255,.2) 0 6px,transparent 6px 12px),linear-gradient(135deg,#0f4c81,#1463ff)}.smed-editor-step.external.running{background-image:repeating-linear-gradient(135deg,rgba(255,255,255,.2) 0 6px,transparent 6px 12px),linear-gradient(135deg,#047857,#10b981)}.smed-editor-step.waiting.running{background-image:repeating-linear-gradient(135deg,rgba(255,255,255,.2) 0 6px,transparent 6px 12px),linear-gradient(135deg,#b45309,#f59e0b)}.smed-editor-step.waste.running{background-image:repeating-linear-gradient(135deg,rgba(255,255,255,.2) 0 6px,transparent 6px 12px),linear-gradient(135deg,#b91c1c,#ef4444)}
.smed-editor-step b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:1.1}.smed-editor-step small{flex:0 0 auto;font-size:9px;color:rgba(255,255,255,.88);font-weight:800}.smed-editor-empty-track{position:absolute;inset:9px 12px auto;color:#94a3b8;font-size:10px;font-weight:750;pointer-events:none}
.smed-editor-losses{position:relative;height:20px;border-top:1px solid #fee2e2;background:#fff7f7}.smed-editor-loss{position:absolute;top:4px;height:11px;min-width:4px;border:0;border-radius:4px;background:linear-gradient(180deg,#fb7185,#be123c);box-shadow:0 2px 6px rgba(190,18,60,.24);cursor:pointer;z-index:3}
.smed-editor-playhead{position:absolute;z-index:12;top:0;bottom:0;width:0;pointer-events:none}.smed-editor-playhead i{position:absolute;top:0;bottom:0;left:-1px;width:2px;background:#ef4444;box-shadow:0 0 0 1px rgba(255,255,255,.55)}.smed-editor-playhead:before{content:"";position:absolute;top:0;left:-6px;width:12px;height:9px;border-radius:2px 2px 7px 7px;background:#ef4444}.smed-editor-playhead span{position:absolute;top:4px;left:8px;padding:3px 5px;border-radius:6px;background:#0f172a;color:#fff;font-size:8px;font-weight:900;white-space:nowrap;box-shadow:0 3px 8px rgba(15,23,42,.18)}
.smed-quick-editor{margin-top:10px;border:1px solid #dbe5f0;border-radius:15px;background:#fff;overflow:hidden}.smed-quick-editor-empty{padding:14px 16px;color:#64748b;font-size:11px;font-weight:650;line-height:1.55;background:#f8fafc}.smed-quick-editor-head{display:flex;justify-content:space-between;gap:16px;padding:12px 14px;border-bottom:1px solid #e2e8f0;background:linear-gradient(180deg,#fff,#f8fafc)}.smed-quick-editor-head>div:first-child{display:flex;flex-direction:column;gap:2px}.smed-quick-editor-head span{font-size:9px;color:#64748b;font-weight:850;text-transform:uppercase;letter-spacing:.07em}.smed-quick-editor-head b{font-size:13px;color:#0f172a}.smed-quick-editor-time{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.smed-quick-editor-time span{padding:4px 6px;border-radius:7px;background:#eef2f7;color:#475569;letter-spacing:0;text-transform:none}.smed-quick-editor-time strong{font-size:12px;color:#0f4c81}
.smed-quick-editor-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:10px;padding:12px 14px}.smed-quick-editor-grid label{display:flex;flex-direction:column;gap:5px;min-width:0}.smed-quick-editor-grid label.wide{grid-column:1/-1}.smed-quick-editor-grid label>span{font-size:9px;font-weight:850;color:#64748b;text-transform:uppercase;letter-spacing:.05em}.smed-quick-editor-grid input,.smed-quick-editor-grid select{width:100%;border:1px solid #cbd5e1;border-radius:9px;padding:8px 9px;background:#fff;color:#0f172a;font:inherit;font-size:11px;box-sizing:border-box}.smed-quick-editor-grid input:focus,.smed-quick-editor-grid select:focus{outline:2px solid rgba(20,99,255,.16);border-color:#60a5fa}
.smed-quick-type-row{display:flex;flex-wrap:wrap;gap:7px;padding:0 14px 12px}.smed-quick-type{border:1px solid #cbd5e1;border-radius:999px;background:#fff;padding:6px 10px;color:#475569;font-size:10px;font-weight:850;cursor:pointer}.smed-quick-type:hover{border-color:#94a3b8}.smed-quick-type.active{background:#0f4c81;border-color:#0f4c81;color:#fff}.smed-quick-type[data-type=external].active{background:#047857;border-color:#047857}.smed-quick-type[data-type=waiting].active{background:#b45309;border-color:#b45309}.smed-quick-type[data-type=waste].active{background:#b91c1c;border-color:#b91c1c}.smed-quick-editor-actions{display:flex;flex-wrap:wrap;gap:8px;padding:10px 14px 13px;border-top:1px solid #eef2f7;background:#fbfdff}
@media(max-width:760px){.smed-quick-capture-bar,.smed-timeline-toolbar,.smed-quick-editor-head{align-items:stretch;flex-direction:column}.smed-quick-capture-bar .lean-btn{width:100%}.smed-timeline-toolbar label{justify-content:space-between}.smed-timeline-toolbar input[type=range]{width:min(180px,45vw)}.smed-quick-editor-grid{grid-template-columns:1fr 1fr}.smed-quick-editor-grid label:first-child,.smed-quick-editor-grid label.wide{grid-column:1/-1}.smed-video-interaction-hint{left:8px;bottom:8px;max-width:calc(100% - 16px);padding:7px 9px}.smed-video-interaction-hint span{font-size:9px}.smed-editor-timeline{border-radius:12px}.smed-editor-step small{display:none}}
@media(max-width:480px){.smed-quick-editor-grid{grid-template-columns:1fr}.smed-quick-editor-grid label:first-child,.smed-quick-editor-grid label.wide{grid-column:auto}.smed-quick-editor-time{justify-content:flex-start}.smed-video-interaction-hint span{display:none}}
@media print{.smed-quick-capture-bar,.smed-timeline-toolbar,.smed-editor-timeline,.smed-quick-editor,.smed-video-interaction-hint,.smed-video-click-flash{display:none!important}}

/* SMED v5 — live step register beside video */
.smed-step-register-panel{display:flex;flex-direction:column;min-height:0;padding:16px}
.smed-step-register-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:10px}
.smed-step-register-head h4{margin-bottom:4px}.smed-step-register-head .smed-muted{margin:0;font-size:11px;line-height:1.45}
.smed-register-count{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;min-width:68px;padding:7px 10px;border-radius:999px;background:#eef4ff;color:#0f4c81;border:1px solid #cbdcf1;font-size:10px;font-weight:900;white-space:nowrap}
.smed-step-register-wrap{flex:1;min-height:260px;max-height:690px;overflow:auto;border:1px solid #dbe5f0;border-radius:14px;background:#fff}
.smed-step-register-table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:11px}
.smed-step-register-table th{position:sticky;top:0;z-index:2;padding:8px 7px;background:#eef4ff;color:#0f4c81;border-bottom:1px solid #d4dfec;text-align:left;font-size:9px;font-weight:950;text-transform:uppercase;letter-spacing:.045em}
.smed-step-register-table th:nth-child(1){width:38px}.smed-step-register-table th:nth-child(2){width:76px}.smed-step-register-table th:nth-child(3){width:22%}.smed-step-register-table th:nth-child(4){width:29%}.smed-step-register-table th:nth-child(5){width:auto}
.smed-step-register-table td{padding:6px 6px;border-bottom:1px solid #edf2f7;vertical-align:middle;background:#fff;transition:background .15s ease}
.smed-step-register-table tr:last-child td{border-bottom:0}.smed-step-register-table tr{box-shadow:inset 3px 0 0 #cbd5e1}.smed-step-register-table tr.work-value{box-shadow:inset 3px 0 0 #16a34a}.smed-step-register-table tr.work-necessary{box-shadow:inset 3px 0 0 #2563eb}.smed-step-register-table tr.work-waste{box-shadow:inset 3px 0 0 #dc2626}.smed-step-register-table tr.work-waiting{box-shadow:inset 3px 0 0 #d97706}
.smed-step-register-table tr.selected td{background:#f0f6ff}.smed-step-register-table tr:hover td{background:#f8fbff}.smed-step-register-table tr.empty{box-shadow:none}.smed-step-register-table tr.empty td{padding:26px 18px;text-align:center;color:#64748b;font-weight:700;line-height:1.5}
.smed-step-register-table input,.smed-step-register-table select{width:100%;min-width:0;box-sizing:border-box;border:1px solid #d7e1ec;border-radius:8px;background:#fbfdff;color:#0f172a;padding:7px 7px;font:inherit;font-weight:700;outline:none}.smed-step-register-table input:focus,.smed-step-register-table select:focus{border-color:#60a5fa;background:#fff;box-shadow:0 0 0 3px rgba(37,99,235,.10)}
.smed-register-index,.smed-register-time button{border:0;background:transparent;color:#0f4c81;cursor:pointer;font:inherit;font-weight:900;padding:3px;text-align:left}.smed-register-index{width:26px;height:26px;border-radius:8px;background:#eef4ff;text-align:center}.smed-register-index:hover,.smed-register-time button:hover{color:#1463ff}.smed-register-time button{display:flex;flex-direction:column;gap:1px}.smed-register-time b{font-size:10px}.smed-register-time small{font-size:9px;color:#64748b;font-weight:800}
.smed-step-register-legend{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}.smed-step-register-legend span{padding:5px 8px;border-radius:999px;background:#f8fafc;border:1px solid #e2e8f0;color:#475569;font-size:9px;font-weight:850}.smed-step-register-legend .value{border-color:#bbf7d0;background:#f0fdf4;color:#166534}.smed-step-register-legend .necessary{border-color:#bfdbfe;background:#eff6ff;color:#1d4ed8}.smed-step-register-legend .waste{border-color:#fecaca;background:#fef2f2;color:#b91c1c}.smed-step-register-legend .waiting{border-color:#fed7aa;background:#fff7ed;color:#b45309}
.smed-summary-panel .smed-kpis{grid-template-columns:repeat(6,minmax(0,1fr))}.smed-summary-panel .smed-chart{max-width:900px}.smed-summary-panel .smed-running-list{max-width:900px}
.smed-quick-editor-grid{grid-template-columns:1.2fr 1fr 1fr 1fr}.smed-table{min-width:1450px}
@media(max-width:1380px){.smed-step-register-table th:nth-child(3){width:20%}.smed-step-register-table th:nth-child(4){width:31%}.smed-summary-panel .smed-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:1180px){.smed-step-register-wrap{max-height:560px}.smed-step-register-table th:nth-child(3){width:24%}.smed-step-register-table th:nth-child(4){width:26%}}
@media(max-width:760px){.smed-step-register-head{flex-direction:column}.smed-step-register-wrap{max-height:none;overflow-x:auto}.smed-step-register-table{min-width:680px}.smed-summary-panel .smed-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.smed-quick-editor-grid{grid-template-columns:1fr 1fr}}
@media(max-width:480px){.smed-summary-panel .smed-kpis{grid-template-columns:1fr}.smed-quick-editor-grid{grid-template-columns:1fr}}
@media print{.smed-step-register-panel{break-inside:avoid}.smed-step-register-wrap{max-height:none;overflow:visible}.smed-step-register-table{min-width:0;font-size:8px}.smed-step-register-table input,.smed-step-register-table select{border:0;background:transparent;padding:2px;font-size:8px}.smed-step-register-legend{display:none}.smed-summary-panel .smed-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}


.smed-inline-actions{margin-top:12px;justify-content:flex-start;flex-wrap:wrap}
.smed-inline-loss-tools{margin-top:14px;border:1px solid #dbe5f0;border-radius:14px;background:#f8fbff;padding:12px}
.smed-inline-loss-head{display:grid;gap:4px;margin-bottom:10px}.smed-inline-loss-head b{font-size:13px;color:#0f172a}.smed-inline-loss-head span{font-size:11px;color:#64748b;line-height:1.45}
.smed-inline-loss-grid{display:grid;grid-template-columns:minmax(140px,180px) minmax(140px,1fr) repeat(5,max-content);gap:8px;align-items:center}
.smed-step-register-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.smed-step-register-table.smed-step-register-detailed{min-width:1180px}
.smed-step-register-detailed th:nth-child(1){width:38px}.smed-step-register-detailed th:nth-child(2),.smed-step-register-detailed th:nth-child(3){width:88px}.smed-step-register-detailed th:nth-child(4){width:74px}.smed-step-register-detailed th:nth-child(5){width:210px}.smed-step-register-detailed th:nth-child(6){width:130px}.smed-step-register-detailed th:nth-child(7){width:140px}.smed-step-register-detailed th:nth-child(8){width:130px}.smed-step-register-detailed th:nth-child(9){width:150px}.smed-step-register-detailed th:nth-child(10){width:220px}.smed-step-register-detailed th:nth-child(11){width:118px}
.smed-step-register-table td small{display:block;margin-top:4px;color:#64748b;font-size:10px;font-weight:750}
.smed-step-register-table textarea{width:100%;min-width:0;box-sizing:border-box;border:1px solid #d7e1ec;border-radius:8px;background:#fbfdff;color:#0f172a;padding:7px 7px;font:inherit;font-weight:700;outline:none;min-height:44px;resize:vertical}.smed-step-register-table textarea:focus{border-color:#60a5fa;background:#fff;box-shadow:0 0 0 3px rgba(37,99,235,.10)}
@media(max-width:1200px){.smed-inline-loss-grid{grid-template-columns:1fr 1fr;}.smed-inline-loss-grid .lean-btn{width:100%}}
@media(max-width:760px){.smed-inline-loss-grid{grid-template-columns:1fr}.smed-step-register-actions{align-items:flex-start}}
@media print{.smed-inline-loss-tools,.smed-inline-actions{display:none!important}}


/* SMED Video Work Analysis v7 – wireframe workspace */
.smed-v7{display:grid;gap:16px}
.smed-v7-head{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 18px;border:1px solid #dbe5f0;border-radius:16px;background:#fff}
.smed-v7-head>div:first-child{min-width:0}.smed-v7-head>div:first-child>span{display:block;margin-bottom:4px;color:#2563eb;font-size:10px;font-weight:950;letter-spacing:.12em}.smed-v7-head h3{margin:0 0 4px;font-size:22px;color:#0f172a}.smed-v7-head p{margin:0;max-width:900px;color:#64748b;font-size:12px;line-height:1.5}
.smed-v7 .smed-local-badge{min-width:220px;padding:9px 12px;border-radius:12px}.smed-v7 .smed-local-badge b{font-size:11px}.smed-v7 .smed-local-badge span{font-size:10px}
.smed-v7-workspace{--smed-video-share:52%;display:grid;grid-template-columns:minmax(360px,var(--smed-video-share)) 14px minmax(420px,1fr);gap:0;align-items:stretch}
.smed-v7-workspace>.smed-panel{margin:0;min-width:0;height:600px;box-sizing:border-box}
.smed-v7-video-panel{display:flex;flex-direction:column;overflow:hidden}.smed-v7-video-panel .smed-video-shell{flex:1;min-height:320px;max-height:none}.smed-v7-video-panel .smed-video{width:100%;height:100%;object-fit:contain}
.smed-v7-video-controls{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-top:10px}.smed-v7-video-controls .lean-btn{padding:8px 10px;font-size:10px}.smed-v7-video-controls select{border:1px solid #cbd5e1;border-radius:9px;background:#fff;padding:8px 9px;font-weight:800;color:#334155}
.smed-v7-video-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}.smed-v7-video-actions label{display:flex;align-items:center;gap:6px;margin-left:auto;color:#64748b;font-size:10px;font-weight:850}.smed-v7-video-actions input{width:90px;border:1px solid #cbd5e1;border-radius:9px;padding:8px}
.smed-v7-steps-panel{display:flex;flex-direction:column;padding:14px;overflow:hidden}.smed-v7-table-wrap{flex:1;min-height:0;max-height:none;overflow:auto;border-radius:12px}.smed-v7-table-wrap .smed-step-register-detailed{min-width:1090px}.smed-v7-table-wrap .smed-step-register-table th{top:0}.smed-v7-table-wrap .smed-step-register-table td{padding:5px}.smed-v7-table-wrap .smed-step-register-table input,.smed-v7-table-wrap .smed-step-register-table select,.smed-v7-table-wrap .smed-step-register-table textarea{font-size:10px;padding:6px}.smed-v7-table-wrap .smed-step-register-table textarea{min-height:38px}.smed-v7-table-wrap .lean-btn{padding:6px 7px;font-size:9px}
.smed-v7-timeline-panel{margin:0;padding:14px 16px}.smed-v7-timeline-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:8px}.smed-v7-timeline-head h4,.smed-v7-compare-head h4{margin:0 0 4px}.smed-v7-timeline-stats{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.smed-v7-timeline-stats span{display:flex;align-items:baseline;gap:5px;padding:7px 9px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc;color:#64748b;font-size:9px;font-weight:850}.smed-v7-timeline-stats b{font-size:12px;color:#0f172a}
.smed-v7-timeline-panel .smed-editor-timeline{min-height:122px}.smed-v7-timeline-panel .smed-editor-steps{min-height:72px}
.smed-v7-lossbar{display:grid;grid-template-columns:160px minmax(160px,1fr) repeat(3,max-content) minmax(220px,auto);gap:7px;align-items:center;margin-top:10px}.smed-v7-lossbar select,.smed-v7-lossbar input{min-width:0;border:1px solid #cbd5e1;border-radius:9px;background:#fff;padding:8px 9px;font-size:10px;font-weight:750}.smed-v7-lossbar .lean-btn{padding:8px 9px;font-size:9px}.smed-v7-lossbar .smed-loss-marker{margin:0;padding:8px 9px;font-size:10px}
.smed-v7-loss-list{max-height:124px;overflow:auto;margin-top:8px}.smed-v7-loss-list:empty{display:none}.smed-v7-loss-list .smed-loss-row{padding:7px 9px;grid-template-columns:28px minmax(0,1fr) auto}.smed-v7-loss-list .smed-loss-index{width:25px;height:25px;font-size:10px}
.smed-v7-compare-panel{margin:0;padding:14px 16px}.smed-v7-compare-head{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-bottom:10px}.smed-v7-compare-panel .smed-compare-stage{min-height:390px;grid-template-columns:1fr 1fr}.smed-v7-compare-panel .smed-compare-video-card video{width:100%;height:100%;max-height:520px;object-fit:contain}.smed-v7-compare-controls{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:10px;color:#64748b;font-size:10px;font-weight:750}.smed-v7-compare-controls>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.smed-v7-compare-controls>div{display:flex;gap:7px;flex-wrap:wrap}
.smed-v7-advanced{border:1px solid #dbe5f0;border-radius:16px;background:#fff;overflow:hidden}.smed-v7-advanced>summary{cursor:pointer;list-style:none;padding:13px 16px;font-size:12px;font-weight:900;color:#0f172a;background:#f8fafc}.smed-v7-advanced>summary::-webkit-details-marker{display:none}.smed-v7-advanced>summary:after{content:'＋';float:right;color:#2563eb}.smed-v7-advanced[open]>summary:after{content:'−'}.smed-v7-advanced-body{display:grid;gap:12px;padding:12px}.smed-v7-export-row{display:flex;gap:8px;flex-wrap:wrap}.smed-v7-inner-panel{margin:0!important}
@media(max-width:1250px){.smed-v7-workspace{grid-template-columns:1fr}.smed-v7-workspace>.smed-panel{height:auto}.smed-v7-video-panel .smed-video-shell{min-height:420px}.smed-v7-steps-panel{min-height:520px}.smed-v7-lossbar{grid-template-columns:1fr 1fr 1fr}.smed-v7-lossbar .smed-loss-marker{grid-column:1/-1}.smed-v7-compare-panel .smed-compare-stage{min-height:320px}}
@media(max-width:760px){.smed-v7-head,.smed-v7-timeline-head,.smed-v7-compare-head,.smed-v7-compare-controls{display:grid}.smed-v7 .smed-local-badge{min-width:0}.smed-v7-video-panel .smed-video-shell{min-height:260px}.smed-v7-lossbar{grid-template-columns:1fr}.smed-v7-lossbar .smed-loss-marker{grid-column:auto}.smed-v7-compare-panel .smed-compare-stage.side{grid-template-columns:1fr;min-height:0}.smed-v7-compare-panel .smed-compare-video-card{min-height:230px}.smed-v7-timeline-stats{justify-content:flex-start}.smed-v7-video-actions label{margin-left:0}.smed-v7-steps-panel{min-height:470px}}
@media print{.smed-v7-video-controls,.smed-v7-video-actions,.smed-v7-lossbar,.smed-v7-compare-controls,.smed-compare-mode,.smed-v7-advanced>summary{display:none!important}.smed-v7-advanced{border:0}.smed-v7-advanced-body{padding:0}.smed-v7-workspace{grid-template-columns:1fr 1fr}.smed-v7-workspace>.smed-panel{height:auto}.smed-v7-table-wrap{max-height:none;overflow:visible}}


/* v8: resizable main video / steps divider */
.smed-v8-splitter{position:relative;display:grid;place-items:center;cursor:col-resize;touch-action:none;user-select:none;min-width:14px;z-index:3}
.smed-v8-splitter:before{content:'';position:absolute;inset:0 4px;border-radius:999px;background:#dbe5f0;transition:background .15s,box-shadow .15s}
.smed-v8-splitter span{position:relative;width:4px;height:56px;border-radius:999px;background:#94a3b8;box-shadow:0 0 0 1px rgba(255,255,255,.75)}
.smed-v8-splitter:hover:before,.smed-v8-splitter.dragging:before{background:#bfdbfe;box-shadow:0 0 0 2px rgba(37,99,235,.10)}
.smed-v8-splitter:hover span,.smed-v8-splitter.dragging span{background:#2563eb}
body.smed-resizing,body.smed-resizing *{cursor:col-resize!important;user-select:none!important}

/* v8: single color-coded classification */
.smed-step-register-table tr.work-external{box-shadow:inset 3px 0 0 #0891b2}
.smed-classification{font-weight:900!important;border-width:1px!important;transition:background .15s,color .15s,border-color .15s}
.smed-classification.smed-class-unclassified{background:#f8fafc!important;color:#64748b!important;border-color:#cbd5e1!important}
.smed-classification.smed-class-value{background:#ecfdf5!important;color:#047857!important;border-color:#6ee7b7!important}
.smed-classification.smed-class-necessary{background:#eff6ff!important;color:#1d4ed8!important;border-color:#93c5fd!important}
.smed-classification.smed-class-external{background:#ecfeff!important;color:#0e7490!important;border-color:#67e8f9!important}
.smed-classification.smed-class-waste{background:#fef2f2!important;color:#b91c1c!important;border-color:#fca5a5!important}
.smed-classification.smed-class-waiting{background:#fff7ed!important;color:#c2410c!important;border-color:#fdba74!important}
.smed-step-register-detailed th:nth-child(1){width:38px}.smed-step-register-detailed th:nth-child(2),.smed-step-register-detailed th:nth-child(3){width:88px}.smed-step-register-detailed th:nth-child(4){width:74px}.smed-step-register-detailed th:nth-child(5){width:210px}.smed-step-register-detailed th:nth-child(6){width:130px}.smed-step-register-detailed th:nth-child(7){width:140px}.smed-step-register-detailed th:nth-child(8){width:165px}.smed-step-register-detailed th:nth-child(9){width:220px}.smed-step-register-detailed th:nth-child(10){width:118px}

/* v8: Before / After always stays side by side */
.smed-v7-compare-panel .smed-compare-stage,.smed-v7-compare-panel .smed-compare-stage.side{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;min-height:390px!important}
.smed-v7-compare-panel .smed-compare-video-card{min-width:0!important;min-height:260px}
.smed-v7-compare-panel .smed-compare-video-card.after{position:relative!important;inset:auto!important;width:auto!important;height:auto!important;border:0!important;box-shadow:none!important}
.smed-v7-compare-head .smed-compare-mode{display:none!important}

/* v8: desktop sidebar can be collapsed */
.sidebar{transition:width .22s ease,min-width .22s ease,padding .22s ease,opacity .16s ease,transform .22s ease}
.desktop-sidebar-toggle{position:fixed;top:12px;left:328px;z-index:30;width:40px;height:40px;display:grid;place-items:center;border:1px solid #dbe3ef;border-radius:12px;background:rgba(255,255,255,.97);color:#0f172a;box-shadow:0 8px 24px rgba(15,23,42,.12);cursor:pointer;font-size:19px;font-weight:900;transition:left .22s ease,background .15s,border-color .15s}
.desktop-sidebar-toggle:hover{background:#eef4ff;border-color:#aac7f6}
body.sidebar-collapsed .sidebar{width:0!important;min-width:0!important;padding-left:0!important;padding-right:0!important;opacity:0;overflow:hidden;transform:translateX(-100%);box-shadow:none}
body.sidebar-collapsed .desktop-sidebar-toggle{left:12px}

@media(max-width:1250px){.smed-v7-workspace{grid-template-columns:1fr!important;gap:16px!important}.smed-v8-splitter{display:none!important}}
@media(max-width:920px){.desktop-sidebar-toggle{display:none!important}}
@media(max-width:760px){.smed-v7-compare-panel .smed-compare-stage,.smed-v7-compare-panel .smed-compare-stage.side{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;min-height:230px!important}.smed-v7-compare-panel .smed-compare-video-card{min-height:190px!important}.smed-v7-compare-panel .smed-compare-video-card>span{font-size:8px;padding:4px 6px}}
@media print{.smed-v8-splitter,.desktop-sidebar-toggle{display:none!important}}

.smed-step-register-legend .external{border-color:#a5f3fc;background:#ecfeff;color:#0e7490}
@media(max-width:920px){body.sidebar-collapsed .sidebar{width:min(316px,88vw)!important;min-width:0!important;padding:18px 14px!important;opacity:1!important;transform:none!important;box-shadow:8px 0 28px rgba(15,23,42,.22)!important}}


/* v9: timeline is informational; block colour follows analysis classification. */
.smed-editor-step.value{background:linear-gradient(135deg,#047857,#22c55e)}
.smed-editor-step.necessary{background:linear-gradient(135deg,#1d4ed8,#3b82f6)}
.smed-editor-step.unclassified{background:linear-gradient(135deg,#64748b,#94a3b8)}
.smed-editor-step.value.running{background-image:repeating-linear-gradient(135deg,rgba(255,255,255,.2) 0 6px,transparent 6px 12px),linear-gradient(135deg,#047857,#22c55e)}
.smed-editor-step.necessary.running{background-image:repeating-linear-gradient(135deg,rgba(255,255,255,.2) 0 6px,transparent 6px 12px),linear-gradient(135deg,#1d4ed8,#3b82f6)}
.smed-editor-step.unclassified.running{background-image:repeating-linear-gradient(135deg,rgba(255,255,255,.2) 0 6px,transparent 6px 12px),linear-gradient(135deg,#64748b,#94a3b8)}


/* SMED Video Work Analysis v10 – dual timeline playheads + per-player loop ranges */
.smed-loop-control{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin-top:10px;padding:9px 10px;border:1px solid #dbe5f0;border-radius:12px;background:#f8fbff}.smed-loop-control>b{font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:#334155;margin-right:2px}.smed-loop-control label{display:flex;align-items:center;gap:5px;font-size:10px;font-weight:850;color:#475569}.smed-loop-control input[type=number]{width:80px;border:1px solid #cbd5e1;border-radius:8px;padding:7px 8px;background:#fff;color:#0f172a;font:inherit;font-weight:800}.smed-loop-control .lean-btn{padding:7px 9px;font-size:10px}.smed-loop-check{padding:5px 7px;border-radius:8px;background:#fff;border:1px solid #dbe5f0}.smed-loop-check input{accent-color:#2563eb}.smed-compare-loop-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}.smed-compare-loop-grid .smed-loop-control{margin-top:0}.smed-compare-loop-grid .smed-loop-control.after{background:#f0fdf4;border-color:#bbf7d0}
.smed-editor-playhead.compare-before,.smed-editor-playhead.compare-after{display:none;z-index:9}.smed-editor-playhead.compare-before{background:#2563eb}.smed-editor-playhead.compare-after{background:#16a34a}.smed-editor-playhead.compare-before i,.smed-editor-playhead.compare-after i{background:currentColor}.smed-editor-playhead.compare-before span,.smed-editor-playhead.compare-after span{white-space:nowrap;top:-3px;padding:3px 6px;border-radius:6px;color:#fff;font-size:9px;font-weight:950;box-shadow:0 2px 8px rgba(15,23,42,.18)}.smed-editor-playhead.compare-before span{background:#2563eb}.smed-editor-playhead.compare-after span{background:#16a34a}.smed-editor-timeline-canvas.compare-active .smed-editor-step.work-waste,.smed-editor-timeline-canvas.compare-active .smed-editor-step.waste{box-shadow:inset 0 0 0 2px rgba(220,38,38,.45)}
@media(max-width:980px){.smed-compare-loop-grid{grid-template-columns:1fr}.smed-loop-control{align-items:flex-start}.smed-loop-control label{flex:1 1 130px}.smed-loop-control input[type=number]{width:100%}}
@media(max-width:620px){.smed-loop-control{display:grid;grid-template-columns:1fr 1fr}.smed-loop-control>b{grid-column:1/-1}.smed-loop-check{justify-content:center}.smed-loop-control .lean-btn{width:100%}}
@media print{.smed-loop-control,.smed-compare-loop-grid{display:none!important}}

/* SMED v11 – active section is defined only by Analysis Steps */
.smed-loop-control,.smed-compare-loop-grid{display:none!important}
.smed-compare-clock{position:absolute;z-index:5;left:14px;bottom:14px;padding:8px 11px;border-radius:10px;background:rgba(2,6,23,.82);color:#fff;font-variant-numeric:tabular-nums;font-weight:950;font-size:18px;letter-spacing:.02em;box-shadow:0 5px 18px rgba(0,0,0,.28);pointer-events:none}
.smed-compare-clock.improved{background:rgba(6,95,70,.88)}
@media(max-width:700px){.smed-compare-clock{font-size:14px;left:9px;bottom:9px;padding:6px 8px}}

/* SMED v12 – multi-project workspace + output charts */
.smed-project-manager{display:grid;grid-template-columns:minmax(230px,.7fr) minmax(0,1.3fr);gap:18px;align-items:center;margin:0 0 16px;padding:16px 18px;border:1px solid #dbe5f0;border-radius:18px;background:linear-gradient(135deg,#fff,#f8fbff);box-shadow:0 8px 22px rgba(15,23,42,.05)}
.smed-project-copy{display:grid;gap:4px}.smed-project-copy>span{font-size:9px;font-weight:950;letter-spacing:.12em;color:#2563eb}.smed-project-copy h4{margin:0;color:#0f172a;font-size:17px}.smed-project-copy p{margin:0;color:#64748b;font-size:11px;line-height:1.5}
.smed-project-controls{display:grid;grid-template-columns:minmax(160px,.65fr) minmax(180px,1fr);gap:8px 10px;align-items:end}.smed-project-controls label{display:grid;gap:4px;color:#475569;font-size:10px;font-weight:850}.smed-project-controls select,.smed-project-controls input{width:100%;border:1px solid #cbd5e1;border-radius:10px;background:#fff;padding:9px 10px;color:#0f172a;font:inherit;font-weight:750;outline:none}.smed-project-controls select:focus,.smed-project-controls input:focus{border-color:#60a5fa;box-shadow:0 0 0 3px rgba(37,99,235,.1)}
.smed-project-buttons{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:7px}.smed-project-status{grid-column:1/-1;color:#64748b;font-size:9px;font-weight:750;min-height:12px}
.smed-output-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(260px,.75fr);gap:14px}.smed-pie-output{min-height:280px;display:grid;align-items:center}.smed-pie-layout{display:grid;grid-template-columns:minmax(180px,260px) minmax(0,1fr);gap:24px;align-items:center}.smed-donut{--pie:#94a3b8 0 100%;width:min(240px,100%);aspect-ratio:1;border-radius:50%;background:conic-gradient(var(--pie));display:grid;place-items:center;margin:auto;box-shadow:inset 0 0 0 1px rgba(15,23,42,.04)}.smed-donut:before{content:"";grid-area:1/1;width:62%;aspect-ratio:1;border-radius:50%;background:#fff;box-shadow:0 0 0 1px #e2e8f0}.smed-donut>div{grid-area:1/1;z-index:1;display:grid;text-align:center;gap:3px}.smed-donut b{font-size:23px;color:#0f172a}.smed-donut span{font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:#64748b}.smed-pie-legend{display:grid;gap:8px}.smed-pie-legend>div{display:grid;grid-template-columns:12px 1fr;gap:9px;align-items:start;padding:7px 8px;border-radius:10px;background:#f8fafc;border:1px solid #eef2f7}.smed-pie-legend i{width:10px;height:10px;border-radius:3px;margin-top:3px}.smed-pie-legend span{display:grid;gap:2px}.smed-pie-legend b{font-size:11px;color:#0f172a}.smed-pie-legend small{font-size:9px;color:#64748b;font-weight:750}.smed-pie-empty{padding:42px 20px;text-align:center;border:1px dashed #cbd5e1;border-radius:14px;color:#64748b;background:#f8fafc;font-weight:700}
.smed-output-summary{display:grid;grid-template-columns:1fr 1fr;gap:10px}.smed-output-kpi{padding:14px;border:1px solid #e2e8f0;border-radius:13px;background:#f8fafc;display:grid;gap:4px}.smed-output-kpi b{font-size:19px;color:#0f172a}.smed-output-kpi span{font-size:9px;color:#64748b;font-weight:900;text-transform:uppercase;letter-spacing:.04em}.smed-output-kpi.value{background:#f0fdf4;border-color:#bbf7d0}.smed-output-kpi.value b{color:#166534}.smed-output-kpi.waste{background:#fef2f2;border-color:#fecaca}.smed-output-kpi.waste b{color:#b91c1c}
.smed-output-class-legend{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}.smed-output-class-legend span{padding:6px 9px;border-radius:999px;font-size:9px;font-weight:900;border:1px solid #e2e8f0;background:#f8fafc;color:#475569}.smed-output-class-legend .value{background:#f0fdf4;border-color:#bbf7d0;color:#166534}.smed-output-class-legend .necessary{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}.smed-output-class-legend .external{background:#f0fdfa;border-color:#99f6e4;color:#0f766e}.smed-output-class-legend .waste{background:#fef2f2;border-color:#fecaca;color:#b91c1c}.smed-output-class-legend .waiting{background:#fff7ed;border-color:#fed7aa;color:#b45309}
.smed-gantt-bar.work-value{background:linear-gradient(180deg,#22c55e,#16a34a);border-color:#15803d}.smed-gantt-bar.work-necessary{background:linear-gradient(180deg,#60a5fa,#2563eb);border-color:#1d4ed8}.smed-gantt-bar.work-external{background:linear-gradient(180deg,#2dd4bf,#0f766e);border-color:#0f766e}.smed-gantt-bar.work-waste{background:linear-gradient(180deg,#f87171,#dc2626);border-color:#b91c1c}.smed-gantt-bar.work-waiting{background:linear-gradient(180deg,#fb923c,#d97706);border-color:#b45309}.smed-gantt-bar.work-unclassified{background:linear-gradient(180deg,#cbd5e1,#94a3b8);border-color:#64748b}
@media(max-width:980px){.smed-project-manager,.smed-output-grid{grid-template-columns:1fr}.smed-project-controls{grid-template-columns:1fr 1fr}.smed-pie-layout{grid-template-columns:1fr}.smed-donut{max-width:210px}}
@media(max-width:620px){.smed-project-controls{grid-template-columns:1fr}.smed-project-buttons,.smed-project-status{grid-column:auto}.smed-output-summary{grid-template-columns:1fr 1fr}}
@media print{.smed-project-manager,.smed-v7-export-row{display:none!important}.smed-v7-advanced{display:block!important}.smed-v7-advanced>summary{display:none!important}.smed-v7-advanced>.smed-v7-advanced-body{display:block!important}.smed-output-grid{grid-template-columns:1fr 1fr}.smed-pie-layout{grid-template-columns:180px 1fr}.smed-donut{width:180px}.smed-gantt-shell{overflow:visible!important}.smed-gantt{min-width:0!important}}

/* v13 – source video identity */
.smed-source-video{grid-column:1/-1;border:1px solid #dbe5f0;border-radius:14px;background:#f8fafc;padding:11px 12px;display:grid;gap:9px;min-width:0}
.smed-source-video.empty{border-style:dashed}.smed-source-video.match{border-color:#86efac;background:#f0fdf4}.smed-source-video.mismatch{border-color:#fca5a5;background:#fff7f7}.smed-source-video.idle{border-color:#bfdbfe;background:#f8fbff}
.smed-source-title{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.smed-source-title>div{display:grid;gap:2px;min-width:0}.smed-source-title span{font-size:9px;letter-spacing:.08em;text-transform:uppercase;color:#64748b;font-weight:900}.smed-source-title b{font-size:13px;color:#0f172a;overflow-wrap:anywhere}.smed-source-title strong{font-size:9px;font-weight:950;padding:6px 8px;border-radius:999px;background:#e2e8f0;color:#475569;white-space:nowrap}.smed-source-video.match .smed-source-title strong{background:#dcfce7;color:#166534}.smed-source-video.mismatch .smed-source-title strong{background:#fee2e2;color:#b91c1c}
.smed-source-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px}.smed-source-grid>span{display:grid;gap:2px;padding:7px 8px;border:1px solid rgba(203,213,225,.72);border-radius:9px;background:rgba(255,255,255,.72);min-width:0}.smed-source-grid small{font-size:8px;color:#64748b;text-transform:uppercase;letter-spacing:.04em;font-weight:850}.smed-source-grid b{font-size:10px;color:#0f172a;overflow-wrap:anywhere}.smed-loaded-video,.smed-source-hint{display:flex;gap:8px;align-items:center;font-size:10px;color:#475569;min-width:0}.smed-loaded-video small{font-weight:850;color:#64748b}.smed-loaded-video b{overflow-wrap:anywhere}.smed-source-hint{font-weight:700}
@media(max-width:1180px){.smed-source-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){.smed-source-title{display:grid}.smed-source-title strong{justify-self:start}.smed-source-grid{grid-template-columns:1fr 1fr}.smed-loaded-video{display:grid;gap:2px}}
@media(max-width:460px){.smed-source-grid{grid-template-columns:1fr}}


/* v14 – compact project table */
.smed-project-manager.smed-project-manager-table{display:block;padding:0;overflow:hidden;background:#fff}
.smed-project-table-head{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:14px 16px;border-bottom:1px solid #dbe5f0;background:linear-gradient(180deg,#fff,#f8fbff)}
.smed-project-table-head .smed-project-copy{max-width:760px}.smed-project-table-head .smed-project-copy p{font-size:10px}
.smed-project-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.smed-project-table-wrap{overflow:auto;max-width:100%}
.smed-project-table{width:100%;min-width:1180px;border-collapse:separate;border-spacing:0;font-size:10px}.smed-project-table th{position:sticky;top:0;z-index:2;padding:9px 10px;background:#eef4ff;color:#0f4c81;border-bottom:1px solid #d4dfec;text-align:left;font-size:8px;font-weight:950;text-transform:uppercase;letter-spacing:.055em;white-space:nowrap}.smed-project-table td{padding:9px 10px;border-bottom:1px solid #e8eef6;color:#334155;vertical-align:middle;background:#fff}
.smed-project-table tr:last-child td{border-bottom:0}.smed-project-table tr.active td{background:#f2f7ff}.smed-project-table tr.active td:first-child{box-shadow:inset 4px 0 0 #1463ff}.smed-project-table tr:hover td{background:#f8fbff}.smed-project-table tr.active:hover td{background:#eef5ff}
.smed-project-table td:nth-child(1){width:180px}.smed-project-table td:nth-child(2){width:220px}.smed-project-table td:nth-child(3),.smed-project-table td:nth-child(4){width:86px;white-space:nowrap}.smed-project-table td:nth-child(5),.smed-project-table td:nth-child(6){width:150px}.smed-project-table td:nth-child(7){width:104px}.smed-project-table td:nth-child(8){min-width:300px}
.smed-project-name-button{display:grid;gap:3px;width:100%;padding:0;border:0;background:none;text-align:left;cursor:pointer;color:#0f172a}.smed-project-name-button b{font-size:11px}.smed-project-name-button small{font-size:8px;color:#64748b;font-weight:900;letter-spacing:.045em}.smed-project-table tr.active .smed-project-name-button small{color:#1463ff}.smed-project-video-name{display:block;max-width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#0f172a}.smed-project-table td>small{display:block;margin-top:2px;color:#64748b;font-size:8px;line-height:1.35}
.smed-project-state{display:inline-flex;align-items:center;justify-content:center;padding:5px 8px;border-radius:999px;background:#e2e8f0;color:#475569;font-size:8px;font-weight:950;white-space:nowrap}.smed-project-state.match{background:#dcfce7;color:#166534}.smed-project-state.mismatch{background:#fee2e2;color:#b91c1c}.smed-project-state.idle{background:#dbeafe;color:#1d4ed8}.smed-project-state.empty{background:#f1f5f9;color:#64748b}.smed-project-state.stored{background:#f1f5f9;color:#475569}
.smed-project-row-actions{display:flex;flex-wrap:wrap;gap:5px}.smed-project-mini{border:1px solid #cbd5e1;background:#fff;color:#334155;border-radius:7px;padding:5px 7px;font-size:8px;font-weight:850;cursor:pointer;white-space:nowrap}.smed-project-mini:hover{border-color:#60a5fa;color:#0f4c81;background:#f8fbff}.smed-project-mini.active{background:#eaf2ff;color:#1463ff;border-color:#bfd3ff;cursor:default}.smed-project-mini.danger{border-color:#fecaca;color:#b91c1c}.smed-project-mini.danger:hover{background:#fff1f2;border-color:#fca5a5}
@media(max-width:760px){.smed-project-table-head{align-items:flex-start;flex-direction:column}.smed-project-toolbar{justify-content:flex-start}.smed-project-table{min-width:1080px}}@media print{.smed-project-manager-table{display:none!important}}


/* v15 professional row-aligned Gantt output */
.smed-pro-gantt{min-width:1180px;border:1px solid #d8e2ee;border-radius:14px;overflow:hidden;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.03)}
.smed-pro-gantt-header,.smed-pro-gantt-row{display:grid;grid-template-columns:minmax(560px,42%) minmax(620px,58%)}
.smed-pro-gantt-header{position:sticky;top:0;z-index:8;background:#f7f9fc;border-bottom:1px solid #cfd9e6}
.smed-pro-gantt-info{display:grid;grid-template-columns:42px minmax(190px,1.55fr) minmax(100px,.75fr) minmax(130px,1fr) 96px;min-width:0;align-items:center}
.smed-pro-gantt-columns{min-height:52px;color:#53657a;font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.045em}
.smed-pro-gantt-columns>span{padding:0 10px}.smed-pro-gantt-columns>span+span{border-left:1px solid #e0e7ef;height:100%;display:flex;align-items:center}
.smed-pro-gantt-scale{position:relative;min-height:52px;background:repeating-linear-gradient(90deg,#fff 0,#fff 52px,#fbfcfe 52px,#fbfcfe 104px);border-left:1px solid #cfd9e6;overflow:visible}
.smed-pro-gantt-scale span{position:absolute;top:8px;transform:translateX(-50%);font-size:9px;font-weight:900;color:#5c6d82;white-space:nowrap}.smed-pro-gantt-scale span:first-of-type{transform:none}.smed-pro-gantt-scale span:last-of-type{transform:translateX(-100%)}
.smed-pro-gantt-gridline{position:absolute;top:0;bottom:0;width:1px;background:#dfe6ee;pointer-events:none;z-index:0}
.smed-pro-gantt-row{min-height:58px;border-bottom:1px solid #e6ebf2}.smed-pro-gantt-row:last-child{border-bottom:0}.smed-pro-gantt-row:nth-child(even){background:#fbfcfe}.smed-pro-gantt-row:hover{background:#f4f8fd}
.smed-pro-gantt-row>.smed-pro-gantt-info{min-height:58px}.smed-pro-gantt-row>.smed-pro-gantt-info>*{padding:7px 10px;min-width:0}.smed-pro-gantt-row>.smed-pro-gantt-info>*+*{border-left:1px solid #edf1f5;height:100%;display:flex;align-items:center}
.smed-pro-gantt-index{font-weight:950;color:#244460;justify-content:center}
.smed-pro-gantt-name{border:0;background:transparent;text-align:left;cursor:pointer;display:grid!important;align-content:center!important;gap:2px;color:#20364e;font:inherit}.smed-pro-gantt-name b{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.smed-pro-gantt-name small{color:#7b8b9e;font-size:9px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.smed-pro-gantt-name:hover b{color:#075eaa;text-decoration:underline}
.smed-pro-gantt-class{justify-content:center!important;height:auto!important;margin:0 8px;padding:5px 7px!important;border:1px solid transparent!important;border-radius:999px;font-size:9px;font-weight:950;white-space:nowrap}.smed-pro-gantt-class.work-value{background:#dcfce7;color:#166534;border-color:#bbf7d0!important}.smed-pro-gantt-class.work-necessary{background:#dbeafe;color:#1d4ed8;border-color:#bfdbfe!important}.smed-pro-gantt-class.work-external{background:#ccfbf1;color:#0f766e;border-color:#99f6e4!important}.smed-pro-gantt-class.work-waste{background:#fee2e2;color:#b91c1c;border-color:#fecaca!important}.smed-pro-gantt-class.work-waiting{background:#ffedd5;color:#b45309;border-color:#fed7aa!important}.smed-pro-gantt-class.work-unclassified{background:#f1f5f9;color:#64748b;border-color:#e2e8f0!important}
.smed-pro-gantt-period{font-size:10px;font-weight:800;color:#52657a;white-space:nowrap}.smed-pro-gantt-duration{font-size:10px;color:#0f172a;justify-content:flex-end}
.smed-pro-gantt-track{position:relative;min-height:58px;border-left:1px solid #cfd9e6;background:repeating-linear-gradient(90deg,rgba(148,163,184,.045) 0,rgba(148,163,184,.045) 52px,transparent 52px,transparent 104px);overflow:hidden}
.smed-pro-gantt-bar{position:absolute;top:16px;height:26px;min-width:5px;border:1px solid rgba(15,23,42,.18);border-radius:4px;cursor:pointer;z-index:2;box-shadow:0 2px 4px rgba(15,23,42,.10);overflow:hidden;padding:0 7px;text-align:left;transition:filter .15s ease,transform .15s ease}.smed-pro-gantt-bar:hover{filter:brightness(1.04);transform:translateY(-1px);z-index:4}.smed-pro-gantt-bar span{font-size:9px;font-weight:900;color:#fff;white-space:nowrap;text-shadow:0 1px 1px rgba(0,0,0,.18)}
.smed-pro-gantt-bar.work-value{background:#22a879}.smed-pro-gantt-bar.work-necessary{background:#4e8fd5}.smed-pro-gantt-bar.work-external{background:#17a79b}.smed-pro-gantt-bar.work-waste{background:#dd5151}.smed-pro-gantt-bar.work-waiting{background:#e58a2a}.smed-pro-gantt-bar.work-unclassified{background:#8d9aad}
.smed-gantt-shell{overflow:auto;max-height:640px;border-radius:14px}.smed-gantt-insights{display:flex;flex-wrap:wrap;gap:6px}.smed-gantt-insights span{background:#eef4fa;border:1px solid #d9e5f0;color:#38516a;border-radius:999px;padding:5px 8px;font-size:9px;font-weight:850}
@media(max-width:900px){.smed-pro-gantt{min-width:1040px}.smed-pro-gantt-header,.smed-pro-gantt-row{grid-template-columns:500px 540px}.smed-pro-gantt-info{grid-template-columns:38px minmax(170px,1.4fr) 92px 122px 78px}}
@media print{.smed-pro-gantt{min-width:0!important;font-size:7px}.smed-pro-gantt-header,.smed-pro-gantt-row{grid-template-columns:43% 57%}.smed-pro-gantt-info{grid-template-columns:28px minmax(110px,1.5fr) 70px 100px 65px}.smed-pro-gantt-columns{min-height:34px}.smed-pro-gantt-row,.smed-pro-gantt-row>.smed-pro-gantt-info,.smed-pro-gantt-track{min-height:38px}.smed-pro-gantt-bar{top:9px;height:20px}.smed-pro-gantt-name b{font-size:8px}.smed-pro-gantt-name small,.smed-pro-gantt-period,.smed-pro-gantt-duration,.smed-pro-gantt-class,.smed-pro-gantt-scale span{font-size:6.5px}.smed-gantt-shell{max-height:none;overflow:visible}}
.smed-pro-gantt-group-row{background:#e7f5f1!important;border-bottom-color:#c8e8df}.smed-pro-gantt-group-row>.smed-pro-gantt-info{box-shadow:inset 5px 0 0 #2bb69b}.smed-pro-gantt-group-name{display:grid!important;align-content:center!important;gap:2px;padding-left:12px!important}.smed-pro-gantt-group-name b{font-size:12px;color:#135e54}.smed-pro-gantt-group-name small{font-size:9px;color:#498078;font-weight:800}.smed-pro-gantt-group-class{background:#d1fae5!important;color:#047857!important;border-color:#a7f3d0!important}.smed-pro-gantt-summary{position:absolute;top:19px;height:18px;background:#38b79c;z-index:2;min-width:6px;border-radius:2px;box-shadow:0 1px 2px rgba(15,118,110,.18)}.smed-pro-gantt-summary:before,.smed-pro-gantt-summary:after{content:"";position:absolute;bottom:-6px;border-style:solid;border-width:6px 5px 0}.smed-pro-gantt-summary:before{left:0;border-color:#16856f transparent transparent}.smed-pro-gantt-summary:after{right:0;border-color:#16856f transparent transparent}.smed-pro-gantt-summary span{display:block;padding:1px 6px;color:#fff;font-size:8px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.smed-pro-gantt-child-row .smed-pro-gantt-name{padding-left:22px!important;position:relative}.smed-pro-gantt-child-row .smed-pro-gantt-name:before{content:"";position:absolute;left:9px;top:50%;width:6px;height:1px;background:#a7b5c5}


/* v16 analytical Gantt – process hierarchy, dependencies, Muda zones and BEFORE/AFTER summary */
.smed-pro-gantt{--gantt-info:46%;min-width:1320px}
.smed-pro-gantt-header,.smed-pro-gantt-row{grid-template-columns:var(--gantt-info) calc(100% - var(--gantt-info))}
.smed-pro-gantt-info{grid-template-columns:42px minmax(185px,1.45fr) minmax(105px,.8fr) minmax(96px,.72fr) minmax(128px,.95fr) 90px}
.smed-pro-gantt-owner{font-size:9px;font-weight:800;color:#52657a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.smed-pro-gantt-body-wrap{position:relative}
.smed-pro-gantt-overlay{position:absolute;z-index:5;left:var(--gantt-info);right:0;top:0;bottom:0;pointer-events:none;overflow:hidden}
.smed-pro-gantt-dependencies{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.smed-pro-gantt-dependency{fill:none;stroke:#8796a8;stroke-width:1.25;vector-effect:non-scaling-stroke;opacity:.82}
.smed-pro-gantt-dependencies marker path{fill:#6f8094}
.smed-pro-gantt-waste-band{position:absolute;top:0;bottom:0;z-index:1;background:repeating-linear-gradient(135deg,rgba(220,38,38,.09) 0,rgba(220,38,38,.09) 5px,rgba(248,113,113,.035) 5px,rgba(248,113,113,.035) 10px);border-left:1px solid rgba(220,38,38,.16);border-right:1px solid rgba(220,38,38,.16);pointer-events:none}
.smed-pro-gantt-process-row{background:#f7f9fc!important}.smed-pro-gantt-process-row.after{background:#f2fbf7!important}
.smed-pro-gantt-processbar{position:absolute;top:17px;height:22px;z-index:2;border-radius:3px;box-shadow:0 1px 2px rgba(15,23,42,.14);min-width:5px}
.smed-pro-gantt-processbar.before{background:#3e5874}.smed-pro-gantt-processbar.after{background:#15956f}
.smed-pro-gantt-processbar:before,.smed-pro-gantt-processbar:after{content:"";position:absolute;bottom:-6px;border-style:solid;border-width:6px 5px 0}.smed-pro-gantt-processbar:before{left:0}.smed-pro-gantt-processbar:after{right:0}
.smed-pro-gantt-processbar.before:before,.smed-pro-gantt-processbar.before:after{border-color:#2f455e transparent transparent}.smed-pro-gantt-processbar.after:before,.smed-pro-gantt-processbar.after:after{border-color:#0f7658 transparent transparent}
.smed-pro-gantt-processbar span{display:block;padding:3px 8px;color:#fff;font-size:8px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.smed-pro-gantt-milestone{position:absolute;z-index:4;top:22px;width:12px;height:12px;background:#24506c;transform:translate(-50%,-1px) rotate(45deg);border:2px solid #fff;box-shadow:0 1px 3px rgba(15,23,42,.22)}
.smed-pro-gantt-playhead{position:absolute;z-index:8;top:0;bottom:0;width:2px;background:#1769ff;box-shadow:0 0 0 1px rgba(23,105,255,.08);display:none}
.smed-pro-gantt-playhead:before{content:"";position:absolute;top:2px;left:50%;width:12px;height:12px;border-radius:50%;background:#1769ff;transform:translate(-50%,-50%);box-shadow:0 0 0 3px #fff}
.smed-pro-gantt-playhead span{position:absolute;top:6px;left:7px;background:#1769ff;color:#fff;border-radius:5px;padding:2px 5px;font-size:7px;font-weight:900;white-space:nowrap}
.smed-pro-gantt-group-row{background:#edf9f5!important}.smed-pro-gantt-group-row>.smed-pro-gantt-info{box-shadow:inset 5px 0 0 #20a980}
.smed-pro-gantt-group-name b{color:#164e44}.smed-pro-gantt-summary{background:#22a87f}.smed-pro-gantt-summary:before,.smed-pro-gantt-summary:after{border-color:#14775a transparent transparent}
.smed-pro-gantt-child-row .smed-pro-gantt-name{padding-left:24px!important}
.smed-pro-gantt-child-row .smed-pro-gantt-name:before{width:8px;background:#a7b5c5}
.smed-pro-gantt-track{overflow:visible}.smed-pro-gantt-bar{z-index:3}.smed-pro-gantt-summary{z-index:3}.smed-pro-gantt-milestone{z-index:4}
@media(max-width:1000px){.smed-pro-gantt{min-width:1180px;--gantt-info:48%}.smed-pro-gantt-info{grid-template-columns:38px minmax(165px,1.35fr) 100px 92px 120px 78px}}
@media print{.smed-pro-gantt{--gantt-info:48%;min-width:0!important}.smed-pro-gantt-info{grid-template-columns:26px minmax(90px,1.35fr) 58px 58px 82px 48px}.smed-pro-gantt-dependency{stroke-width:.7}.smed-pro-gantt-playhead{display:none!important}.smed-pro-gantt-waste-band{print-color-adjust:exact;-webkit-print-color-adjust:exact}}


/* Video Work Analysis v18: project comparison + PowerPoint */
.smed-project-table{min-width:1450px}.smed-project-meta-input{width:100%;min-width:120px;border:1px solid #d7e1ec;border-radius:8px;background:#fbfdff;color:#0f172a;padding:7px 8px;font:inherit;font-weight:750;outline:none}.smed-project-meta-input:focus{border-color:#60a5fa;background:#fff;box-shadow:0 0 0 3px rgba(37,99,235,.10)}
.smed-group-comparison{display:grid;gap:16px}.smed-group-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.smed-group-kpis>div{display:grid;gap:3px;padding:12px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc}.smed-group-kpis small{font-size:8px;font-weight:950;text-transform:uppercase;letter-spacing:.06em;color:#64748b}.smed-group-kpis b{font-size:16px;color:#0f172a}.smed-group-kpis span{font-size:9px;color:#64748b;font-weight:750}
.smed-compare-section{border-top:1px solid #e5ebf3;padding-top:14px}.smed-compare-section h5{margin:0 0 12px;font-size:12px;color:#0f172a}.smed-compare-empty{padding:24px;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc;color:#64748b;display:grid;gap:6px;text-align:center;font-weight:700}.smed-compare-empty.compact{padding:14px}
.smed-group-bars{height:250px;display:flex;align-items:flex-end;gap:18px;padding:18px 12px 0;border-left:1px solid #dbe5f0;border-bottom:1px solid #dbe5f0;background:repeating-linear-gradient(0deg,#fff 0,#fff 49px,#edf2f7 50px)}.smed-group-bar-cluster{flex:1;min-width:90px;max-width:180px;display:grid;gap:8px;text-align:center}.smed-group-bar-plot{height:190px;display:flex;align-items:flex-end;justify-content:center;gap:7px}.smed-group-bar-plot i{position:relative;width:34%;height:var(--h);min-height:3px;border-radius:5px 5px 0 0;display:block}.smed-group-bar-plot i.before{background:#4e8fd5}.smed-group-bar-plot i.after{background:#20a979}.smed-group-bar-plot i span{position:absolute;left:50%;top:-18px;transform:translateX(-50%);font-size:8px;font-style:normal;font-weight:900;color:#475569;white-space:nowrap}.smed-group-bar-cluster>b{font-size:10px;color:#0f172a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.smed-group-bar-cluster>small{font-size:8px;color:#64748b}.smed-group-bar-legend{display:flex;gap:14px;margin-top:9px;font-size:9px;font-weight:850;color:#64748b}.smed-group-bar-legend span:before{content:"";display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:5px;vertical-align:-1px}.smed-group-bar-legend .before:before{background:#4e8fd5}.smed-group-bar-legend .after:before{background:#20a979}
.smed-composition-list{display:grid;gap:9px}.smed-composition-row{display:grid;grid-template-columns:minmax(110px,180px) minmax(250px,1fr) 82px;gap:10px;align-items:center}.smed-composition-row>b{font-size:10px;color:#0f172a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.smed-composition-row>span{font-size:9px;font-weight:850;color:#64748b;text-align:right}.smed-composition-stack{height:22px;display:flex;border-radius:6px;overflow:hidden;background:#eef2f7}.smed-composition-stack i{width:var(--w);height:100%;display:block}.smed-composition-stack i.value{background:#16a34a}.smed-composition-stack i.necessary{background:#2563eb}.smed-composition-stack i.external{background:#0f766e}.smed-composition-stack i.waste{background:#dc2626}.smed-composition-stack i.waiting{background:#d97706}.smed-composition-stack i.unclassified{background:#94a3b8}
.smed-step-compare-wrap{overflow:auto;border:1px solid #e2e8f0;border-radius:12px}.smed-step-compare-table{width:100%;min-width:700px;border-collapse:collapse;font-size:9px}.smed-step-compare-table th{padding:8px 10px;background:#eef4ff;color:#0f4c81;text-align:left;border-bottom:1px solid #d4dfec}.smed-step-compare-table td{padding:8px 10px;border-bottom:1px solid #edf2f7}.smed-step-compare-table tr:last-child td{border-bottom:0}.smed-step-mini-bar{position:relative;height:20px;background:#f1f5f9;border-radius:5px;overflow:hidden}.smed-step-mini-bar i{position:absolute;inset:0 auto 0 0;width:var(--w);background:#60a5fa;opacity:.55}.smed-step-mini-bar span{position:relative;z-index:1;display:flex;align-items:center;height:100%;padding:0 6px;font-weight:900;color:#334155}
.smed-ppt-panel{display:flex;flex-direction:column;align-items:flex-start;gap:9px}.smed-ppt-panel h4,.smed-ppt-panel p{margin:0}.smed-ppt-note{display:grid;gap:2px;padding:10px 12px;border-radius:10px;background:#eff6ff;border:1px solid #bfdbfe;color:#1e3a8a;font-size:9px}.smed-ppt-note span{color:#475569}
@media(max-width:900px){.smed-group-kpis{grid-template-columns:1fr}.smed-group-bars{overflow-x:auto}.smed-composition-row{grid-template-columns:100px minmax(180px,1fr) 70px}}
@media print{.smed-ppt-panel button{display:none!important}.smed-group-bars{height:190px}.smed-group-bar-plot{height:140px}}

.smed-project-table td:nth-child(1){width:170px}.smed-project-table td:nth-child(2),.smed-project-table td:nth-child(3){width:155px}.smed-project-table td:nth-child(4){width:210px}.smed-project-table td:nth-child(5),.smed-project-table td:nth-child(6){width:86px;white-space:nowrap}.smed-project-table td:nth-child(7){width:150px}.smed-project-table td:nth-child(8){width:104px}.smed-project-table td:nth-child(9){min-width:300px}

/* Capacity & Production Balancer - selectable print/PDF export (v19) */
.cpb-print-modal[hidden]{display:none!important}
.cpb-print-modal{position:fixed;inset:0;z-index:10020;display:grid;place-items:center;padding:22px;font-family:Arial,Helvetica,sans-serif}
.cpb-print-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.58);backdrop-filter:blur(3px)}
.cpb-print-modal-card{position:relative;width:min(720px,calc(100vw - 32px));max-height:min(820px,calc(100vh - 40px));overflow:auto;border:1px solid #cbd5e1;border-radius:20px;background:#fff;box-shadow:0 28px 80px rgba(15,23,42,.30)}
.cpb-print-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:20px 22px 16px;border-bottom:1px solid #e2e8f0;background:linear-gradient(180deg,#fff,#f8fbff)}
.cpb-print-modal-head span{display:block;color:#1463ff;font-size:9px;font-weight:1000;letter-spacing:.1em}
.cpb-print-modal-head h3{margin:4px 0 5px;color:#0f172a;font-size:22px}
.cpb-print-modal-head p{margin:0;max-width:600px;color:#64748b;font-size:12px;line-height:1.5;font-weight:650}
.cpb-print-modal-x{flex:0 0 auto;width:34px;height:34px;border:1px solid #dbe5f0;border-radius:10px;background:#fff;color:#475569;font-size:21px;line-height:1;cursor:pointer}
.cpb-print-modal-tools{display:flex;flex-wrap:wrap;gap:8px;padding:14px 22px 4px}
.cpb-print-option-list{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px 22px 20px}
.cpb-print-option{display:flex;align-items:flex-start;gap:10px;min-height:58px;padding:11px 12px;border:1px solid #dbe5f0;border-radius:13px;background:#fff;cursor:pointer;transition:.15s ease}
.cpb-print-option:hover{border-color:#93b8f5;background:#f8fbff}
.cpb-print-option:has(input:checked){border-color:#7eabf5;background:#eef5ff;box-shadow:inset 0 0 0 1px rgba(20,99,255,.08)}
.cpb-print-option input{margin-top:2px;accent-color:#1463ff}
.cpb-print-option span{display:grid;gap:3px;min-width:0}.cpb-print-option b{color:#172033;font-size:12px;line-height:1.3}.cpb-print-option small{color:#64748b;font-size:9px;line-height:1.35;font-weight:650}
.cpb-print-modal-foot{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:8px;padding:14px 22px;border-top:1px solid #e2e8f0;background:rgba(255,255,255,.97);backdrop-filter:blur(8px)}
body.cpb-print-modal-open{overflow:hidden}
@media(max-width:700px){.cpb-print-option-list{grid-template-columns:1fr}.cpb-print-modal{padding:10px}.cpb-print-modal-card{width:calc(100vw - 20px);max-height:calc(100vh - 20px)}}

@media print{
  .cpb-print-modal{display:none!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-excluded{display:none!important}
  body.cpb-printing #capacity-production-balancer [data-cap-print-section="report-summary"],
  body.cpb-printing #capacity-production-balancer [data-cap-print-section="result-summary"]{page:cpbPortrait}
  body.cpb-printing #capacity-production-balancer [data-cap-print-section="manual-plan"],
  body.cpb-printing #capacity-production-balancer [data-cap-print-section="machine-plan"],
  body.cpb-printing #capacity-production-balancer [data-cap-print-section="job-plan"],
  body.cpb-printing #capacity-production-balancer [data-cap-print-section="matrix"]{page:cpbLandscape;break-before:page}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page{page:cpbPortrait;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:4mm!important;align-items:start!important;margin:0!important;padding:0!important;break-before:page;break-after:page;break-inside:avoid-page!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page.cpb-print-pair-single{grid-template-columns:1fr!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page>.cpb-result-panel{margin:0!important;padding:5mm 4mm!important;border-radius:3mm!important;break-inside:avoid-page!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page h5{margin:0 0 3mm!important;font-size:10px!important;line-height:1.2!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-load-list{gap:1.4mm!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-load-card{padding:1.6mm 1.8mm!important;border-radius:2mm!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-load-head strong,
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-load-head b{font-size:7.2px!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-load-sub{font-size:5.8px!important;line-height:1.2!important;margin-top:.6mm!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-bar{height:2.2mm!important;margin:1mm 0 0!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-job-tags{display:none!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-insights{gap:1.4mm!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-insight{padding:1.5mm!important;grid-template-columns:5mm 1fr!important;gap:1.5mm!important;border-radius:2mm!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-insight>b{width:5mm!important;height:5mm!important;border-radius:1.5mm!important;font-size:7px!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-insight strong{font-size:6.8px!important;line-height:1.2!important}
  body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-insight span{font-size:5.8px!important;line-height:1.25!important;margin-top:.5mm!important}
  body.cpb-printing #capacity-production-balancer [data-cap-print-section="machine-plan"],
  body.cpb-printing #capacity-production-balancer [data-cap-print-section="job-plan"],
  body.cpb-printing #capacity-production-balancer [data-cap-print-section="matrix"]{margin-top:0!important}
}


/* Capacity Balancer v20: editable print-only workstation label */
.cpb-load-name{min-width:0;display:flex;flex-direction:column;gap:5px;flex:1}
.cpb-load-name>strong{display:block;line-height:1.25}
.cpb-load-label-edit{display:block;max-width:320px}
.cpb-load-label-edit input{width:100%;box-sizing:border-box;border:1px dashed #cbd5e1;border-radius:8px;background:#f8fafc;color:#334155;padding:6px 8px;font:inherit;font-size:11px;font-weight:650;outline:none}
.cpb-load-label-edit input:focus{border-style:solid;border-color:#60a5fa;background:#fff;box-shadow:0 0 0 3px rgba(37,99,235,.08)}
.cpb-load-print-label{display:none;font-weight:750;color:inherit}
body.cpb-printing #capacity-production-balancer .cpb-load-label-edit{display:none!important}
body.cpb-printing #capacity-production-balancer .cpb-load-print-label{display:inline!important}
body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-load-name{gap:0!important}
body.cpb-printing #capacity-production-balancer .cpb-print-paired-page .cpb-load-print-label{font-size:7.2px!important}

/* v21 lazy module loading UI */
.lazy-tool-placeholder,.lazy-tool-error{min-height:220px;display:flex;align-items:center;justify-content:center;gap:16px;text-align:left;border:1px dashed #cbd5e1;border-radius:18px;background:#f8fafc;padding:28px;color:#334155}.lazy-tool-placeholder strong,.lazy-tool-error strong{display:block;color:#0f172a;font-size:16px}.lazy-tool-placeholder span{display:block;margin-top:5px;color:#64748b;font-size:13px}.lazy-tool-spinner{width:34px;height:34px;border:4px solid #dbeafe;border-top-color:#2563eb;border-radius:50%;animation:leanLazySpin .8s linear infinite;flex:0 0 auto}.lazy-tool-error{flex-direction:column;text-align:center}.lazy-tool-error button{border:0;border-radius:10px;background:#2563eb;color:#fff;font-weight:800;padding:10px 16px;cursor:pointer}@keyframes leanLazySpin{to{transform:rotate(360deg)}}
