    :root{
      --bg:#f0f2f5;
      --panel:#f7f8fa;
      --panel2:#ffffff;
      --text:#1f2937;
      --muted:#6b7280;
      --line:#d7dde6;
      --accent:#2f52d4;
      --good:#166534;
      --good-soft:#ecfdf3;
      --good-line:#86efac;
      --warn:#6b7280;
      --bad:#b42323;
      --bad-soft:#fff5f5;
      --bad-line:#f0b4b4;
      --chip:#eef2f8;
      --btn:#f5f7fb;
      --btn2:#e8edf6;
      --input:#ffffff;
      --input-focus:#2f52d4;
      --input-readonly:#f2f4f7;
      --input-readonly-border:#d7dde6;
      --input-readonly-text:#6b7280;
      --space-1:6px;
      --space-2:10px;
      --space-3:12px;
      --space-4:14px;
      --space-5:16px;
      --radius-sm:6px;
      --radius-md:8px;
      --control-h:36px;
      --control-h-sm:30px;
    }
    [hidden]{display:none !important}
    *{box-sizing:border-box}
    body{
      margin:0;
      font-family:"Malgun Gothic","맑은 고딕","Noto Sans KR","Segoe UI",Arial,sans-serif;
      font-size:12px;
      line-height:1.45;
      background:var(--bg);
      color:var(--text);
    }
    a{color:var(--accent); text-decoration:none}
    .mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace}
    .muted{color:var(--muted)}

    /* ? FULL-WIDTH WRAP (changed) */
    .wrap{
      width:100%;
      max-width:none;
      margin:0;
      padding:0 12px 12px;
    }
    @media (min-width: 1200px){
      .wrap{ padding:0 16px 12px; }
    }
    @media (min-width: 1600px){
      .wrap{ padding:0 20px 12px; }
    }

    /* Top nav */
    .top{
      display:flex; gap:var(--space-4); align-items:center; justify-content:space-between;
      position:sticky;
      top:0;
      z-index:1000;
      background:var(--bg);
      height:70px;
      min-height:70px;
      padding:0;
      border-bottom:1px solid var(--line);
      margin-bottom:var(--space-3);
    }
    .brand{display:flex; flex:0 0 auto; gap:12px; align-items:center}
    .brand h1{display:flex; align-items:center; gap:8px; margin:0; font-size:16px; font-weight:700}
    .brand-title-btn{
      background:transparent;
      border:0;
      padding:0;
      margin:0;
      color:inherit;
      font:inherit;
      cursor:pointer;
      white-space:nowrap;
    }
    .app-version-badge{
      display:inline-flex;
      align-items:center;
      min-height:22px;
      padding:0 8px;
      border:1px solid var(--line);
      border-radius:999px;
      background:#fff;
      color:var(--muted);
      font-size:11px;
      font-weight:700;
      line-height:1;
      white-space:nowrap;
    }
    .global-busy{
      position:sticky;
      top:70px;
      z-index:999;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      min-height:38px;
      margin:-6px 0 10px;
      padding:8px 12px;
      border:1px solid #bfd0ff;
      border-radius:8px;
      background:#f7f9ff;
      color:#1f3ea8;
      box-shadow:0 4px 10px rgba(31,41,55,.08);
    }
    .global-busy.is-ok{
      border-color:#c8d7f8;
      background:#f8fbff;
      color:#2446a8;
    }
    .global-busy.is-bad{
      border-color:#efcaca;
      background:#fff7f7;
      color:#9b1c1c;
    }
    .global-busy-main{
      display:flex;
      align-items:center;
      gap:8px;
      min-width:0;
      font-weight:700;
    }
    .global-busy-main span:last-child{
      min-width:0;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
    }
    .global-busy-dot{
      width:8px;
      height:8px;
      flex:0 0 auto;
      border-radius:999px;
      background:#2f52d4;
      box-shadow:0 0 0 4px rgba(47,82,212,.12);
    }
    .global-busy:not(.is-ok):not(.is-bad) .global-busy-dot{
      animation:globalBusyPulse 1.2s ease-in-out infinite;
    }
    .global-busy.is-bad .global-busy-dot{
      background:#b42323;
      box-shadow:0 0 0 4px rgba(180,35,35,.12);
    }
    .global-busy-elapsed{
      flex:0 0 auto;
      color:var(--muted);
      font-size:11px;
      font-weight:700;
      white-space:nowrap;
    }
    @keyframes globalBusyPulse{
      0%, 100%{opacity:.45}
      50%{opacity:1}
    }
    .brand .sub{font-size:12px; color:var(--muted); margin-top:4px}
    .nav{
      display:flex; gap:var(--space-2); flex-wrap:nowrap; align-items:center; justify-content:flex-end;
      white-space:nowrap;
      overflow-x:hidden;
      overflow-y:hidden;
      min-width:0;
    }
    .top-right{
      display:flex;
      flex:1 1 auto;
      min-width:0;
      align-items:center;
      justify-content:flex-end;
      gap:10px;
    }
    .session{
      display:flex;
      align-items:center;
      gap:8px;
    }
    .session-user{
      min-height:var(--control-h);
      display:inline-flex;
      align-items:center;
      padding:0 12px;
      border-radius:8px;
      border:1px solid #b7e4d2;
      background:#ecfdf5;
      color:#0f766e;
      font-size:14px;
      font-weight:700;
      max-width:300px;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
    #btnLogout{
      background:#fff1f1;
      border-color:#f0c5c5;
      color:#b42323;
    }
    #btnLogout:hover{
      background:#ffe6e6;
      border-color:#e6abab;
      color:#981b1b;
    }
    .navbtn{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-height:var(--control-h);
      padding:0 14px;
      border-radius:8px;
      border:1px solid var(--line);
      background:var(--btn);
      color:var(--muted);
      cursor:pointer;
      font-weight:700;
      font-size:12px;
      transition:background-color .16s ease, border-color .16s ease, color .16s ease;
    }
    .navbtn.active{
      background:#e5ebff;
      border-color:#b8c6f3;
      color:#1f3ea8;
    }
    .navbtn svg{
      width:14px;
      height:14px;
      flex:none;
      opacity:.85;
      margin-right:6px;
    }
    #workflowSubtabs{
      display:none;
      margin-bottom:12px;
    }
    body.workflow-mode #workflowSubtabs{
      display:flex;
    }
    @media (max-width: 1320px){
      .nav{gap:4px}
      .navbtn{padding:0 10px}
      .navbtn svg{margin-right:4px}
      .session-user{max-width:170px}
    }
    @media (max-width: 1120px){
      .navbtn{
        width:var(--control-h);
        min-width:var(--control-h);
        padding:0;
      }
      .navbtn svg{margin-right:0}
      .navbtn-label{
        position:absolute;
        width:1px;
        height:1px;
        padding:0;
        margin:-1px;
        overflow:hidden;
        clip:rect(0,0,0,0);
        white-space:nowrap;
        border:0;
      }
      .session-user{max-width:140px}
    }
    .chip{
      display:inline-flex;
      align-items:center;
      background:var(--chip); border:1px solid var(--line);
      min-height:28px;
      padding:0 10px;
      border-radius:7px;
      color:var(--muted);
      font-size:11px;
    }

    /* Layout cards */
    .grid{display:grid; grid-template-columns:1fr; gap:12px;}
    @media (max-width: 980px){ .grid{grid-template-columns:1fr} }
    .card{
      background:var(--panel);
      border:1px solid var(--line);
      border-radius:10px;
      overflow:hidden;
    }
    .hd{
      padding:12px 16px;
      border-bottom:1px solid var(--line);
      display:flex; justify-content:space-between; align-items:center; gap:12px;
    }
    .hd h2{margin:0; font-size:13px; font-weight:700}
    .hd-tools{
      display:flex;
      align-items:center;
      gap:8px;
      margin-left:auto;
      flex-wrap:wrap;
    }
    .card-toggle{
      background:transparent;
      border:1px solid var(--line);
      color:var(--muted);
      border-radius:6px;
      font-size:16px;
      font-weight:700;
      padding:0;
      cursor:pointer;
      width:28px;
      min-width:28px;
      height:28px;
      line-height:1;
      display:inline-flex;
      align-items:center;
      justify-content:center;
    }
    .card.collapsed .bd{display:none}
    .card.collapsed .hd{border-bottom:none}
    .bd{padding:16px}
    .row{display:flex; gap:12px; flex-wrap:wrap}
    .row > *{flex:1}
    .row.tight{align-items:center}
    .row.tight > *{flex:unset}
    label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
    .input, select, textarea{
      width:100%;
      background:var(--input);
      border:1px solid var(--line);
      color:var(--text);
      padding:7px 8px;
      border-radius:var(--radius-sm);
      font-size:12px;
      text-align:left;
      outline:none;
    }
    .input,
    select{
      min-height:var(--control-h);
    }
    .input:focus, select:focus, textarea:focus{
      border-color:var(--input-focus);
      box-shadow:0 0 0 2px rgba(47,82,212,.14);
    }
    .input[readonly],
    input[readonly],
    textarea[readonly]{
      background:var(--input-readonly);
      border-color:var(--input-readonly-border);
      color:var(--input-readonly-text);
      cursor:default;
    }
    .input[readonly]:focus,
    input[readonly]:focus,
    textarea[readonly]:focus{
      box-shadow:none;
      border-color:var(--input-readonly-border);
    }
    .asset-path-wrap .input[readonly].is-empty{
      background:#ffffff;
      border-color:var(--line);
      color:var(--input-readonly-text);
    }
    .input[readonly].daily-upload-path,
    .asset-path-wrap .input[readonly].daily-upload-path,
    .asset-path-wrap .input[readonly].daily-upload-path.is-empty{
      background:#efef9d;
      color:var(--text);
    }
    .input.is-saved-path{
      background:#e9edf5;
      border-color:#c6d0e0;
      color:#253247;
    }
    .input.is-saved-path:focus{
      border-color:#b3bfd4;
      box-shadow:0 0 0 2px rgba(47,82,212,.10);
    }
    textarea{min-height:72px; resize:vertical}
    .btn{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      background:var(--btn);
      border:1px solid var(--line);
      color:var(--text);
      min-height:var(--control-h);
      height:var(--control-h);
      min-width:88px;
      padding:0 14px;
      border-radius:8px;
      line-height:1;
      cursor:pointer;
      font-weight:700;
      font-size:12px;
      white-space:nowrap;
      transition:background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
      user-select:none;
    }
    .btn.small{
      min-height:var(--control-h-sm);
      height:var(--control-h-sm);
      min-width:auto;
      padding:0 8px;
      font-size:11px;
      font-weight:700;
      border-radius:var(--radius-sm);
    }
    label.btn{
      margin-bottom:0;
    }
    .btn:hover{
      background:var(--btn2);
      border-color:#c8d1df;
    }
    .btn:focus-visible{
      outline:none;
      box-shadow:0 0 0 2px rgba(47,82,212,.16);
    }
    .btn:disabled{
      cursor:not-allowed;
      opacity:.55;
    }
    .btn.primary{
      background:#2f52d4;
      border-color:#2746b2;
      color:#ffffff;
    }
    .btn.primary:hover{
      background:#2847bb;
      border-color:#223d9f;
      color:#ffffff;
    }
    .btn.good{
      background:#ecfdf3;
      border-color:#86efac;
      color:#166534;
    }
    .btn.good:hover{
      background:#dcfce7;
      border-color:#4ade80;
      color:#14532d;
    }
    .btn.danger{
      background:#fff1f1;
      border-color:#f0c5c5;
      color:#b42323;
    }
    .btn.danger:hover{
      background:#ffe6e6;
      border-color:#e6abab;
      color:#981b1b;
    }
    .btn.copy-error,
    .btn.copy-error:disabled,
    .btn.copy-error.primary,
    .btn.copy-error.primary:disabled{
      background:#dc2626;
      border-color:#b91c1c;
      color:#ffffff;
      opacity:1;
    }
    .btn.copy-error:hover,
    .btn.copy-error.primary:hover{
      background:#b91c1c;
      border-color:#991b1b;
      color:#ffffff;
    }
    .hr{height:1px; background:var(--line); margin:16px 0}
    .actions-row{
      display:flex;
      align-items:center;
      justify-content:flex-end;
      gap:8px;
      margin-top:10px;
      flex-wrap:wrap;
    }
    .erp-inline-note{
      min-height:var(--control-h);
      display:inline-flex;
      align-items:center;
      margin-right:auto;
      color:var(--muted);
      font-size:12px;
      line-height:1.2;
      padding:0 2px;
      white-space:nowrap;
    }
    .run-exec-status{
      margin-right:4px;
      font-size:13px;
      color:var(--muted);
      min-height:20px;
      display:flex;
      align-items:center;
    }
    .run-exec-status.ok{ color:var(--good); }
    .run-exec-status.bad{ color:var(--bad); }
    .run-exec-status-below{
      margin-top:4px;
      margin-right:0;
      width:100%;
      min-height:20px;
      justify-content:flex-end;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
      flex-wrap:nowrap;
    }
    .run-exec-layout{
      display:flex;
      flex-direction:column;
      gap:8px;
    }
    .run-exec-actions{
      align-items:flex-start;
      justify-content:space-between;
      gap:12px;
    }
    .run-cm29-file{
      display:flex;
      align-items:center;
      gap:8px;
      flex:1 1 0;
      min-width:320px;
      max-width:none;
      margin-right:0;
    }
    .run-cm29-file .input{
      min-width:240px;
    }
    .run-pending-file-block{
      display:flex;
      flex-direction:column;
      gap:8px;
      flex:1 1 0;
      min-width:320px;
      max-width:none;
      margin-right:0;
    }
    .run-pending-file-block .run-cm29-file{
      flex:1 1 auto;
      min-width:0;
      max-width:none;
      margin-right:0;
    }
    .run-pending-order-check{
      display:flex;
      align-items:center;
      gap:8px;
      margin-left:4px;
      color:var(--muted);
      font-size:12px;
      user-select:none;
    }
    .run-pending-order-check input{
      margin:0;
    }
    .run-pending-file-block.is-disabled label[for="runPendingOrderFile"]{
      opacity:.55;
      pointer-events:none;
    }
    .policy-color-legend{
      display:flex;
      flex-direction:column;
      gap:5px;
      align-items:flex-start;
      margin-top:6px;
      font-size:12px;
      color:var(--text);
    }
    .policy-color-swatch{
      display:inline-block;
      width:14px;
      height:14px;
      margin-right:5px;
      border:1px solid #c8c8a0;
      border-radius:3px;
      vertical-align:-2px;
    }
    .policy-color-swatch.is-yellow{
      background:#fff59d;
    }
    .policy-color-swatch.is-orange{
      background:#ffcc80;
    }
    .policy-warehouse-diff-panel{
      margin-top:10px;
      border:1px solid #c7d2fe;
      border-radius:8px;
      background:#f8fbff;
      overflow:hidden;
    }
    .policy-warehouse-diff-panel.is-error{
      border-color:#f0b4b4;
      background:#fff5f5;
    }
    .policy-warehouse-diff-panel.is-error .policy-warehouse-diff-head{
      color:#8a1f1f;
      border-bottom-color:#f0b4b4;
    }
    .policy-warehouse-diff-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      padding:9px 10px;
      border-bottom:1px solid #d7dde6;
      color:#1f3ea8;
    }
    .policy-warehouse-diff-guide{
      padding:8px 10px;
      border-bottom:1px solid #e5e7eb;
      background:#ffffff;
      color:#4b5563;
      font-size:12px;
      font-weight:700;
    }
    .policy-warehouse-diff-chips{
      display:flex;
      gap:6px;
      flex-wrap:wrap;
      padding:8px 10px;
      border-bottom:1px solid #e5e7eb;
      background:#ffffff;
    }
    .policy-warehouse-diff-chip{
      min-height:28px;
      padding:0 9px;
      border:1px solid var(--line);
      border-radius:999px;
      background:#f5f7fb;
      color:var(--muted);
      cursor:pointer;
      font-weight:700;
      font-size:12px;
    }
    .policy-warehouse-diff-chip.active{
      background:#e5ebff;
      border-color:#b8c6f3;
      color:#1f3ea8;
    }
    .policy-warehouse-diff-scroll{
      max-height:220px;
      overflow:auto;
      background:#ffffff;
    }
    .policy-warehouse-diff-table{
      width:100%;
      min-width:860px;
      border-collapse:collapse;
      font-size:12px;
    }
    .policy-warehouse-diff-table th,
    .policy-warehouse-diff-table td{
      padding:7px 8px;
      border-bottom:1px solid #e5e7eb;
      text-align:left;
      white-space:nowrap;
      vertical-align:middle;
    }
    .policy-warehouse-diff-table th{
      position:sticky;
      top:0;
      z-index:1;
      background:#eef2ff;
      color:#1f3ea8;
      font-weight:800;
    }
    .policy-warehouse-diff-table td.is-number{
      text-align:right;
      font-family:Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    }
    .policy-warehouse-diff-table td.is-diff{
      color:#b42323;
      font-weight:800;
    }
    .policy-reconcile-preview{
      margin-top:10px;
      border:1px solid #d7dde6;
      border-radius:8px;
      background:#ffffff;
      overflow:hidden;
    }
    .policy-reconcile-preview-head{
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:12px;
      padding:11px 12px;
      border-bottom:1px solid #e5e7eb;
      background:#f8fafc;
    }
    .policy-reconcile-preview-head strong{
      display:block;
      color:var(--text);
      font-size:14px;
      line-height:1.35;
    }
    .policy-reconcile-preview-head p{
      margin:4px 0 0;
      color:#4b5563;
      font-size:12px;
      line-height:1.45;
    }
    .policy-reconcile-preview-badge{
      flex:0 0 auto;
      display:inline-flex;
      align-items:center;
      min-height:26px;
      padding:0 9px;
      border:1px solid #cbd5e1;
      border-radius:999px;
      background:#ffffff;
      color:#334155;
      font-size:12px;
      font-weight:800;
    }
    .policy-reconcile-summary{
      display:flex;
      flex-wrap:wrap;
      gap:6px;
      padding:8px 10px;
      border-bottom:1px solid #e5e7eb;
      background:#ffffff;
    }
    .policy-reconcile-summary span{
      display:inline-flex;
      align-items:center;
      min-height:28px;
      padding:0 9px;
      border:1px solid #d7dde6;
      border-radius:999px;
      background:#f8fafc;
      color:#334155;
      font-size:12px;
      font-weight:800;
    }
    .policy-reconcile-summary span.is-urgent{
      border-color:#f7c6a0;
      background:#fff7ed;
      color:#9a3412;
    }
    .policy-reconcile-preview-grid{
      display:grid;
      grid-template-columns:minmax(0, 1.35fr) minmax(280px, .8fr);
      gap:0;
      background:#ffffff;
    }
    .policy-reconcile-preview-block{
      padding:10px;
      min-width:0;
    }
    .policy-reconcile-preview-block + .policy-reconcile-preview-block{
      border-left:1px solid #e5e7eb;
    }
    .policy-reconcile-block-title{
      color:var(--text);
      font-size:13px;
      font-weight:900;
    }
    .policy-reconcile-block-desc{
      margin-top:2px;
      color:#6b7280;
      font-size:12px;
      font-weight:700;
    }
    .policy-reconcile-preview-table{
      width:100%;
      margin-top:8px;
      border-collapse:collapse;
      font-size:12px;
    }
    .policy-reconcile-preview-table th,
    .policy-reconcile-preview-table td{
      padding:7px 8px;
      border-bottom:1px solid #e5e7eb;
      text-align:left;
      white-space:nowrap;
      vertical-align:middle;
    }
    .policy-reconcile-preview-table th{
      background:#f1f5f9;
      color:#334155;
      font-weight:900;
    }
    .policy-reconcile-preview-table .is-number{
      text-align:right;
      font-family:Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    }
    .policy-reconcile-preview-table .is-diff{
      color:#b42323;
      font-weight:900;
    }
    @media (max-width: 980px){
      .policy-reconcile-preview-grid{
        grid-template-columns:1fr;
      }
      .policy-reconcile-preview-block + .policy-reconcile-preview-block{
        border-left:0;
        border-top:1px solid #e5e7eb;
      }
      .policy-reconcile-preview-head{
        flex-direction:column;
      }
    }
    .run-exec-submit{
      margin-top:0;
      justify-content:flex-end;
    }
    .hint{
      border:1px dashed #c6ceda;
      background:#f5f7fb;
      padding:10px 12px;
      border-radius:8px;
      color:#4b5563;
      font-size:12px;
    }
    .tpl-panel{
      display:grid;
      gap:10px;
    }
    .tpl-hint{
      margin:0;
      line-height:1.4;
    }
    .asset-path-toolbar{
      display:flex;
      align-items:flex-end;
      gap:8px;
      flex-wrap:wrap;
    }
    .asset-path-wrap{
      flex:1;
      min-width:240px;
    }
    .asset-path-actions{
      display:flex;
      align-items:center;
      gap:8px;
      flex:0 0 auto;
    }
    .asset-path-actions .btn{
      min-width:92px;
    }
    .policy-google-master-toolbar{
      padding:10px;
      border:1px solid #b8c6f3;
      border-radius:8px;
      background:#f4f7ff;
    }
    .google-source-panel{
      padding:10px;
      border:1px solid #b8c6f3;
      border-radius:8px;
      background:#f4f7ff;
    }
    .google-source-panel .asset-path-toolbar{
      padding:0;
      border:0;
      background:transparent;
    }
    .manual-match-upload{
      border-top:1px solid #d9dee8;
      padding-top:8px;
    }
    .manual-match-upload > summary{
      color:#667085;
      cursor:pointer;
      font-size:12px;
      font-weight:700;
      list-style:none;
      width:max-content;
    }
    .manual-match-upload > summary::-webkit-details-marker{
      display:none;
    }
    .manual-match-upload > summary::before{
      content:"+";
      display:inline-block;
      margin-right:6px;
      width:12px;
    }
    .manual-match-upload[open] > summary::before{
      content:"-";
    }
    .manual-match-upload-body{
      padding-top:10px;
    }
    .dashboard-daily-compare-bar{
      display:grid;
      grid-template-columns:minmax(220px, 1fr) minmax(220px, 1fr) auto;
      gap:10px;
      align-items:end;
      margin-top:8px;
    }
    .dashboard-file-picker{
      min-width:0;
    }
    .dashboard-file-row{
      display:grid;
      grid-template-columns:minmax(0, 1fr) auto;
      gap:8px;
      align-items:center;
    }
    .dashboard-daily-actions{
      display:flex;
      gap:8px;
      align-items:end;
      justify-content:flex-end;
      white-space:nowrap;
    }
    .dashboard-daily-actions label{
      display:none;
    }
    .dashboard-source-grid{
      display:grid;
      grid-template-columns:repeat(2, minmax(0, 1fr));
      gap:10px;
    }
    .dashboard-source-card{
      border:1px solid var(--line);
      border-radius:8px;
      background:#fbfdff;
      padding:12px;
      min-height:118px;
      display:flex;
      flex-direction:column;
      gap:7px;
    }
    .dashboard-source-title{
      font-size:13px;
      font-weight:800;
      color:var(--text);
    }
    .dashboard-source-meta{
      font-size:12px;
      color:var(--muted);
      min-height:18px;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
    }
    .dashboard-source-meta.is-id{
      font-family:Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
      color:#1f3ea8;
    }
    .dashboard-source-actions{
      margin-top:auto;
      display:flex;
      justify-content:flex-end;
    }
    .daily-stock-mismatch-panel{
      margin-top:10px;
      border:1px solid #f0c5c5;
      border-radius:8px;
      background:#fff7f7;
      overflow:hidden;
    }
    .daily-stock-mismatch-panel.is-ok{
      border-color:#bbf7d0;
      background:#f0fdf4;
    }
    .daily-stock-mismatch-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      padding:9px 10px;
      border-bottom:1px solid #f0c5c5;
      color:#981b1b;
    }
    .daily-stock-mismatch-panel.is-ok .daily-stock-mismatch-head{
      border-bottom-color:#bbf7d0;
      color:#166534;
    }
    .daily-stock-mismatch-scroll{
      max-height:280px;
      overflow:auto;
      background:#ffffff;
    }
    .daily-stock-mismatch-table{
      width:100%;
      border-collapse:collapse;
      min-width:780px;
      font-size:12px;
    }
    .daily-stock-mismatch-table th,
    .daily-stock-mismatch-table td{
      padding:7px 8px;
      border-bottom:1px solid #f3dada;
      text-align:left;
      vertical-align:middle;
      white-space:nowrap;
    }
    .daily-stock-mismatch-table th{
      position:sticky;
      top:0;
      z-index:1;
      background:#fee2e2;
      color:#7f1d1d;
      font-weight:800;
    }
    .daily-stock-mismatch-panel.is-ok .daily-stock-mismatch-table th{
      background:#dcfce7;
      color:#166534;
    }
    .daily-stock-mismatch-table td.is-number{
      text-align:right;
      font-family:Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    }
    .daily-stock-mismatch-table td.is-diff{
      color:#b42323;
      font-weight:800;
    }
    .daily-stock-mismatch-table .status-pill{
      display:inline-flex;
      align-items:center;
      min-height:24px;
      padding:0 8px;
      border-radius:999px;
      background:#dc2626;
      color:#ffffff;
      font-weight:800;
    }
    #dailyStockMismatchSummary.is-ok{
      display:inline-flex;
      align-items:center;
      gap:6px;
      min-height:22px;
      padding:2px 10px;
      border-radius:999px;
      background:#dcfce7;
      color:#166534;
      font-weight:800;
    }
    @media (max-width: 980px){
      .dashboard-daily-compare-bar{
        grid-template-columns:1fr;
      }
      .dashboard-daily-actions{
        justify-content:flex-start;
        flex-wrap:wrap;
      }
      .dashboard-source-grid{
        grid-template-columns:1fr;
      }
    }
    .policy-master-source-status{
      min-height:24px;
      display:flex;
      align-items:center;
      padding:0 2px;
      margin-top:0;
      font-weight:700;
    }
    .policy-master-source-status.is-google{
      color:#1f3ea8;
    }
    .policy-master-source-status.is-manual{
      color:#b45309;
    }
    .policy-master-source-status.is-error{
      color:#b42323;
    }
    .erp-config-accordion.policy-manual-master-accordion{
      margin-top:2px;
      border-radius:8px;
    }
    .erp-config-accordion.policy-manual-master-accordion > summary{
      padding:9px 12px;
      background:#ffffff;
    }
    .tpl-file{
      flex:1;
      min-width:240px;
      min-height:var(--control-h);
      display:flex;
      align-items:center;
      padding:0 10px;
      border:1px solid var(--line);
      border-radius:var(--radius-sm);
      background:var(--panel2);
      color:var(--muted);
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
    }
    .tpl-meta-row{
      display:flex;
      align-items:center;
      gap:8px;
      flex-wrap:wrap;
    }
    .tpl-meta-label{
      color:var(--muted);
      font-size:12px;
      white-space:nowrap;
    }
    .tpl-meta-input{
      width:320px;
      max-width:100%;
    }
    .tpl-meta-actions{
      margin-left:auto;
      display:flex;
      gap:8px;
      flex-wrap:wrap;
    }
    @media (max-width: 980px){
      .asset-path-actions{
        margin-left:auto;
      }
      .tpl-meta-actions{
        margin-left:0;
      }
      .tpl-meta-input{
        width:100%;
      }
    }

    /* Tables */
    table{
      width:100%;
      border-collapse:collapse;
      border-radius:6px;
      overflow:hidden;
      border:1px solid var(--line);
      background:var(--panel2);
      /* Optional: stable layout */
      table-layout: fixed;
    }
    th, td{
      padding:8px 10px;
      border-bottom:1px solid var(--line);
      font-size:12px;
      vertical-align:top;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
    }
    .col-name{
      white-space:normal;
      word-break:break-word;
      width:260px;
      max-width:420px;
    }
    .col-name input{
      white-space:normal;
      height:auto;
    }
    .col-name textarea{
      min-height:38px;
      height:38px;
      resize:vertical;
      white-space:normal;
      line-height:1.35;
    }
    .col-qty,
    .col-flag{
      width:90px;
      max-width:90px;
      text-align:center;
    }
    .col-qty input,
    .col-flag input{
      text-align:left;
    }
    th{
      text-align:left;
      color:#4b5563;
      font-weight:700;
      background:#eef2f7;
      position:sticky; top:0; z-index:3; /* sticky header */
    }
    tr:last-child td{border-bottom:none}
    .cfg-table{
      table-layout:auto;
    }
    .cfg-table th,
    .cfg-table td{
      white-space:nowrap;
      overflow:visible;
      text-overflow:clip;
      vertical-align:middle;
    }
    .cfg-table th{
      position:static;
      top:auto;
      z-index:auto;
    }
    .cfg-table tbody td{
      padding-top:6px;
      padding-bottom:6px;
    }
    .cfg-table tbody td:first-child{
      font-weight:600;
      color:var(--text);
      text-align:center;
    }
    .cfg-table .input{
      width:100%;
      min-height:var(--control-h);
      height:var(--control-h);
      padding:0 8px;
      line-height:1;
      border-radius:8px;
      text-align:left;
    }
    /* Rule tab: center specific columns (2~6) */
    .cfg-table th:nth-child(2),
    .cfg-table th:nth-child(3),
    .cfg-table th:nth-child(4),
    .cfg-table th:nth-child(5),
    .cfg-table th:nth-child(6),
    .cfg-table td:nth-child(2),
    .cfg-table td:nth-child(3),
    .cfg-table td:nth-child(4),
    .cfg-table td:nth-child(5),
    .cfg-table td:nth-child(6){
      text-align:center;
    }
    .cfg-table th:first-child{
      text-align:center;
    }
    .cfg-table td:nth-child(2) .input,
    .cfg-table td:nth-child(3) .input,
    .cfg-table td:nth-child(4) .input,
    .cfg-table td:nth-child(5) .input,
    .cfg-table td:nth-child(6) .input{
      text-align:center;
    }
    .policy-price-badge{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-width:86px;
      height:24px;
      padding:0 9px;
      border:1px solid transparent;
      border-radius:999px;
      font-size:12px;
      font-weight:800;
      line-height:1;
      white-space:nowrap;
    }
    .policy-price-badge.is-period1{
      color:#164194;
      background:#e8f0ff;
      border-color:#9cbcff;
    }
    .policy-price-badge.is-period2{
      color:#6d28a8;
      background:#f3e8ff;
      border-color:#d8b4fe;
    }
    .policy-price-badge.is-always{
      color:#047857;
      background:#dcfce7;
      border-color:#86efac;
    }
    .policy-price-badge.is-list{
      color:#b42318;
      background:#fff1f1;
      border-color:#f3aaa3;
    }
    #policyItemMasterPreviewSummary{
      display:flex;
      align-items:flex-start;
      flex-direction:column;
      gap:4px;
      line-height:1.4;
    }
    .policy-price-summary-top{
      display:flex;
      align-items:center;
      gap:8px;
      flex-wrap:wrap;
      min-height:34px;
      margin-top:8px;
      padding:5px 8px;
      border:1px solid var(--line);
      border-radius:8px;
      background:#f7f9fc;
      line-height:1.4;
    }
    .policy-price-summary-top[hidden]{
      display:none;
    }
    .policy-price-summary{
      display:inline-flex;
      align-items:center;
      gap:6px;
      flex-wrap:wrap;
    }
    .policy-price-summary-label,
    .policy-preview-summary-text,
    .policy-preview-summary-line{
      display:inline-flex;
      align-items:center;
      min-height:24px;
    }
    .policy-price-summary-badge{
      min-width:78px;
      height:24px;
    }
    .policy-price-filter-btn{
      font-family:inherit;
      cursor:pointer;
      appearance:none;
    }
    .policy-price-filter-btn:hover{
      filter:brightness(.97);
    }
    .policy-price-filter-btn.is-active{
      box-shadow:0 0 0 2px rgba(31,62,168,.18);
      transform:translateY(-1px);
    }
    .erp-map-table th,
    .erp-map-table td{
      text-align:center !important;
    }
    .erp-map-table .input{
      width:140px !important;
      min-width:140px;
      max-width:140px;
      margin:0 auto;
      text-align:center !important;
    }
    .erp-map-table td:nth-child(3){
      text-align:center !important;
    }
    .erp-fixed-stack{
      display:grid;
      gap:14px;
    }
    .erp-mini-fields{
      align-items:flex-end;
    }
    .erp-mini-fields > div{
      flex:0 0 250px;
      max-width:250px;
    }
    .erp-mini-fields .erp-inline-action{
      flex:0 0 auto;
      max-width:none;
      margin-left:8px;
    }
    .erp-substack{
      display:grid;
      gap:12px;
      margin-top:12px;
    }
    .erp-subcard .hd{
      padding:10px 12px;
    }
    .erp-subcard .bd{
      padding:12px;
    }
    #erpDefaultManager{
      text-align:left;
    }
    .erp-fixed-stack .asset-path-toolbar{
      margin-bottom:2px;
    }
    .erp-config-accordion{
      border:1px solid var(--line);
      border-radius:10px;
      background:var(--panel2);
      overflow:hidden;
    }
    .erp-config-accordion > summary{
      list-style:none;
      cursor:pointer;
      user-select:none;
      padding:12px 14px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      font-weight:700;
      color:var(--text);
      background:linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
      border-bottom:1px solid transparent;
    }
    .erp-config-header{
      padding:12px 14px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      font-weight:700;
      color:var(--text);
      background:linear-gradient(180deg, #ffffff 0%, #eef3fb 100%);
      border-bottom:1px solid var(--line);
    }
    .erp-config-header .title{
      display:inline-flex;
      align-items:center;
      gap:8px;
    }
    .erp-config-header .title::before{
      content:"";
      width:8px;
      height:8px;
      border-radius:50%;
      background:var(--accent);
      box-shadow:0 0 0 4px rgba(47,82,212,.15);
      flex:0 0 8px;
    }
    .erp-config-accordion > summary::-webkit-details-marker{
      display:none;
    }
    .erp-config-accordion > summary .title{
      display:inline-flex;
      align-items:center;
      gap:8px;
    }
    .erp-config-accordion > summary .title::before{
      content:"";
      width:8px;
      height:8px;
      border-radius:50%;
      background:var(--accent);
      box-shadow:0 0 0 4px rgba(47,82,212,.15);
      flex:0 0 8px;
    }
    .erp-config-accordion > summary .chev{
      width:9px;
      height:9px;
      border-right:2px solid #75809a;
      border-bottom:2px solid #75809a;
      transform:rotate(45deg);
      transition:transform .16s ease, border-color .16s ease;
      margin-right:2px;
      flex:0 0 9px;
    }
    .erp-config-accordion[open] > summary{
      border-bottom-color:var(--line);
      background:linear-gradient(180deg, #ffffff 0%, #eef3fb 100%);
    }
    .erp-config-accordion[open] > summary .chev{
      transform:rotate(225deg);
      border-color:#4f5d78;
      margin-top:4px;
    }
    .erp-config-accordion-body{
      padding:12px;
      background:var(--panel2);
    }
    .inv-map-wrap{
      overflow:auto;
    }
    .inv-map-table{
      table-layout:auto;
    }
    .inv-map-table th,
    .inv-map-table td{
      white-space:nowrap;
      overflow:visible;
      text-overflow:clip;
      vertical-align:middle;
    }
    .inv-map-table th{
      position:static;
      top:auto;
      z-index:auto;
    }
    .inv-map-table .input{
      width:100%;
      min-height:var(--control-h);
      height:var(--control-h);
      padding:0 8px;
      line-height:1;
      border-radius:8px;
    }
    /* Run tab: center specific columns (barcode/stock/header row) */
    .inv-map-table th:nth-child(3),
    .inv-map-table th:nth-child(4),
    .inv-map-table th:nth-child(5),
    .inv-map-table th:nth-child(6),
    .inv-map-table td:nth-child(3),
    .inv-map-table td:nth-child(4),
    .inv-map-table td:nth-child(5),
    .inv-map-table td:nth-child(6){
      text-align:center;
    }
    .inv-map-table td:nth-child(3) .input,
    .inv-map-table td:nth-child(4) .input,
    .inv-map-table td:nth-child(5) .input,
    .inv-map-table td:nth-child(6) .input{
      text-align:center;
    }
    .inv-map-actions{
      display:flex;
      gap:8px;
      justify-content:flex-end;
      margin-top:10px;
      flex-wrap:wrap;
    }
    .inv-pull-status{
      margin-top:8px;
      text-align:right;
      color:var(--muted);
      font-size:13px;
    }
    .inv-pull-status.ok{ color:var(--good); }
    .inv-pull-status.bad{ color:var(--bad); }
    .dist-compact-row{
      display:flex;
      gap:12px;
      flex-wrap:wrap;
      align-items:flex-end;
    }
    .dist-compact-item{
      flex:1 1 180px;
      min-width:180px;
    }
    .dist-compact-item select,
    .dist-compact-item .input{
      width:100%;
    }
    .ratio-matrix-wrap{
      overflow:auto;
      margin-top:8px;
    }
    .ratio-matrix{
      table-layout:auto;
    }
    .ratio-matrix th,
    .ratio-matrix td{
      white-space:nowrap;
      overflow:visible;
      text-overflow:clip;
      vertical-align:middle;
      text-align:center;
    }
    .ratio-matrix th{
      position:static;
      top:auto;
      z-index:auto;
    }
    .ratio-matrix tbody td:first-child{
      font-weight:600;
      color:var(--text);
      text-align:center;
    }
    .ratio-matrix .input{
      width:100%;
      min-height:var(--control-h);
      height:var(--control-h);
      padding:0 8px;
      line-height:1;
      text-align:left;
    }
    .ratio-info-row{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
      margin-bottom:10px;
    }
    .ratio-info-chip{
      display:inline-flex;
      align-items:center;
      min-height:28px;
      padding:0 10px;
      border:1px solid var(--line);
      border-radius:999px;
      background:#eef2f7;
      color:var(--muted);
      font-size:13px;
      white-space:nowrap;
    }
    #runsTable td:last-child{
      overflow:visible;
      text-overflow:clip;
    }
    #runsTable .actions-cell{
      display:flex;
      gap:6px;
      justify-content:flex-end;
      flex-wrap:nowrap;
      white-space:nowrap;
    }

    .tabs{display:flex; gap:8px; flex-wrap:wrap;}
    .tab{
      min-height:var(--control-h);
      padding:0 12px;
      border-radius:8px;
      border:1px solid var(--line);
      background:var(--btn);
      cursor:pointer;
      font-size:12px;
      color:var(--muted);
      font-weight:700;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      transition:background-color .16s ease, border-color .16s ease, color .16s ease;
    }
    .tab.active{
      background:#e5ebff;
      border-color:#b8c6f3;
      color:#1f3ea8;
    }
    .pill{
      display:inline-flex; align-items:center; gap:6px;
      min-height:26px;
      padding:0 8px;
      border-radius:999px;
      border:1px solid var(--line);
      background:#eef2f7;
      font-size:11px; color:var(--muted);
      white-space:nowrap;
    }
    .dot{width:8px; height:8px; border-radius:50%; background:var(--muted);}
    .dot.good{background:var(--good)}
    .dot.warn{background:var(--warn)}
    .dot.bad{background:var(--bad)}
    input[type="checkbox"]{accent-color:var(--accent);}

    /* Views */
    .view{display:none}
    .view.active{display:block}
    body.workflow-mode #view-rules.view.active,
    body.workflow-mode #view-mapping.view.active,
    body.workflow-mode #view-run.view.active{
      margin:0 0 12px 0;
    }
    body.workflow-mode #view-run.view.active{
      margin-bottom:0;
    }
    .closing-frame{
      width:100%;
      min-height:calc(100vh - 190px);
      border:0;
      display:block;
      background:#fff;
    }

    /* Mapping: barcode cards */
    .cards{
      display:grid;
      grid-template-columns: repeat(3, 1fr);
      gap:12px;
      margin-top:12px;
    }
    @media (max-width: 1300px){ .cards{grid-template-columns: repeat(2, 1fr);} }
    @media (max-width: 980px){ .cards{grid-template-columns:1fr} }
    .bcard{
      background:var(--panel2);
      border:1px solid var(--line);
      border-radius:8px;
      padding:12px;
    }
    .bcard .toprow{
      display:flex; justify-content:space-between; gap:10px; align-items:center;
      margin-bottom:8px;
    }
    .bcard .barcode{font-weight:900}
    .kv{display:grid; grid-template-columns: 130px 1fr; gap:8px; margin-top:8px;}
    .k{color:var(--muted); font-size:12px}
    .v{font-size:13px}
    .actrow{display:flex; gap:8px; justify-content:flex-end; margin-top:10px;}
    .small{font-size:11px}
    .log{
      background:#f4f6fa;
      border:1px solid var(--line);
      border-radius:8px;
      padding:12px;
      max-height:240px;
      overflow:auto;
      font-size:12px;
      color:#3f4d63;
      line-height:1.45;
      white-space:pre-wrap;
    }
    .log.is-error{
      background:#fff5f5;
      border-color:#f0b4b4;
      color:#8a1f1f;
    }
    .promotion-sales-controls > div{
      min-width:180px;
      max-width:280px;
      flex:1 1 220px;
    }
    .promotion-sales-summary{
      display:grid;
      grid-template-columns:repeat(3, minmax(0, 1fr));
      gap:10px;
      margin-top:12px;
    }
    .promotion-sales-summary[hidden],
    .promotion-sales-results[hidden]{
      display:none;
    }
    .promotion-sales-summary .v{
      font-weight:800;
      margin-top:4px;
    }
    .promotion-sales-results{
      display:grid;
      gap:12px;
      margin-top:12px;
    }
    .promotion-sales-message{
      min-height:260px;
      line-height:1.5;
    }
    .promotion-sales-tables{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:12px;
    }
    .promotion-sales-pane{
      height:320px;
    }
    @media (max-width: 1100px){
      .promotion-sales-summary,
      .promotion-sales-tables{
        grid-template-columns:1fr;
      }
    }

    /* Optional: mapping table panes (better use of vertical space) */
    .pane{border-radius:8px; overflow:auto; border:1px solid var(--line); background:var(--panel2);}
    .pane.match{
      height:520px;
      position:relative;
      overflow-y:auto;
      overflow-x:auto;
    }
    .pane.erp-scroll{
      height:520px;
      position:relative;
      overflow-y:auto;
      overflow-x:auto;
    }
    .pane.erp-scroll.policy-item-master-preview-pane{
      height:auto;
      max-height:none;
      overflow-y:hidden;
    }
    .pane.erp-scroll.policy-item-master-preview-pane.is-loaded{
      height:440px;
      max-height:440px;
      overflow-y:auto;
    }
    .pane table{
      border-collapse:separate;
      border-spacing:0;
      overflow:visible;
    }
    .pane table thead{
      position:sticky;
      top:0;
      z-index:9;
    }
    .pane table thead th{
      position:sticky !important;
      top:0;
      z-index:10;
      background:#eef2f7;
      box-shadow:inset 0 -1px 0 var(--line);
      background-clip:padding-box;
    }
    #erpDiscountTable thead th{
      position:sticky !important;
      top:0;
      z-index:10;
      background:#eef2f7;
      box-shadow:inset 0 -1px 0 var(--line);
    }
    #erpDiscountTable{
      width:100%;
      min-width:max-content;
      table-layout:fixed;
      border-collapse:separate;
      border-spacing:0;
      overflow:visible;
    }
    #erpDiscountTable thead{
      position:sticky;
      top:0;
      z-index:9;
    }
    #erpDiscountTable th,
    #erpDiscountTable td{
      overflow:visible;
      text-overflow:clip;
      white-space:nowrap;
    }
    #erpDiscountTable th:nth-child(8),
    #erpDiscountTable td:nth-child(8){
      width:auto !important;
      min-width:340px !important;
      max-width:none !important;
      overflow:visible !important;
      text-overflow:clip !important;
      white-space:normal !important;
      word-break:break-word !important;
    }
    #erpDiscountTable th:nth-child(9),
    #erpDiscountTable td:nth-child(9){
      width:auto !important;
      min-width:240px !important;
      max-width:none !important;
      overflow:visible !important;
      text-overflow:clip !important;
      white-space:normal !important;
      word-break:break-word !important;
    }
    #erpDiscountTable td:nth-child(7),
    #erpDiscountTable td:nth-child(8),
    #erpDiscountTable td:nth-child(9){
      line-height:1.35;
    }
    #erpDiscountTable th:nth-child(13),
    #erpDiscountTable td:nth-child(13),
    #erpDiscountTable th:nth-child(12),
    #erpDiscountTable td:nth-child(12),
    #erpDiscountTable th:nth-child(11),
    #erpDiscountTable td:nth-child(11),
    #erpDiscountTable th:nth-child(10),
    #erpDiscountTable td:nth-child(10),
    #erpDiscountTable th:nth-child(5),
    #erpDiscountTable td:nth-child(5){
      text-align:center !important;
    }
    #erpDiscountTable td:nth-child(12) .input{
      text-align:center !important;
    }
    .erp-full-body .cfg-table th:nth-child(11),
    .erp-full-body .cfg-table td:nth-child(11),
    .erp-full-body .cfg-table th:nth-child(10),
    .erp-full-body .cfg-table td:nth-child(10),
    .erp-full-body .cfg-table th:nth-child(9),
    .erp-full-body .cfg-table td:nth-child(9),
    .erp-full-body .cfg-table th:nth-child(8),
    .erp-full-body .cfg-table td:nth-child(8){
      text-align:center !important;
    }
    .erp-full-body .cfg-table td:nth-child(11) .input,
    .erp-full-body .cfg-table td:nth-child(12) .input{
      text-align:center !important;
    }
    .erp-full-body .cfg-table th:nth-child(5),
    .erp-full-body .cfg-table td:nth-child(5),
    .erp-full-body .cfg-table th:nth-child(6),
    .erp-full-body .cfg-table td:nth-child(6),
    .erp-full-body .cfg-table th:nth-child(7),
    .erp-full-body .cfg-table td:nth-child(7){
      white-space:normal !important;
      word-break:break-word !important;
      text-overflow:clip !important;
      overflow:visible !important;
      line-height:1.35;
    }
    #erpDiscountTable tr.erp-row-worked td{
      background:#edf4ff;
    }
    .erp-full-body .cfg-table tr.erp-row-worked td{
      background:#edf4ff;
    }
    .erp-full-overlay{
      position:fixed;
      inset:0;
      background:rgba(15, 23, 42, 0.42);
      display:none;
      align-items:center;
      justify-content:center;
      z-index:1200;
      padding:24px;
    }
    .erp-full-overlay.open{ display:flex; }
    .erp-full-panel{
      width:min(1400px, 96vw);
      height:min(82vh, 860px);
      background:#fff;
      border:1px solid var(--line);
      border-radius:12px;
      display:flex;
      flex-direction:column;
      overflow:hidden;
      box-shadow:0 24px 64px rgba(15, 23, 42, 0.28);
    }
    .erp-full-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      padding:12px 14px;
      border-bottom:1px solid var(--line);
      background:#f6f8fc;
    }
    .erp-full-body{
      flex:1;
      overflow:auto;
      padding:10px;
      background:#fff;
    }
    .erp-full-body .cfg-table{
      min-width:1700px;
    }
    .erp-full-body .cfg-table thead th{
      position:sticky !important;
      top:0;
      z-index:8;
      background:#eef2f7;
      box-shadow:inset 0 -1px 0 var(--line);
    }
    body.erp-fullscreen-lock{
      overflow:hidden;
    }
    .erp-work-area.fullscreen{
      position:fixed;
      inset:10px;
      z-index:1300;
      background:var(--panel);
      border:1px solid var(--line);
      border-radius:12px;
      overflow:auto;
      padding:16px;
      box-shadow:0 16px 48px rgba(15,23,42,0.24);
    }
    .pane.bom{height:320px;}
    /* Policy tab tables: keep the same visual scale as 판매 수량 등록 table */
    #view-policy .pane.erp-scroll .cfg-table th,
    #view-policy .pane.erp-scroll .cfg-table td{
      font-size:13px;
      line-height:1.45;
    }
    #view-policy .pane.erp-scroll .cfg-table tbody td{
      padding-top:6px;
      padding-bottom:6px;
    }
    #matchTable.dynamic-cols{
      width:100%;
      min-width:max-content;
      max-width:none;
      table-layout:fixed;
      border-collapse:separate;
      border-spacing:0;
      overflow:visible;
    }
    #matchTable.dynamic-cols th,
    #matchTable.dynamic-cols td{
      overflow:visible;
      text-overflow:clip;
      white-space:nowrap;
    }
    #matchTable.dynamic-cols th{
      white-space:nowrap;
      line-height:1.25;
    }
    #matchTable.dynamic-cols thead{
      position:sticky;
      top:0;
      z-index:5;
    }
    #matchTable.dynamic-cols thead th{
      position:sticky;
      top:0;
      z-index:6;
      background:#eef2f7;
      box-shadow:inset 0 -1px 0 var(--line);
    }
    /* Mapping tab: force sticky header on the lower match table */
    #view-mapping .pane.match{
      position:relative;
      overflow:auto;
      -webkit-overflow-scrolling:touch;
    }
    #view-mapping #matchTable.dynamic-cols{
      position:relative;
      border-collapse:separate;
      border-spacing:0;
    }
    #view-mapping #matchTable.dynamic-cols thead th{
      position:sticky !important;
      top:0 !important;
      z-index:30 !important;
      background:#eef2f7 !important;
      box-shadow:inset 0 -1px 0 var(--line);
      background-clip:padding-box;
    }
    #view-mapping #matchTable.dynamic-cols tbody td{
      position:relative;
      z-index:1;
    }
    #matchTable.dynamic-cols .input{
      width:100%;
      min-width:0;
    }
    #matchTable.dynamic-cols textarea.input{
      min-height:34px;
      height:34px;
      resize:none;
      overflow:auto;
      white-space:pre;
      line-height:1.25;
    }
    #matchTable.dynamic-cols .col-name,
    #matchTable.dynamic-cols .col-qty,
    #matchTable.dynamic-cols .col-flag,
    #matchTable.dynamic-cols .col-code{
      width:auto;
      max-width:none;
    }
    .users-table{
      table-layout:auto;
    }
    .users-table th,
    .users-table td{
      white-space:nowrap;
      overflow:visible;
      text-overflow:clip;
      vertical-align:middle;
    }
    .users-table th:first-child,
    .users-table td:first-child{
      text-align:center;
      width:72px;
    }
    .users-table .input,
    .users-table select{
      min-height:var(--control-h);
      height:var(--control-h);
    }
    .users-table input[type="checkbox"]{
      width:16px;
      height:16px;
      accent-color:var(--accent);
      cursor:pointer;
    }
    .users-table input[type="checkbox"]:disabled{
      cursor:not-allowed;
      opacity:.45;
    }

    /* QHD readability tuning: enlarge overall typography
       except the scrollable editor area in tab 2. */
    body{font-size:15px}
    .brand h1{font-size:20px}
    .hd h2{font-size:16px}
    .navbtn,
    .btn,
    label,
    .input,
    select,
    textarea,
    th,
    td,
    .tab,
    .k,
    .v,
    .log{
      font-size:14px;
    }
    .chip,
    .pill,
    .small,
    .card-toggle{
      font-size:13px;
    }

    /* Keep tab 2 scroll editor area at current size */
    #view-mapping .pane.match th,
    #view-mapping .pane.match td,
    #view-mapping .pane.match .input,
    #view-mapping .pane.match textarea.input,
    #view-mapping #matchTable.dynamic-cols th,
    #view-mapping #matchTable.dynamic-cols td,
    #view-mapping #matchTable.dynamic-cols .input{
      font-size:13px;
    }


