:root { --bg:#f4f6f8; --card:#fff; --text:#1d2733; --muted:#6b7785; --red:#fce8e6; --yellow:#fff8dd; --green:#edf7ed; --border:#d9e1e8; --primary:#2563eb; }
* { box-sizing:border-box; }
html { scroll-behavior:auto; }
body { margin:0; font-family:Arial, sans-serif; color:var(--text); background:var(--bg); }
.wrap { max-width:1900px; margin:0 auto; padding:12px; }
.topbar { background:#fff; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:50; }
.topbar-inner { display:flex; justify-content:space-between; align-items:center; min-height:56px; }
.brand { text-decoration:none; color:#111; font-weight:700; }
.main { padding-top:12px; }
.card { background:var(--card); border:1px solid var(--border); border-radius:10px; padding:12px; margin-bottom:12px; box-shadow:0 2px 10px rgba(13,29,45,.03); }
.compact-card { padding:10px; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
.grid-home-top { display:grid; grid-template-columns:1.5fr 1fr .9fr; gap:12px; align-items:start; }
.stats-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:10px; margin-bottom:12px; }
.stat { text-align:center; }
.row { display:flex; }
.row.between { justify-content:space-between; }
.row.center { align-items:center; }
.row.gap4 { gap:4px; }
.row.gap8 { gap:8px; }
.row.wrap { flex-wrap:wrap; }
.link-btn, button { display:inline-block; padding:7px 10px; border:1px solid var(--border); border-radius:8px; background:#fff; cursor:pointer; text-decoration:none; color:#111; }
button.small, .link-btn.small { padding:3px 6px; font-size:12px; }
button.primary { background:var(--primary); color:#fff; border-color:var(--primary); }
button.danger, .icon-btn.danger { background:#fff0f0; }
.icon-btn { width:24px; height:24px; padding:0; display:inline-flex; align-items:center; justify-content:center; border-radius:6px; font-size:13px; }
.form-grid { display:grid; gap:8px; }
.form-grid.cols-4 { grid-template-columns:repeat(4, minmax(0,1fr)); }
.form-grid .col-span-4 { grid-column: 1 / -1; }
.compact input, .compact select, .compact textarea, .form-grid input, .form-grid select, .form-grid textarea { width:100%; padding:6px 8px; border:1px solid var(--border); border-radius:8px; font-size:13px; }
textarea { min-height:72px; }
.dense-table { width:100%; border-collapse:collapse; font-size:13px; }
.dense-table th, .dense-table td { border:1px solid var(--border); padding:6px; vertical-align:top; }
.dense-table th { background:#f8fafc; position:sticky; top:56px; z-index:10; }
.status-red { background:var(--red); }
.status-yellow { background:var(--yellow); }
.status-green { background:var(--green); }
.muted { color:var(--muted); font-size:12px; }
.error-list { margin:0; padding-left:18px; }
.mt6 { margin-top:6px; }
.mt12 { margin-top:12px; }
.sources-block { margin-top:6px; display:grid; gap:6px; }
.source-chip { padding:6px; border:1px dashed var(--border); border-radius:8px; background:#fafbfd; }
.source-chip.selected { border-color:#7bb68d; background:#f3fbf4; }
.source-chip.cheapest-source { font-weight:700; border-width:2px; }
.source-meta { display:flex; flex-wrap:wrap; gap:8px 14px; font-size:12px; }
.tag { display:inline-flex; align-items:center; gap:4px; padding:2px 6px; background:#eef3f8; border-radius:999px; font-size:11px; text-decoration:none; color:inherit; }
.strong-tag { background:#d9f2dd; font-weight:700; }
.resource-list { margin-top:8px; max-height:360px; overflow:auto; }
.resource-item { padding:8px 0; border-bottom:1px solid var(--border); }
.inline-form { display:inline; }
.picker-selected { margin:6px 0 10px; font-size:13px; }
.resource-picker-card { position:sticky; top:66px; }
.date-wrap { display:flex; gap:6px; align-items:center; position:relative; }
.native-date-helper { position:absolute; opacity:0; pointer-events:none; width:1px; height:1px; }
details summary { cursor:pointer; font-weight:700; }
.login-body { min-height:100vh; display:flex; align-items:center; justify-content:center; background:radial-gradient(circle at top left, #dde8ff, #f5f7fb 45%, #eef1f6); }
.login-shell { width:min(100%, 460px); padding:24px; }
.login-card { background:#fff; border:1px solid var(--border); border-radius:16px; padding:28px; box-shadow:0 18px 40px rgba(24,39,75,.12); }
.login-brand { font-size:14px; letter-spacing:.14em; text-transform:uppercase; color:var(--primary); font-weight:700; margin-bottom:8px; }
.error-banner { background:#fff0f0; border:1px solid #f2c4c4; color:#9f1f1f; padding:10px 12px; border-radius:8px; margin-bottom:12px; }
.scroll-block { max-height:calc(100vh - 240px); overflow:auto; border:1px solid var(--border); border-radius:8px; }
.scroll-mini { max-height:460px; overflow:auto; }
.tiny { font-size:11px; }
.code-col { width:250px; }
.material-handle, .source-handle { cursor:grab; user-select:none; }
.material-row.selected-row, .source-item.selected-row { outline:2px solid var(--primary); }
.compact-icons form { margin:0; }
.source-summary-line { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.attachments-list { display:flex; gap:6px; flex-wrap:wrap; }
.side-tools-card { align-self:start; }
.tool-line { margin-top:8px; font-size:13px; }
.small-text { font-size:12px; }
.participant-form select { width:100%; }
@media (max-width: 1400px) { .grid-home-top, .grid-3, .stats-grid, .grid-2 { grid-template-columns:1fr; } .form-grid.cols-4 { grid-template-columns:1fr 1fr; } }
/* v6.7 UI refinement */
.project-title-card h1 { margin:0 0 4px; }
.project-header-details > summary { list-style:none; padding:6px 8px; border-radius:8px; background:#f8fafc; }
.project-header-details > summary::-webkit-details-marker { display:none; }
.project-tools-grid { display:grid; grid-template-columns:minmax(260px,.55fr) minmax(520px,1.45fr); gap:12px; align-items:start; }
.import-mini { padding:10px; }
.import-mini h3, .resource-picker-card h3 { margin:0 0 8px; }
.resource-picker-card { position:sticky; top:66px; }
.resource-list { max-height:calc(100vh - 260px); }
.materials-table input, .materials-table select { width:100%; padding:5px 6px; border:1px solid var(--border); border-radius:7px; font-size:13px; background:#fff; }
.materials-table .code-col { width:205px; max-width:205px; }
.materials-table .code-col input { margin-top:6px; font-size:12px; }
.material-details > summary { list-style:none; margin-top:4px; padding:3px 0; }
.material-details > summary::-webkit-details-marker, .source-details > summary::-webkit-details-marker { display:none; }
.source-details > summary { list-style:none; }
.drag-handle { display:inline-flex; align-items:center; justify-content:center; width:20px; height:22px; border:1px solid var(--border); border-radius:5px; background:#fff; cursor:grab; }
.drag-handle:active { cursor:grabbing; }
.file-with-clipboard { display:grid; grid-template-columns:1fr auto; gap:6px; align-items:center; }
.file-with-clipboard input[type=file] { min-width:0; }
.inline-form { display:inline-flex; margin:0; }
.material-row.drag-over, .source-item.drag-over { outline:2px dashed var(--primary); outline-offset:-2px; }
@media (max-width: 1400px) { .project-tools-grid { grid-template-columns:1fr; } .resource-picker-card { position:static; } }
/* v6.7.1 project-page refinements */
.project-top-actions { align-items:center; }
.top-import-form { display:flex; gap:6px; align-items:center; max-width:360px; }
.top-import-form input[type=file] { max-width:210px; font-size:12px; padding:5px; }
.project-tools-grid-v2 { display:grid; grid-template-columns:minmax(520px, 1.25fr) minmax(360px, .75fr); gap:12px; align-items:start; }
.resource-list-large { max-height:360px; overflow:auto; }
.library-results { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:8px; max-height:360px; overflow:auto; }
.library-item { border:1px solid #e1e5eb; border-radius:8px; padding:7px; margin-top:6px; background:#fff; }
.library-column select { max-width:210px; }
.material-name-col { min-width:430px; width:48%; }
.material-name-input { width:100%; min-width:360px; }
.source-toolbar { margin-bottom:4px; }
.source-chip details summary { cursor:pointer; padding:5px 4px; border-radius:6px; }
.source-chip details summary:hover { background:#f5f7fa; }
.project-header-details > summary { cursor:pointer; font-weight:600; }
.jump-highlight { outline:3px solid rgba(37,99,235,.35); outline-offset:-3px; }
.library-scroll { max-height:calc(100vh - 260px); overflow:auto; }
.scroll-box { border:1px solid #e1e5eb; border-radius:8px; }
@media (max-width:1100px){ .project-tools-grid-v2 { grid-template-columns:1fr; } .material-name-col { min-width:280px; } .material-name-input { min-width:240px; } }
/* v6.7.2 fixes */
.notice-banner { margin:10px 0; padding:10px 12px; border:1px solid #f1c46c; background:#fff8dd; border-radius:8px; }
.material-name-col { min-width:620px !important; width:58% !important; }
.material-name-input { min-width:540px !important; font-size:13px; }
.material-row.multi-selected { outline:2px solid rgba(37,99,235,.55); outline-offset:-2px; }
.library-project-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; align-items:start; }
.library-results-single { max-height:270px; overflow:auto; margin-top:8px; border:1px solid #e5ebf2; border-radius:8px; padding:6px; }
.library-edit-table input { width:100%; padding:5px 6px; border:1px solid var(--border); border-radius:6px; font-size:12px; margin-bottom:4px; }
.resource-catalog-scroll { height:calc(100vh - 230px); overflow:auto; border:1px solid var(--border); border-radius:8px; }
.resource-catalog-scroll .dense-table th, .scroll-box .dense-table th { position:sticky; top:0; z-index:5; }
.resource-table td:first-child { min-width:190px; }
.modal-backdrop { position:fixed; inset:0; z-index:200; background:rgba(15,23,42,.34); display:flex; align-items:flex-start; justify-content:center; padding:72px 16px 16px; }
.modal-backdrop[hidden] { display:none; }
.modal-card { width:min(980px,96vw); max-height:calc(100vh - 100px); overflow:auto; background:#fff; border:1px solid var(--border); border-radius:14px; box-shadow:0 22px 70px rgba(15,23,42,.25); padding:14px; }
.resource-modal-results { margin-top:10px; max-height:calc(100vh - 260px); overflow:auto; border:1px solid #e5ebf2; border-radius:8px; padding:6px; }
.clipboard-catcher { border:1px dashed var(--primary); background:#eff6ff; color:#1d4ed8; border-radius:8px; padding:8px; grid-column:1/-1; min-height:34px; }
.cheapest-source summary .strong-tag { margin-left:6px; }
@media (max-width:1200px) { .library-project-grid { grid-template-columns:1fr; } .material-name-col { min-width:360px !important; } .material-name-input { min-width:300px !important; } }

/* v6.7.3 refinements */
.material-name-col { min-width:720px !important; width:64% !important; }
.material-name-input { min-width:640px !important; }
.clipboard-dropzone { grid-column:1 / -1; border:2px dashed var(--primary); background:#eff6ff; color:#1d4ed8; border-radius:8px; padding:10px; min-height:42px; outline:none; cursor:text; }
.clipboard-dropzone:focus { box-shadow:0 0 0 3px rgba(37,99,235,.18); }
.resource-catalog-card { min-height:0; }
.resource-catalog-scroll { max-height:calc(100vh - 250px); overflow:auto; position:relative; }
.resource-catalog-scroll .dense-table thead th { position:sticky; top:0; z-index:10; background:#f8fafc; box-shadow:0 1px 0 var(--border); }
@media (max-width:1200px) { .material-name-col { min-width:440px !important; } .material-name-input { min-width:380px !important; } }

/* v6.7.5 project fixes */
.compact-library-picker { padding:10px 12px; }
.compact-library-picker .library-project-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
.compact-library-picker h3 { margin:0; }
.compact-library-picker .library-results-single { max-height:170px; }
.resource-inline-picker { position:static !important; inset:auto !important; z-index:auto !important; background:transparent !important; display:block; padding:0; }
.resource-inline-picker[hidden] { display:none !important; }
.resource-picker-row > td { padding:8px 12px !important; background:#f8fafc; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.resource-inline-picker .modal-card { width:100%; max-height:360px; overflow:auto; box-shadow:none; border:1px solid var(--border); border-radius:10px; padding:12px; }
.resource-inline-picker .resource-modal-results { max-height:220px; }
.attachment-tag { display:inline-flex; align-items:center; gap:4px; }
.preview-btn { text-decoration:none; color:inherit; }
.source-action-form, .source-action-form button { pointer-events:auto; }
@media (max-width:1200px) { .compact-library-picker .library-project-grid { grid-template-columns:1fr; } }

/* v6.7.6 targeted project fixes */
.compact-library-picker { padding:8px 10px !important; }
.compact-library-head h3 { margin:0; font-size:16px; }
.compact-library-picker .library-project-grid { display:grid !important; grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important; gap:8px !important; align-items:start; }
.compact-library-picker .library-column { padding:6px; border:1px solid var(--border); border-radius:8px; background:#fff; }
.compact-library-picker .library-column form { margin-top:4px !important; display:grid; grid-template-columns:1fr auto; gap:6px; }
.compact-library-picker .library-column input { min-width:0; width:100%; }
.compact-library-picker .library-results-single { max-height:118px !important; overflow:auto; padding:4px !important; margin-top:4px !important; }
.compact-library-picker .library-item { padding:5px !important; margin-top:4px !important; font-size:12px; }
.inline-notice { margin:0 0 6px 0 !important; padding:7px 9px !important; }
.materials-table { min-width:1550px; }
.material-name-col { min-width:850px !important; width:70% !important; }
.material-name-input { min-width:760px !important; width:100% !important; }
.code-col { width:300px !important; max-width:320px; }
.source-toolbar button, .source-toolbar form { pointer-events:auto; }
@media (max-width:1200px) {
  .compact-library-picker .library-project-grid { grid-template-columns:1fr !important; }
  .material-name-col { min-width:520px !important; }
  .material-name-input { min-width:460px !important; }
}

/* v6.7.7 autosave/performance/UI */
.compact-library-picker { padding:8px 10px !important; }
.compact-library-details > summary { cursor:pointer; font-weight:600; margin-bottom:6px; }
.compact-library-picker .library-project-grid { display:grid !important; grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important; gap:8px !important; align-items:start; }
.compact-library-picker .library-column { padding:6px !important; border:1px solid var(--border); border-radius:8px; background:#fff; min-width:0; }
.compact-library-picker .library-column form { display:grid !important; grid-template-columns:minmax(0,1fr) auto !important; gap:6px !important; margin-top:4px !important; }
.compact-library-picker .library-column input { width:100%; min-width:0; }
.compact-library-picker .library-results-single { max-height:120px !important; overflow:auto; padding:4px !important; margin-top:4px !important; }
.compact-library-picker .library-item { padding:5px !important; margin-top:4px !important; font-size:12px; }
.materials-table { min-width:1700px !important; table-layout:auto; }
.material-name-col { min-width:980px !important; width:72% !important; }
.material-name-input { width:100% !important; min-width:900px !important; font-size:13px; }
.autosave-badge { margin-left:6px; font-size:11px; color:#64748b; font-weight:400; }
.project-list-table th a { color:inherit; text-decoration:none; border-bottom:1px dashed #94a3b8; }
.project-list-table input, .project-list-table select { max-width:220px; }
@media (max-width:1300px) {
  .compact-library-picker .library-project-grid { grid-template-columns:1fr !important; }
  .material-name-col { min-width:620px !important; }
  .material-name-input { min-width:560px !important; }
}

#materials-section { overflow-x:auto; }

/* v6.7.8 improvements */
.status-pill { display:inline-block; padding:3px 7px; border-radius:999px; border:1px solid var(--border); background:#f8fafc; font-size:12px; white-space:nowrap; }
.error-text { color:#b91c1c; margin:2px 0; }
.warn-text { color:#92400e; margin:2px 0; }
.bulk-material-actions { margin:6px 0 8px; padding:6px 8px; border:1px solid var(--border); border-radius:8px; background:#fbfdff; }
.library-card-scroll { max-height:calc(100vh - 235px); overflow:auto; padding-right:4px; }
.library-card { border:1px solid var(--border); border-radius:10px; padding:8px; margin:8px 0; background:#fff; }
.library-card.pinned { border-color:#93c5fd; background:#eff6ff; }
.library-card.excluded { opacity:.62; background:#f8fafc; }
.library-card input { width:100%; min-width:0; padding:5px 6px; font-size:12px; }
.grow { flex:1 1 auto; min-width:0; }
.hotkey-hint { font-size:11px; color:var(--muted); }
.autofill-flash { outline:2px solid rgba(37,99,235,.35); outline-offset:1px; }

/* v6.7.9 targeted UI fixes */
.materials-table { min-width: 2350px !important; table-layout: auto !important; }
.material-name-col { min-width: 1220px !important; width: 74% !important; }
.material-name-input { min-width: 1120px !important; width: 100% !important; max-width: none !important; box-sizing: border-box; }
.tc-min-line { margin-top:4px; font-size:11px; color:#1d4ed8; white-space:normal; line-height:1.25; }
.bulk-material-actions { gap:6px !important; }
.hotkey-hint { display:none !important; }

.library-compact-grid { grid-template-columns:minmax(0, 1.15fr) minmax(0, 1fr); gap:12px; }
.library-table-scroll, .participant-list-scroll { max-height: calc(100vh - 245px); overflow:auto; border:1px solid var(--border); border-radius:8px; }
.library-dense-table, .participant-table { width:100%; table-layout:fixed; }
.library-dense-table th, .library-dense-table td, .participant-table th, .participant-table td { padding:4px 6px !important; vertical-align:top; }
.library-row-details summary, .participant-details summary { cursor:pointer; line-height:1.25; }
.library-row-details[open], .participant-details[open] { background:#f8fafc; border-radius:6px; padding:4px; }
.pinned-row { background:#eff6ff; }
.excluded-row { opacity:.58; background:#f8fafc; }
.participant-search { width:100%; margin:4px 0 6px; padding:6px 8px; }
.participants-grid { align-items:start; }
.participant-section .form-grid { gap:5px; }
.participant-section h3 { margin-bottom:4px; }

.project-list-wide { table-layout: fixed; width:100%; }
.project-list-wide th, .project-list-wide td { vertical-align:top; }
.project-list-wide .project-name-main { width:42%; }
.project-list-wide th:nth-child(1), .project-list-wide td:nth-child(1) { width:44px; }
.project-list-wide th:nth-child(3), .project-list-wide td:nth-child(3) { width:95px; }
.project-list-wide th:nth-child(4), .project-list-wide td:nth-child(4) { width:115px; }
.project-list-wide th:nth-child(5), .project-list-wide td:nth-child(5) { width:95px; }
.project-list-wide th:nth-child(6), .project-list-wide td:nth-child(6),
.project-list-wide th:nth-child(7), .project-list-wide td:nth-child(7),
.project-list-wide th:nth-child(8), .project-list-wide td:nth-child(8),
.project-list-wide th:nth-child(9), .project-list-wide td:nth-child(9) { width:72px; }
.project-list-wide th:nth-child(10), .project-list-wide td:nth-child(10) { width:120px; }

@media (max-width: 1300px) {
  .material-name-col { min-width: 900px !important; }
  .material-name-input { min-width: 820px !important; }
  .library-compact-grid { grid-template-columns: 1fr; }
}

/* v6.7.11 hard layout fixes */
#materials-table.materials-table { min-width: 2700px !important; width:2700px !important; table-layout: fixed !important; }
#materials-table .material-name-col { width: 1550px !important; min-width:1550px !important; max-width:none !important; }
#materials-table td:nth-child(2) { width:1550px !important; min-width:1550px !important; max-width:none !important; }
#materials-table .material-name-input { display:block !important; width:1500px !important; min-width:1500px !important; max-width:none !important; box-sizing:border-box !important; }
#materials-table th:nth-child(1), #materials-table td:nth-child(1) { width:160px !important; }
#materials-table th:nth-child(3), #materials-table td:nth-child(3) { width:80px !important; }
#materials-table th:nth-child(4), #materials-table td:nth-child(4) { width:520px !important; }
#materials-table th:nth-child(5), #materials-table td:nth-child(5) { width:90px !important; }

.project-list-wide { table-layout: fixed !important; width:100% !important; min-width:1180px; }
.project-list-wide .project-name-main,
.project-list-wide th:nth-child(2),
.project-list-wide td:nth-child(2) { width:52% !important; min-width:520px !important; }
.project-list-wide th:nth-child(1), .project-list-wide td:nth-child(1) { width:42px !important; }
.project-list-wide th:nth-child(3), .project-list-wide td:nth-child(3) { width:90px !important; }
.project-list-wide th:nth-child(4), .project-list-wide td:nth-child(4) { width:105px !important; }
.project-list-wide th:nth-child(5), .project-list-wide td:nth-child(5) { width:90px !important; }
.project-list-wide th:nth-child(6), .project-list-wide td:nth-child(6),
.project-list-wide th:nth-child(7), .project-list-wide td:nth-child(7),
.project-list-wide th:nth-child(8), .project-list-wide td:nth-child(8),
.project-list-wide th:nth-child(9), .project-list-wide td:nth-child(9) { width:62px !important; }
.project-list-wide th:nth-child(10), .project-list-wide td:nth-child(10) { width:110px !important; }
.project-list-table td:nth-child(2) a { font-weight:600; }
.library-dense-table th a { color:inherit; text-decoration:underline; text-underline-offset:2px; }

/* v6.7.12 hard width override */
.materials-table-scroll-hard { width:100%; max-width:100%; overflow-x:auto; overflow-y:visible; padding-bottom:8px; }
.materials-table-scroll-hard #materials-table { table-layout:fixed !important; width:3400px !important; min-width:3400px !important; max-width:none !important; }
.materials-table-scroll-hard #materials-table th:nth-child(2),
.materials-table-scroll-hard #materials-table td:nth-child(2) { width:2200px !important; min-width:2200px !important; max-width:none !important; }
.materials-table-scroll-hard #materials-table .material-name-input { width:2150px !important; min-width:2150px !important; max-width:none !important; display:block !important; }
.project-list-table-wrap, .projects-table-wrap { width:100%; overflow-x:auto; }
.project-list-wide { table-layout:fixed !important; width:100% !important; min-width:1400px !important; }
.project-list-wide .project-name-main,
.project-list-wide th:nth-child(2),
.project-list-wide td:nth-child(2) { width:720px !important; min-width:720px !important; max-width:none !important; }
.project-list-wide td:nth-child(2) div { white-space:normal !important; overflow:visible !important; text-overflow:clip !important; }

/* v6.7.13 dynamic material name width */
.materials-table-scroll-hard { width:100%; max-width:100%; overflow-x:auto; overflow-y:visible; padding-bottom:8px; }
.materials-table-scroll-hard #materials-table {
  table-layout:auto !important;
  width:max-content !important;
  min-width:100% !important;
  max-width:none !important;
}
.materials-table-scroll-hard #materials-table th:nth-child(2),
.materials-table-scroll-hard #materials-table td:nth-child(2) {
  width:auto !important;
  min-width:420px !important;
  max-width:none !important;
}
.materials-table-scroll-hard #materials-table .material-name-input,
#materials-table .autosize-material-name {
  display:inline-block !important;
  width:420px !important;
  min-width:420px !important;
  max-width:1500px !important;
  box-sizing:border-box !important;
  transition:width .08s ease-out;
}
.materials-table-scroll-hard #materials-table th:nth-child(1), 
.materials-table-scroll-hard #materials-table td:nth-child(1) { width:160px !important; min-width:160px !important; }
.materials-table-scroll-hard #materials-table th:nth-child(3), 
.materials-table-scroll-hard #materials-table td:nth-child(3) { width:80px !important; min-width:80px !important; }
.materials-table-scroll-hard #materials-table th:nth-child(4), 
.materials-table-scroll-hard #materials-table td:nth-child(4) { width:520px !important; min-width:520px !important; }
.materials-table-scroll-hard #materials-table th:nth-child(5), 
.materials-table-scroll-hard #materials-table td:nth-child(5) { width:90px !important; min-width:90px !important; }

/* v6.9.14 attachment preview */
.attachments-list { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap:8px; }
.attachment-card { display:grid; grid-template-columns:72px minmax(0,1fr); gap:8px; align-items:start; border:1px solid var(--border); border-radius:8px; background:#fff; padding:7px; }
.attachment-thumb { width:72px; height:72px; object-fit:cover; border-radius:6px; border:1px solid var(--border); background:#f8fafc; display:block; }
.attachment-file-icon { width:72px; height:72px; border:1px solid var(--border); border-radius:6px; background:#f8fafc; display:flex; align-items:center; justify-content:center; font-weight:700; color:#4b5563; }
.attachment-name { font-size:12px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attachment-preview-link { text-decoration:none; color:inherit; }
.attachment-preview-card { min-height:70vh; }
.attachment-preview-image { display:block; max-width:100%; max-height:78vh; margin:auto; object-fit:contain; }
.attachment-preview-frame { width:100%; height:78vh; border:1px solid var(--border); border-radius:8px; background:#fff; }
.attachment-preview-empty { min-height:260px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:8px; color:#4b5563; }
.check-help-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.check-help-grid ul { margin:6px 0 0; padding-left:18px; }
@media (max-width: 1200px) { .check-help-grid { grid-template-columns:1fr; } }

/* v6.9.16 project statuses */
.project-status-row.project-status-in_work > td { background:#fff8dd !important; }
.project-status-row.project-status-ready > td { background:#edf7ed !important; }
.inline-status-form { margin:0; }
.inline-status-form select { min-width:110px; padding:4px 6px; border:1px solid var(--border); border-radius:7px; background:#fff; font-size:12px; }
.project-status-row.project-status-in_work .inline-status-form select { background:#fff8dd; }
.project-status-row.project-status-ready .inline-status-form select { background:#edf7ed; }

/* v6.9.17 TC transport price mode */
.notice-inline {
  padding: 6px 8px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 8px;
  font-size: 12px;
  color: #92400e;
  margin-top: 6px;
}
.muted-disabled {
  opacity: 0.62;
}

/* v6.9.19 cosmetics */
.cargo-class-help-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  min-width:24px;
  padding:0;
  border:1px solid var(--border);
  border-radius:999px;
  background:#f8fafc;
  color:#1f2937;
  text-decoration:none;
  font-size:13px;
  font-weight:700;
  line-height:1;
  align-self:center;
}
.cargo-class-help-btn:hover {
  background:#eef3f8;
  border-color:#b8c6d6;
}

/* v6.9.20 compact ZNP block */
.znp-compact-grid {
  display:grid;
  grid-template-columns: 190px 150px 28px minmax(130px, 1fr) minmax(120px, 1fr);
  gap:6px;
  align-items:center;
}
.znp-compact-grid input,
.znp-compact-grid select {
  width:100%;
  min-width:0;
  padding:6px 8px;
  border:1px solid var(--border);
  border-radius:8px;
  font-size:13px;
  background:#fff;
}
.znp-compact-grid .cargo-class-help-btn {
  justify-self:center;
}
.znp-compact-grid [data-transport-block="percent"],
.znp-compact-grid [data-transport-block="manual"] {
  grid-column:2 / span 2;
}
.znp-compact-grid [name="transport_cost_manual"] {
  grid-column:2 / span 2;
}
@media (max-width: 1150px) {
  .znp-compact-grid {
    grid-template-columns: 1fr 1fr 32px;
  }
  .znp-compact-grid [name="transport_distance_km"],
  .znp-compact-grid [name="transport_weight_kg"] {
    grid-column:auto;
  }
}

/* v6.9.21 proof document metadata */
.proof-doc-details > summary {
  padding: 4px 6px;
  border-radius: 7px;
  background: #f8fafc;
}
.proof-doc-grid {
  display: grid;
  grid-template-columns: 220px 260px 160px 180px minmax(260px, 1fr);
  gap: 6px;
  align-items: start;
}
.proof-doc-grid input,
.proof-doc-grid select,
.proof-doc-grid textarea {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}
.proof-doc-grid textarea {
  min-height: 36px;
  resize: vertical;
}
.proof-screenshot-note {
  align-self: center;
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.proof-screenshot-mode .proof-doc-grid {
  grid-template-columns: 220px minmax(320px, 1fr);
}
@media (max-width: 1300px) {
  .proof-doc-grid,
  .proof-screenshot-mode .proof-doc-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.fns-lookup-btn{min-width:44px; padding:6px 8px; font-size:12px;}
.autofill-flash{box-shadow:0 0 0 2px rgba(34,197,94,.35) inset;}

/* v6.9.55 source document fields */
.source-doc-fields { display:grid; grid-template-columns:minmax(260px,1fr) auto minmax(140px,.35fr) auto; gap:6px; align-items:end; margin:6px 0; padding:7px; border:1px solid var(--border); border-radius:8px; background:#fff; }
.source-doc-field { display:grid; gap:3px; min-width:0; font-size:11px; color:var(--muted); font-weight:400; }
.source-doc-field input { width:100%; padding:5px 6px; border:1px solid var(--border); border-radius:7px; font-size:12px; background:#fff; color:var(--text); }
.same-as-material { display:flex; align-items:center; gap:4px; white-space:nowrap; font-size:11px; color:var(--muted); padding-bottom:6px; font-weight:400; }
.source-doc-field input:required { border-color:#d97706; background:#fffaf0; }
@media (max-width: 1200px) { .source-doc-fields { grid-template-columns:1fr auto; } .source-doc-field.unit-field { grid-column:1; } }
