/* User-approved qualification table work surface. Shared theme tokens, navigation,
 * controls, account surfaces and conversation motion remain in translator.css. */
.qw-root { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; background: var(--page); color: var(--text); }
.qw-root, .qw-preview, .qualification-reference-body { --qw-source-reference: #1768b8; --qw-source-ai: #8050b8; --qw-source-human: #a8610e; }
[data-theme="dark"] :is(.qw-root,.qw-preview,.qualification-reference-body) { --qw-source-reference: #8cbbff; --qw-source-ai: #be9ce9; --qw-source-human: #e3ae5e; }
.qw-root[hidden], .qw-root [hidden] { display: none !important; }
.qw-stage { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; padding: 20px 24px 16px; }
.qw-work-views { display: inline-flex; gap: 2px; padding: 3px; margin-left: 14px; border: 1px solid var(--separator); border-radius: 9px; }
.qw-work-view { border: 0; border-radius: 6px; padding: 5px 12px; background: transparent; color: var(--muted); cursor: pointer; }
.qw-work-view[aria-pressed="true"] { color: var(--text); background: var(--panel); box-shadow: 0 1px 4px #00000012; }
.qw-work-relations { flex: 1; min-height: 100px; overflow: auto; padding: 0 2px 8px; font-size: 15px; line-height: 1.65; }
.qw-term-trigger { min-height: 44px; max-width: 100%; padding: 4px 0; color: var(--text); font: inherit; text-align: left; line-height: inherit; white-space: normal; overflow-wrap: anywhere; text-decoration: underline dotted var(--muted); text-underline-offset: 4px; }
.qw-term-trigger[aria-expanded="true"] { outline: 1px solid var(--accent); outline-offset: 2px; }
.qw-term-trigger:hover, .qw-term-trigger:focus-visible { color: var(--text); }
.qw-review-focus { box-sizing: border-box; width: 100%; max-width: 1080px; align-self: center; }
.qw-relations-heading, .qw-relations-pages { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--muted); font-size: 14px; }
.qw-relations-heading { justify-content: space-between; flex-wrap: wrap; padding-top: 6px; }
.qw-relations-title, .qw-optimize-controls, .qw-relation-actions { display: flex; align-items: center; gap: 10px; }
.qw-relations-heading strong { color: var(--text); font-size: 16px; }
.qw-optimize-controls { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.qw-optimize-position { box-sizing: border-box; width: 205px; max-width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--separator); border-radius: var(--radius-control); background: var(--panel); color: var(--text); font: inherit; }
.qw-review-navigation { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 12px; }
.qw-review-views, .qw-relation-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.qw-review-views > button, .qw-relation-filters > button { min-height: 40px; font-size: 13px; }
.qw-review-views > button[aria-pressed="true"], .qw-relation-filters > button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.qw-optimize-progress { flex: none; min-height: 78px; margin: 2px 0 12px; padding: 12px 0; }
.qw-progress-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.qw-progress-title { font-size: 16px; font-weight: 600; color: var(--text); }
.qw-progress-count { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text); }
.qw-optimize-progress progress { display: block; box-sizing: border-box; width: 100%; height: 6px; margin: 10px 0; border: 0; border-radius: 3px; overflow: hidden; appearance: none; background: var(--separator); accent-color: var(--accent); }
.qw-optimize-progress progress::-webkit-progress-bar { background: var(--separator); }
.qw-optimize-progress progress::-webkit-progress-value { background: var(--accent); }
.qw-progress-note { margin: 0; color: var(--muted); font-size: 13px; }
.qw-review-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.qw-review-pager > strong { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.qw-review-pager > button { min-height: 40px; font-size: 14px; }
.qw-relation-row { display: flex; margin: 0 0 10px; padding: 16px 20px; border: 1px solid var(--separator); border-radius: 12px; background: var(--panel); }
.qw-relation-row[data-status="adopted"] { border-color: var(--accent); }
.qw-relation-content { flex: 1; min-width: 0; }
.qw-relation-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.qw-relation-number { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 500; }
.qw-relation-state { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 14px; }
.qw-relation-state > svg { width: 16px; height: 16px; }
.qw-relation-row[data-status="pending"] .qw-relation-state, .qw-relation-row[data-status="adopted"] .qw-relation-state { color: var(--accent); font-weight: 500; }
.qw-relation-trail { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
.qw-relation-part { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; max-width: 100%; }
.qw-relation-chevron { align-self: center; flex: 0 0 12px; width: 12px; height: 12px; margin-right: 4px; color: var(--muted); }
.qw-relation-label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.qw-relation-value { min-width: 0; overflow-wrap: anywhere; font-size: 15px; line-height: 1.65; font-weight: 400; color: var(--text); }
.qw-relation-part[data-role="任务"] .qw-relation-value { font-weight: 600; }
.qw-relation-part[data-role="动作"] { flex-basis: 100%; align-items: baseline; margin-top: 6px; }
.qw-relation-part[data-role="动作"] > .qw-relation-chevron { display: none; }
.qw-original-requirements { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--separator); }
.qw-requirement-heading { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--text); }
.qw-requirement-items { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; min-width: 0; }
.qw-requirement-items > li { min-width: 0; padding: 6px 0; border-bottom: 1px solid var(--separator); }
.qw-requirement-items > li:last-child { border-bottom: 0; }
.qw-requirement-text { display: block; color: var(--text); font-size: 15px; line-height: 1.65; font-weight: 400; white-space: pre-wrap; overflow-wrap: anywhere; }
.qw-relation-suggestion { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--separator); }
.qw-relation-suggestion p { overflow-wrap: anywhere; }
.qw-recommendation-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 4px; }
.qw-recommendation-copy { min-width: 0; }
.qw-recommendation-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.qw-source-tag { display: inline-flex; flex: none; align-items: center; box-sizing: border-box; min-height: 24px; padding: 1px 7px; border: 1px solid var(--separator); border-radius: 5px; color: var(--text); font-size: 12px; font-weight: 500; line-height: 20px; white-space: nowrap; }
.qw-source-tag { --qw-tag-color: var(--qw-source-ai); border-color: color-mix(in srgb, var(--qw-tag-color) 42%, transparent); color: var(--qw-tag-color); }
.qw-source-tag[data-source="direct"] { --qw-tag-color: var(--qw-source-reference); }
.qw-source-tag[data-source="original"], .qw-source-tag[data-source="unknown"] { --qw-tag-color: var(--muted); }
.qw-source-tag[data-source="human"] { --qw-tag-color: var(--qw-source-human); }
.qw-recommendation-level { color: var(--text); font-size: 16px; font-weight: 600; }
.qw-recommendation-description, .qw-recommendation-note { color: var(--muted); font-size: 13px; margin: 4px 0 0; line-height: 1.6; }
.qw-addition-count { flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.qw-comparison-section { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 14px; margin: 0; padding: 10px 0; }
.qw-comparison-section > .qw-requirement-heading { margin-top: 2px; }
.qw-comparison-section + .qw-comparison-section { border-top: 1px solid var(--separator); }
.qw-comparison-columns { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; }
.qw-comparison-before, .qw-comparison-after { min-width: 0; }
.qw-comparison-label { margin: 0 0 2px; font-size: 13px; font-weight: 500; color: var(--text); }
.qw-comparison-empty { margin: 10px 0; color: var(--muted); font-size: 14px; }
.qw-review-outcome, .qw-review-busy-note { display: block; color: var(--muted); font-size: 13px; line-height: 1.6; }
.qw-review-outcome { margin: 14px 0 0; }
.qw-review-busy-note { margin: 12px 0 0; }
.qw-relation-actions { flex-wrap: wrap; gap: 6px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--separator); }
.qw-suggestion-source-label { flex: 1 1 180px; min-width: 0; overflow: hidden; padding: 6px 8px 6px 0; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.qw-review-tail { display: flex; justify-content: flex-end; padding-bottom: 8px; }
.qw-overview-row { display: grid; grid-template-columns: 58px minmax(0,1fr) auto auto; align-items: baseline; gap: 16px; width: 100%; min-height: 58px; text-align: left; border: 0; border-bottom: 1px solid var(--separator); border-radius: 0; padding: 14px 12px; }
.qw-overview-level { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 13px; }
.qw-overview-title { overflow-wrap: anywhere; color: var(--text); font-size: 15px; font-weight: 500; }
.qw-overview-title > strong { font-weight: 500; }
.qw-overview-action { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: 13px; font-weight: 400; color: var(--muted); }
.qw-unknown-confirm { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; color: var(--text); font-size: 13px; line-height: 1.6; }
.qw-unknown-confirm input { flex: none; margin-top: 3px; }
.qw-relations-pages { justify-content: flex-end; border-top: 1px solid var(--separator); }
.qw-relations-message { margin: 24px 18px; color: var(--muted); font-size: 15px; }
@media (max-width: 700px) {
  .qw-relation-row { padding: 16px; }
  .qw-comparison-section { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .qw-original-requirements { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .qw-overview-row { grid-template-columns: 42px minmax(0,1fr); gap: 8px; }
  .qw-overview-row > .qw-relation-state, .qw-overview-level { grid-column: 2; }
}
@media (max-width: 480px) {
  .qw-comparison-columns { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .qw-recommendation-heading { flex-wrap: wrap; gap: 2px; }
}
.qw-feedback { display: flex; flex: none; align-items: center; gap: 8px; margin: 8px 24px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.qw-feedback > svg { flex: 0 0 15px; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.qw-feedback > span { min-width: 0; overflow-wrap: anywhere; }
.qw-feedback .qw-feedback-close { flex: 0 0 32px; width: 32px; height: 32px; }
.qw-empty { display: flex; flex: 1; min-height: 0; justify-content: center; align-items: center; overflow: auto; padding: 24px 16px 64px; }
.qw-empty-content { width: min(640px, 100%); min-width: 0; margin: auto; text-align: center; }
.qw-empty h1 { margin: 0 0 10px; font-size: clamp(24px, 2.4vw, 30px); font-weight: 600; letter-spacing: -.035em; line-height: 1.3; }
.qw-empty-description { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.qw-dropzone { margin-top: 32px; }
.qw-upload-button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; width: min(460px, 100%); min-height: 116px; padding: 24px; font-size: 17px; font-weight: 500; }
.qw-upload-button > svg { flex: 0 0 26px; width: 26px; height: 26px; }
.qw-drop-title { line-height: 1.5; }
.qw-dragging .qw-upload-button { border-color: var(--accent); background: var(--accent-soft); }
.qw-upload-hint { margin: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.qw-import { display: flex; flex-direction: column; justify-content: center; align-items: center; width: min(1060px, 100%); margin: auto; padding: 44px 0; text-align: center; }
.qw-import h2 { margin: 28px 0 8px; font-size: 25px; font-weight: 600; letter-spacing: -.025em; }
.qw-import > p { margin: 0 0 32px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.qw-import-steps { display: flex; width: min(400px, 100%); gap: 20px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.qw-import-steps li { position: relative; flex: 1; padding-top: 20px; }
.qw-import-steps li::before { content: ''; position: absolute; height: 5px; inset: 0 0 auto; border-radius: 5px; background: var(--separator); }
.qw-import-steps .is-current::before, .qw-import-steps .is-done::before { background: var(--accent); }
.qw-import-steps .is-current { color: var(--text); }
.qw-sheet-choice { display: flex; flex: 1; flex-direction: column; width: min(1160px, 100%); min-height: 0; margin: 0 auto; padding: 20px 0 8px; }
.qw-sheet-choice-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.qw-sheet-choice-heading h2 { margin: 0; font-size: 20px; font-weight: 600; }
.qw-sheet-choice-copy { min-width: 0; }
.qw-sheet-choice-copy p { margin: 8px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.qw-sheet-choice-layout { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(0, 1.4fr); gap: 28px; flex: 1; min-height: 0; }
.qw-sheet-choice-sidebar { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.qw-sheet-choice-list { min-height: 0; overflow: auto; padding-right: 8px; }
.qw-sheet-choice-row .selector-main strong { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.qw-sheet-choice-detail { display: flex; flex-direction: column; align-items: stretch; gap: 18px; min-width: 0; min-height: 0; overflow: auto; padding: 24px; border: 1px solid var(--separator); border-radius: 14px; background: var(--panel); }
.qw-sheet-choice-detail h3 { margin: 0; overflow-wrap: anywhere; font-size: 16px; font-weight: 600; }
.qw-sheet-choice-preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.qw-sheet-choice-preview-heading > button { flex: none; }
.qw-sheet-choice-caption { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.qw-sheet-choice-example { display: grid; gap: 16px; margin: 0; }
.qw-sheet-choice-example > div { min-width: 0; }
.qw-sheet-choice-example dt { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.qw-sheet-choice-example dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; }
.qw-sheet-choice-empty { color: var(--muted); font-size: 13px; line-height: 1.5; }
@media (max-width: 680px) {
  .qw-sheet-choice { overflow: auto; }
  .qw-sheet-choice-layout { display: block; }
  .qw-sheet-choice-sidebar { max-height: 240px; margin-bottom: 16px; }
  .qw-sheet-choice-detail { overflow: visible; padding: 18px; }
  .qw-sheet-choice-preview-heading { flex-direction: column; }
  .qw-relation-row { padding: 14px 14px 16px; }
}
.qw-skeleton { display: grid; width: 100%; gap: 9px; overflow: hidden; }
.qw-skeleton-row { display: grid; grid-template-columns: .55fr 1.5fr 1.5fr 1.5fr 1.5fr; gap: 9px; }
.qw-skeleton-cell { position: relative; height: 50px; overflow: hidden; background: var(--separator); opacity: .55; border-radius: 10px; }
.qw-skeleton-cell::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 15%, var(--panel) 50%, transparent 85%); transform: translateX(-100%); animation: qw-skeleton-sweep 1.8s ease-in-out infinite; }
.qw-skeleton-row:nth-child(2) .qw-skeleton-cell::after { animation-delay: .08s; }
.qw-skeleton-row:nth-child(3) .qw-skeleton-cell::after { animation-delay: .16s; }
.qw-skeleton-row:nth-child(4) .qw-skeleton-cell::after { animation-delay: .24s; }
.qw-skeleton-row:nth-child(5) .qw-skeleton-cell::after { animation-delay: .32s; }
@keyframes qw-skeleton-sweep { to { transform: translateX(100%); } }
.qw-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; flex: none; margin-bottom: 14px; }
.qw-toolbar-info { display: flex; flex: 1; align-items: baseline; flex-wrap: wrap; gap: 12px; min-width: 180px; }
.qw-workbook-title { overflow: hidden; max-width: min(40vw, 500px); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.qw-save-status { font-size: 12px; color: var(--muted); white-space: nowrap; }
.qw-toolbar-actions, .qw-proposal-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.qw-toolbar button:disabled, .qw-proposal-actions button:disabled { opacity: .45; cursor: default; }
.qw-table-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; flex: none; margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.qw-origin-legend { display: flex; flex-wrap: wrap; gap: 16px; }
.qw-origin-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.qw-origin-legend > span::before { content: ''; width: 10px; height: 10px; border: 2px solid; border-radius: 3px; }
.qw-legend-reference::before { border-color: var(--qw-source-reference) !important; }
.qw-legend-human::before { border-color: var(--qw-source-human) !important; }
.qw-legend-ai::before { border-color: var(--qw-source-ai) !important; }
.qw-table-scroll { position: relative; flex: 1; min-width: 0; min-height: 100px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--separator); border-radius: 10px; background: var(--panel); scrollbar-gutter: stable; }
.qw-table { width: max-content; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; line-height: 1.6; background: var(--panel); }
.qw-table col { min-width: 64px; }
.qw-table th, .qw-table td { box-sizing: border-box; border-right: 1px solid var(--separator); border-bottom: 1px solid var(--separator); }
.qw-table thead { position: sticky; top: 0; z-index: 5; }
.qw-column-label, .qw-corner { height: 34px; padding: 5px 10px; font-size: 11px; font-weight: 500; text-align: center; color: var(--muted); background: var(--panel-subtle); }
.qw-column-role { margin-left: 8px; color: var(--text); font-size: 11px; }
.qw-row-number { position: sticky; left: 0; z-index: 3; width: 48px; min-width: 48px; padding: 6px 4px; background: var(--panel-subtle); color: var(--muted); font-size: 11px; font-weight: 400; text-align: center; cursor: pointer; user-select: none; }
.qw-corner { position: sticky; left: 0; z-index: 6; }
.qw-cell { position: relative; min-height: 44px; height: 44px; padding: 10px 12px; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; cursor: cell; outline: none; }
.qw-cell-value { display: block; min-height: 1.6em; }
/* Newly imported XLSX sheets retain their own document typography and geometry.
 * Absolutely positioned content clips to the saved row height, just as Excel
 * does, instead of stretching every row to fit the web app's default padding. */
.qw-source-table { background: #fff; color: #000; font-family: Calibri, Arial, sans-serif; font-size: 14.666667px; line-height: normal; }
.qw-source-table col { min-width: 0; }
.qw-source-table .qw-column-label { padding: 0; overflow: hidden; white-space: nowrap; }
.qw-source-table .qw-cell { min-height: 0; height: 0; padding: 0; background-color: #fff; color: #000; vertical-align: bottom; white-space: pre; }
.qw-source-table .qw-cell-viewport { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding: 0 2px; pointer-events: none; }
.qw-source-table .qw-cell-value { flex: 0 0 auto; min-height: 0; min-width: 0; line-height: normal; white-space: pre; overflow: visible; }
.qw-source-table .qw-source-wrap .qw-cell-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.qw-source-table .qw-row-number { padding: 0; height: 0; line-height: normal; }
.qw-source-table .qw-row-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qw-source-table .qw-editing { height: auto; }
.qw-source-table .qw-pending-label { top: 2px; right: 2px; width: 6px; height: 6px; overflow: hidden; border-radius: 50%; background: #9561d3; box-shadow: 0 0 0 1px #fff; font-size: 0; line-height: 0; }
.qw-root .qw-table-scroll .qw-cell, .qw-is-selecting { user-select: none; -webkit-user-select: none; }
.qw-is-selecting, .qw-is-selecting * { cursor: cell !important; }
.qw-cell-editor { user-select: text; -webkit-user-select: text; }
/* Compact contextual action. Surface, curves and open/closing states reuse the
 * Translation Agent's attached-suggestion-popover; the 180ms closing transform
 * follows its shared hideSurface lifecycle. */
.qw-selection-ask { position: fixed; z-index: 45; width: max-content; min-width: 116px; max-width: calc(100vw - 16px); border: 1px solid color-mix(in srgb, var(--separator) 88%, transparent); border-radius: var(--radius-control); background: var(--panel-raised); box-shadow: var(--shadow-soft); opacity: 0; visibility: hidden; pointer-events: none; transform: translate3d(0, 8px, 0) scale(.985); transform-origin: top left; transition: opacity 160ms var(--motion-return-easing), transform 240ms var(--motion-spring-easing), visibility 0s linear 240ms; }
.qw-selection-ask.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: translate3d(0, 0, 0) scale(1); transition-delay: 0s; }
.qw-selection-ask.is-closing { opacity: 0; visibility: visible; pointer-events: none; transform: translate3d(0, 6px, 0) scale(.985); transition: opacity 140ms var(--motion-return-easing), transform 180ms var(--motion-spring-easing), visibility 0s linear 180ms; }
.qw-selection-ask .qw-ask-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 42px; margin: 0; padding: 0 13px; border: 0; border-radius: calc(var(--radius-control) - 1px); background: transparent; color: var(--text); font-family: var(--font-ui); font-size: var(--font-control-size); font-weight: var(--weight-medium); line-height: 1; white-space: nowrap; cursor: pointer; transition: background-color var(--motion-standard), color var(--motion-standard), transform var(--motion-spring); }
.qw-ask-button > img { flex: 0 0 18px; width: 18px; height: 18px; object-fit: contain; pointer-events: none; }
.qw-ask-button > span { pointer-events: none; }
.qw-selection-ask .qw-ask-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qw-selection-ask .qw-ask-button:active { transform: scale(.97); transition-duration: var(--motion-press-duration); }
@media (hover: hover) and (pointer: fine) { .qw-selection-ask .qw-ask-button:hover { background: var(--panel-subtle); } }
.qw-nowrap .qw-cell-value { white-space: pre; overflow: hidden; }
.qw-cell::after { content: ''; position: absolute; inset: 1px; border: 0 solid transparent; pointer-events: none; z-index: 1; }
.qw-origin-reference::after { border-width: 2px; border-color: var(--qw-source-reference,#1768b8); }
.qw-origin-human::after { border-width: 2px; border-color: var(--qw-source-human,#a8610e); }
.qw-origin-ai::after { border-width: 2px; border-color: var(--qw-source-ai,#8050b8); }
.qw-cell.qw-selected { outline: 2px solid var(--accent); outline-offset: -1px; z-index: 2; }
.qw-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; z-index: 2; }
.qw-cell.qw-selected::after { inset: 4px; }
.qw-cell.qw-partial-selected, .qw-cell.qw-partial-selected:focus-visible { outline: none; z-index: 2; }
.qw-selection-fragment { position: absolute; box-sizing: border-box; z-index: 4; border: 2px solid var(--accent); background: transparent; pointer-events: none; }
.qw-formula-cell::before { content: 'ƒ'; position: absolute; left: 3px; bottom: 1px; color: var(--muted); font-size: 10px; }
.qw-pending { padding-top: 26px; }
.qw-pending-label { position: absolute; top: 3px; right: 6px; font-size: 10px; font-weight: 500; line-height: 1.5; color: #9561d3; }
.qw-pending-row > .qw-row-number { color: #9561d3; font-size: 10px; }
.qw-proposal-inspector { display: flex; flex: 0 1 auto; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 0; max-height: min(45vh, 400px); overflow: auto; margin-bottom: 10px; padding: 10px 0; border-top: 1px solid var(--separator); border-bottom: 1px solid var(--separator); }
.qw-proposal-summary { display: flex; flex: 1; align-items: baseline; flex-wrap: wrap; gap: 10px; min-width: 160px; font-size: 12px; line-height: 1.7; }
.qw-proposal-summary strong { font-weight: 600; white-space: nowrap; }
.qw-proposal-summary > span { max-height: 5.1em; overflow: auto; color: var(--muted); overflow-wrap: anywhere; }
.qw-requirements-preview { flex: 1 0 100%; min-width: 0; overflow: auto; border-top: 1px solid var(--separator); }
.qw-requirements-table { width: 100%; min-width: 520px; border-collapse: collapse; table-layout: fixed; font-size: 12px; line-height: 1.7; }
.qw-requirements-table th, .qw-requirements-table td { width: 33.333%; padding: 8px 10px; text-align: left; vertical-align: top; overflow-wrap: anywhere; border-bottom: 1px solid var(--separator); }
.qw-requirements-table th { position: sticky; top: 0; background: var(--panel); font-weight: 600; }
.qw-requirements-table tbody tr:last-child td { border-bottom: 0; }
.qw-requirements-table ul { margin: 0; padding-left: 16px; }
.qw-requirement-action { font-weight: 500; white-space: pre-wrap; }
.qw-requirement-context { color: var(--muted); white-space: pre-wrap; }
.qw-requirements-hint { flex: 1 0 100%; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.qw-cell > .qw-requirements-marker { position: absolute; z-index: 3; top: 3px; right: 5px; max-width: calc(100% - 10px); min-height: 20px; padding: 1px 5px; font-size: 10px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qw-editing { padding: 0; min-width: 160px; z-index: 8 !important; outline: 2px solid var(--accent); outline-offset: -1px; }
.qw-editing::after { display: none; }
.qw-cell-editor { display: block; box-sizing: border-box; width: 100%; min-width: 150px; min-height: 84px; max-height: 400px; margin: 0; padding: 10px 12px; resize: vertical; border: 0; border-radius: 0; outline: 0; background: var(--panel); color: var(--text); font: inherit; line-height: 1.6; }
.qw-editor-hint { display: block; padding: 4px 8px; background: var(--panel); color: var(--muted); font-size: 10px; line-height: 1.6; }
.qw-editor-retry { margin: 6px 8px 8px; }
.qw-sheet-bar { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; }
.qw-sheet-tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; gap: 4px; }
.qw-sheet-tab { min-height: 40px; flex: none; padding: 6px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.qw-sheet-tab.is-active { border-bottom-color: var(--accent); color: var(--text); }
.qw-sheet-tab:hover, .qw-sheet-tab:focus-visible { color: var(--text); background: var(--panel-subtle); outline: 0; }
.qw-sheet-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.qw-warning, .qw-import-error, .qw-result-note { flex: none; margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.qw-warnings { flex: none; margin-bottom: 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.qw-warnings > summary { cursor: pointer; }
.qw-warnings-body { max-height: 120px; overflow: auto; margin-top: 8px; }
.qw-mapping-note { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.qw-mapping-text { flex: 1; min-width: 180px; }
.qw-mapping-text > p { margin: 0; }
.qw-position-summary { overflow-wrap: anywhere; }
.qw-agent-launcher { position: absolute; z-index: 25; right: 24px; bottom: 74px; display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 9px 18px 9px 10px; border: 1px solid var(--separator); border-radius: 30px; background: var(--panel); color: var(--text); box-shadow: 0 6px 24px #00000014; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.qw-agent-launcher > img { width: 36px; height: 36px; object-fit: contain; }
.qw-sheet-bar > .qw-agent-launcher { position: static; flex: none; }
.qw-agent-launcher:hover, .qw-agent-launcher:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 3px; }
.qw-agent-panel { position: absolute; display: grid; grid-template-rows: auto auto minmax(0, 1fr); z-index: 30; right: 16px; top: 16px; bottom: 16px; width: min(410px, calc(100% - 32px)); min-height: 200px; border: 1px solid var(--separator); border-radius: 18px; overflow: hidden; background: var(--page); box-shadow: 0 12px 38px #0000001a; }
.qw-agent-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--separator); }
.qw-agent-title { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.qw-agent-title > img { width: 28px; height: 28px; object-fit: contain; }
.qw-agent-controls { display: flex; align-items: center; gap: 4px; }
.qw-agent-controls > button { width: 40px; height: 40px; }
.qw-selection-summary { padding: 10px 16px; border-bottom: 1px solid var(--separator); color: var(--muted); font-size: 11px; line-height: 1.7; }
.qw-agent-context { min-width: 0; border-bottom: 1px solid var(--separator); }
.qw-agent-context .qw-selection-summary { border-bottom: 0; }
.qw-agent-context .qw-feedback { margin: 0; padding: 0 12px 8px 16px; font-size: 11px; }
.qw-agent-context .qw-feedback > svg { flex-basis: 14px; width: 14px; height: 14px; }
.qw-agent-body { display: grid; min-height: 0; overflow: hidden; }
.qw-agent-body > * { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; min-width: 0; overflow: hidden; }
.qw-agent-panel .transcript-shell { min-height: 0; }
.qw-agent-panel .transcript { height: 100%; padding: 16px; }
.qw-agent-panel .terminal-width { max-width: 100%; }
.qw-agent-panel .startup, .qw-agent-panel .rule { display: none; }
.qw-agent-panel .composer-shell { padding: 8px 12px 12px; }
.qw-agent-panel .composer-wrap { width: 100%; }
.qw-agent-panel .footer { display: none; }
.qw-agent-panel .empty-workspace { min-height: 120px; padding: 30px 8px; font-size: 12px; }
.qw-agent-panel .message-user { max-width: 100%; }
.qw-agent-panel .assistant-content { font-size: 13px; }
.qw-agent-panel .composer-hint { font-size: 10px; }
.qw-agent-panel .qualification-model-note { margin: 6px 4px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.qw-root[data-chat-side='left'] .qw-agent-panel { left: 16px; right: auto; }
.qw-root[data-chat-side='left'] .qw-agent-launcher { left: 24px; right: auto; }
.qw-preview { min-width: 0; }
.qw-preview-heading { margin: 18px 0 10px; font-size: 14px; }
.qw-preview .qw-table-scroll { max-height: 440px; }
.qw-preview .qw-cell { cursor: default; }
.qw-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 1100px) {
  .qw-root.qw-chat-open[data-chat-side='right'] .qw-stage { padding-right: 442px; }
  .qw-root.qw-chat-open[data-chat-side='left'] .qw-stage { padding-left: 442px; }
  .qw-chat-open .qw-toolbar-actions { gap: 6px; }
}
@media (max-width: 700px) {
  .qw-stage { padding: 14px 12px 10px; }
  .qw-feedback { margin: 6px 12px 0; }
  .qw-empty { padding: 20px 0 28px; }
  .qw-empty h1 { font-size: 25px; }
  .qw-empty-description { font-size: 13px; }
  .qw-dropzone { margin-top: 26px; }
  .qw-upload-button { min-height: 104px; padding: 20px 16px; font-size: 16px; }
  .qw-toolbar { gap: 10px; }
  .qw-workbook-title { max-width: 65vw; font-size: 14px; }
  .qw-toolbar-actions { width: 100%; gap: 6px; }
  .qw-toolbar-actions > button { flex: 1; padding: 6px 8px; min-height: 40px; font-size: 11px; white-space: nowrap; }
  .qw-table-meta { font-size: 10px; gap: 8px; }
  .qw-origin-legend { gap: 10px; }
  .qw-origin-legend > span::before { width: 8px; height: 8px; }
  .qw-column-role { display: none; }
  .qw-suggestion-source-label { flex-basis: 100%; }
  .qw-agent-launcher { right: 16px; bottom: 64px; min-height: 50px; padding: 7px 13px 7px 8px; font-size: 12px; }
  .qw-agent-launcher > img { width: 32px; height: 32px; }
  .qw-agent-panel { top: 8px; bottom: 8px; right: 8px; width: calc(100% - 16px); border-radius: 14px; }
  .qw-root[data-chat-side='left'] .qw-agent-panel { left: 8px; }
  .qw-agent-panel .composer-shell { padding: 6px 8px max(8px, env(safe-area-inset-bottom)); }
  .qw-skeleton-cell { height: 40px; border-radius: 7px; }
  .qw-skeleton-row, .qw-skeleton { gap: 6px; }
  .qw-import h2 { font-size: 22px; }
  .qw-sheet-count { display: none; }
}
@media (max-height: 500px) {
  .qw-empty { padding-top: 12px; padding-bottom: 12px; }
  .qw-dropzone { margin-top: 20px; }
  .qw-upload-button { min-height: 76px; padding: 16px; }
  .qw-upload-hint { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .qw-dropzone { transition: none; }
  .qw-skeleton-cell::after { animation: none; transform: none; opacity: .2; }
  .qw-selection-ask, .qw-selection-ask.is-open, .qw-selection-ask.is-closing { transition: none; transform: none; }
  .qw-selection-ask .qw-ask-button { transition: none; }
  .qw-selection-ask .qw-ask-button:active { transform: none; }
}
/* Large sheets keep the same cell surface and source typography. Only viewport
 * geometry changes; the source grid and its Excel coordinates remain complete. */
.qw-virtual-space { position: relative; min-width: 100%; min-height: 100%; }
.qw-table.qw-virtual-table { position: absolute; display: block; overflow: hidden; contain: layout style; }
.qw-virtual-table > thead, .qw-virtual-table > tbody { position: absolute; display: block; inset: 0; pointer-events: none; }
.qw-virtual-table > thead { z-index: 5; height: 34px; overflow: hidden; }
.qw-virtual-table > thead > tr { display: contents; }
.qw-virtual-table > thead .qw-column-label, .qw-virtual-table > thead .qw-corner { position: absolute; top: 0; height: 34px; overflow: hidden; white-space: nowrap; }
.qw-virtual-table > thead .qw-corner { left: 0; z-index: 6; }
/* A shared horizontal translation moves retained cells and headers together.
 * Row labels stay fixed while the body layer owns vertical scrolling. */
.qw-virtual-table > thead .qw-column-label, .qw-virtual-table > tbody > tr > .qw-cell { transform: translateX(var(--qw-window-x, 0px)); }
.qw-virtual-table > tbody > tr { position: absolute; display: block; left: 0; width: 100%; pointer-events: none; }
.qw-virtual-table > tbody > tr > .qw-row-number { position: absolute; display: block; left: 0; padding: 0; z-index: 3; pointer-events: auto; }
.qw-virtual-table > tbody > tr > .qw-row-number > .qw-row-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qw-virtual-table > tbody > tr > .qw-cell { position: absolute; display: block; min-height: 0; overflow: hidden; pointer-events: auto; }
.qw-virtual-table > tbody > tr > .qw-cell.qw-editing { overflow: visible; min-height: 110px; }
.qw-preview .qw-virtual-space { min-height: 440px; }