.policy-filter-combo{
  position:relative;
  display:flex;
  align-items:center;
  gap:0;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  min-height:var(--control-h);
  overflow:visible;
}
.policy-filter-combo:focus-within{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(59,130,246,.18);
}
.policy-filter-combo .input{
  flex:1 1 auto;
  min-width:0;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:transparent;
}
.policy-filter-combo .input:focus{
  box-shadow:none;
}
.policy-filter-combo-toggle{
  width:36px;
  min-width:36px;
  height:var(--control-h);
  border:0;
  border-left:1px solid var(--line);
  border-radius:0;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
}
.policy-filter-combo-toggle:hover{
  background:#f4f6fb;
}
.policy-filter-combo-menu{
  position:absolute;
  top:calc(100% + 4px);
  left:0;
  right:0;
  max-height:280px;
  overflow:auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 8px 20px rgba(0,0,0,.12);
  z-index:120;
  padding:4px;
}
.policy-filter-combo-item{
  display:block;
  width:100%;
  text-align:left;
  border:0;
  background:transparent;
  border-radius:6px;
  padding:6px 8px;
  line-height:1.3;
  cursor:pointer;
}
.policy-filter-combo-item:hover,
.policy-filter-combo-item.active{
  background:#eef4ff;
}
.policy-filter-combo-empty{
  padding:6px 8px;
  color:var(--muted);
  font-size:12px;
}


.policy-filter-combo-tools{
  display:flex;
  gap:6px;
  padding:4px 4px 6px;
  border-bottom:1px solid var(--line);
  margin-bottom:4px;
}
.policy-filter-combo-tool{
  border:1px solid var(--line);
  background:#fff;
  border-radius:6px;
  padding:4px 8px;
  font-size:12px;
  cursor:pointer;
}
.policy-filter-combo-check{
  display:flex;
  align-items:center;
  gap:8px;
  padding:5px 8px;
  border-radius:6px;
  cursor:pointer;
}
.policy-filter-combo-check:hover{
  background:#eef4ff;
}
.policy-filter-combo-check input{
  width:14px;
  height:14px;
  accent-color:var(--accent);
}
.policy-filter-combo-check span{
  flex:1 1 auto;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.label-grid{
  grid-template-columns:minmax(620px, 1.45fr) minmax(420px, .9fr);
  align-items:stretch;
}
.label-output-card{
  display:flex;
  flex-direction:column;
}
.label-output-card .bd{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.label-preview-card{
  display:flex;
  flex-direction:column;
}
.label-preview-card .bd{
  flex:1 1 auto;
  display:flex;
  min-height:0;
}
.label-grid-wide{
  grid-column:1 / -1;
}
.label-grid-full{
  grid-column:1 / -1;
}
.label-jobs-card{
  min-height:560px;
}
.label-preview-stage{
  flex:1 1 auto;
  min-height:600px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:14px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f8fafc;
  overflow:auto;
}
.label-file-empty{
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}
.label-file-preview{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
}
.label-file-preview-image{
  display:block;
  max-width:100%;
  max-height:560px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  object-fit:contain;
}
.label-file-preview-meta{
  max-width:100%;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  line-height:1.4;
  text-align:center;
  word-break:break-word;
}
.label-file-preview-doc{
  min-height:220px;
}
.label-file-doc-icon{
  width:96px;
  height:64px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid #94a3b8;
  border-radius:8px;
  background:#fff;
  color:#0f172a;
  font-size:20px;
  font-weight:900;
  letter-spacing:0;
}
.label-file-doc-name{
  max-width:100%;
  color:#111827;
  font-size:14px;
  font-weight:800;
  line-height:1.4;
  text-align:center;
  word-break:break-word;
}
.label-library-panel{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  min-height:0;
  margin-top:12px;
  border-top:1px solid var(--line);
  padding-top:12px;
}
.label-library-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.label-library-controls{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto auto auto;
  gap:8px;
  margin-bottom:8px;
}
.label-file-search-highlight{
  background:#efef9d;
  color:var(--text);
}
.label-file-bulk-check{
  min-height:var(--control-h);
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:0 10px;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  background:var(--panel2);
  color:var(--text);
  font-weight:700;
  white-space:nowrap;
  cursor:pointer;
}
.label-file-bulk-check input{
  width:15px;
  height:15px;
  accent-color:var(--accent);
}
.label-print-options{
  gap:8px;
  align-items:flex-end;
  margin-bottom:8px;
}
.label-print-options > div{
  flex:0 0 auto;
}
.label-print-options > div:nth-child(1){
  width:86px;
}
.label-print-options > div:nth-child(2){
  width:164px;
}
.label-print-options > div:nth-child(3){
  width:104px;
}
.label-print-options > div:nth-child(4){
  width:190px;
}
.label-print-options .input{
  width:100%;
}
.label-option-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:20px;
  margin-bottom:5px;
}
.label-option-heading > label{
  margin-bottom:0;
  font-size:13px;
  line-height:1.2;
}
.label-month-toggle{
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin-bottom:0;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  line-height:1.2;
  white-space:nowrap;
  cursor:pointer;
  user-select:none;
}
.label-month-toggle input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.label-month-toggle-track{
  width:28px;
  height:15px;
  display:inline-flex;
  align-items:center;
  padding:1px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--panel2);
  transition:background .16s ease, border-color .16s ease;
}
.label-month-toggle-thumb{
  width:11px;
  height:11px;
  border-radius:50%;
  background:var(--muted);
  transition:transform .16s ease, background .16s ease;
}
.label-month-toggle input:checked + .label-month-toggle-track{
  border-color:var(--accent);
  background:var(--accent);
}
.label-month-toggle input:checked + .label-month-toggle-track .label-month-toggle-thumb{
  transform:translateX(13px);
  background:#fff;
}
.label-month-toggle input:focus-visible + .label-month-toggle-track{
  outline:2px solid var(--accent);
  outline-offset:2px;
}
.label-month-toggle input:checked ~ .label-month-toggle-text{
  color:#374151;
}
.label-month-field .input:disabled{
  background:var(--panel2);
  color:var(--muted);
  border-color:var(--line);
}
#labelPrinterSelect{
  appearance:none;
  -webkit-appearance:none;
  background-image:none;
  padding-right:12px;
}
.label-library-scroll{
  flex:0 0 auto;
  height:500px;
  min-height:0;
  max-height:500px;
  overflow:auto;
}
.label-files-table td{
  word-break:break-word;
}
.label-files-table th:first-child,
.label-files-table td:first-child{
  text-align:center;
}
.label-files-table th:nth-child(2),
.label-files-table td:nth-child(2){
  text-align:left;
}
.label-file-actions{
  display:flex;
  gap:6px;
  justify-content:center;
  align-items:center;
  white-space:nowrap;
}
.label-file-main{
  font-weight:800;
  color:#111827;
  line-height:1.35;
}
.label-file-sub{
  margin-top:2px;
  color:#64748b;
  font-size:11px;
  line-height:1.35;
}
.label-library-pager{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:16px;
}
.label-page-numbers{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  flex-wrap:wrap;
}
.label-page-btn{
  min-width:34px;
  height:32px;
  padding:0 10px;
}
.label-page-btn.is-active{
  border-color:#2563eb;
  background:#2563eb;
  color:#fff;
}
.label-page-nav{
  width:32px;
  min-width:32px;
  height:32px;
  padding:0;
  font-size:18px;
  line-height:1;
}
.label-file-row-selected td{
  background:#eef4ff;
}
.label-bulk-panel{
  margin-top:16px;
  padding-top:12px;
  border-top:1px solid var(--line);
}
.label-bulk-card .label-bulk-panel{
  margin-top:0;
  padding-top:0;
  border-top:0;
}
.label-bulk-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.label-bulk-head > .input{
  flex:1 1 auto;
  min-width:280px;
}
.label-bulk-head label{
  display:block;
  margin-bottom:2px;
}
.label-bulk-actions{
  display:grid;
  grid-template-columns:repeat(2, max-content);
  gap:8px;
  justify-content:flex-end;
}
.label-bulk-actions .btn{
  white-space:nowrap;
}
.label-bulk-month-tools{
  display:grid;
  grid-template-columns:minmax(180px, 240px) repeat(3, max-content);
  gap:8px;
  align-items:center;
  margin-top:8px;
}
.label-bulk-month-value{
  font-weight:700;
  white-space:nowrap;
}
.label-bulk-month-value.missing{
  color:#b45309;
}
.label-bulk-preview-scroll{
  margin-top:8px;
  max-height:420px;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
.label-bulk-preview-table{
  width:100%;
  min-width:940px;
}
.label-bulk-preview-table th,
.label-bulk-preview-table td{
  vertical-align:top;
}
.label-bulk-preview-table .is-number{
  text-align:right;
}
.label-bulk-barcode{
  font-weight:800;
}
.label-bulk-preview-table .status-pill{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:0 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.label-bulk-preview-table .status-pill.good{
  background:#dcfce7;
  color:#166534;
}
.label-bulk-preview-table .status-pill.warn{
  background:#fef3c7;
  color:#92400e;
}
.label-bulk-preview-table .status-pill.bad{
  background:#fee2e2;
  color:#991b1b;
}
.label-ezpx-preview{
  gap:10px;
}
.label-ezpx-canvas{
  width:min(100%, 720px);
  max-width:100%;
  max-height:560px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#e5e7eb;
  overflow:auto;
}
.label-ezpx-svg{
  display:block;
  width:100%;
  height:auto;
  max-height:520px;
  background:#fff;
}
.label-jobs-table td{
  word-break:break-word;
}
.label-jobs-scroll{
  min-height:320px;
  max-height:420px;
  overflow:auto;
}
.label-jobs-card .log{
  min-height:150px;
}
@media (max-width: 1100px){
  .label-grid{
    grid-template-columns:1fr;
  }
  .label-output-card{
    grid-row:auto;
  }
  .label-grid-wide{
    grid-column:auto;
  }
  .label-preview-stage{
    min-height:360px;
  }
  .label-library-controls{
    grid-template-columns:1fr;
  }
  .label-library-scroll{
    height:460px;
    min-height:0;
    max-height:460px;
  }
}

@media (max-width: 760px){
  .label-bulk-head{
    align-items:stretch;
    flex-direction:column;
  }
  .label-bulk-head > .input{
    min-width:0;
  }
  .label-bulk-actions{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    justify-content:flex-start;
  }
  .label-bulk-month-tools{
    grid-template-columns:1fr 1fr;
  }
}


