    :root {
      --app-viewport-height: 100vh;
      --safe-area-top: env(safe-area-inset-top, 0px);
      --safe-area-right: env(safe-area-inset-right, 0px);
      --safe-area-bottom: env(safe-area-inset-bottom, 0px);
      --safe-area-left: env(safe-area-inset-left, 0px);
      --bg: #eef3f7;
      --panel: #ffffff;
      --panel-soft: #f6f8fb;
      --line: #d6dee8;
      --line-strong: #aebdcb;
      --text: #16202a;
      --muted: #64748b;
      --blue: #1d4ed8;
      --teal: #0f766e;
      --green: #15803d;
      --amber: #b45309;
      --red: #b91c1c;
    }
    @supports (height: 100dvh) {
      :root { --app-viewport-height: 100dvh; }
    }
    * { box-sizing: border-box; }
    html { width: 100%; min-height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    body { min-height: 100%; margin: 0; font-family: Arial, "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); font-size: 14px; }
    button, input, textarea, select { font: inherit; }
    button { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 6px; padding: 8px 10px; cursor: pointer; min-height: 36px; transition: background .12s ease, border-color .12s ease, box-shadow .12s ease; }
    button:hover:not(:disabled) { border-color: var(--line-strong); background: #f8fafc; }
    button.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
    button.primary:hover:not(:disabled) { background: #1e40af; border-color: #1e40af; }
    button.success { background: var(--green); color: #fff; border-color: var(--green); }
    button.success:hover:not(:disabled) { background: #166534; border-color: #166534; }
    button.warn { color: var(--amber); }
    button.danger { background: var(--red); color: #fff; border-color: var(--red); }
    button.subtle-danger { color: var(--red); border-color: #fecaca; background: #fff; }
    button.subtle-danger:hover:not(:disabled) { background: #fef2f2; border-color: #fca5a5; }
    button:disabled { opacity: .55; cursor: not-allowed; }
    input, textarea, select { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; background: #fff; color: var(--text); }
    input:focus, textarea:focus, select:focus { outline: 2px solid rgba(29,78,216,.14); border-color: #93b4f8; }
    textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
    .hidden { display: none !important; }
    .login { min-height: 100vh; min-height: var(--app-viewport-height); display: grid; place-items: center; padding: calc(24px + var(--safe-area-top)) calc(24px + var(--safe-area-right)) calc(24px + var(--safe-area-bottom)) calc(24px + var(--safe-area-left)); }
    .login-box { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
    .login-box h1 { margin: 0 0 18px; font-size: 20px; }
    .login-brand { display: grid; justify-items: center; gap: 10px; margin-bottom: 18px; text-align: center; }
    .login-brand img { width: 190px; height: 116px; object-fit: contain; border-radius: 4px; background: #fff; }
    .login-brand h1 { margin: 0; }
    .account-open-help { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }
    .login-box label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 13px; }
    .auth-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
    .auth-mode button.active { background: var(--teal); color: #fff; border-color: var(--teal); }
    .login-box .hidden { display: none !important; }
    .app { height: 100vh; height: var(--app-viewport-height); display: grid; grid-template-rows: 58px 1fr; min-width: 1060px; }
    .topbar { display: flex; align-items: center; justify-content: space-between; background: #0f172a; color: #fff; padding: 0 18px; border-bottom: 3px solid var(--teal); }
    .brand { font-weight: 700; }
    .brand-logo { width: 38px; height: 38px; flex: 0 0 38px; object-fit: contain; border: 1px solid rgba(103,232,249,.35); border-radius: 4px; background: #fff; }
    .top-actions { display: flex; align-items: center; gap: 10px; color: #d1d5db; font-size: 13px; }
    .top-actions button { background: #1f2937; color: #fff; border-color: #334155; }
    .top-actions button:hover:not(:disabled) { background: #27364a; color: #fff; border-color: #475569; }
    .app-update-notice { color: #fef3c7; border: 1px solid #d97706; border-radius: 5px; padding: 5px 8px; background: #451a03; white-space: nowrap; }
    .admin-test-mode { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #475569; border-radius: 6px; background: #1f2937; color: #e2e8f0; cursor: pointer; user-select: none; }
    .admin-test-mode input { width: 16px; height: 16px; padding: 0; accent-color: #f59e0b; }
    .admin-test-mode.active { color: #fef3c7; border-color: #f59e0b; background: #451a03; }
    .layout { min-height: 0; display: grid; grid-template-columns: minmax(300px, .82fr) minmax(420px, 1.34fr) minmax(340px, .98fr); gap: 1px; background: var(--line); }
    .panel { min-height: 0; background: var(--panel); display: flex; flex-direction: column; }
    .panel-head { min-height: 82px; padding: 12px; border-bottom: 1px solid var(--line); display: grid; gap: 9px; background: #fbfdff; }
    .panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .panel-title strong { font-size: 15px; }
    .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
    .toolbar.three { grid-template-columns: minmax(112px, 132px) minmax(0, 1fr); }
    .toolbar-actions { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(132px, 1.1fr) 1fr 1fr; gap: 8px; }
    .toolbar-actions button { justify-self: stretch; }
    .select-all-control { min-height: 36px; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: flex; align-items: center; gap: 7px; padding: 0 10px; color: #334155; cursor: pointer; user-select: none; }
    .select-all-control:hover { border-color: var(--line-strong); background: #f8fafc; }
    .select-all-check { width: 16px; height: 16px; min-width: 16px; padding: 0; }
    .row { display: flex; gap: 8px; align-items: center; min-width: 0; }
    .row > * { min-width: 0; }
    .hint { color: var(--muted); font-size: 12px; line-height: 1.4; }
    .error { color: var(--red); font-size: 13px; min-height: 18px; }
    .status { color: var(--muted); font-size: 12px; min-height: 18px; }
    .status.review { color: var(--amber); font-weight: 700; }
    .history-list { flex: 1; overflow: auto; padding: 10px; display: grid; grid-auto-rows: max-content; gap: 7px; align-content: start; background: var(--panel-soft); }
    .history-item { display: block; text-align: left; width: 100%; min-width: 0; border: 1px solid #dce4ee; border-radius: 8px; padding: 9px 10px; background: #fff; cursor: pointer; transition: background .12s ease, border-color .12s ease, box-shadow .12s ease; }
    .history-item:hover { border-color: var(--line-strong); background: #fbfdff; }
    .history-item.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(29,78,216,.12); }
    .history-item.selected { background: #f0fdfa; border-color: #99f6e4; }
    .history-item:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
    .history-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; min-width: 0; }
    .history-title-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
    .history-check { width: 16px; height: 16px; min-width: 16px; padding: 0; flex: 0 0 auto; }
    .history-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .history-preview { margin-top: 7px; color: #334155; font-size: 13px; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; max-height: 92px; overflow: hidden; }
    .history-meta { display: block; margin-top: 7px; }
    .tag { display: inline-block; border-radius: 999px; padding: 2px 7px; font-size: 12px; background: #eef2ff; color: #3730a3; white-space: nowrap; }
    .history-detail { border-top: 1px solid var(--line); padding: 10px 12px; min-height: 170px; max-height: 32vh; overflow: auto; background: #fff; }
    .detail-block { white-space: pre-wrap; word-break: break-word; color: #334155; font-size: 13px; line-height: 1.45; }
    .chat-head { border-bottom: 1px solid var(--line); padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; align-items: start; min-height: 82px; background: #fbfdff; }
    .chat-identity { min-width: 0; display: grid; gap: 4px; }
    .chat-title { font-weight: 700; font-size: 15px; }
    .chat-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
    .agent-task-status { width: max-content; max-width: min(100%, 360px); min-height: 28px; margin-top: 4px; padding: 4px 9px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: #475569; font-size: 12px; line-height: 1.35; }
    .agent-task-status span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .agent-task-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #94a3b8; }
    .agent-task-status[data-phase="collecting"] .agent-task-dot { background: #38bdf8; }
    .agent-task-status[data-phase="reviewing"] .agent-task-dot { background: #f59e0b; }
    .agent-task-status[data-phase="awaiting_feedback"] .agent-task-dot { background: #22c55e; }
    .agent-task-status[data-phase="completed"] .agent-task-dot { background: #14b8a6; }
    .agent-task-status[data-phase="failed"] .agent-task-dot,
    .agent-task-status[data-phase="cancelled"] .agent-task-dot { background: #ef4444; }
    .messages { min-height: 0; flex: 1 1 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 14px; display: grid; gap: 10px; align-content: start; background: #f3f6fa; }
    .msg { max-width: 84%; border-radius: 8px; padding: 9px 10px; border: 1px solid var(--line); background: #fff; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
    .msg.customer { justify-self: start; }
    .msg.agent_suggestion { justify-self: start; background: #fff7ed; border-color: #fed7aa; }
    .msg.staff_final { justify-self: end; background: #eff6ff; border-color: #bfdbfe; }
    .msg.system_note { justify-self: center; max-width: 92%; background: #f1f5f9; color: var(--muted); }
    .msg.clarification { justify-self: start; width: min(560px, 92%); max-width: 92%; background: #fff; border-color: #aebdcb; }
    .msg.schema-review { width: min(720px, 96%); max-width: 96%; color: var(--text); }
    .msg.result { justify-self: start; width: min(680px, 94%); max-width: 94%; background: #fff; border-color: #b9c6d5; }
    .msg.query-error { justify-self: start; max-width: 92%; background: #fff7f7; border-color: #fecaca; color: #7f1d1d; }
    .msg-meta { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
    .msg-content { white-space: pre-wrap; overflow-wrap: anywhere; }
    .clarification-form { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
    .clarification-choice { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; color: #26384a; cursor: pointer; }
    .clarification-choice input { width: 16px; height: 16px; min-width: 16px; margin: 2px 0 0; padding: 0; }
    .clarification-explanation { min-height: 74px; }
    .clarification-actions { display: flex; align-items: center; gap: 8px; }
    .clarification-error { min-height: 18px; color: var(--red); font-size: 12px; }
    .schema-review-form { display: grid; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); white-space: normal; }
    .schema-review-heading { min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .schema-review-heading strong { min-width: 0; font-size: 14px; }
    .schema-review-blockers { flex: 0 0 auto; color: var(--green); font-size: 12px; }
    .schema-review-blockers.active { color: var(--amber); font-weight: 700; }
    .schema-review-field { min-width: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
    .schema-review-field.valid, .schema-review-field.confirmed { border-color: #9fd3ad; background: #f3fbf5; }
    .schema-review-field.needs-confirmation { border-color: #efc37a; background: #fffaf0; }
    .schema-review-field.invalid { border-color: #efaaaa; background: #fff6f6; }
    button.schema-review-row { width: 100%; min-height: 48px; display: grid; grid-template-columns: 22px minmax(92px, .58fr) minmax(0, 1.42fr) 18px; gap: 8px; align-items: center; padding: 8px 10px; border: 0; border-radius: 0; background: transparent; color: #172033; text-align: left; transition: background .14s ease, box-shadow .14s ease, transform .14s ease; }
    button.schema-review-row:hover:not(:disabled), button.schema-review-row:focus-visible { background: #eaf3ff; box-shadow: inset 0 0 0 1px #60a5fa; transform: translateY(-1px); outline: 0; }
    .schema-review-status-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 12px; font-weight: 700; line-height: 1; }
    .needs-confirmation .schema-review-status-icon { background: #d97706; }
    .invalid .schema-review-status-icon { background: var(--red); }
    .schema-review-field-label { min-width: 0; color: #334155; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
    .schema-review-field-value { min-width: 0; color: #172033; line-height: 1.4; overflow-wrap: anywhere; }
    .schema-review-chevron { color: #64748b; text-align: center; }
    .schema-review-field-note { padding: 0 10px 8px 40px; color: #64748b; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
    .needs-confirmation .schema-review-field-note { color: #92400e; }
    .invalid .schema-review-field-note { color: #991b1b; }
    .schema-review-editor { display: grid; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
    .schema-review-options { display: grid; gap: 6px; }
    button.schema-review-option { width: 100%; min-height: 40px; padding: 8px 10px; border-color: #cbd5e1; background: #fff; color: #1f2937; text-align: left; line-height: 1.35; overflow-wrap: anywhere; transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
    button.schema-review-option:hover:not(:disabled), button.schema-review-option:focus-visible { border-color: #60a5fa; background: #eaf3ff; box-shadow: 0 2px 8px rgba(37,99,235,.12); transform: translateY(-1px); outline: 0; }
    button.schema-review-option.selected { border-color: #2563eb; background: #dbeafe; box-shadow: inset 3px 0 0 #2563eb; color: #172033; }
    .schema-review-explanation { min-height: 70px; background: #fff; }
    .schema-port-search, .schema-carrier-search, .schema-service-code-search { position: relative; display: grid; gap: 6px; min-width: 0; }
    .schema-port-selected, .schema-carrier-selected, .schema-service-code-selected { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
    .schema-port-selected-item, .schema-carrier-selected-item, .schema-service-code-selected-item { display: inline-grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; max-width: 100%; min-height: 32px; border: 1px solid #93c5fd; border-radius: 4px; background: #eff6ff; color: #1e3a5f; }
    .schema-port-selected-item > span, .schema-carrier-selected-item > span, .schema-service-code-selected-item > span { min-width: 0; padding: 5px 7px; overflow-wrap: anywhere; }
    button.schema-port-selected-remove, button.schema-carrier-selected-remove, button.schema-service-code-selected-remove { width: 28px; min-width: 28px; height: 30px; min-height: 30px; padding: 0; border: 0; border-left: 1px solid #bfdbfe; border-radius: 0; background: transparent; color: #1d4ed8; font-size: 18px; line-height: 1; }
    .schema-port-search-input, .schema-carrier-search-input, .schema-service-code-search-input { min-height: 40px; }
    .schema-port-search-results, .schema-carrier-search-results, .schema-service-code-search-results { max-height: 260px; overflow: auto; border: 1px solid #b8c5d3; border-radius: 6px; background: #fff; box-shadow: 0 8px 20px rgba(15,23,42,.14); }
    button.schema-port-search-result, button.schema-carrier-search-result, button.schema-service-code-search-result { display: block; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-bottom: 1px solid #e2e8f0; border-radius: 0; background: #fff; text-align: left; line-height: 1.35; overflow-wrap: anywhere; }
    button.schema-port-search-result:last-child, button.schema-carrier-search-result:last-child, button.schema-service-code-search-result:last-child { border-bottom: 0; }
    button.schema-port-search-result:hover, button.schema-port-search-result:focus-visible, button.schema-port-search-result.selected, button.schema-carrier-search-result:hover, button.schema-carrier-search-result:focus-visible, button.schema-carrier-search-result.selected, button.schema-service-code-search-result:hover, button.schema-service-code-search-result:focus-visible, button.schema-service-code-search-result.selected { background: #eaf3ff; color: #172033; outline: 0; }
    button.schema-port-search-result.selected, button.schema-carrier-search-result.selected, button.schema-service-code-search-result.selected { box-shadow: inset 3px 0 0 #2563eb; }
    .schema-port-search-state, .schema-carrier-search-state, .schema-service-code-search-state { min-height: 16px; color: var(--muted); font-size: 11px; }
    .schema-review-editor-actions, .schema-review-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .schema-review-editor-actions button.primary { min-width: 104px; }
    button.schema-review-remove-destination { margin-right: auto; }
    button.schema-review-cancel { width: 36px; min-width: 36px; height: 36px; padding: 0; font-size: 20px; line-height: 1; }
    .schema-review-actions { justify-content: flex-end; padding-top: 3px; }
    .schema-review-confirm { min-width: 128px; }
    .schema-review-error { min-height: 18px; color: var(--red); font-size: 12px; overflow-wrap: anywhere; }
    .result-feedback { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
    .result-feedback button { width: 36px; min-width: 36px; height: 36px; padding: 0; font-size: 20px; line-height: 1; }
    .result-feedback button.feedback-correct { color: var(--green); border-color: #86c89c; }
    .result-feedback button.feedback-incorrect { color: var(--red); border-color: #f1a3a3; }
    .result-feedback button.feedback-abandon { width: auto; min-width: 118px; padding: 0 12px; color: #475569; border-color: #cbd5e1; font-size: 13px; line-height: 1.2; }
    .result-feedback-state { color: var(--muted); font-size: 12px; }
    .result-feedback-state.correct { color: var(--green); font-weight: 700; }
    .result-feedback-state.abandoned { color: #64748b; font-weight: 700; }
    .dangerous-goods-action { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
    .dangerous-goods-override { min-width: 128px; }
    .dangerous-goods-action + .result-feedback { margin-top: 8px; padding-top: 0; border-top: 0; }
    .result-issue-form { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
    .result-issue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; }
    .result-issue-option { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 7px; align-items: center; color: #334155; cursor: pointer; }
    .result-issue-option input { width: 16px; height: 16px; min-width: 16px; padding: 0; }
    .result-issue-comment { min-height: 78px; }
    .composer { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; background: #fbfdff; }
    .review-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; display: grid; gap: 8px; }
    .review-box.pending { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.12); }
    .quote-body { flex: 1; overflow: auto; padding: 12px; display: grid; gap: 12px; align-content: start; background: var(--panel-soft); }
    .section { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; }
    .section h2 { margin: 0 0 8px; font-size: 15px; }
    .worldex-parse-summary { min-height: 18px; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
    .result-box { white-space: pre-wrap; color: #17202a; line-height: 1.45; font-size: 13px; background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 10px; min-height: 120px; word-break: break-word; }
    .worldex-result-summary { white-space: pre-wrap; margin-bottom: 10px; overflow-wrap: anywhere; }
    .local-charge-panel { min-width: 0; margin-top: 10px; color: #17202a; white-space: normal; line-height: 1.4; }
    .local-charge-panel:first-child { margin-top: 0; }
    .local-charge-heading { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
    .local-charge-heading strong { font-size: 14px; }
    .local-charge-scope { min-width: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; text-align: right; }
    .local-charge-summary { margin: 0 0 8px; color: #334155; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
    .local-charge-warning { display: grid; gap: 2px; margin: 0 0 8px; padding: 7px 9px; border: 1px solid #fecaca; border-radius: 5px; background: #fff5f5; color: #dc2626; font-weight: 700; font-size: 12px; }
    .local-charge-warning-item { white-space: pre-wrap; overflow-wrap: anywhere; }
    .local-charge-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 5px; background: #fff; -webkit-overflow-scrolling: touch; }
    .local-charge-table { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
    .local-charge-table th, .local-charge-table td { min-width: 72px; padding: 7px 8px; border-bottom: 1px solid #e5eaf0; text-align: right; vertical-align: middle; white-space: nowrap; }
    .local-charge-table th { color: #475569; background: #f8fafc; font-weight: 700; }
    .local-charge-table th:first-child, .local-charge-table td:first-child { min-width: 132px; text-align: left; }
    .local-charge-table th:nth-child(2), .local-charge-table td:nth-child(2) { min-width: 56px; text-align: center; }
    .local-charge-table th:nth-child(3), .local-charge-table td:nth-child(3) { min-width: 64px; text-align: center; }
    .local-charge-table tbody tr:last-child td { border-bottom: 0; }
    .local-charge-table tbody tr.excluded td { background: #fff7f7; }
    .local-charge-table tbody tr.excluded td:first-child { color: #b91c1c; font-weight: 700; }
    .local-charge-name { overflow: hidden; text-overflow: ellipsis; }
    .local-charge-empty { padding: 16px 10px; border: 1px dashed var(--line-strong); border-radius: 5px; color: var(--muted); font-size: 12px; text-align: center; }
    .local-charge-empty.no_data, .local-charge-empty.unavailable { color: var(--amber); background: #fffbeb; }
    .local-charge-provenance { margin-top: 6px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
    .json-box { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.45; color: #1f2937; background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 10px; max-height: 260px; overflow: auto; word-break: break-word; }
    .preferences-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
    .preferences-head h2 { margin: 0; }
    .preferences-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .preference-field { display: grid; gap: 6px; color: #334155; font-size: 13px; }
    .preference-block { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 9px; }
    .preference-label { color: #334155; font-size: 13px; font-weight: 700; }
    .preference-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
    .preference-check { display: inline-flex; align-items: center; gap: 7px; color: #334155; cursor: pointer; }
    .preference-check input { width: 16px; height: 16px; min-width: 16px; padding: 0; }
    .preference-sort-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .preference-sort-control { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px 8px; color: #334155; font-size: 13px; }
    .preference-sort-control input { width: 16px; height: 16px; min-width: 16px; padding: 0; }
    .preference-sort-control select { grid-column: 1 / -1; min-width: 0; }
    .template-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
    .template-field-selector { display: grid; gap: 7px; }
    .template-field-selector-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
    .template-field-count { color: var(--muted); font-size: 12px; }
    .template-field-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; }
    .template-field-choice { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: #334155; cursor: pointer; }
    .template-field-choice input { width: 16px; height: 16px; min-width: 16px; padding: 0; }
    .template-field-choice span { min-width: 0; overflow-wrap: anywhere; }
    .template-feedback { min-height: 18px; color: var(--muted); font-size: 12px; line-height: 1.4; }
    .template-feedback:empty { min-height: 0; }
    .template-feedback.error { color: var(--red); }
    .template-rows { display: grid; gap: 8px; }
    .template-line { border: 1px dashed var(--line-strong); border-radius: 6px; padding: 8px; min-height: 52px; background: #fbfdff; }
    .template-line.drag-over { border-color: var(--blue); background: #eff6ff; }
    .template-line-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
    .template-line-title { color: var(--muted); font-size: 12px; }
    .template-line-actions { display: flex; gap: 6px; }
    .template-line-actions button { min-height: 28px; padding: 3px 8px; font-size: 12px; }
    .template-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; align-items: center; }
    .template-tag { width: auto; min-height: 28px; padding: 4px 8px; border-color: #b9c6d5; background: #fff; color: #26384a; cursor: grab; }
    .template-tag.selected { border-color: var(--blue); background: #eff6ff; box-shadow: 0 0 0 2px rgba(29,78,216,.12); }
    .template-tag.drop-before { border-left: 3px solid var(--blue); padding-left: 6px; background: #eff6ff; }
    .preferences-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
    .user-management-dialog { width: min(720px, calc(100vw - 40px - var(--safe-area-left) - var(--safe-area-right))); height: min(620px, calc(var(--app-viewport-height) - 40px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); box-shadow: 0 18px 48px rgba(15,23,42,.28); }
    .user-management-dialog::backdrop { background: rgba(15,23,42,.52); }
    .user-management-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
    .user-management-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfdff; }
    .user-management-head h2 { margin: 0; font-size: 17px; }
    .user-management-head > button { width: 36px; min-width: 36px; padding: 0; font-size: 22px; line-height: 1; }
    .user-management-main { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); background: #fff; }
    .user-management-create { display: grid; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel-soft); }
    .user-management-create-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .user-management-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
    .user-management-form-grid label, .user-management-profile-grid label, .user-management-profile-field { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
    .user-management-form-grid input, .user-management-form-grid select, .user-management-profile-grid input, .user-management-profile-grid select { min-width: 0; min-height: 36px; }
    .user-management-create-actions { display: flex; justify-content: flex-end; }
    .user-management-summary { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
    .user-management-list { min-height: 0; overflow: auto; padding: 12px 14px; display: grid; grid-auto-rows: max-content; gap: 8px; align-content: start; }
    .user-management-row { min-width: 0; display: grid; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fbfdff; }
    .user-management-identity { min-width: 0; display: grid; gap: 3px; }
    .user-management-identity strong, .user-management-username, .user-management-meta { min-width: 0; overflow-wrap: anywhere; }
    .user-management-username, .user-management-meta { color: var(--muted); font-size: 12px; }
    .user-management-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
    .user-management-editor { min-width: 0; display: flex; align-items: center; gap: 7px; }
    .user-management-editor input { width: min(220px, 36vw); min-width: 130px; min-height: 36px; }
    .user-management-profile { display: grid; gap: 9px; }
    .user-management-profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
    .user-management-role-control { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
    .user-management-role-control button { min-height: 36px; padding-inline: 10px; white-space: nowrap; }
    .user-management-active { min-height: 36px; display: flex; align-items: center; gap: 7px; color: var(--text); }
    .user-management-active input { width: 16px; height: 16px; margin: 0; padding: 0; }
    .user-management-reset { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
    .announcements-dialog { width: min(980px, calc(100vw - 40px - var(--safe-area-left) - var(--safe-area-right))); height: min(780px, calc(var(--app-viewport-height) - 40px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); box-shadow: 0 18px 48px rgba(15,23,42,.28); }
    .announcements-dialog::backdrop { background: rgba(15,23,42,.52); }
    .announcements-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
    .announcements-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfdff; }
    .announcements-head h2 { margin: 0; font-size: 17px; }
    .announcements-head > button { width: 36px; min-width: 36px; padding: 0; font-size: 22px; line-height: 1; }
    .announcement-tabs { min-height: 48px; display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-bottom: 1px solid var(--line); background: var(--panel-soft); }
    .announcement-tabs button { min-height: 34px; padding: 6px 13px; }
    .announcement-tabs button.active { color: #fff; background: var(--blue); border-color: var(--blue); }
    .announcement-tabs .announcement-refresh { margin-left: auto; }
    .announcement-panel { min-height: 0; overflow: auto; background: #fff; }
    .announcement-meta { min-height: 40px; display: flex; align-items: center; padding: 8px 16px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
    .announcement-updates-list { padding: 0 16px 18px; }
    .announcement-update-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
    .announcement-update-section:last-child { border-bottom: 0; }
    .announcement-update-section h3 { margin: 0 0 10px; font-size: 15px; }
    .announcement-update-section ul { margin: 0; padding-left: 21px; display: grid; gap: 8px; }
    .announcement-update-section li { color: #26384a; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
    .announcement-empty { padding: 28px 16px; color: var(--muted); text-align: center; }
    .announcement-requirement-form { padding: 14px 16px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); background: #fbfdff; }
    .announcement-form-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .announcement-form-head button { min-height: 30px; padding: 4px 9px; }
    .announcement-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 190px); gap: 10px; }
    .announcement-form-grid label, .announcement-content-field { min-width: 0; display: grid; gap: 5px; color: #334155; font-size: 12px; }
    .announcement-content-field textarea { min-height: 92px; }
    .announcement-form-actions { display: flex; justify-content: flex-end; }
    .announcement-requirements-list { padding: 14px 16px 18px; display: grid; grid-auto-rows: max-content; gap: 9px; }
    .announcement-requirement-item { border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; background: #fbfdff; display: grid; gap: 8px; }
    .announcement-requirement-head { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
    .announcement-requirement-title { min-width: 0; flex: 1; font-size: 14px; overflow-wrap: anywhere; }
    .announcement-status-badge { flex: 0 0 auto; border-radius: 999px; padding: 2px 7px; color: #334155; background: #e2e8f0; font-size: 12px; white-space: nowrap; }
    .announcement-status-badge.in_progress { color: #92400e; background: #fef3c7; }
    .announcement-status-badge.completed { color: #166534; background: #dcfce7; }
    .announcement-status-badge.on_hold { color: #475569; background: #e2e8f0; }
    .announcement-requirement-edit { flex: 0 0 auto; min-height: 29px; padding: 3px 9px; font-size: 12px; }
    .announcement-requirement-content { color: #26384a; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
    .announcement-requirement-meta { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
    .worldex-usage-dialog { width: min(620px, calc(100vw - 40px - var(--safe-area-left) - var(--safe-area-right))); height: min(680px, calc(var(--app-viewport-height) - 40px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); box-shadow: 0 18px 48px rgba(15,23,42,.28); }
    .worldex-usage-dialog::backdrop { background: rgba(15,23,42,.52); }
    .worldex-usage-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); }
    .worldex-usage-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfdff; }
    .worldex-usage-head h2 { margin: 0; font-size: 17px; }
    .worldex-usage-head > button { width: 36px; min-width: 36px; padding: 0; font-size: 22px; line-height: 1; }
    .worldex-usage-channel-tabs, .worldex-usage-tabs { min-height: 48px; display: flex; align-items: end; gap: 4px; padding: 8px 14px 0; border-bottom: 1px solid var(--line); background: var(--panel-soft); }
    .worldex-usage-channel-tabs { min-height: 44px; align-items: center; padding-top: 6px; }
    .worldex-usage-channel-tabs button, .worldex-usage-tabs button { min-height: 36px; padding: 7px 18px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; background: transparent; color: var(--muted); }
    .worldex-usage-channel-tabs button.active, .worldex-usage-tabs button.active { border-color: var(--line); border-bottom-color: #fff; background: #fff; color: var(--text); font-weight: 700; }
    .worldex-usage-main { min-height: 0; display: grid; grid-template-rows: auto auto minmax(180px, 1fr) minmax(220px, 1fr); background: #fff; }
    .worldex-usage-summary { min-height: 52px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
    .worldex-usage-columns, .worldex-usage-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 80px; gap: 10px; align-items: center; }
    .worldex-usage-columns { min-height: 38px; padding: 7px 16px; color: var(--muted); font-size: 12px; background: var(--panel-soft); border-bottom: 1px solid var(--line); }
    .worldex-usage-columns span:last-child { text-align: right; }
    .worldex-usage-list { min-height: 0; overflow: auto; }
    .worldex-usage-row { min-height: 58px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
    .worldex-usage-rank { color: var(--muted); font-variant-numeric: tabular-nums; }
    .worldex-usage-user { min-width: 0; display: grid; gap: 3px; }
    .worldex-usage-name { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
    .worldex-usage-username { min-width: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
    .worldex-usage-count { display: grid; gap: 2px; text-align: right; font-variant-numeric: tabular-nums; }
    .worldex-usage-count strong { font-weight: 700; }
    .worldex-usage-count small { color: var(--muted); font-size: 10px; font-weight: 400; }
    .worldex-usage-row.zero .worldex-usage-count { color: var(--muted); font-weight: 400; }
    .worldex-usage-empty { padding: 32px 16px; color: var(--muted); text-align: center; }
    .worldex-usage-daily { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); border-top: 1px solid var(--line); }
    .worldex-usage-daily-head { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; background: var(--panel-soft); border-bottom: 1px solid var(--line); }
    .worldex-usage-daily-list { min-height: 0; overflow: auto; padding: 8px 16px 14px; background: #fff; }
    .worldex-usage-day { border-bottom: 1px solid var(--line); padding: 7px 0 9px; }
    .worldex-usage-day:last-child { border-bottom: 0; }
    .worldex-usage-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
    .worldex-usage-day-item { display: grid; grid-template-columns: 150px minmax(0, 1fr) 24px; gap: 8px; align-items: start; padding: 5px 0; }
    .worldex-usage-day-meta { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
    .worldex-usage-day-query { min-width: 0; color: #26384a; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
    .worldex-usage-day-verdict { text-align: center; font-weight: 800; }
    .worldex-usage-day-verdict.correct { color: var(--green); }
    .worldex-usage-day-verdict.incorrect { color: var(--red); }
    .worldex-usage-day-summary { grid-column: 2 / -1; color: var(--muted); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
    .worldex-usage-day-empty { color: var(--muted); font-size: 12px; padding: 3px 0; }
    .worldex-audit-dialog { width: min(920px, calc(100vw - 40px - var(--safe-area-left) - var(--safe-area-right))); height: min(720px, calc(var(--app-viewport-height) - 40px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); box-shadow: 0 18px 48px rgba(15,23,42,.28); }
    .worldex-audit-dialog::backdrop { background: rgba(15,23,42,.52); }
    .worldex-audit-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto 1fr; }
    .worldex-audit-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfdff; }
    .worldex-audit-head h2 { margin: 0; font-size: 17px; }
    .worldex-audit-head button { width: 36px; min-width: 36px; padding: 0; font-size: 22px; line-height: 1; }
    .worldex-audit-layout { min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
    .worldex-audit-layout.self-only { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
    .worldex-audit-layout.self-only .worldex-audit-users { display: none; }
    .worldex-audit-users { min-height: 0; overflow: auto; border-right: 1px solid var(--line); background: var(--panel-soft); padding: 10px; display: grid; grid-auto-rows: max-content; gap: 7px; align-content: start; }
    .worldex-audit-user { width: 100%; min-height: 54px; display: grid; gap: 4px; text-align: left; padding: 8px 10px; }
    .worldex-audit-user.active { border-color: var(--blue); background: #eff6ff; box-shadow: 0 0 0 2px rgba(29,78,216,.1); }
    .worldex-audit-user-name { font-weight: 700; overflow-wrap: anywhere; }
    .worldex-audit-user-meta { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
    .worldex-audit-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto auto 1fr auto; }
    .worldex-audit-summary { min-height: 52px; padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .worldex-audit-toolbar { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) auto; align-items: end; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--panel-soft); }
    .worldex-audit-toolbar label { min-width: 0; display: grid; gap: 5px; color: #334155; font-size: 12px; }
    .worldex-audit-toolbar input { min-width: 0; min-height: 34px; padding: 6px 8px; }
    .worldex-audit-actions { display: flex; gap: 7px; }
    .worldex-audit-actions button { min-height: 34px; padding: 6px 10px; white-space: nowrap; }
    .worldex-audit-records { min-height: 0; overflow: auto; padding: 12px 14px; display: grid; grid-auto-rows: max-content; gap: 8px; align-content: start; background: #fff; }
    .worldex-audit-record { border: 1px solid var(--line); border-radius: 6px; padding: 10px 11px; background: #fbfdff; display: grid; gap: 7px; }
    .worldex-audit-record-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
    .worldex-audit-query { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; line-height: 1.45; color: #26384a; }
    .worldex-audit-footer { min-height: 54px; padding: 9px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; background: #fbfdff; }
    .worldex-failures-dialog { width: min(1180px, calc(100vw - 40px - var(--safe-area-left) - var(--safe-area-right))); height: min(820px, calc(var(--app-viewport-height) - 40px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); box-shadow: 0 18px 48px rgba(15,23,42,.28); }
    .worldex-failures-dialog::backdrop { background: rgba(15,23,42,.52); }
    .worldex-failures-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto auto auto 1fr auto; }
    .worldex-failures-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfdff; }
    .worldex-failures-head h2 { margin: 0; font-size: 17px; }
    .worldex-failures-head button { width: 36px; min-width: 36px; padding: 0; font-size: 22px; line-height: 1; }
    .worldex-failures-tabs { display: flex; gap: 4px; padding: 8px 14px 0; border-bottom: 1px solid var(--line); background: #fbfdff; }
    .worldex-failures-tabs button { min-height: 36px; padding: 7px 14px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; background: transparent; color: var(--muted); }
    .worldex-failures-tabs button.active { border-color: var(--line); border-bottom-color: #fff; background: #fff; color: var(--text); font-weight: 700; }
    .worldex-failures-toolbar { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-soft); align-items: end; }
    .worldex-failures-toolbar label { display: grid; gap: 5px; color: #334155; font-size: 12px; min-width: 0; }
    .worldex-failures-toolbar input, .worldex-failures-toolbar select { min-width: 0; min-height: 34px; padding: 6px 8px; }
    .worldex-failures-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
    .worldex-failures-list-wrap { min-height: 0; display: grid; grid-template-rows: auto 1fr; }
    .worldex-failures-list-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: #fff; }
    .worldex-failures-list { min-height: 0; overflow: auto; padding: 12px 14px; display: grid; grid-auto-rows: max-content; gap: 8px; align-content: start; background: #fff; }
    .worldex-failure-item { border: 1px solid var(--line); border-radius: 6px; padding: 10px 11px; background: #fbfdff; display: grid; gap: 7px; }
    .worldex-failure-item.synced { border-color: #bbf7d0; background: #f0fdf4; }
    .worldex-failure-item-head { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
    .worldex-failure-check { width: 16px; height: 16px; min-width: 16px; padding: 0; margin-top: 2px; }
    .worldex-failure-meta { min-width: 0; flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; color: var(--muted); font-size: 12px; }
    .worldex-failure-stage { color: var(--amber); font-weight: 700; }
    .worldex-failure-status { margin-left: auto; color: var(--green); font-size: 12px; white-space: nowrap; }
    .worldex-failure-prompt { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; line-height: 1.45; color: #26384a; }
    .worldex-failure-error { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; color: var(--red); font-size: 12px; line-height: 1.4; background: #fff7f7; border: 1px solid #fee2e2; border-radius: 5px; padding: 7px 8px; }
    .worldex-failure-detail { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; }
    .worldex-quality-toolbar { min-height: 56px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-soft); }
    .worldex-quality-toolbar button { min-height: 34px; padding: 6px 12px; white-space: nowrap; }
    .worldex-quality-audit-state { color: var(--green); font-weight: 700; }
    .worldex-failures-footer { min-height: 54px; padding: 9px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 12px; background: #fbfdff; }
    .worldex-rag-dialog { width: min(1540px, calc(100vw - 32px - var(--safe-area-left) - var(--safe-area-right))); height: min(920px, calc(var(--app-viewport-height) - 32px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); box-shadow: 0 18px 48px rgba(15,23,42,.28); }
    .worldex-rag-dialog::backdrop { background: rgba(15,23,42,.52); }
    .worldex-rag-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto auto 1fr auto; }
    .worldex-rag-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfdff; }
    .worldex-rag-head h2 { margin: 0; font-size: 17px; }
    .worldex-rag-head button { width: 36px; min-width: 36px; padding: 0; font-size: 22px; line-height: 1; }
    .worldex-rag-toolbar { display: grid; grid-template-columns: minmax(150px, 220px) minmax(150px, 220px) 1fr; gap: 8px; align-items: end; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-soft); }
    .worldex-rag-toolbar label { display: grid; gap: 5px; color: #334155; font-size: 12px; }
    .worldex-rag-toolbar select { min-height: 34px; padding: 6px 8px; }
    .worldex-rag-actions { display: flex; justify-content: flex-end; gap: 8px; }
    .worldex-rag-list-wrap { min-height: 0; display: grid; grid-template-rows: auto 1fr; }
    .worldex-rag-list-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: #fff; }
    .worldex-rag-list { min-height: 0; overflow: auto; padding: 28px; background: #f4f5f7; }
    .worldex-rag-item { width: min(100%, 1400px); margin: 0 auto; border: 1px solid #e2e8f0; border-radius: 8px; padding: 28px; background: #fff; box-shadow: 0 5px 18px rgba(15,23,42,.07); display: grid; gap: 24px; }
    .worldex-rag-case-header { min-width: 0; display: grid; gap: 18px; padding-bottom: 24px; border-bottom: 1px solid #e5e7eb; }
    .worldex-rag-case-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
    .worldex-rag-badges { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
    .worldex-rag-badge { min-height: 30px; display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 6px; font-size: 13px; font-weight: 700; white-space: nowrap; }
    .worldex-rag-badge::before { content: ""; width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: currentColor; box-shadow: inset 0 1px 2px rgba(255,255,255,.6); }
    .worldex-rag-badge.verdict-incorrect { background: #fee2e2; color: #b91c1c; }
    .worldex-rag-badge.verdict-correct { background: #dcfce7; color: #15803d; }
    .worldex-rag-badge.verdict-unknown { background: #f1f5f9; color: #64748b; }
    .worldex-rag-badge.intervention-yes { background: #fef3c7; color: #b45309; }
    .worldex-rag-badge.intervention-no { background: #f1f5f9; color: #64748b; }
    .worldex-rag-state { min-height: 34px; display: inline-flex; align-items: center; padding: 6px 15px; border: 1px solid #c7d2fe; border-radius: 999px; background: #e0e7ff; color: #4f46e5; font-size: 13px; font-weight: 700; white-space: nowrap; }
    .worldex-rag-state.state-approved { border-color: #bbf7d0; background: #dcfce7; color: #15803d; }
    .worldex-rag-state.state-reviewed { border-color: #fde68a; background: #fffbeb; color: #92400e; }
    .worldex-rag-state.state-revoked { border-color: #fecaca; background: #fee2e2; color: #b91c1c; }
    .worldex-rag-prompt { min-width: 0; padding: 16px 18px; border-left: 4px solid #3b82f6; border-radius: 8px; background: #f8fafc; color: #1e293b; font-size: 18px; font-weight: 700; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
    .worldex-rag-effective-query { margin-top: 9px; padding-top: 9px; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 13px; font-weight: 500; }
    .worldex-rag-provenance { display: flex; justify-content: space-between; gap: 16px; color: #64748b; font-size: 13px; line-height: 1.5; }
    .worldex-rag-business-note { display: flex; gap: 5px; padding: 12px 14px; border: 1px solid #fde68a; border-radius: 6px; background: #fffbeb; color: #92400e; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
    .worldex-rag-business-note strong { flex: 0 0 auto; color: #78350f; }
    .worldex-rag-text-block { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid #e2e8f0; }
    .worldex-rag-text-label { color: #64748b; font-size: 12px; font-weight: 700; }
    .worldex-rag-query { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; color: #1e293b; font-weight: 600; }
    .worldex-rag-meta { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
    .worldex-rag-schemas { display: grid; grid-template-columns: 1fr; gap: 14px; padding-top: 3px; border-top: 1px solid #e2e8f0; }
    .worldex-rag-schema { min-width: 0; background: transparent; }
    .worldex-rag-schema-title { margin: 0; padding: 8px 0 6px; color: #334155; font-size: 13px; font-weight: 700; }
    .worldex-rag-schema-rows { border-top: 1px solid #cbd5e1; }
    .worldex-rag-schema-row { display: grid; grid-template-columns: minmax(96px, .36fr) minmax(0, 1fr); gap: 10px; padding: 8px 4px; border-bottom: 1px solid #e2e8f0; }
    .worldex-rag-schema-row-label { color: #64748b; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
    .worldex-rag-schema-row-value { color: #1e293b; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
    .worldex-rag-schema-empty { padding: 8px 4px; color: #94a3b8; font-size: 12px; }
    .worldex-rag-schema-comparison { min-width: 0; }
    .worldex-rag-comparison-scroll { min-width: 0; overflow: auto; }
    .worldex-rag-comparison-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
    .worldex-rag-comparison-table thead th { padding: 14px 16px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; color: #475569; font-size: 13px; font-weight: 700; text-align: left; }
    .worldex-rag-comparison-table thead th:nth-child(1) { width: 15%; }
    .worldex-rag-comparison-table thead th:nth-child(2), .worldex-rag-comparison-table thead th:nth-child(3) { width: 23%; }
    .worldex-rag-comparison-table thead th:nth-child(4) { width: 39%; }
    .worldex-rag-comparison-table tbody th, .worldex-rag-comparison-table tbody td { min-width: 0; padding: 14px 16px; border-bottom: 1px solid #edf0f3; vertical-align: middle; text-align: left; }
    .worldex-rag-comparison-table tbody th { color: #1e293b; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
    .worldex-rag-comparison-cell { color: #64748b; font-size: 13px; line-height: 1.55; }
    .worldex-rag-comparison-value { display: inline-block; max-width: 100%; padding: 4px 7px; border-radius: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
    .worldex-rag-comparison-cell.is-unchanged .worldex-rag-comparison-value { padding-inline: 0; color: #94a3b8; }
    .worldex-rag-comparison-cell.is-missing .worldex-rag-comparison-value { padding-inline: 0; color: #94a3b8; font-style: italic; }
    .worldex-rag-comparison-cell.is-removed .worldex-rag-comparison-value { background: #fee2e2; color: #b91c1c; text-decoration: line-through; }
    .worldex-rag-comparison-cell.is-added .worldex-rag-comparison-value { background: #dcfce7; color: #15803d; font-weight: 700; }
    .worldex-rag-comparison-table .worldex-rag-unparsed-summary td { padding: 0; background: #fbfdff; }
    .worldex-rag-unparsed-toggle { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: 0; background: transparent; color: #475569; font-size: 12px; font-weight: 700; text-align: left; }
    .worldex-rag-unparsed-toggle:hover:not(:disabled) { background: #f1f5f9; color: #1d4ed8; }
    .worldex-rag-unparsed-toggle::before { content: "›"; color: #64748b; font-size: 18px; line-height: 1; transform: rotate(90deg); transition: transform .15s ease; }
    .worldex-rag-unparsed-toggle[aria-expanded="true"]::before { transform: rotate(-90deg); }
    .worldex-rag-admin-cell { min-width: 0; }
    .worldex-rag-admin-cell .worldex-rag-structured-control { min-height: 38px; border-color: #cbd5e1; background: #fff; }
    .worldex-rag-admin-cell.is-modified .worldex-rag-structured-control { border-color: #86efac; background: #f0fdf4; font-weight: 600; }
    .worldex-rag-admin-cell.is-invalid .worldex-rag-structured-control { border-color: #fca5a5; background: #fef2f2; }
    .worldex-rag-admin-details { min-width: 0; }
    .worldex-rag-admin-details summary { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #334155; cursor: pointer; list-style: none; white-space: pre-wrap; overflow-wrap: anywhere; }
    .worldex-rag-admin-details summary::-webkit-details-marker { display: none; }
    .worldex-rag-admin-details summary::after { content: "编辑"; flex: 0 0 auto; color: #2563eb; font-size: 12px; font-weight: 700; }
    .worldex-rag-admin-details[open] summary::after { content: "收起"; }
    .worldex-rag-admin-cell.is-modified .worldex-rag-admin-details summary { border-color: #86efac; background: #f0fdf4; font-weight: 600; }
    .worldex-rag-admin-editor-host { min-width: 0; display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; }
    .worldex-rag-admin-editor-host.is-simple { margin-top: 0; padding: 0; border: 0; background: transparent; }
    .worldex-rag-admin-subfield { display: grid; grid-template-columns: minmax(90px, .35fr) minmax(0, 1fr); gap: 8px; align-items: start; }
    .worldex-rag-admin-subfield > span { color: #64748b; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
    .worldex-rag-restore-button { min-height: 34px; padding: 6px 10px; color: #2563eb; border-color: #bfdbfe; background: #eff6ff; font-size: 12px; }
    .worldex-rag-admin-readonly { display: block; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 6px; color: #334155; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
    .worldex-rag-admin-cell.is-modified .worldex-rag-admin-readonly { border-color: #86efac; background: #f0fdf4; font-weight: 600; }
    .worldex-rag-raw-details { min-width: 0; color: #2563eb; font-size: 13px; }
    .worldex-rag-raw-details summary { width: fit-content; cursor: pointer; font-weight: 600; list-style: none; }
    .worldex-rag-raw-details summary::-webkit-details-marker { display: none; }
    .worldex-rag-raw-details summary::before { content: "[+] "; }
    .worldex-rag-raw-details[open] summary::before { content: "[-] "; }
    .worldex-rag-raw-details pre { max-height: 360px; margin: 12px 0 0; overflow: auto; padding: 14px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; color: #334155; font: 12px/1.55 Consolas, "Courier New", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
    .worldex-rag-review-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; padding-top: 6px; }
    .worldex-rag-review-editor > label:not(.worldex-rag-review-comment) { display: grid; gap: 5px; color: #334155; font-size: 12px; font-weight: 700; }
    .worldex-rag-review-editor input, .worldex-rag-review-editor select, .worldex-rag-review-editor textarea { min-width: 0; padding: 7px 8px; }
    .worldex-rag-review-editor > label:not(.worldex-rag-review-comment) > select, .worldex-rag-intent-choices { min-height: 38px; }
    .worldex-rag-review-schema { grid-column: 1 / -1; }
    .worldex-rag-review-schema textarea { resize: vertical; }
    .worldex-rag-review-comment { grid-column: 1 / -1; display: grid; gap: 10px; padding: 16px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; color: #334155; font-size: 13px; }
    .worldex-rag-review-comment strong { font-size: 14px; }
    .worldex-rag-review-comment textarea { min-height: 92px; resize: vertical; background: #fff; }
    .worldex-rag-intent-choices { min-width: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 3px; overflow-x: auto; padding: 3px 5px; border: 1px solid var(--line); border-radius: 6px; background: #fff; scrollbar-width: thin; }
    .worldex-rag-intent-choice { flex: 0 0 auto; display: inline-flex !important; grid-template-columns: none !important; align-items: center; gap: 4px; min-height: 28px; padding: 3px 7px; border: 0; border-radius: 4px; background: transparent; color: #334155; cursor: pointer; white-space: nowrap; }
    .worldex-rag-intent-choice:hover { background: #f1f5f9; }
    .worldex-rag-intent-choice input { width: 15px; min-width: 15px; height: 15px; min-height: 15px; margin: 0; padding: 0; accent-color: var(--blue); }
    .worldex-rag-intent-choice:has(input:focus-visible) { outline: 2px solid #93b4f8; outline-offset: 1px; }
    .worldex-rag-intent-choice:has(input:checked) { border-color: transparent; background: #eff6ff; color: #1d4ed8; }
    .worldex-rag-review-schema-picker { grid-column: 1 / -1; display: grid; padding-top: 2px; }
    .worldex-rag-review-schema-head, .worldex-rag-result-head { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .worldex-rag-review-schema-head h3, .worldex-rag-result-head h3 { margin: 0; color: #1e293b; font-size: 14px; }
    .worldex-rag-review-schema-head span, .worldex-rag-result-head span { color: #64748b; font-size: 12px; }
    .worldex-rag-schema-choice-row { display: block; border-top: 1px solid #e2e8f0; background: transparent; }
    .worldex-rag-schema-choice-summary { min-height: 46px; display: grid; grid-template-columns: minmax(120px, .32fr) minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 4px; cursor: pointer; list-style: none; }
    .worldex-rag-schema-choice-summary::-webkit-details-marker { display: none; }
    .worldex-rag-schema-choice-summary::after { content: "›"; justify-self: end; grid-column: 2; grid-row: 1; color: #64748b; font-size: 18px; line-height: 1; transform: rotate(90deg); transition: transform .15s ease; }
    .worldex-rag-schema-choice-row[open] > .worldex-rag-schema-choice-summary::after { transform: rotate(-90deg); }
    .worldex-rag-schema-choice-summary > strong { overflow-wrap: anywhere; color: #334155; font-size: 12px; }
    .worldex-rag-schema-choice-value { min-width: 0; padding-right: 24px; color: #1e293b; font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
    .worldex-rag-schema-choice-body { display: grid; gap: 8px; padding: 0 4px 12px min(32%, 132px); background: #f8fafc; }
    .worldex-rag-schema-choice-buttons { display: flex; flex-wrap: wrap; gap: 5px; }
    .worldex-rag-schema-choice { min-height: 28px; padding: 4px 8px; font-size: 12px; }
    .worldex-rag-schema-choice.selected { border-color: var(--blue); background: #eff6ff; color: #1d4ed8; font-weight: 700; }
    .worldex-rag-schema-choice-preview { max-height: 180px; overflow: auto; padding: 7px 9px; border-left: 3px solid #bfdbfe; background: #fff; color: #334155; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; }
    .worldex-rag-schema-custom { min-width: 0; }
    .worldex-rag-structured-editor { min-width: 0; display: grid; gap: 6px; }
    .worldex-rag-structured-object, .worldex-rag-structured-list { min-width: 0; display: grid; gap: 6px; }
    .worldex-rag-structured-field { min-width: 0; display: grid; grid-template-columns: minmax(92px, .3fr) minmax(0, 1fr); gap: 8px; align-items: start; }
    .worldex-rag-structured-label, .worldex-rag-structured-index { color: #64748b; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
    .worldex-rag-structured-item { min-width: 0; display: grid; grid-template-columns: minmax(92px, .25fr) minmax(0, 1fr) 32px; gap: 8px; align-items: start; padding-bottom: 6px; border-bottom: 1px solid #e2e8f0; }
    .worldex-rag-structured-control { width: 100%; min-height: 34px; padding: 6px 8px; font: inherit; }
    textarea.worldex-rag-structured-control { min-height: 72px; resize: vertical; }
    .worldex-rag-structured-remove { width: 32px; min-width: 32px; height: 32px; padding: 0; font-size: 18px; line-height: 1; }
    .worldex-rag-structured-add { justify-self: start; min-height: 30px; padding: 5px 9px; font-size: 12px; }
    .worldex-rag-review-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 12px; padding-top: 4px; }
    .worldex-rag-review-actions button { min-width: 148px; min-height: 44px; padding-inline: 18px; font-weight: 700; }
    .worldex-rag-approved-actions { display: flex; justify-content: flex-end; gap: 8px; }
    .worldex-rag-approved-actions input { min-width: 220px; padding: 7px 8px; }
    .worldex-rag-result { display: grid; gap: 10px; padding-top: 4px; }
    .worldex-rag-result-text { padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f1f5f9; color: #334155; font: 13px/1.65 Consolas, "Courier New", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
    .worldex-rag-result-text.error { border-left-color: #dc2626; background: #fff7f7; color: #991b1b; }
    .worldex-rag-result-empty { padding: 10px 0; color: #64748b; font-size: 13px; }
    .worldex-rag-result .local-charge-panel { margin-top: 2px; }
    .worldex-rag-saved-review { display: grid; gap: 8px; padding: 16px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; color: #334155; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
    .worldex-rag-saved-review-meta { color: #64748b; font-size: 12px; }
    .worldex-rag-footer { min-height: 54px; padding: 9px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 12px; background: #fbfdff; }
    .worldex-rag-page-jump { display: inline-flex; align-items: center; gap: 6px; color: #475569; font-size: 13px; }
    .worldex-rag-page-jump input { width: 72px; min-height: 36px; padding: 6px 8px; text-align: center; }
    @media (max-width: 1060px) {
      .app { min-width: 0; height: auto; min-height: 100vh; }
      .layout { grid-template-columns: 1fr; }
      .panel { min-height: 680px; }
      .worldex-rag-list { padding: 18px; }
      .worldex-rag-comparison-table { min-width: 980px; }
    }
    @media (max-width: 600px) {
      .app { grid-template-rows: auto 1fr; }
      .topbar { min-height: 58px; padding: 8px 10px; flex-wrap: wrap; gap: 8px; }
      .brand { flex: 1 1 100%; }
      .top-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
      .admin-test-mode { flex: 0 0 auto; }
      .preferences-grid { grid-template-columns: 1fr; }
      .preference-sort-grid { grid-template-columns: 1fr; }
      .template-field-choices { grid-template-columns: 1fr; }
      .preferences-actions button { flex: 1 1 128px; }
      .worldex-usage-dialog { width: calc(100vw - 20px - var(--safe-area-left) - var(--safe-area-right)); height: calc(var(--app-viewport-height) - 20px - var(--safe-area-top) - var(--safe-area-bottom)); }
      .worldex-usage-columns, .worldex-usage-row { grid-template-columns: 46px minmax(0, 1fr) 62px; gap: 7px; }
      .worldex-usage-day-item { grid-template-columns: 92px minmax(0, 1fr) 22px; gap: 5px; }
      .worldex-audit-dialog { width: calc(100vw - 20px - var(--safe-area-left) - var(--safe-area-right)); height: calc(var(--app-viewport-height) - 20px - var(--safe-area-top) - var(--safe-area-bottom)); }
      .worldex-audit-layout { grid-template-columns: 1fr; grid-template-rows: minmax(150px, 32vh) minmax(0, 1fr); }
      .worldex-audit-users { border-right: 0; border-bottom: 1px solid var(--line); }
      .worldex-audit-toolbar { grid-template-columns: 1fr 1fr; }
      .worldex-audit-actions { grid-column: 1 / -1; }
      .worldex-audit-actions button { flex: 1 1 0; }
      .worldex-rag-footer { flex-wrap: wrap; }
      .worldex-failures-dialog { width: calc(100vw - 20px - var(--safe-area-left) - var(--safe-area-right)); height: calc(var(--app-viewport-height) - 20px - var(--safe-area-top) - var(--safe-area-bottom)); }
      .worldex-failures-toolbar { grid-template-columns: 1fr 1fr; }
      .worldex-failures-actions { grid-column: 1 / -1; justify-content: stretch; }
      .worldex-failures-actions button { flex: 1 1 130px; }
      .worldex-rag-dialog { width: calc(100vw - 20px - var(--safe-area-left) - var(--safe-area-right)); height: calc(var(--app-viewport-height) - 20px - var(--safe-area-top) - var(--safe-area-bottom)); }
      .worldex-rag-toolbar { grid-template-columns: 1fr 1fr; }
      .worldex-rag-actions { grid-column: 1 / -1; justify-content: stretch; }
      .worldex-rag-actions button { flex: 1 1 130px; }
      .worldex-rag-schemas { grid-template-columns: 1fr; }
      .worldex-rag-text-block { grid-template-columns: 1fr; gap: 4px; }
      .worldex-rag-review-editor { grid-template-columns: 1fr; }
      .worldex-rag-list { padding: 10px; }
      .worldex-rag-item { padding: 13px 12px; }
      .worldex-rag-case-header { gap: 14px; padding-bottom: 18px; }
      .worldex-rag-case-top, .worldex-rag-provenance { align-items: flex-start; flex-direction: column; }
      .worldex-rag-prompt { padding: 13px 14px; font-size: 16px; }
      .worldex-rag-business-note { align-items: flex-start; flex-direction: column; }
      .worldex-rag-comparison-table { min-width: 0; table-layout: auto; }
      .worldex-rag-comparison-table thead { display: none; }
      .worldex-rag-comparison-table tbody, .worldex-rag-comparison-table tbody tr, .worldex-rag-comparison-table tbody th, .worldex-rag-comparison-table tbody td { display: block; width: 100%; }
      .worldex-rag-comparison-table tbody tr { padding: 12px 0; border-bottom: 1px solid #dbe3ec; }
      .worldex-rag-comparison-table tbody th, .worldex-rag-comparison-table tbody td { padding: 7px 10px; border-bottom: 0; }
      .worldex-rag-comparison-table tbody th { margin-bottom: 4px; background: #f8fafc; font-size: 14px; }
      .worldex-rag-comparison-table tbody td::before { display: block; margin-bottom: 5px; color: #64748b; font-size: 11px; font-weight: 700; }
      .worldex-rag-comparison-table tbody td:nth-child(2)::before { content: "初始解析 (LLM)"; }
      .worldex-rag-comparison-table tbody td:nth-child(3)::before { content: "业务员修改"; }
      .worldex-rag-comparison-table tbody td:nth-child(4)::before { content: "管理员修改 (终审入库值)"; }
      .worldex-rag-admin-subfield { grid-template-columns: 1fr; }
      .worldex-rag-schema-choice-summary { grid-template-columns: 1fr; gap: 4px; }
      .worldex-rag-schema-choice-summary::after { grid-column: 1; justify-self: end; }
      .worldex-rag-schema-choice-value { padding-right: 24px; }
      .worldex-rag-schema-choice-body { padding-left: 4px; }
      .worldex-rag-schema-row, .worldex-rag-structured-field { grid-template-columns: 1fr; gap: 4px; }
      .worldex-rag-structured-item { grid-template-columns: 1fr 32px; }
      .worldex-rag-structured-item > .worldex-rag-structured-index { grid-column: 1; grid-row: 1; }
      .worldex-rag-structured-item > .worldex-rag-structured-remove { grid-column: 2; grid-row: 1; }
      .worldex-rag-structured-item > .worldex-rag-structured-editor { grid-column: 1 / -1; }
      .worldex-rag-review-comment, .worldex-rag-review-actions { grid-column: auto; }
      .worldex-rag-review-actions { align-items: stretch; flex-direction: column; justify-content: stretch; }
      .worldex-rag-review-actions button { width: 100%; min-width: 0; flex: 1 1 0; }
      .worldex-rag-approved-actions { align-items: stretch; flex-direction: column; }
      .worldex-rag-approved-actions input { min-width: 0; }
      .user-management-dialog { width: calc(100vw - 20px - var(--safe-area-left) - var(--safe-area-right)); height: calc(var(--app-viewport-height) - 20px - var(--safe-area-top) - var(--safe-area-bottom)); }
      .user-management-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
      .user-management-form-grid, .user-management-profile-grid { grid-template-columns: 1fr; }
      .user-management-row { align-items: flex-start; flex-direction: column; }
      .user-management-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
      .user-management-role-control { grid-template-columns: minmax(0, 1fr) auto; }
      .user-management-editor { width: 100%; flex-wrap: wrap; }
      .user-management-editor input { width: min(100%, 280px); }
      .announcements-dialog { width: calc(100vw - 20px - var(--safe-area-left) - var(--safe-area-right)); height: calc(var(--app-viewport-height) - 20px - var(--safe-area-top) - var(--safe-area-bottom)); }
      .announcement-tabs { padding-inline: 10px; }
      .announcement-form-grid { grid-template-columns: 1fr; }
      .announcement-requirement-head { flex-wrap: wrap; }
      .announcement-requirement-title { flex-basis: calc(100% - 90px); }
      .msg.schema-review { width: 100%; max-width: 100%; }
      button.schema-review-row { grid-template-columns: 22px minmax(72px, .55fr) minmax(0, 1.45fr) 16px; gap: 6px; padding-inline: 8px; }
      .schema-review-field-note { padding-left: 36px; }
      .schema-review-actions { justify-content: stretch; }
      .schema-review-confirm { width: 100%; }
      .local-charge-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
      .local-charge-scope { text-align: left; }
      .local-charge-table { min-width: 720px; }
    }
    @media (prefers-reduced-motion: reduce) {
      button.schema-review-row, button.schema-review-option { transition: none; }
      button.schema-review-row:hover:not(:disabled), button.schema-review-row:focus-visible,
      button.schema-review-option:hover:not(:disabled), button.schema-review-option:focus-visible { transform: none; }
    }

    /* Command center visual layer. */
    :root {
      --bg: #05080d;
      --panel: #0a1017;
      --panel-soft: #070c12;
      --surface: #0d151d;
      --surface-raised: #111c26;
      --surface-active: #102531;
      --line: #1b2a35;
      --line-strong: #35505d;
      --text: #e8f2f5;
      --text-strong: #f7fbfc;
      --muted: #81949f;
      --blue: #22d3ee;
      --teal: #2dd4bf;
      --green: #34d399;
      --amber: #fbbf24;
      --red: #fb7185;
      --cyan-soft: rgba(34, 211, 238, .1);
      --cyan-line: rgba(34, 211, 238, .34);
      --shadow-deep: 0 24px 72px rgba(0, 0, 0, .46);
    }
    html { color-scheme: dark; background: var(--bg); }
    body {
      color: var(--text);
      background-color: var(--bg);
      background-image:
        linear-gradient(rgba(64, 96, 111, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(64, 96, 111, .055) 1px, transparent 1px);
      background-size: 28px 28px;
      font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
      letter-spacing: 0;
    }
    * { scrollbar-width: thin; scrollbar-color: #29414d #080d13; }
    *::-webkit-scrollbar { width: 9px; height: 9px; }
    *::-webkit-scrollbar-track { background: #080d13; }
    *::-webkit-scrollbar-thumb { border: 2px solid #080d13; border-radius: 8px; background: #29414d; }
    *::-webkit-scrollbar-thumb:hover { background: #3a6070; }
    button, input, textarea, select { letter-spacing: 0; }
    button {
      border-color: var(--line);
      border-radius: 5px;
      background: #0d1720;
      color: var(--text);
      box-shadow: inset 0 1px rgba(255, 255, 255, .025);
      transition: color .12s ease, background-color .12s ease, border-color .12s ease, box-shadow .12s ease, transform .12s ease;
    }
    button:hover:not(:disabled) {
      border-color: #3d6673;
      background: #12212b;
      color: var(--text-strong);
      box-shadow: 0 0 0 1px rgba(34, 211, 238, .05), 0 0 18px rgba(34, 211, 238, .07);
    }
    button:active:not(:disabled) { transform: translateY(1px); }
    button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
      outline: 2px solid rgba(34, 211, 238, .7);
      outline-offset: 2px;
    }
    button.primary {
      border-color: #18bdd3;
      background: #16a8bf;
      color: #021014;
      font-weight: 800;
      box-shadow: inset 0 1px rgba(255, 255, 255, .22), 0 0 20px rgba(34, 211, 238, .12);
    }
    button.primary:hover:not(:disabled) {
      border-color: #67e8f9;
      background: #22d3ee;
      color: #02090c;
      box-shadow: 0 0 24px rgba(34, 211, 238, .25);
    }
    button.success { border-color: #27ae82; background: #15946d; color: #03140e; font-weight: 800; }
    button.danger { border-color: #be5266; background: #9f3f52; color: #fff; }
    button.subtle-danger { border-color: rgba(251, 113, 133, .36); background: rgba(159, 63, 82, .08); color: #fda4af; }
    button.subtle-danger:hover:not(:disabled) { border-color: #fb7185; background: rgba(159, 63, 82, .18); }
    button:disabled { opacity: .42; }
    input, textarea, select {
      border-color: var(--line);
      border-radius: 5px;
      background: #080f16;
      color: var(--text);
      caret-color: var(--blue);
      box-shadow: inset 0 1px 4px rgba(0, 0, 0, .28);
    }
    input::placeholder, textarea::placeholder { color: #586b76; }
    input:focus, textarea:focus, select:focus {
      border-color: #2b8797;
      outline: 2px solid rgba(34, 211, 238, .1);
      background: #0a131b;
    }
    input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); box-shadow: none; }
    .hint, .status { color: var(--muted); }
    .error { color: var(--red); }
    .ui-surface-hidden { display: none !important; }

    .login {
      position: relative;
      isolation: isolate;
      background-color: #05080d;
      background-image:
        linear-gradient(rgba(34, 211, 238, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, .045) 1px, transparent 1px);
      background-size: 32px 32px;
    }
    .login-box {
      position: relative;
      overflow: hidden;
      border-color: #29424e;
      border-radius: 7px;
      background: rgba(9, 16, 23, .96);
      box-shadow: var(--shadow-deep), 0 0 0 1px rgba(34, 211, 238, .04);
      animation: panel-boot .42s cubic-bezier(.2, .8, .2, 1) both;
    }
    .login-box::before {
      content: "";
      position: absolute;
      inset: 0 0 auto;
      height: 2px;
      background: #22d3ee;
      box-shadow: 0 0 18px rgba(34, 211, 238, .55);
    }
    .login-box h1 { color: var(--text-strong); }
    .login-box label { color: var(--muted); }
    .auth-mode { gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--line); }
    .auth-mode button { border: 0; border-radius: 0; }
    .auth-mode button.active { background: #12333a; color: #67e8f9; box-shadow: inset 0 -2px #22d3ee; }

    .command-center {
      height: 100vh;
      height: 100dvh;
      height: var(--app-viewport-height);
      min-width: 980px;
      min-height: 0;
      overflow: hidden;
      grid-template-rows: calc(64px + var(--safe-area-top)) minmax(0, 1fr);
      isolation: isolate;
      background: var(--bg);
    }
    .topbar {
      position: relative;
      z-index: 80;
      overflow: visible;
      border-bottom: 1px solid #23404b;
      padding: var(--safe-area-top) calc(16px + var(--safe-area-right)) 0 calc(16px + var(--safe-area-left));
      background: rgba(6, 12, 18, .96);
      color: var(--text);
      box-shadow: 0 8px 28px rgba(0, 0, 0, .24);
      backdrop-filter: blur(16px);
    }
    .topbar::after {
      content: "";
      position: absolute;
      right: 100%;
      bottom: -1px;
      width: 22%;
      height: 2px;
      background: #22d3ee;
      box-shadow: 0 0 14px rgba(34, 211, 238, .8);
      animation: telemetry-scan 8s linear infinite;
      pointer-events: none;
    }
    .brand { min-width: 0; display: flex; align-items: center; gap: 10px; color: #f1fbfd; font-size: 15px; font-weight: 800; }
    .brand > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .brand-mark {
      position: relative;
      width: 22px;
      height: 22px;
      flex: 0 0 22px;
      border: 1px solid #38d7e9;
      background: #0b2730;
      box-shadow: inset 0 0 0 4px #071218, 0 0 14px rgba(34, 211, 238, .22);
      transform: rotate(45deg);
    }
    .brand-mark::before, .brand-mark::after {
      content: "";
      position: absolute;
      inset: 50% 3px auto;
      height: 1px;
      background: #67e8f9;
    }
    .brand-mark::after { inset: 3px auto 3px 50%; width: 1px; height: auto; }
    .top-actions { min-width: 0; flex: 0 0 auto; gap: 7px; color: #9aabb4; overflow: visible; }
    .top-actions::-webkit-scrollbar { display: none; }
    .top-actions button, .admin-test-mode {
      min-height: 34px;
      border-color: #233743;
      border-radius: 5px;
      background: #0b141c;
      color: #c9d6db;
      white-space: nowrap;
    }
    .top-actions button:hover:not(:disabled) { border-color: #3c6875; background: #10212a; color: #ecfeff; }
    .admin-test-mode.active { border-color: rgba(251, 191, 36, .62); background: rgba(146, 64, 14, .18); color: #fde68a; }
    .app-update-notice { border-color: rgba(251, 191, 36, .55); background: rgba(120, 53, 15, .24); color: #fde68a; }
    .settings-menu-wrap { position: relative; display: flex; align-items: center; }
    .top-actions button.settings-menu-toggle {
      width: 40px;
      min-width: 40px;
      height: 40px;
      min-height: 40px;
      display: grid;
      place-items: center;
      padding: 0;
      border-color: #31505d;
      background: #0b171f;
      color: #dffbff;
    }
    .settings-menu-toggle > span { font-size: 23px; line-height: 1; }
    .settings-menu-toggle[aria-expanded="true"] { border-color: #22d3ee; background: #10313a; box-shadow: 0 0 16px rgba(34, 211, 238, .14); }
    .settings-menu {
      position: absolute;
      z-index: 100;
      top: calc(100% + 9px);
      right: var(--safe-area-right);
      width: min(320px, calc(100vw - 24px - var(--safe-area-left) - var(--safe-area-right)));
      max-height: calc(var(--app-viewport-height) - 82px - var(--safe-area-top) - var(--safe-area-bottom));
      display: grid;
      gap: 6px;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding: 10px;
      border: 1px solid #304b58;
      border-radius: 7px;
      background: rgba(7, 14, 20, .98);
      box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(34, 211, 238, .04);
      backdrop-filter: blur(18px);
    }
    .settings-menu-head { display: grid; gap: 3px; padding: 5px 6px 9px; border-bottom: 1px solid #1f333d; }
    .settings-menu-head strong { color: #effcff; font-size: 14px; }
    .settings-user { min-width: 0; color: #78909a; font-size: 12px; overflow-wrap: anywhere; }
    .settings-menu .app-update-notice { display: block; white-space: normal; }
    .settings-menu-group { display: grid; gap: 5px; padding-top: 5px; border-top: 1px solid #1a2d37; }
    .settings-menu-section-title { padding: 2px 6px; color: #6f8792; font-size: 11px; font-weight: 700; }
    .top-actions button.settings-menu-item {
      width: 100%;
      min-height: 38px;
      justify-self: stretch;
      padding: 8px 10px;
      border-color: #213641;
      background: #0a141c;
      color: #c9d8dd;
      text-align: left;
    }
    .top-actions button.settings-menu-item:hover:not(:disabled) { border-color: #397080; background: #10242d; color: #effcff; }
    .settings-menu .admin-test-mode { width: 100%; min-height: 38px; justify-content: flex-start; }
    .top-actions button.settings-logout { margin-top: 3px; border-color: rgba(251, 113, 133, .28); color: #fda4af; }

    .command-layout {
      position: relative;
      min-height: 0;
      overflow: visible;
      grid-template-columns: minmax(0, 1fr);
      gap: 1px;
      background: #1b2a35;
    }
    .command-layout > .history-panel { display: none !important; }
    .command-layout > .panel {
      min-height: 0;
      border: 0;
      background: var(--panel);
      box-shadow: inset 0 1px rgba(255, 255, 255, .018);
    }
    .conversation-panel { position: relative; z-index: 1; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
    .preferences-backdrop {
      position: fixed;
      z-index: 55;
      inset: calc(64px + var(--safe-area-top)) 0 auto;
      height: calc(var(--app-viewport-height) - 64px - var(--safe-area-top));
      width: auto;
      min-height: 0;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: rgba(1, 5, 8, .62);
      backdrop-filter: blur(3px);
    }
    .preferences-panel {
      position: fixed;
      z-index: 60;
      inset: calc(64px + var(--safe-area-top)) var(--safe-area-right) auto auto;
      width: min(520px, calc(100vw - 24px));
      height: calc(var(--app-viewport-height) - 64px - var(--safe-area-top) - var(--safe-area-bottom));
      min-height: 0;
      overflow: hidden;
      visibility: hidden;
      pointer-events: none;
      transform: translateX(100%);
      border-left: 1px solid #304b58 !important;
      box-shadow: -24px 0 60px rgba(0, 0, 0, .42);
      transition: transform .22s cubic-bezier(.2, .8, .2, 1), visibility .22s;
    }
    .preferences-panel.open { visibility: visible; pointer-events: auto; transform: translateX(0); }
    .chat-head, .panel-head {
      position: relative;
      flex: 0 0 auto;
      min-height: 78px;
      border-bottom-color: var(--line);
      background: #091119;
      box-shadow: inset 0 -1px rgba(34, 211, 238, .025);
    }
    .chat-head::before, .preferences-panel-head::before {
      content: "";
      position: absolute;
      left: 0;
      top: 18px;
      bottom: 18px;
      width: 2px;
      background: #22d3ee;
      box-shadow: 0 0 12px rgba(34, 211, 238, .45);
    }
    .chat-title, .panel-title strong { color: var(--text-strong); font-size: 16px; }
    .chat-sub { color: #6e8793; font-family: "Cascadia Code", Consolas, monospace; }
    .agent-task-status { border-color: #263b47; background: #0b151d; color: #9ab0ba; }
    .messages {
      min-height: 0;
      flex: 1 1 0;
      grid-auto-rows: max-content;
      overflow-x: hidden;
      overflow-y: auto;
      isolation: isolate;
      scrollbar-gutter: stable;
      overscroll-behavior: contain;
      padding: 18px max(clamp(14px, 2.4vw, 32px), var(--safe-area-right)) 18px max(clamp(14px, 2.4vw, 32px), var(--safe-area-left));
      gap: 12px;
      background-color: #060b10;
      background-image:
        linear-gradient(rgba(57, 92, 106, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57, 92, 106, .035) 1px, transparent 1px);
      background-size: 28px 28px;
      scroll-behavior: auto;
      -webkit-overflow-scrolling: touch;
    }
    .msg {
      position: relative;
      z-index: 0;
      min-width: 0;
      border-color: #23343e;
      border-radius: 6px;
      background: rgba(12, 20, 28, .97);
      color: #dce8ec;
      box-shadow: 0 10px 28px rgba(0, 0, 0, .15);
      animation: message-enter .22s cubic-bezier(.2, .8, .2, 1) both;
    }
    .msg::before {
      content: "";
      position: absolute;
      left: -1px;
      top: 9px;
      bottom: 9px;
      width: 2px;
      border-radius: 2px;
      background: #49606b;
    }
    .msg.customer { background: #0c161e; }
    .msg.customer::before { background: #22d3ee; box-shadow: 0 0 9px rgba(34, 211, 238, .45); }
    .msg.agent_suggestion { border-color: rgba(251, 191, 36, .32); background: rgba(68, 43, 12, .34); }
    .msg.agent_suggestion::before { background: var(--amber); }
    .msg.staff_final { border-color: rgba(45, 212, 191, .35); background: rgba(10, 51, 51, .42); }
    .msg.staff_final::before { background: var(--teal); }
    .msg.system_note { border-style: dashed; background: rgba(17, 28, 38, .78); color: var(--muted); box-shadow: none; }
    .msg.system_note::before { display: none; }
    .msg.clarification, .msg.result { border-color: #365361; background: #0b151d; }
    .msg.query-error { border-color: rgba(251, 113, 133, .45); background: rgba(88, 28, 41, .34); color: #fecdd3; }
    .msg.query-error::before { background: var(--red); }
    .msg-meta { color: #718994; font-family: "Cascadia Code", Consolas, monospace; }
    .msg-content { color: inherit; }
    html[data-theme="dark"] .msg.agent-authored .msg-content {
      color: #f2f8fa;
      font-weight: 600;
    }
    html[data-theme="dark"] .msg.agent-authored .msg-meta {
      color: #adbec6;
      font-weight: 700;
    }
    html[data-theme="dark"] .msg.welcome {
      border-color: #365764;
      background: #0b171f;
    }
    html[data-theme="dark"] .msg.welcome::before {
      background: #22d3ee;
      box-shadow: 0 0 9px rgba(34, 211, 238, .32);
    }
    .msg.welcome .msg-content { line-height: 1.65; }
    .staff-welcome-tips {
      display: grid;
      gap: 10px;
      margin-top: 16px;
      padding: 14px;
      border: 1px solid var(--teal);
      border-left-width: 4px;
      border-radius: 8px;
      background: var(--panel-soft);
      color: var(--text);
      white-space: normal;
      line-height: 1.6;
    }
    .staff-welcome-tips-title { color: var(--teal); font-size: 14px; }
    .staff-welcome-tips p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; }
    .staff-welcome-tips p > strong, .staff-welcome-tips kbd {
      color: var(--teal);
      font-weight: 700;
    }
    .staff-welcome-tips kbd {
      padding: 1px 9px;
      border: 1px solid var(--teal);
      border-bottom-width: 3px;
      border-radius: 5px;
      font-family: inherit;
    }
    .staff-welcome-tips p > span { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
    .staff-welcome-tips small { color: var(--muted); font-size: 12px; }
    .result-artifact {
      display: grid;
      gap: 10px;
      margin-top: 14px;
      padding-top: 12px;
      border-top: 1px solid #29414c;
      white-space: normal;
    }
    .result-artifact h4 {
      margin: 0;
      color: #dbe7eb;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.35;
    }
    .result-artifact-table-wrap {
      max-width: 100%;
      overflow-x: auto;
      border-block: 1px solid #29414c;
    }
    .result-artifact table {
      width: 100%;
      min-width: 420px;
      border-collapse: collapse;
      font-size: 12px;
      line-height: 1.4;
    }
    .result-artifact th,
    .result-artifact td {
      padding: 7px 8px;
      border-bottom: 1px solid #213640;
      text-align: left;
      vertical-align: top;
    }
    .result-artifact th { color: #8fa5ae; font-weight: 650; }
    .result-artifact td:nth-child(2) {
      font-family: "Cascadia Code", Consolas, monospace;
      overflow-wrap: anywhere;
    }
    .result-artifact-chart {
      display: block;
      width: 100%;
      height: auto;
      aspect-ratio: 8 / 3;
      min-height: 180px;
      max-height: 270px;
    }
    .clarification-form { border-top-color: var(--line); }
    .clarification-choice { color: #c9d7dc; }
    .composer {
      position: relative;
      border-top-color: #1e333d;
      padding: 14px max(clamp(14px, 2.4vw, 32px), var(--safe-area-right)) calc(14px + var(--safe-area-bottom)) max(clamp(14px, 2.4vw, 32px), var(--safe-area-left));
      background: rgba(7, 13, 19, .98);
      box-shadow: 0 -14px 34px rgba(0, 0, 0, .2);
    }
    .composer::before {
      content: "";
      position: absolute;
      inset: -1px 28% auto;
      height: 1px;
      background: rgba(34, 211, 238, .42);
      box-shadow: 0 0 10px rgba(34, 211, 238, .34);
    }
    .composer textarea { min-height: 86px; background: #070e14; }
    .review-box { border-color: var(--line); background: #0b141c; }
    .review-box.pending { border-color: rgba(251, 191, 36, .52); box-shadow: 0 0 0 1px rgba(251, 191, 36, .08), 0 0 22px rgba(251, 191, 36, .05); }

    @keyframes telemetry-scan {
      0% { right: 105%; opacity: 0; }
      8%, 88% { opacity: .9; }
      100% { right: -26%; opacity: 0; }
    }
    @keyframes panel-boot {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @keyframes message-enter {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    .msg.schema-review {
      grid-column: 1;
      align-self: start;
      width: min(780px, 98%);
      max-width: 98%;
      overflow: hidden;
      border-color: #31505d;
      background: #09131a;
      color: var(--text);
      box-shadow: 0 18px 42px rgba(0, 0, 0, .22), 0 0 0 1px rgba(34, 211, 238, .025);
    }
    .msg.schema-review::before { top: 0; bottom: 0; background: #22d3ee; box-shadow: 0 0 14px rgba(34, 211, 238, .38); }
    .msg.result { grid-column: 1; align-self: start; scroll-margin-block: 12px; }
    .msg.schema-review + .msg.result { margin-top: 4px; }
    .result-review-shortcut {
      min-height: 30px;
      margin: 0 0 8px;
      padding: 4px 8px;
      border-color: #2c5260;
      background: #0d222b;
      color: #8debf5;
      font-size: 12px;
    }
    .schema-review-form { gap: 8px; border-top-color: #1f343f; }
    .schema-review-heading { padding: 2px 1px 4px; }
    .schema-review-heading strong { color: #eafcff; }
    .schema-review-blockers { color: var(--green); }
    .schema-review-blockers.active { color: var(--amber); }
    .schema-review-field {
      border-color: #213541;
      background: #0b151d;
      transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
    }
    .schema-review-field.valid, .schema-review-field.confirmed {
      border-color: rgba(52, 211, 153, .38);
      background: rgba(11, 42, 35, .48);
    }
    .schema-review-field.needs-confirmation {
      border-color: rgba(251, 191, 36, .55);
      background: rgba(62, 42, 10, .38);
      box-shadow: inset 2px 0 rgba(251, 191, 36, .7), 0 0 18px rgba(251, 191, 36, .035);
    }
    .schema-review-field.invalid {
      border-color: rgba(251, 113, 133, .58);
      background: rgba(66, 23, 34, .4);
      box-shadow: inset 2px 0 rgba(251, 113, 133, .75);
    }
    button.schema-review-row { color: var(--text); }
    button.schema-review-row:hover:not(:disabled), button.schema-review-row:focus-visible {
      background: rgba(34, 211, 238, .075);
      box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .42);
      transform: translateY(-1px);
    }
    .schema-review-status-icon {
      background: #28b886;
      color: #02140e;
      box-shadow: 0 0 12px rgba(52, 211, 153, .2);
    }
    .needs-confirmation .schema-review-status-icon {
      background: var(--amber);
      color: #1b1000;
      animation: status-beacon 1.8s ease-in-out infinite;
    }
    .invalid .schema-review-status-icon { background: var(--red); color: #24050b; }
    .schema-review-field-label { color: #9eb1ba; }
    .schema-review-field-value { color: #eff9fb; }
    .schema-review-chevron, .schema-review-field-note { color: #718994; }
    .needs-confirmation .schema-review-field-note { color: #fcd77b; }
    .invalid .schema-review-field-note { color: #fda4af; }
    .schema-review-editor { border-top-color: #213742; background: #080f16; }
    button.schema-review-option {
      border-color: #263b47;
      background: #0c161e;
      color: #cbd9de;
    }
    button.schema-review-option:hover:not(:disabled), button.schema-review-option:focus-visible {
      border-color: #3191a1;
      background: #10252e;
      box-shadow: 0 5px 18px rgba(0, 0, 0, .24);
    }
    button.schema-review-option.selected {
      border-color: #22d3ee;
      background: #10313a;
      color: #e6fcff;
      box-shadow: inset 3px 0 #22d3ee, 0 0 16px rgba(34, 211, 238, .08);
    }
    .schema-review-explanation { background: #070e14; }
    .schema-port-search-results, .schema-carrier-search-results, .schema-service-code-search-results {
      border-color: #304a57;
      background: #081017;
      box-shadow: 0 16px 36px rgba(0, 0, 0, .48);
    }
    button.schema-port-search-result, button.schema-carrier-search-result, button.schema-service-code-search-result {
      border-bottom-color: #1d303a;
      background: #0a131b;
      color: #cbd9de;
    }
    button.schema-port-search-result:hover, button.schema-port-search-result:focus-visible,
    button.schema-port-search-result.selected, button.schema-carrier-search-result:hover,
    button.schema-carrier-search-result:focus-visible, button.schema-carrier-search-result.selected,
    button.schema-service-code-search-result:hover, button.schema-service-code-search-result:focus-visible,
    button.schema-service-code-search-result.selected {
      background: #102b34;
      color: #ecfeff;
    }
    button.schema-port-search-result.selected, button.schema-carrier-search-result.selected,
    button.schema-service-code-search-result.selected { box-shadow: inset 3px 0 #22d3ee; }
    .schema-port-selected-item, .schema-carrier-selected-item, .schema-service-code-selected-item {
      border-color: #2a8796;
      background: #0d2c34;
      color: #c8f8fc;
    }
    button.schema-port-selected-remove, button.schema-carrier-selected-remove,
    button.schema-service-code-selected-remove { border-left-color: #276674; color: #67e8f9; }
    .schema-review-actions { border-top-color: var(--line); }
    .schema-review-error { color: var(--red); }

    .result-box, .json-box {
      border-color: #213541;
      background: #071017;
      color: #d5e4e9;
      box-shadow: inset 0 1px 6px rgba(0, 0, 0, .3);
    }
    .worldex-result-summary { color: #e4f1f4; }
    .result-feedback { border-top-color: #1d303a; }
    .result-feedback button.feedback-correct { border-color: rgba(52, 211, 153, .48); color: var(--green); }
    .result-feedback button.feedback-incorrect { border-color: rgba(251, 113, 133, .5); color: var(--red); }
    .result-feedback button.feedback-abandon { border-color: #334955; color: #9aadb5; }
    .result-feedback-state.correct { color: var(--green); }
    .result-feedback-state.abandoned { color: var(--muted); }
    .result-issue-form, .dangerous-goods-action { border-top-color: var(--line); }
    .result-issue-option { color: #b9c9cf; }
    .local-charge-panel { color: #dbe9ed; }
    .local-charge-scope, .local-charge-provenance { color: var(--muted); }
    .local-charge-summary { color: #afc2ca; }
    .local-charge-warning {
      border-color: rgba(251, 113, 133, .45);
      background: rgba(91, 28, 43, .34);
      color: #fda4af;
    }
    .local-charge-table-wrap { border-color: #263c48; background: #080f16; }
    .local-charge-table th, .local-charge-table td { border-bottom-color: #1b2b35; }
    .local-charge-table th { background: #0d1821; color: #9db0b9; }
    .local-charge-table td { background: #091119; color: #d7e5e9; }
    .local-charge-table tbody tr:hover td { background: #0e2028; }
    .local-charge-table tbody tr.excluded td { background: rgba(83, 26, 39, .32); }
    .local-charge-table tbody tr.excluded td:first-child { color: #fda4af; }
    .local-charge-empty { border-color: #35505d; color: var(--muted); background: #081017; }
    .local-charge-empty.no_data, .local-charge-empty.unavailable { background: rgba(69, 45, 8, .3); color: #fcd77b; }

    .preferences-panel-head { min-height: 78px; padding-inline: 16px; }
    .preferences-panel-head #quoteStatus { max-width: 230px; overflow-wrap: anywhere; text-align: right; }
    .legacy-preference-close { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; font-size: 22px; line-height: 1; }
    .preferences-body {
      min-height: 0;
      flex: 1 1 0;
      display: block;
      padding: 0;
      overflow: auto;
      background-color: #070c12;
      background-image: linear-gradient(rgba(56, 91, 105, .035) 1px, transparent 1px);
      background-size: 100% 30px;
    }
    .preferences-workspace {
      min-height: 100%;
      margin: 0;
      padding: 18px 16px 24px;
      border: 0;
      border-radius: 0;
      background: transparent;
      animation: preference-enter .3s cubic-bezier(.2, .8, .2, 1) both;
    }
    .preferences-head { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #1c303a; }
    .preferences-head h2 { color: #e9f9fb; font-size: 15px; }
    .preferences-grid { gap: 10px; }
    .preferences-grid .preference-field:nth-child(3) { grid-column: 1 / -1; }
    .preference-field, .preference-label, .preference-check,
    .preference-sort-control, .template-field-choice { color: #aebfc6; }
    .preference-field > span, .preference-label { font-weight: 700; }
    .preference-field input, .preference-field select { min-height: 38px; }
    .preference-block { margin-top: 16px; padding-top: 16px; border-top-color: #1c303a; }
    .preference-sort-grid { grid-template-columns: 1fr; gap: 6px; }
    .preference-sort-control {
      grid-template-columns: 18px minmax(72px, 1fr) minmax(118px, 1.35fr);
      min-height: 42px;
      padding: 6px 8px;
      border: 1px solid #1d303a;
      border-radius: 5px;
      background: rgba(10, 19, 27, .76);
      transition: border-color .12s ease, background-color .12s ease;
    }
    .preference-sort-control:has(input:checked) { border-color: #296f7d; background: rgba(15, 49, 58, .62); }
    .preference-sort-control select { grid-column: auto; min-height: 32px; padding-block: 5px; }
    .template-toolbar { gap: 6px; }
    .template-toolbar button { min-height: 32px; padding: 5px 8px; font-size: 12px; }
    .template-field-selector { gap: 9px; }
    .template-field-choices {
      gap: 1px;
      overflow: hidden;
      border: 1px solid #1d303a;
      border-radius: 5px;
      background: #1d303a;
    }
    .template-field-choice {
      min-height: 38px;
      padding: 7px 8px;
      background: #0a131b;
      transition: background-color .12s ease, color .12s ease;
    }
    .template-field-choice:hover { background: #10232c; color: #e6f8fb; }
    .template-field-choice:has(input:checked) { background: #0d2932; color: #bff7fc; }
    .template-line {
      position: relative;
      border-color: #35505d;
      border-radius: 5px;
      background: rgba(8, 16, 23, .9);
      transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease, transform .14s ease;
    }
    .template-line.drag-over {
      border-color: #22d3ee;
      background: #0c2730;
      box-shadow: 0 0 0 1px rgba(34, 211, 238, .15), 0 0 22px rgba(34, 211, 238, .1);
      transform: translateY(-2px);
    }
    .template-line-title { color: #7f96a0; font-family: "Cascadia Code", Consolas, monospace; }
    .template-tag {
      border-color: #304a57;
      border-radius: 4px;
      background: #0c1821;
      color: #bfd0d6;
      transition: border-color .12s ease, background-color .12s ease, box-shadow .12s ease, transform .12s ease;
    }
    .template-tag:hover { border-color: #3c7180; background: #10252e; transform: translateY(-1px); }
    .template-tag.selected {
      border-color: #22d3ee;
      background: #10313a;
      color: #d9fbff;
      box-shadow: 0 0 0 1px rgba(34, 211, 238, .14), 0 0 14px rgba(34, 211, 238, .09);
    }
    .template-tag.drop-before { border-left-color: #67e8f9; background: #12333c; }
    .template-feedback { color: #78909a; }
    .preferences-actions {
      position: sticky;
      z-index: 3;
      bottom: -24px;
      margin: 18px -16px -24px;
      padding: 14px 16px;
      border-top-color: #243944;
      background: rgba(7, 13, 19, .96);
      box-shadow: 0 -14px 30px rgba(0, 0, 0, .2);
      backdrop-filter: blur(14px);
    }
    .preferences-actions .status { flex: 1 1 100%; }

    @keyframes status-beacon {
      0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, .22); }
      50% { box-shadow: 0 0 0 5px rgba(251, 191, 36, 0); }
    }
    @keyframes preference-enter {
      from { opacity: 0; transform: translateX(10px); }
      to { opacity: 1; transform: translateX(0); }
    }

    :is(.user-management-dialog, .announcements-dialog, .worldex-usage-dialog,
      .worldex-audit-dialog, .worldex-failures-dialog, .worldex-rag-dialog) {
      border-color: #304b58;
      border-radius: 7px;
      background: #081017;
      color: var(--text);
      box-shadow: var(--shadow-deep), 0 0 0 1px rgba(34, 211, 238, .035), 0 0 60px rgba(34, 211, 238, .035);
      animation: dialog-materialize .2s cubic-bezier(.2, .8, .2, 1) both;
    }
    :is(.user-management-dialog, .announcements-dialog, .worldex-usage-dialog,
      .worldex-audit-dialog, .worldex-failures-dialog, .worldex-rag-dialog)::backdrop {
      background: rgba(1, 5, 8, .78);
      backdrop-filter: blur(8px);
    }
    :is(.user-management-head, .announcements-head, .worldex-usage-head,
      .worldex-audit-head, .worldex-failures-head, .worldex-rag-head) {
      position: relative;
      border-bottom-color: #203640;
      background: #09131a;
      box-shadow: inset 0 -1px rgba(34, 211, 238, .03);
    }
    :is(.user-management-head, .announcements-head, .worldex-usage-head,
      .worldex-audit-head, .worldex-failures-head, .worldex-rag-head)::before {
      content: "";
      position: absolute;
      left: 0;
      top: 15px;
      bottom: 15px;
      width: 2px;
      background: #22d3ee;
      box-shadow: 0 0 12px rgba(34, 211, 238, .42);
    }
    :is(.user-management-head, .announcements-head, .worldex-usage-head,
      .worldex-audit-head, .worldex-failures-head, .worldex-rag-head) h2 { color: #ecfbfd; }
    :is(.announcement-tabs, .worldex-usage-channel-tabs, .worldex-usage-tabs,
      .worldex-failures-tabs) {
      border-bottom-color: var(--line);
      background: #070e14;
    }
    :is(.announcement-tabs, .worldex-usage-channel-tabs, .worldex-usage-tabs,
      .worldex-failures-tabs) button.active {
      border-color: #2b5461;
      border-bottom-color: #22d3ee;
      background: #0e242c;
      color: #c9f9fd;
      box-shadow: inset 0 -2px #22d3ee;
    }
    :is(.announcement-panel, .user-management-main, .worldex-usage-main,
      .worldex-audit-main, .worldex-audit-records, .worldex-failures-list,
      .worldex-rag-list-wrap) { background: #080f16; }
    :is(.announcement-requirement-form, .worldex-usage-columns,
      .worldex-usage-daily-head, .worldex-audit-users, .worldex-audit-toolbar,
      .worldex-failures-toolbar, .worldex-quality-toolbar, .worldex-rag-toolbar) {
      border-color: var(--line);
      background: #09131a;
    }
    :is(.announcement-form-grid label, .announcement-content-field,
      .worldex-audit-toolbar label, .worldex-failures-toolbar label,
      .worldex-rag-toolbar label) { color: #9db0b9; }
    .announcement-update-section { border-bottom-color: var(--line); }
    .announcement-update-section h3 { color: #e8f3f6; }
    .announcement-update-section li, .announcement-requirement-content { color: #bfced3; }
    .announcement-requirement-item, .user-management-row, .worldex-audit-record,
    .worldex-failure-item {
      border-color: #20343f;
      background: #0b151d;
      transition: border-color .14s ease, background-color .14s ease, transform .14s ease;
    }
    .announcement-requirement-item:hover, .user-management-row:hover,
    .worldex-audit-record:hover, .worldex-failure-item:hover {
      border-color: #315562;
      background: #0d1b24;
      transform: translateY(-1px);
    }
    .announcement-status-badge { background: #15232d; color: #9eb1ba; }
    .announcement-status-badge.in_progress { background: rgba(120, 76, 12, .32); color: #fcd77b; }
    .announcement-status-badge.completed { background: rgba(13, 92, 67, .35); color: #6ee7b7; }
    .announcement-status-badge.on_hold { background: #17232c; color: #91a5ae; }
    .user-management-username, .user-management-meta { color: var(--muted); }
    .worldex-usage-row { border-bottom-color: #192b35; }
    .worldex-usage-row:hover { background: #0c1921; }
    .worldex-usage-daily { border-top-color: var(--line); }
    .worldex-usage-daily-list { background: #080f16; }
    .worldex-usage-day { border-bottom-color: #192b35; }
    .worldex-usage-day-query, .worldex-audit-query, .worldex-failure-prompt { color: #c6d5da; }
    .worldex-audit-user.active {
      border-color: #22d3ee;
      background: #0d2932;
      color: #d9fbff;
      box-shadow: 0 0 0 1px rgba(34, 211, 238, .12), 0 0 16px rgba(34, 211, 238, .06);
    }
    .worldex-failure-item.synced { border-color: rgba(52, 211, 153, .38); background: rgba(10, 58, 45, .3); }
    .worldex-failure-error { border-color: rgba(251, 113, 133, .34); background: rgba(88, 28, 41, .3); color: #fda4af; }
    :is(.worldex-audit-footer, .worldex-failures-footer, .worldex-rag-footer) {
      border-top-color: #203640;
      background: #09131a;
    }

    .worldex-rag-list-head { border-bottom-color: #20343f; background: #09131a; }
    .worldex-rag-list {
      background-color: #060b10;
      background-image:
        linear-gradient(rgba(57, 92, 106, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57, 92, 106, .035) 1px, transparent 1px);
      background-size: 30px 30px;
    }
    .worldex-rag-item {
      border-color: #243b46;
      background: #09131a;
      box-shadow: 0 18px 48px rgba(0, 0, 0, .28), 0 0 0 1px rgba(34, 211, 238, .025);
      animation: case-enter .24s cubic-bezier(.2, .8, .2, 1) both;
    }
    .worldex-rag-case-header { border-bottom-color: #20343f; }
    .worldex-rag-badge { border: 1px solid currentColor; background: transparent; }
    .worldex-rag-badge::before { box-shadow: 0 0 8px currentColor; }
    .worldex-rag-badge.verdict-incorrect { border-color: rgba(251, 113, 133, .38); background: rgba(88, 28, 41, .26); color: #fda4af; }
    .worldex-rag-badge.verdict-correct { border-color: rgba(52, 211, 153, .38); background: rgba(10, 73, 54, .25); color: #6ee7b7; }
    .worldex-rag-badge.verdict-unknown, .worldex-rag-badge.intervention-no { border-color: #344955; background: #111d26; color: #91a4ad; }
    .worldex-rag-badge.intervention-yes { border-color: rgba(251, 191, 36, .4); background: rgba(91, 57, 9, .28); color: #fcd77b; }
    .worldex-rag-state { border-color: #315f70; background: #102a35; color: #a5f3fc; }
    .worldex-rag-state.state-approved { border-color: rgba(52, 211, 153, .4); background: rgba(10, 73, 54, .3); color: #6ee7b7; }
    .worldex-rag-state.state-reviewed { border-color: rgba(251, 191, 36, .42); background: rgba(91, 57, 9, .3); color: #fcd77b; }
    .worldex-rag-state.state-revoked { border-color: rgba(251, 113, 133, .4); background: rgba(88, 28, 41, .3); color: #fda4af; }
    .worldex-rag-prompt {
      border-left-color: #22d3ee;
      background: #0b1820;
      color: #effbfc;
      box-shadow: inset 10px 0 22px rgba(34, 211, 238, .025);
    }
    .worldex-rag-effective-query { border-top-color: #20343f; color: #8298a2; }
    .worldex-rag-provenance { color: #8298a2; }
    .worldex-rag-business-note { border-color: rgba(251, 191, 36, .36); background: rgba(82, 53, 11, .27); color: #fcd77b; }
    .worldex-rag-business-note strong { color: #fde68a; }
    .worldex-rag-text-block, .worldex-rag-schemas, .worldex-rag-schema-choice-row { border-color: #20343f; }
    .worldex-rag-text-label, .worldex-rag-schema-row-label,
    .worldex-rag-structured-label, .worldex-rag-structured-index { color: #849aa4; }
    .worldex-rag-query, .worldex-rag-schema-row-value, .worldex-rag-schema-choice-value { color: #d7e5e9; }
    .worldex-rag-schema-title { color: #aebfc6; }
    .worldex-rag-schema-rows { border-top-color: #31505d; }
    .worldex-rag-schema-row, .worldex-rag-structured-item { border-bottom-color: #1c303a; }
    .worldex-rag-comparison-table thead th {
      border-bottom-color: #2a414d;
      background: #0d1821;
      color: #9db0b9;
    }
    .worldex-rag-comparison-table tbody th, .worldex-rag-comparison-table tbody td { border-bottom-color: #1b2d37; }
    .worldex-rag-comparison-table tbody th { color: #d8e6ea; }
    .worldex-rag-comparison-cell { color: #9cb0b8; }
    .worldex-rag-comparison-cell.is-unchanged .worldex-rag-comparison-value,
    .worldex-rag-comparison-cell.is-missing .worldex-rag-comparison-value { color: #617781; }
    .worldex-rag-comparison-cell.is-removed .worldex-rag-comparison-value { background: rgba(105, 33, 48, .46); color: #fda4af; }
    .worldex-rag-comparison-cell.is-added .worldex-rag-comparison-value { background: rgba(10, 88, 64, .42); color: #6ee7b7; }
    .worldex-rag-comparison-table .worldex-rag-unparsed-summary td { background: #080f16; }
    .worldex-rag-unparsed-toggle { color: #91a5ae; }
    .worldex-rag-unparsed-toggle:hover:not(:disabled) { background: #0d2029; color: #67e8f9; }
    .worldex-rag-admin-cell .worldex-rag-structured-control,
    .worldex-rag-admin-details summary, .worldex-rag-admin-readonly {
      border-color: #304853;
      background: #081017;
      color: #c9d8dd;
    }
    .worldex-rag-admin-cell.is-modified .worldex-rag-structured-control,
    .worldex-rag-admin-cell.is-modified .worldex-rag-admin-details summary,
    .worldex-rag-admin-cell.is-modified .worldex-rag-admin-readonly {
      border-color: rgba(52, 211, 153, .5);
      background: rgba(10, 73, 54, .28);
      color: #d1fae5;
    }
    .worldex-rag-admin-cell.is-invalid .worldex-rag-structured-control { border-color: rgba(251, 113, 133, .58); background: rgba(88, 28, 41, .3); }
    .worldex-rag-admin-details summary::after, .worldex-rag-raw-details { color: #67e8f9; }
    .worldex-rag-admin-editor-host, .worldex-rag-review-comment,
    .worldex-rag-schema-choice-body, .worldex-rag-saved-review {
      border-color: #20343f;
      background: #081017;
      color: #b9cad0;
    }
    .worldex-rag-admin-subfield > span { color: #8298a2; }
    .worldex-rag-restore-button { border-color: #2d6674; background: #0d2932; color: #67e8f9; }
    .worldex-rag-raw-details pre, .worldex-rag-result-text,
    .worldex-rag-schema-choice-preview {
      border-color: #243b46;
      background: #070f16;
      color: #c4d5da;
    }
    .worldex-rag-review-editor > label:not(.worldex-rag-review-comment) { color: #9db0b9; }
    .worldex-rag-review-comment textarea { background: #070e14; }
    .worldex-rag-intent-choices { border-color: #29414d; background: #071017; }
    .worldex-rag-intent-choice { color: #9eb1ba; }
    .worldex-rag-intent-choice:hover { background: #10232c; }
    .worldex-rag-intent-choice:has(input:checked) { background: #0e3039; color: #bff8fc; }
    .worldex-rag-review-schema-head h3, .worldex-rag-result-head h3 { color: #dcebee; }
    .worldex-rag-review-schema-head span, .worldex-rag-result-head span { color: #7f96a0; }
    .worldex-rag-schema-choice-summary > strong { color: #9db0b9; }
    .worldex-rag-schema-choice.selected { border-color: #22d3ee; background: #10313a; color: #d9fbff; }
    .worldex-rag-result-text.error { border-left-color: var(--red); background: rgba(88, 28, 41, .3); color: #fda4af; }
    .worldex-rag-result-empty, .worldex-rag-saved-review-meta, .worldex-rag-page-jump { color: #81949f; }

    @keyframes dialog-materialize {
      from { opacity: 0; transform: translateY(8px) scale(.992); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes case-enter {
      from { opacity: 0; transform: translateY(8px); }
      to { opacity: 1; transform: translateY(0); }
    }

    @media (max-width: 1060px) {
      .command-center { min-width: 0; height: 100vh; height: 100dvh; height: var(--app-viewport-height); min-height: 0; }
      .command-layout { grid-template-columns: minmax(0, 1fr); }
      .command-layout > .panel { min-height: 0; }
      .topbar { gap: 12px; }
      .brand { flex: 0 0 auto; }
      .top-actions { justify-content: flex-end; }
      .preferences-grid { grid-template-columns: 1fr; }
      .preferences-grid .preference-field:nth-child(3) { grid-column: auto; }
      .template-field-choices { grid-template-columns: 1fr; }
    }
    @media (max-width: 820px) {
      .command-center { height: 100vh; height: 100dvh; height: var(--app-viewport-height); min-height: 0; overflow: hidden; grid-template-rows: calc(56px + var(--safe-area-top)) minmax(0, 1fr); }
      .topbar { min-height: calc(56px + var(--safe-area-top)); padding: calc(7px + var(--safe-area-top)) calc(10px + var(--safe-area-right)) 7px calc(10px + var(--safe-area-left)); flex-wrap: nowrap; }
      .brand { flex: 1 1 auto; }
      .top-actions { width: auto; justify-content: flex-end; }
      .settings-menu { position: fixed; top: calc(62px + var(--safe-area-top)); right: max(8px, var(--safe-area-right)); width: min(320px, calc(100vw - 16px - var(--safe-area-left) - var(--safe-area-right))); max-height: calc(var(--app-viewport-height) - 70px - var(--safe-area-top) - var(--safe-area-bottom)); }
      .command-layout { min-height: 0; grid-template-columns: minmax(0, 1fr); }
      .conversation-panel { height: 100%; min-height: 0 !important; }
      .preferences-backdrop { inset: calc(56px + var(--safe-area-top)) 0 auto; height: calc(var(--app-viewport-height) - 56px - var(--safe-area-top)); }
      .preferences-panel { inset: calc(56px + var(--safe-area-top)) var(--safe-area-right) auto auto; width: min(calc(100vw - var(--safe-area-left) - var(--safe-area-right)), 520px); height: calc(var(--app-viewport-height) - 56px - var(--safe-area-top) - var(--safe-area-bottom)); min-height: 0 !important; }
      input:not([type="checkbox"]):not([type="radio"]), textarea, select { font-size: 16px; }
      .preferences-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .preferences-grid .preference-field:nth-child(3) { grid-column: 1 / -1; }
      .template-field-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @media (max-width: 600px) {
      .messages { padding: 12px max(10px, var(--safe-area-right)) 12px max(10px, var(--safe-area-left)); }
      .msg, .msg.clarification, .msg.result, .msg.schema-review { width: 100%; max-width: 100%; }
      .chat-head { min-height: 68px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: 9px 10px; }
      .chat-head > .row { width: auto; justify-content: flex-end; }
      .chat-head #completeTrainingBtn { max-width: 118px; min-height: 38px; padding: 6px 8px; white-space: normal; font-size: 12px; }
      .agent-task-status { width: min(100%, 240px); }
      .composer { padding: 12px max(10px, var(--safe-area-right)) calc(12px + var(--safe-area-bottom)) max(10px, var(--safe-area-left)); }
      .composer .row { align-items: stretch; flex-direction: row; }
      .composer textarea { min-height: 60px; max-height: 120px; }
      .composer #customerSendBtn { width: 38px; min-width: 38px !important; height: 38px; min-height: 38px; }
      .preferences-panel { width: calc(100vw - var(--safe-area-left) - var(--safe-area-right)); border-left: 0 !important; }
      .preferences-panel-head { min-height: 62px; }
      .preferences-grid, .template-field-choices { grid-template-columns: 1fr; }
      .preferences-grid .preference-field:nth-child(3) { grid-column: auto; }
      .preference-sort-control { grid-template-columns: 18px minmax(60px, 1fr); }
      .preference-sort-control select { grid-column: 1 / -1; }
      .worldex-rag-comparison-table tbody th { background: #0d1821; }
      .worldex-rag-comparison-table tbody tr { border-bottom-color: #263c48; }
      .worldex-rag-comparison-table tbody td::before { color: #7f96a0; }
    }
    @media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
      .command-center { grid-template-rows: calc(48px + var(--safe-area-top)) minmax(0, 1fr); }
      .topbar { min-height: calc(48px + var(--safe-area-top)); padding: calc(4px + var(--safe-area-top)) calc(10px + var(--safe-area-right)) 4px calc(10px + var(--safe-area-left)); }
      .chat-head { min-height: 56px; padding-block: 6px; }
      .agent-task-status { margin-top: 2px; min-height: 26px; }
      .composer { padding-top: 8px; padding-bottom: calc(8px + var(--safe-area-bottom)); }
      .composer textarea { min-height: 44px; max-height: 72px; }
      .settings-menu { top: calc(54px + var(--safe-area-top)); max-height: calc(var(--app-viewport-height) - 62px - var(--safe-area-top) - var(--safe-area-bottom)); }
      .preferences-backdrop { inset: calc(48px + var(--safe-area-top)) 0 auto; height: calc(var(--app-viewport-height) - 48px - var(--safe-area-top)); }
      .preferences-panel { inset: calc(48px + var(--safe-area-top)) var(--safe-area-right) auto auto; height: calc(var(--app-viewport-height) - 48px - var(--safe-area-top) - var(--safe-area-bottom)); }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
      }
    }

    /* Registration, account security, and tabular customer management. */
    .auth-mode-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      margin: 0 0 14px;
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: var(--panel-soft);
    }
    .auth-mode-tabs button {
      min-height: 34px;
      border: 0;
      background: transparent;
      color: var(--muted);
    }
    .auth-mode-tabs button[aria-selected="true"] {
      background: var(--text-strong);
      color: var(--bg);
    }
    .auth-extra-fields { display: contents; }
    .auth-code-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 7px;
    }
    .auth-code-row button { min-width: 104px; white-space: nowrap; }
    button.auth-text-button {
      width: 100%;
      margin-top: 8px;
      border: 0;
      background: transparent;
      color: var(--muted);
    }
    button.auth-text-button:hover { color: var(--text-strong); background: transparent; }

    .security-dialog {
      width: min(440px, calc(100vw - 28px));
      max-width: none;
      padding: 0;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      background: var(--panel);
      color: var(--text);
      box-shadow: 0 18px 50px rgba(0, 0, 0, .36);
    }
    .security-dialog::backdrop { background: rgba(0, 0, 0, .62); }
    .security-dialog-shell { display: grid; gap: 14px; padding: 20px; }
    .security-dialog-shell > header {
      display: grid;
      grid-template-columns: 38px minmax(0, 1fr);
      gap: 11px;
      align-items: start;
    }
    .security-dialog-shell > header > .ui-icon {
      width: 36px;
      height: 36px;
      padding: 7px;
      border: 2px solid currentColor;
      border-radius: 50%;
    }
    .security-dialog-shell > header > div:only-child {
      grid-column: 1 / -1;
    }
    .security-dialog h2 { margin: 0; font-size: 18px; letter-spacing: 0; }
    .security-dialog p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
    .security-dialog label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
    .security-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
    .temporary-password-value {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      padding: 10px;
      border: 1px solid var(--line-strong);
      border-radius: 6px;
      background: var(--panel-soft);
    }
    .temporary-password-value code {
      overflow-wrap: anywhere;
      color: var(--text-strong);
      font-size: 19px;
      letter-spacing: 0;
    }

    dialog.user-management-dialog {
      width: min(1180px, calc(100vw - 32px - var(--safe-area-left) - var(--safe-area-right)));
      height: min(780px, calc(var(--app-viewport-height) - 32px));
    }
    .user-management-main {
      grid-template-rows: auto auto auto minmax(0, 1fr) auto;
      overflow: hidden;
    }
    .customer-agent-panel {
      display: grid;
      grid-template-columns: minmax(180px, 240px) minmax(280px, 1fr);
      gap: 10px 14px;
      align-items: center;
      padding: 12px 14px;
      border-bottom: 1px solid var(--line);
      background: var(--panel);
    }
    .customer-agent-heading {
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr);
      gap: 9px;
      align-items: center;
    }
    .customer-agent-heading > span {
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      border: 2px solid currentColor;
      border-radius: 50%;
    }
    .customer-agent-heading .ui-icon { width: 17px; height: 17px; }
    .customer-agent-heading div { display: grid; gap: 2px; }
    .customer-agent-heading small { color: var(--muted); font-size: 11px; }
    .customer-agent-input-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
    }
    .customer-agent-response {
      grid-column: 2;
      display: grid;
      gap: 8px;
      padding: 9px 10px;
      border-left: 3px solid var(--accent);
      background: var(--panel-soft);
      font-size: 13px;
    }
    .customer-agent-response.error { border-left-color: var(--red); }
    .customer-agent-response p { margin: 0; }
    .customer-agent-response > div { display: flex; gap: 7px; }
    .user-management-summary { display: grid; gap: 8px; }
    .user-management-filters {
      display: grid;
      grid-template-columns: minmax(240px, 1fr) repeat(4, minmax(112px, auto));
      gap: 7px;
    }
    .user-search-field {
      display: grid;
      grid-template-columns: 22px minmax(0, 1fr);
      align-items: center;
      padding-left: 8px;
      border: 1px solid var(--line);
      border-radius: 5px;
      background: var(--input);
    }
    .user-search-field .ui-icon { width: 16px; height: 16px; color: var(--muted); }
    .user-search-field input { border: 0; background: transparent; box-shadow: none; }
    .user-search-field input:focus { outline: 0; box-shadow: none; }
    .user-management-table-wrap { min-height: 0; overflow: auto; }
    .user-management-table {
      width: 100%;
      min-width: 1020px;
      border-collapse: collapse;
      table-layout: fixed;
      font-size: 12px;
    }
    .user-management-table th,
    .user-management-table td {
      padding: 9px 8px;
      border-bottom: 1px solid var(--line);
      vertical-align: middle;
      text-align: left;
      overflow-wrap: anywhere;
    }
    .user-management-table th {
      position: sticky;
      top: 0;
      z-index: 2;
      background: var(--panel-soft);
      color: var(--muted);
      font-weight: 600;
    }
    .user-management-table th:nth-child(1) { width: 150px; }
    .user-management-table th:nth-child(2) { width: 118px; }
    .user-management-table th:nth-child(3) { width: 150px; }
    .user-management-table th:nth-child(4),
    .user-management-table th:nth-child(5),
    .user-management-table th:nth-child(6) { width: 82px; }
    .user-management-table th:nth-child(7) { width: 150px; }
    .user-management-table th:nth-child(8) { width: 178px; }
    .user-management-table td strong,
    .user-management-table td small { display: block; }
    .user-management-table td small { margin-top: 3px; color: var(--muted); }
    .user-table-actions { display: flex; flex-wrap: wrap; gap: 5px; }
    .user-table-actions button { min-height: 30px; padding: 4px 7px; font-size: 11px; }
    .user-status-cell { font-weight: 600; }
    .user-status-cell.is-success, .user-status-cell.is-normal { color: var(--green); }
    .user-status-cell.is-temporary { color: var(--yellow); }
    .user-status-cell.is-expired, .user-status-cell.is-danger { color: var(--red); }
    .user-status-cell.is-muted { color: var(--muted); }
    .user-table-editor-row td { padding: 0 10px 12px; background: var(--panel-soft); }
    .user-table-editor {
      display: grid;
      grid-template-columns: repeat(6, minmax(120px, 1fr));
      gap: 8px;
      padding: 12px 0 8px;
    }
    .user-table-editor label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
    .user-table-editor input[type="checkbox"] { width: 18px; height: 18px; margin-top: 8px; }
    .user-table-editor-actions { display: flex; justify-content: flex-end; gap: 7px; }
    .user-table-empty { height: 130px; text-align: center !important; color: var(--muted); }
    .user-management-pagination {
      min-height: 48px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      padding: 8px 14px;
      border-top: 1px solid var(--line);
      background: var(--panel);
    }

    html[data-theme="light"] .auth-mode-tabs button[aria-selected="true"] { background: #101719; color: #fff; }
    html[data-theme="light"] .security-dialog,
    html[data-theme="light"] .customer-agent-panel,
    html[data-theme="light"] .user-management-pagination { background: #fff; }
    html[data-theme="light"] .user-management-table th,
    html[data-theme="light"] .user-table-editor-row td { background: #f2f6f7; }

    @media (max-width: 760px) {
      dialog.user-management-dialog {
        width: calc(100vw - 14px - var(--safe-area-left) - var(--safe-area-right));
        height: calc(var(--app-viewport-height) - 14px - var(--safe-area-top) - var(--safe-area-bottom));
      }
      .customer-agent-panel { grid-template-columns: 1fr; }
      .customer-agent-response { grid-column: 1; }
      .user-management-form-grid { grid-template-columns: 1fr 1fr; }
      .user-management-filters { grid-template-columns: 1fr 1fr; }
      .user-search-field { grid-column: 1 / -1; }
      .user-management-table { min-width: 940px; }
      .user-table-editor { grid-template-columns: 1fr 1fr; }
      .security-dialog-actions { flex-wrap: wrap; }
    }

    /* Booking intake and order-processing workspace. */
    .top-actions button.booking-entry-button,
    html[data-theme="light"] .top-actions button.booking-entry-button {
      min-height: 40px;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 0 12px;
      border: 2px solid #090909;
      border-radius: 6px;
      background: #fff;
      color: #090909;
      box-shadow: none;
      font-weight: 800;
    }
    .top-actions button.booking-entry-button:hover:not(:disabled),
    html[data-theme="light"] .top-actions button.booking-entry-button:hover:not(:disabled) {
      border-color: #090909;
      background: #e9edef;
      color: #090909;
      box-shadow: none;
      transform: none;
    }
    .booking-entry-button .ui-icon { width: 18px; height: 18px; flex-basis: 18px; }
    .booking-tab-hint { display: inline-flex; align-items: center; min-height: 19px; margin-left: 3px; padding: 1px 6px; border: 1px solid currentColor; border-radius: 5px; color: inherit; font-size: 10px; font-family: inherit; font-weight: 800; letter-spacing: .04em; line-height: 1; opacity: .9; box-shadow: 0 1px 0 currentColor; }
    .booking-entry-button:hover .booking-tab-hint { background: rgba(255,255,255,.18); }
    .quote-human-note { margin: 8px 0 4px; color: inherit; font-size: inherit; font-weight: 600; line-height: inherit; }
    .booking-agent-status { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
    .booking-agent-status[data-state="saved"],
    .booking-agent-status[data-state="saved_with_warning"],
    .booking-agent-status[data-state="submitted"] { color: #78d9b0; }
    .booking-agent-status[data-state="failed"],
    .booking-agent-status[data-state="attachments_pending"],
    .booking-agent-status[data-state="needs_verification"],
    .booking-agent-status[data-state="needs_information"],
    .booking-agent-error { color: #f5a0af !important; }
    .booking-agent-error { font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
    html[data-theme="light"] .booking-agent-status[data-state="saved"],
    html[data-theme="light"] .booking-agent-status[data-state="saved_with_warning"],
    html[data-theme="light"] .booking-agent-status[data-state="submitted"] { color: #147550; }
    html[data-theme="light"] .booking-agent-status[data-state="failed"],
    html[data-theme="light"] .booking-agent-status[data-state="attachments_pending"],
    html[data-theme="light"] .booking-agent-status[data-state="needs_verification"],
    html[data-theme="light"] .booking-agent-status[data-state="needs_information"],
    html[data-theme="light"] .booking-agent-error { color: #a72639 !important; }
    .booking-count-badge {
      min-width: 20px;
      height: 20px;
      display: inline-grid;
      place-items: center;
      padding: 0 5px;
      border: 2px solid #090909;
      border-radius: 10px;
      background: #facc15;
      color: #090909;
      font-size: 11px;
      line-height: 1;
    }
    .booking-drop-overlay {
      position: fixed;
      z-index: 300;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 24px;
      background: rgba(2, 7, 10, .72);
      backdrop-filter: blur(4px);
      pointer-events: auto;
      width: 100vw;
      height: 100dvh;
      max-width: none;
      max-height: none;
      box-sizing: border-box;
      margin: 0;
      border: 0;
    }
    html.has-file-drag iframe { pointer-events: none !important; }
    .booking-drop-overlay::backdrop { background: transparent; }
    .booking-drop-target > span { font-size: 13px; line-height: 1.6; padding: 0 20px; text-align: center; }
    .booking-flow-card { margin: 16px 0 8px 44px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
    .booking-flow-title { display: block; font-size: 17px; }
    .booking-flow-offer { margin-top: 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; color: var(--text); font-weight: 600; }
    .booking-flow-help, .booking-flow-files, .booking-flow-progress { font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
    .booking-flow-help { color: var(--muted); }
    .booking-flow-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
    .booking-upload-mode { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 8px; margin: 4px 0 0; }
    .booking-upload-mode legend { padding: 0 5px; font-size: 12px; }
    .booking-upload-mode label { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; cursor: pointer; }
    .booking-upload-mode input { width: 15px; min-width: 15px; margin-top: 3px; }
    .booking-upload-mode label > span { display: grid; gap: 3px; }
    .booking-upload-mode small { color: var(--muted); line-height: 1.5; }
    .booking-batch-card { margin: 16px 0 8px 44px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
    .booking-batch-summary { color: var(--muted); font-size: 13px; line-height: 1.7; }
    .booking-batch-item { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding: 12px 0; }
    .booking-batch-item-copy { flex: 1 1 180px; display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
    .booking-batch-item-copy > span { color: var(--muted); font-size: 12px; }
    .booking-batch-item .booking-agent-error { margin: 0; }
    @media (max-width: 600px) { .booking-batch-card { margin-left: 0; padding: 14px; } }
    @media (max-width: 600px) { .booking-flow-card { margin-left: 0; padding: 14px; } }
    .booking-drop-target {
      width: min(520px, 100%);
      min-height: 210px;
      display: grid;
      place-items: center;
      align-content: center;
      gap: 14px;
      border: 3px dashed #fff;
      border-radius: 8px;
      background: #0a1117;
      color: #fff;
      font-size: 18px;
    }
    .booking-drop-target .ui-icon { width: 42px; height: 42px; }
    dialog.booking-intake-dialog,
    dialog.booking-pool-dialog {
      width: min(1120px, calc(100vw - 28px));
      max-width: none;
      max-height: calc(100dvh - 28px);
      margin: auto;
      padding: 0;
      overflow: hidden;
      border: 1px solid #38505b;
      border-radius: 8px;
      background: #081017;
      color: #dce8ec;
      box-shadow: 0 28px 80px rgba(0, 0, 0, .58);
    }
    dialog.booking-pool-dialog { width: min(1480px, calc(100vw - 28px)); }
    dialog.booking-intake-dialog::backdrop,
    dialog.booking-pool-dialog::backdrop { background: rgba(1, 5, 8, .72); }
    .booking-intake-shell,
    .booking-pool-shell {
      min-height: 0;
      max-height: calc(100dvh - 30px);
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      overflow: hidden;
      background: #081017;
    }
    .booking-dialog-head {
      min-height: 70px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 12px 16px;
      border-bottom: 1px solid #263b45;
      background: #0b151d;
    }
    .booking-dialog-head h2 { margin: 0; color: #f4fbfc; font-size: 18px; letter-spacing: 0; }
    .booking-dialog-head .status { min-height: 16px; margin-top: 4px; }
    .booking-intake-layout {
      min-height: 0;
      display: grid;
      grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
      overflow: hidden;
    }
    .booking-intake-main {
      min-width: 0;
      overflow-y: auto;
      padding: 18px;
    }
    .booking-drop-zone {
      min-height: 190px;
      display: grid;
      place-items: center;
      align-content: center;
      gap: 9px;
      padding: 20px;
      border: 2px dashed #526975;
      border-radius: 8px;
      background: #0a131a;
      color: #e7f2f4;
      text-align: center;
      cursor: pointer;
    }
    .booking-drop-zone:hover,
    .booking-drop-zone.is-dragging { border-color: #e7f2f4; background: #111d24; }
    .booking-drop-zone > .ui-icon { width: 36px; height: 36px; }
    .booking-drop-zone > span { color: #89a0aa; font-size: 12px; }
    .booking-file-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 5px; }
    .booking-file-actions button,
    .booking-download-link {
      min-height: 36px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 7px 11px;
      border: 2px solid #090909;
      border-radius: 6px;
      background: #fff;
      color: #090909;
      font-weight: 700;
      text-decoration: none;
    }
    .booking-file-actions button .ui-icon,
    .booking-download-link .ui-icon { width: 17px; height: 17px; flex-basis: 17px; }
    .booking-files-head,
    .customer-booking-history-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: 18px;
      padding-bottom: 8px;
      border-bottom: 1px solid #263a44;
    }
    .booking-files-head span { color: #8398a1; font-size: 12px; }
    .booking-pending-files { display: grid; gap: 7px; margin-top: 9px; }
    .booking-pending-empty,
    .customer-booking-empty,
    .booking-pool-empty {
      padding: 20px 10px;
      color: #78909a;
      text-align: center;
      font-size: 13px;
    }
    .booking-pending-file {
      min-width: 0;
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr) auto;
      align-items: center;
      gap: 9px;
      padding: 8px 9px;
      border: 1px solid #2a3e48;
      border-radius: 6px;
      background: #0c171e;
    }
    .booking-file-mark {
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      border: 2px solid #090909;
      border-radius: 50%;
      background: #fff;
      color: #090909;
    }
    .booking-file-mark .ui-icon { width: 17px; height: 17px; flex-basis: 17px; }
    .booking-pending-file-copy { min-width: 0; display: grid; gap: 2px; }
    .booking-pending-file-copy strong { overflow: hidden; color: #e4eef1; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
    .booking-pending-file-copy span { color: #7f949d; font-size: 11px; }
    .booking-pending-file button { width: 32px; min-width: 32px; height: 32px; min-height: 32px; }
    .booking-pending-file button .ui-icon { width: 15px; height: 15px; flex-basis: 15px; }
    .booking-remarks-field { display: grid; gap: 7px; margin-top: 16px; color: #c8d6db; font-size: 13px; }
    .booking-remarks-field textarea { min-height: 86px; }
    .booking-intake-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
    .booking-intake-actions button { min-width: 150px; }
    .customer-booking-history {
      min-width: 0;
      min-height: 0;
      overflow-y: auto;
      padding: 0 14px 14px;
      border-left: 1px solid #263a44;
      background: #091219;
    }
    .customer-booking-history-head { position: sticky; z-index: 2; top: 0; margin: 0; padding: 15px 0 10px; background: #091219; }
    .customer-booking-list { display: grid; gap: 8px; padding-top: 9px; }
    .customer-booking-item,
    .booking-pool-item {
      min-width: 0;
      display: grid;
      gap: 6px;
      padding: 10px;
      border: 1px solid #2a3f49;
      border-radius: 7px;
      background: #0c171e;
      color: #dbe7ea;
    }
    .customer-booking-item-head,
    .booking-pool-item-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .customer-booking-item-head strong,
    .booking-pool-item-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .booking-status-pill {
      flex: 0 0 auto;
      padding: 3px 7px;
      border: 1px solid #61727a;
      border-radius: 10px;
      color: #c9d5d9;
      font-size: 11px;
      line-height: 1.2;
    }
    .booking-status-pill[data-status="awaiting_assignment"] { border-color: #d7ad34; color: #f8d66d; }
    .booking-status-pill[data-status="awaiting_review"] { border-color: #4aa6b6; color: #8ee4ef; }
    .booking-status-pill[data-status="submitted"] { border-color: #45a477; color: #8ce4b9; }
    .booking-status-pill[data-status="failed"] { border-color: #c15e70; color: #f5a0af; }
    .customer-booking-item p,
    .booking-pool-item p { margin: 0; overflow-wrap: anywhere; color: #9eb0b7; font-size: 12px; line-height: 1.4; }
    .customer-booking-item-meta,
    .booking-pool-item-meta { display: flex; flex-wrap: wrap; gap: 5px 9px; color: #738993; font-size: 11px; }
    .booking-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
    .booking-mode-pill {
      padding: 3px 7px;
      border: 1px solid #d2a83a;
      border-radius: 10px;
      color: #f3ce69;
      font-size: 11px;
      font-weight: 700;
    }
    .booking-mode-pill.live { border-color: #48a276; color: #8be2b7; }
    .booking-pool-head-actions { display: flex; align-items: center; gap: 8px; }
    .booking-submission-count { color: #8ca1a9; font-size: 12px; }
    .booking-pool-layout {
      min-height: 0;
      display: grid;
      grid-template-columns: 300px minmax(0, 1fr);
      overflow: hidden;
    }
    .booking-pool-sidebar {
      min-height: 0;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      border-right: 1px solid #263a44;
      background: #091219;
    }
    .booking-filter-field { display: grid; gap: 5px; padding: 11px; border-bottom: 1px solid #263a44; color: #8ea2aa; font-size: 11px; }
    .booking-filter-field select { min-height: 36px; }
    .booking-pool-list { min-height: 0; display: grid; grid-auto-rows: max-content; gap: 7px; overflow-y: auto; padding: 9px; }
    button.booking-pool-item {
      width: 100%;
      min-height: 0;
      text-align: left;
      box-shadow: none;
    }
    button.booking-pool-item:hover:not(:disabled) { border-color: #70858e; background: #111f27; box-shadow: none; transform: none; }
    button.booking-pool-item.active { border-color: #dce7ea; background: #14222a; box-shadow: inset 3px 0 #dce7ea; }
    .booking-workspace { min-width: 0; min-height: 0; overflow: hidden; background: #081017; }
    .booking-workspace-empty { height: 100%; display: grid; place-items: center; align-content: center; gap: 12px; color: #738892; }
    .booking-workspace-empty .ui-icon { width: 40px; height: 40px; }
    .booking-workspace-content { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
    .booking-workspace-head {
      min-height: 58px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 9px 13px;
      border-bottom: 1px solid #263a44;
      background: #0a141b;
    }
    .booking-workspace-head > div:first-child { min-width: 0; display: grid; gap: 3px; }
    .booking-workspace-head strong { color: #eef7f8; font-size: 15px; }
    .booking-workspace-head span { overflow: hidden; color: #8398a1; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
    .booking-assignment-control { display: flex; align-items: center; gap: 7px; }
    .booking-assignment-control select { min-width: 170px; }
    .booking-compare-layout { min-height: 0; display: grid; grid-template-columns: minmax(410px, .92fr) minmax(420px, 1.08fr); overflow: hidden; }
    .booking-form-pane,
    .booking-document-pane { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
    .booking-form-pane { grid-template-rows: auto auto minmax(0, 1fr); border-right: 1px solid #263a44; }
    .booking-form-pane > .booking-pane-head { grid-row: 1; }
    .booking-form-pane > .booking-review-warnings { grid-row: 2; align-self: start; max-height: 96px; overflow-y: auto; margin: 6px 12px 0; padding: 6px 8px; }
    .booking-form-pane > .booking-review-warnings p { margin: 0; }
    .booking-form-pane > .booking-review-form { grid-row: 3; }
    .booking-document-pane { grid-template-rows: auto auto minmax(0, 1fr); background: #0a1218; }
    .booking-pane-head {
      min-height: 54px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 9px 13px;
      border-bottom: 1px solid #263a44;
      background: #0b151c;
    }
    .booking-pane-head > div { min-width: 0; display: grid; gap: 2px; }
    .booking-pane-head strong { color: #e9f3f5; font-size: 13px; }
    .booking-pane-head span { color: #78909a; font-size: 11px; }
    .booking-review-form {
      min-height: 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      align-content: start;
      overflow-y: auto;
      padding: 13px;
    }
    .booking-review-field { min-width: 0; display: grid; gap: 5px; color: #92a5ad; font-size: 11px; }
    .booking-review-field.wide { grid-column: 1 / -1; }
    .booking-manual-schedule { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--border, #304952); border-radius: 8px; }
    .booking-manual-schedule legend { padding: 0 5px; color: var(--text, #dce9ed); font-size: 12px; font-weight: 600; }
    .booking-manual-schedule-hint { grid-column: 1 / -1; margin: 0; color: var(--muted, #78909a); font-size: 11px; line-height: 1.5; }
    .booking-review-field textarea { min-height: 76px; }
    .booking-review-form input:disabled,
    .booking-review-form textarea:disabled { color: #82949b; background: #091017; opacity: .75; }
    .booking-document-tabs { display: flex; gap: 1px; overflow-x: auto; padding: 8px 10px; border-bottom: 1px solid #263a44; background: #091219; }
    .booking-document-tabs button {
      min-width: 110px;
      max-width: 190px;
      min-height: 34px;
      overflow: hidden;
      border-radius: 5px;
      color: #91a4ac;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .booking-document-tabs button.active { border-color: #dce7ea; background: #e7edef; color: #090909; }
    .booking-document-preview {
      min-width: 0;
      min-height: 0;
      overflow: auto;
      background: #11191e;
    }
    .booking-document-preview img { width: 100%; height: 100%; display: block; object-fit: contain; background: #20282d; }
    .booking-document-preview iframe { width: 100%; height: 100%; min-height: 460px; display: block; border: 0; background: #fff; }
    .booking-document-preview pre { min-height: 100%; margin: 0; padding: 18px; background: #f6f7f7; color: #111; font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
    .booking-preview-fallback { min-height: 260px; display: grid; place-items: center; align-content: center; gap: 12px; padding: 20px; color: #8ea1a9; text-align: center; }
    .booking-preview-fallback .ui-icon { width: 38px; height: 38px; }
    .booking-workspace-actions {
      min-height: 62px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 13px;
      border-top: 1px solid #263a44;
      background: #0b151c;
    }
    .booking-workspace-actions > div { display: flex; gap: 8px; }
    .booking-workspace-actions button { min-width: 104px; }
    .booking-mobile-tabs { display: none; }

    html[data-theme="light"] dialog.booking-intake-dialog,
    html[data-theme="light"] dialog.booking-pool-dialog,
    html[data-theme="light"] .booking-intake-shell,
    html[data-theme="light"] .booking-pool-shell,
    html[data-theme="light"] .booking-workspace { border-color: #bcc8cd; background: #f7f9fa; color: #17242a; }
    html[data-theme="light"] .booking-dialog-head,
    html[data-theme="light"] .booking-workspace-head,
    html[data-theme="light"] .booking-pane-head,
    html[data-theme="light"] .booking-workspace-actions { border-color: #ccd6da; background: #fff; }
    html[data-theme="light"] .booking-dialog-head h2,
    html[data-theme="light"] .booking-workspace-head strong,
    html[data-theme="light"] .booking-pane-head strong { color: #17242a; }
    html[data-theme="light"] .booking-drop-zone,
    html[data-theme="light"] .booking-pending-file,
    html[data-theme="light"] .customer-booking-item,
    html[data-theme="light"] button.booking-pool-item { border-color: #c9d4d8; background: #fff; color: #17242a; }
    html[data-theme="light"] .booking-drop-zone:hover,
    html[data-theme="light"] .booking-drop-zone.is-dragging,
    html[data-theme="light"] button.booking-pool-item:hover:not(:disabled),
    html[data-theme="light"] button.booking-pool-item.active { border-color: #65777f; background: #eef2f3; }
    html[data-theme="light"] .booking-pending-file-copy strong,
    html[data-theme="light"] .customer-booking-item-head strong,
    html[data-theme="light"] .booking-pool-item-head strong { color: #17242a; }
    html[data-theme="light"] .customer-booking-history,
    html[data-theme="light"] .customer-booking-history-head,
    html[data-theme="light"] .booking-pool-sidebar,
    html[data-theme="light"] .booking-document-pane,
    html[data-theme="light"] .booking-document-tabs { border-color: #ccd6da; background: #f0f4f5; }
    html[data-theme="light"] .booking-review-form input:disabled,
    html[data-theme="light"] .booking-review-form textarea:disabled { color: #63757d; background: #edf1f2; }

    @media (max-width: 900px) {
      dialog.booking-intake-dialog,
      dialog.booking-pool-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
      .booking-intake-shell,
      .booking-pool-shell { height: 100dvh; max-height: 100dvh; }
      .booking-intake-layout { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
      .booking-intake-main { overflow: visible; }
      .customer-booking-history { min-height: 240px; overflow: visible; border-top: 1px solid #263a44; border-left: 0; }
      .customer-booking-history-head { position: static; }
      .booking-pool-layout { grid-template-columns: minmax(220px, 38vw) minmax(0, 1fr); }
      .booking-workspace-content { grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; }
      .booking-compare-layout { grid-template-columns: minmax(0, 1fr); }
      .booking-mobile-tabs { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border-bottom: 1px solid #263a44; background: #263a44; }
      .booking-mobile-tabs button { min-height: 40px; border: 0; border-radius: 0; }
      .booking-mobile-tabs button.active { background: #e8edef; color: #090909; }
      .booking-compare-layout[data-mobile-pane="form"] .booking-document-pane,
      .booking-compare-layout[data-mobile-pane="document"] .booking-form-pane { display: none; }
      .booking-form-pane { border-right: 0; }
    }

    @media (max-width: 620px) {
      .top-actions button.booking-entry-button { width: 40px; min-width: 40px; padding: 0; justify-content: center; border-radius: 50%; }
      .booking-entry-button > span:not(.booking-count-badge) { display: none; }
      .booking-entry-button .booking-count-badge { position: absolute; top: -4px; right: -4px; }
      .booking-entry-button { position: relative; }
      .booking-dialog-head { min-height: 64px; padding: 9px 11px; }
      .booking-pool-head-actions > button:not(.icon-circle),
      .booking-submission-count { display: none; }
      .booking-pool-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(150px, 34vh) minmax(0, 1fr); }
      .booking-pool-sidebar { border-right: 0; border-bottom: 1px solid #263a44; }
      .booking-pool-list { grid-template-columns: repeat(2, minmax(220px, 1fr)); overflow-x: auto; overflow-y: hidden; }
      .booking-workspace-head { align-items: flex-start; flex-direction: column; }
      .booking-assignment-control { width: 100%; }
      .booking-assignment-control select { min-width: 0; flex: 1; }
      .booking-review-form { grid-template-columns: minmax(0, 1fr); }
      .booking-review-field.wide { grid-column: 1; }
      .booking-workspace-actions { align-items: stretch; flex-direction: column; }
      .booking-workspace-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
      .booking-workspace-actions button { min-width: 0; }
      .booking-intake-main { padding: 12px; }
      .booking-drop-zone { min-height: 165px; }
    }

    /* Customer-facing multimodal composer */
    .composer {
      gap: 8px;
      padding-top: 11px;
    }
    .composer::before { inset-inline: 34%; }
    .composer > .status {
      width: min(820px, 100%);
      margin: 0 auto;
    }
    .composer-shell {
      width: min(820px, 100%);
      margin: 0 auto;
      display: grid;
      gap: 3px;
      padding: 7px 8px 7px 14px;
      border: 1px solid #2b414c;
      border-radius: 24px;
      background: #0b141b;
      box-shadow: 0 10px 28px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .025);
      transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
    }
    .composer-shell:focus-within {
      border-color: #3a7080;
      background: #0c171f;
      box-shadow: 0 12px 32px rgba(0, 0, 0, .24), 0 0 0 3px rgba(34, 211, 238, .07);
    }
    .composer .composer-shell textarea {
      width: 100%;
      min-height: 32px;
      max-height: 128px;
      margin: 0;
      padding: 5px 3px 2px;
      overflow-y: auto;
      border: 0;
      border-radius: 0;
      outline: 0;
      resize: none;
      background: transparent;
      box-shadow: none;
      color: #ecf6f8;
      line-height: 1.5;
    }
    .composer .composer-shell textarea::placeholder { color: #6f838d; }
    .composer .composer-shell textarea:focus { border: 0; outline: 0; box-shadow: none; }
    .composer-actions {
      min-height: 38px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .composer-tools { display: flex; align-items: center; gap: 3px; }
    .composer-attachment-picker { position: relative; }
    .composer-attachment-menu {
      position: absolute;
      bottom: calc(100% + 12px);
      left: 0;
      z-index: 40;
      width: 164px;
      padding: 4px;
      border: 1px solid #60767e;
      border-radius: 8px;
      background: #132129;
      box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    }
    .composer-attachment-menu button {
      display: flex;
      align-items: center;
      gap: 9px;
      width: 100%;
      min-height: 40px;
      padding: 8px;
      border: 0;
      border-radius: 4px;
      background: transparent;
      color: #f1f5f4;
      text-align: left;
      white-space: nowrap;
    }
    .composer-attachment-menu button:hover,
    .composer-attachment-menu button:focus-visible { background: #245247; }
    .composer-booking-attachments {
      width: min(820px, 100%);
      margin: 0 auto 8px;
    }
    .composer-booking-files { max-height: 150px; overflow-y: auto; }
    .composer-booking-files .booking-pending-file { margin-bottom: 4px; }
    .composer-booking-files .booking-pending-file-copy { min-width: 0; }
    .composer-booking-files .booking-pending-file-copy strong { overflow-wrap: anywhere; }
    html[data-theme="light"] .composer-attachment-menu { background: #fff; border-color: #bac9c4; }
    html[data-theme="light"] .composer-attachment-menu button { color: #172126; }
    html[data-theme="light"] .composer-attachment-menu button:hover,
    html[data-theme="light"] .composer-attachment-menu button:focus-visible { background: #e3f1e9; }
    button.composer-icon-button,
    button.composer-send-button {
      width: 36px;
      min-width: 36px;
      height: 36px;
      min-height: 36px;
      display: grid;
      place-items: center;
      padding: 0;
      border: 0;
      border-radius: 50%;
      background: transparent;
      color: #91a5ae;
      box-shadow: none;
      line-height: 1;
      touch-action: manipulation;
      user-select: none;
      -webkit-user-select: none;
    }
    button.composer-icon-button:hover:not(:disabled),
    button.composer-icon-button:focus-visible {
      border: 0;
      outline: 0;
      background: #16252d;
      color: #e2f5f7;
      box-shadow: inset 0 0 0 1px #29444f;
    }
    button.composer-icon-button > span { font-size: 17px; filter: grayscale(1); }
    button#voiceInputBtn {
      touch-action: none;
      transition: width .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease;
    }
    button#voiceInputBtn:active:not(:disabled) { transform: scale(.97); }
    button.composer-icon-button.is-listening {
      background: rgba(8, 145, 178, .19);
      color: #8df3ff;
      box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .55), 0 0 16px rgba(34, 211, 238, .11);
    }
    .voice-level {
      height: 18px;
      display: none;
      align-items: center;
      gap: 2px;
    }
    .voice-level i {
      width: 2px;
      height: 6px;
      border-radius: 2px;
      background: currentColor;
      animation: voice-level .72s ease-in-out infinite alternate;
    }
    .voice-level i:nth-child(2) { height: 12px; animation-delay: .16s; }
    .voice-level i:nth-child(3) { height: 8px; animation-delay: .3s; }
    .is-listening .voice-glyph { display: none; }
    .is-listening .voice-level { display: flex; }
    .voice-button-label { display: none; letter-spacing: 0; white-space: nowrap; }
    button#voiceInputBtn.is-transcribing {
      background: rgba(8, 145, 178, .13);
      color: #8edce6;
      box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .3);
    }
    button#voiceInputBtn.is-transcribing .voice-glyph { display: none; }
    button#voiceInputBtn.is-transcribing .voice-level { display: flex; }
    button.composer-send-button {
      position: relative;
      background: #dffafd;
      color: #082029;
      font-size: 23px;
      font-weight: 700;
      transition: transform .14s ease, background-color .14s ease, opacity .14s ease;
    }
    button.composer-send-button:hover:not(:disabled),
    button.composer-send-button:focus-visible {
      border: 0;
      outline: 0;
      background: #ffffff;
      color: #061a22;
      transform: translateY(-1px);
      box-shadow: 0 5px 14px rgba(34, 211, 238, .16);
    }
    button.composer-send-button:disabled { opacity: .26; }
    button.composer-send-button.is-busy .send-glyph { opacity: 0; }
    button.composer-send-button.is-busy::after {
      content: "";
      position: absolute;
      width: 14px;
      height: 14px;
      border: 2px solid rgba(8, 32, 41, .25);
      border-top-color: #082029;
      border-radius: 50%;
      animation: composer-spin .8s linear infinite;
    }
    .composer-attachment {
      width: min(820px, 100%);
      min-height: 62px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: 48px minmax(0, 1fr) 34px;
      gap: 10px;
      align-items: center;
      padding: 7px 8px;
      border: 1px solid #273e49;
      border-radius: 14px;
      background: #0b151d;
    }
    .attachment-thumbnail-wrap {
      position: relative;
      width: 48px;
      height: 48px;
      overflow: hidden;
      border: 1px solid #35505c;
      border-radius: 9px;
      background: #071016;
    }
    .attachment-thumbnail { width: 100%; height: 100%; display: block; object-fit: cover; }
    .attachment-busy {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      background: rgba(5, 12, 17, .64);
    }
    .attachment-busy::after {
      content: "";
      width: 17px;
      height: 17px;
      border: 2px solid rgba(255, 255, 255, .25);
      border-top-color: #7eeef7;
      border-radius: 50%;
      animation: composer-spin .8s linear infinite;
    }
    .attachment-copy { min-width: 0; display: grid; gap: 2px; }
    .attachment-copy strong {
      overflow: hidden;
      color: #dcecef;
      font-size: 12px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .attachment-copy span { color: #7f959f; font-size: 11px; }
    .attachment-copy span.is-error { color: #fda4af; }
    button.attachment-remove { color: #718791; font-size: 20px; }
    .agent-activity {
      width: max-content;
      max-width: min(86%, 520px);
      min-height: 44px;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 12px;
      border: 1px solid #263e49;
      border-radius: 16px;
      background: rgba(10, 20, 27, .94);
      color: #a9bbc2;
      box-shadow: 0 9px 24px rgba(0, 0, 0, .16);
      animation: message-enter .18s ease both;
    }
    .agent-activity-orbit {
      width: 24px;
      height: 20px;
      flex: 0 0 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 3px;
    }
    .agent-activity-orbit i {
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: #67e8f9;
      box-shadow: 0 0 8px rgba(34, 211, 238, .42);
      animation: activity-jump .8s ease-in-out infinite;
    }
    .agent-activity-orbit i:nth-child(2) { animation-delay: .13s; }
    .agent-activity-orbit i:nth-child(3) { animation-delay: .26s; }
    .agent-activity-copy { min-width: 0; display: grid; gap: 1px; }
    .agent-activity-copy strong { color: #e2f5f7; font-size: 12px; font-weight: 700; }
    .agent-activity-copy span {
      overflow: hidden;
      color: #708892;
      font-size: 11px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    @keyframes composer-spin { to { transform: rotate(360deg); } }
    @keyframes activity-jump {
      0%, 60%, 100% { transform: translateY(0); opacity: .45; }
      30% { transform: translateY(-5px); opacity: 1; }
    }
    @keyframes voice-level { from { transform: scaleY(.55); } to { transform: scaleY(1.15); } }

    @media (max-width: 600px) {
      .composer {
        padding: 8px max(8px, var(--safe-area-right)) calc(8px + var(--safe-area-bottom)) max(8px, var(--safe-area-left));
      }
      .composer-shell {
        gap: 1px;
        padding: 6px 7px 6px 12px;
        border-radius: 22px;
      }
      .composer .composer-shell textarea { min-height: 29px; max-height: 96px; padding-top: 4px; }
      .composer-actions { min-height: 38px; }
      button.composer-icon-button,
      button.composer-send-button {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
      }
      button#voiceInputBtn {
        width: 124px;
        min-width: 124px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 0 12px;
        border-radius: 19px;
        background: #12212a;
        box-shadow: inset 0 0 0 1px #29414c;
      }
      button#voiceInputBtn .voice-button-label {
        display: inline;
        overflow: hidden;
        color: currentColor;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        text-overflow: ellipsis;
        filter: none;
      }
      button#voiceInputBtn.is-listening {
        background: rgba(8, 145, 178, .25);
        box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .68), 0 0 18px rgba(34, 211, 238, .13);
      }
      .composer-attachment { min-height: 58px; border-radius: 13px; }
      .agent-activity { max-width: 94%; border-radius: 15px; }
    }

    @media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
      .composer { padding-top: 6px; padding-bottom: calc(6px + var(--safe-area-bottom)); }
      .composer .composer-shell textarea { min-height: 27px; max-height: 54px; }
      .composer-attachment { min-height: 52px; }
      .attachment-thumbnail-wrap { width: 42px; height: 42px; }
    }

    dialog.worldex-reference-dialog {
      width: min(1180px, calc(100vw - 32px));
      max-width: none;
      height: min(88dvh, 920px);
      max-height: calc(100dvh - 28px);
      padding: 0;
      overflow: hidden;
      border: 1px solid #28414d;
      border-radius: 8px;
      background: #070e14;
      color: var(--text);
      box-shadow: 0 30px 90px rgba(0, 0, 0, .56);
    }
    .worldex-reference-shell {
      height: 100%;
      min-height: 0;
      display: grid;
      grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
      background: #070e14;
    }
    .worldex-reference-head {
      min-height: 68px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 14px 18px;
      border-bottom: 1px solid #203640;
      background: #09131a;
    }
    .worldex-reference-head h2 { margin: 0 0 3px; color: #ecfbfd; font-size: 19px; }
    .worldex-reference-head > button {
      width: 36px;
      min-width: 36px;
      height: 36px;
      padding: 0;
      font-size: 23px;
    }
    .worldex-reference-summary {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 1px;
      border-bottom: 1px solid #203640;
      background: #203640;
    }
    .worldex-reference-summary > div {
      min-height: 70px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 13px 18px;
      background: #0a151c;
    }
    .worldex-reference-summary span { color: #849aa4; font-size: 12px; }
    .worldex-reference-summary strong { color: #bff8fc; font-size: 23px; font-variant-numeric: tabular-nums; }
    .worldex-reference-toolbar {
      display: grid;
      grid-template-columns: 150px 130px minmax(220px, 1fr) auto;
      gap: 10px;
      align-items: end;
      padding: 12px 16px;
      border-bottom: 1px solid #203640;
      background: #09131a;
    }
    .worldex-reference-toolbar label,
    .worldex-reference-editor label {
      min-width: 0;
      display: grid;
      gap: 5px;
      color: #8ea3ad;
      font-size: 11px;
    }
    .worldex-reference-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 7px;
    }
    .worldex-reference-sync-meta {
      min-height: 34px;
      padding: 9px 16px;
      border-bottom: 1px solid #1a2d36;
      background: #071017;
      color: #78909b;
      font-size: 11px;
      line-height: 1.45;
    }
    .worldex-reference-sync-meta.error { color: #fda4af; }
    .worldex-reference-editor {
      display: grid;
      gap: 11px;
      padding: 13px 16px;
      border-bottom: 1px solid #2c5260;
      background: #0b1c24;
    }
    .worldex-reference-editor.hidden { display: none; }
    .worldex-reference-editor-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .worldex-reference-editor-head strong { color: #dffafd; }
    .worldex-reference-editor-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }
    .worldex-reference-editor-actions { display: flex; justify-content: flex-end; }
    .worldex-reference-list-wrap {
      min-height: 0;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      background: #070e14;
    }
    .worldex-reference-list-head {
      min-height: 42px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 9px 16px;
      border-bottom: 1px solid #1e333d;
      background: #09131a;
    }
    .worldex-reference-list {
      min-height: 0;
      overflow: auto;
      overscroll-behavior: contain;
    }
    .worldex-reference-row {
      min-height: 64px;
      display: grid;
      grid-template-columns: 104px minmax(0, 1fr) 72px auto;
      gap: 14px;
      align-items: center;
      padding: 10px 16px;
      border-bottom: 1px solid #172a33;
      background: #081118;
      transition: background-color .14s ease;
    }
    .worldex-reference-row:hover { background: #0b1820; }
    .worldex-reference-row.disabled { opacity: .58; }
    .worldex-reference-kind {
      width: max-content;
      padding: 4px 7px;
      border: 1px solid #315866;
      border-radius: 5px;
      color: #a5f3fc;
      font-size: 11px;
    }
    .worldex-reference-content { min-width: 0; display: grid; gap: 4px; }
    .worldex-reference-content strong {
      overflow-wrap: anywhere;
      color: #dcebee;
      font-size: 13px;
      letter-spacing: 0;
    }
    .worldex-reference-content span { color: #718791; font-size: 10px; }
    .worldex-reference-state {
      width: max-content;
      padding: 3px 7px;
      border: 1px solid #344955;
      border-radius: 5px;
      color: #91a4ad;
      font-size: 10px;
    }
    .worldex-reference-state.enabled {
      border-color: rgba(52, 211, 153, .38);
      color: #6ee7b7;
    }
    .worldex-reference-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
    .worldex-reference-row-actions button { min-height: 32px; padding: 5px 10px; }
    .worldex-reference-footer {
      min-height: 52px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 9px 16px;
      border-top: 1px solid #203640;
      background: #09131a;
    }

    @media (max-width: 820px) {
      dialog.worldex-reference-dialog {
        width: calc(100vw - var(--safe-area-left) - var(--safe-area-right));
        height: calc(var(--app-viewport-height) - var(--safe-area-top) - var(--safe-area-bottom));
        max-height: none;
        margin: var(--safe-area-top) var(--safe-area-right) var(--safe-area-bottom) var(--safe-area-left);
        border-radius: 0;
      }
      .worldex-reference-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .worldex-reference-summary > div { min-height: 54px; padding: 9px 12px; }
      .worldex-reference-summary strong { font-size: 18px; }
      .worldex-reference-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
      .worldex-reference-query, .worldex-reference-actions { grid-column: 1 / -1; }
      .worldex-reference-actions { justify-content: flex-start; }
      .worldex-reference-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .worldex-reference-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
        padding: 10px 12px;
      }
      .worldex-reference-kind { grid-column: 1; grid-row: 1; }
      .worldex-reference-state { grid-column: 2; grid-row: 1; }
      .worldex-reference-content { grid-column: 1 / -1; }
      .worldex-reference-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
    }

    @media (max-width: 520px) {
      .worldex-reference-head { min-height: 58px; padding: 10px 12px; }
      .worldex-reference-toolbar { grid-template-columns: 1fr; }
      .worldex-reference-query, .worldex-reference-actions { grid-column: auto; }
      .worldex-reference-actions button { flex: 1 1 calc(50% - 7px); }
      .worldex-reference-editor-grid { grid-template-columns: 1fr; }
    }

    /* Centered conversation lane and explicit light/dark appearance. */
    .topbar::after { display: none; animation: none; }
    .top-actions button.theme-toggle {
      width: 40px;
      min-width: 40px;
      height: 40px;
      min-height: 40px;
      display: grid;
      place-items: center;
      padding: 0;
      border-color: #31505d;
      background: #0b171f;
      color: #dffbff;
    }
    .theme-toggle > span { font-size: 19px; line-height: 1; }

    @media (min-width: 1061px) {
      .command-layout {
        grid-template-columns: minmax(0, 1180px);
        justify-content: center;
        padding-inline: clamp(24px, 6vw, 120px);
      }
      .conversation-panel {
        width: 100%;
        border-inline: 1px solid var(--line) !important;
      }
      .messages {
        grid-template-columns: minmax(0, 820px);
        justify-content: center;
      }
    }

    html[data-theme="light"] {
      color-scheme: light;
      --bg: #edf1f4;
      --panel: #ffffff;
      --panel-soft: #f5f7f9;
      --surface: #ffffff;
      --surface-raised: #f8fafb;
      --surface-active: #e8f3f2;
      --line: #d6dee3;
      --line-strong: #aebdc4;
      --text: #172126;
      --text-strong: #0c1519;
      --muted: #63747c;
      --blue: #0f766e;
      --teal: #0f766e;
      --green: #15803d;
      --amber: #a65b06;
      --red: #b42338;
      --cyan-soft: rgba(15, 118, 110, .08);
      --cyan-line: rgba(15, 118, 110, .28);
      --shadow-deep: 0 22px 58px rgba(25, 39, 47, .16);
      background: var(--bg);
    }
    html[data-theme="light"] body {
      color: var(--text);
      background: var(--bg);
      background-image: none;
    }
    html[data-theme="light"] * { scrollbar-color: #a9b7bd #edf1f4; }
    html[data-theme="light"] *::-webkit-scrollbar-track { background: #edf1f4; }
    html[data-theme="light"] *::-webkit-scrollbar-thumb { border-color: #edf1f4; background: #a9b7bd; }
    html[data-theme="light"] button {
      border-color: var(--line);
      background: #ffffff;
      color: var(--text);
      box-shadow: none;
    }
    html[data-theme="light"] button:hover:not(:disabled) {
      border-color: #8da2aa;
      background: #f5f8f9;
      color: var(--text-strong);
      box-shadow: none;
    }
    html[data-theme="light"] button.primary {
      border-color: #0f766e;
      background: #0f766e;
      color: #ffffff;
      box-shadow: none;
    }
    html[data-theme="light"] button.primary:hover:not(:disabled) { border-color: #115e59; background: #115e59; color: #fff; }
    html[data-theme="light"] button.success { border-color: #15803d; background: #15803d; color: #fff; }
    html[data-theme="light"] button.subtle-danger { border-color: #efb4bd; background: #fff; color: #b42338; }
    html[data-theme="light"] input,
    html[data-theme="light"] textarea,
    html[data-theme="light"] select {
      border-color: var(--line);
      background: #ffffff;
      color: var(--text);
      caret-color: #0f766e;
      box-shadow: none;
    }
    html[data-theme="light"] input::placeholder,
    html[data-theme="light"] textarea::placeholder { color: #819198; }
    html[data-theme="light"] input:focus,
    html[data-theme="light"] textarea:focus,
    html[data-theme="light"] select:focus { border-color: #5b9e98; outline-color: rgba(15, 118, 110, .18); background: #fff; }

    html[data-theme="light"] .login { background: #edf1f4; background-image: none; }
    html[data-theme="light"] .login-box { border-color: var(--line); background: #fff; box-shadow: var(--shadow-deep); }
    html[data-theme="light"] .login-box::before { background: #0f766e; box-shadow: none; }
    html[data-theme="light"] .auth-mode { border-color: var(--line); background: var(--line); }
    html[data-theme="light"] .auth-mode button.active { background: #dcefeb; color: #115e59; box-shadow: inset 0 -2px #0f766e; }
    html[data-theme="light"] .command-center,
    html[data-theme="light"] .command-layout { background: #e6ebee; }
    html[data-theme="light"] .command-layout > .panel { background: #fff; box-shadow: none; }
    html[data-theme="light"] .topbar {
      border-bottom-color: #cbd6da;
      background: rgba(255, 255, 255, .97);
      color: var(--text);
      box-shadow: 0 5px 18px rgba(35, 52, 61, .08);
    }
    html[data-theme="light"] .brand { color: #142126; }
    html[data-theme="light"] .brand-mark { border-color: #0f766e; background: #d9eeeb; box-shadow: inset 0 0 0 4px #fff; }
    html[data-theme="light"] .brand-mark::before,
    html[data-theme="light"] .brand-mark::after { background: #0f766e; }
    html[data-theme="light"] .top-actions button,
    html[data-theme="light"] .top-actions button.theme-toggle,
    html[data-theme="light"] .top-actions button.settings-menu-toggle {
      border-color: #c5d0d5;
      background: #ffffff;
      color: #34464e;
    }
    html[data-theme="light"] .top-actions button:hover:not(:disabled) { border-color: #8fa3aa; background: #f4f7f8; color: #142126; }
    html[data-theme="light"] .settings-menu-toggle[aria-expanded="true"] { border-color: #5b9e98; background: #e9f4f2; box-shadow: none; }
    html[data-theme="light"] .settings-menu {
      border-color: var(--line);
      background: rgba(255, 255, 255, .99);
      box-shadow: 0 20px 48px rgba(25, 39, 47, .16);
    }
    html[data-theme="light"] .settings-menu-head,
    html[data-theme="light"] .settings-menu-group { border-color: #e1e7ea; }
    html[data-theme="light"] .settings-menu-head strong { color: var(--text-strong); }
    html[data-theme="light"] .settings-user,
    html[data-theme="light"] .settings-menu-section-title { color: var(--muted); }
    html[data-theme="light"] .top-actions button.settings-menu-item { border-color: #d9e1e5; background: #fff; color: #34464e; }

    html[data-theme="light"] .chat-head,
    html[data-theme="light"] .panel-head { border-bottom-color: var(--line); background: #fafcfc; box-shadow: none; }
    html[data-theme="light"] .chat-head::before,
    html[data-theme="light"] .preferences-panel-head::before { background: #0f766e; box-shadow: none; }
    html[data-theme="light"] .chat-title,
    html[data-theme="light"] .panel-title strong { color: var(--text-strong); }
    html[data-theme="light"] .chat-sub { color: var(--muted); }
    html[data-theme="light"] .agent-task-status { border-color: #c7d2d7; background: #fff; color: #52636b; }
    html[data-theme="light"] .messages { background: #f1f4f6; background-image: none; }
    html[data-theme="light"] .msg { border-color: #d6dfe3; background: #fff; color: #26343a; box-shadow: 0 5px 16px rgba(31, 47, 55, .06); }
    html[data-theme="light"] .msg::before { background: #9aaab1; }
    html[data-theme="light"] .msg.customer { background: #fff; }
    html[data-theme="light"] .msg.customer::before { background: #0f766e; box-shadow: none; }
    html[data-theme="light"] .msg.agent_suggestion { border-color: #efcf9b; background: #fff8eb; }
    html[data-theme="light"] .msg.staff_final { border-color: #a9d5ca; background: #edf8f5; }
    html[data-theme="light"] .msg.system_note { background: #e8edef; color: var(--muted); }
    html[data-theme="light"] .msg.clarification,
    html[data-theme="light"] .msg.result { border-color: #bccbd1; background: #fff; }
    html[data-theme="light"] .msg.query-error { border-color: #efb4bd; background: #fff3f5; color: #8f2032; }
    html[data-theme="light"] .msg-meta { color: #74868e; }
    html[data-theme="light"] .result-artifact,
    html[data-theme="light"] .result-artifact-table-wrap { border-color: #d7e0e4; }
    html[data-theme="light"] .result-artifact h4 { color: #26343a; }
    html[data-theme="light"] .result-artifact th { color: #63747c; }
    html[data-theme="light"] .result-artifact th,
    html[data-theme="light"] .result-artifact td { border-bottom-color: #e1e7ea; }

    html[data-theme="light"] .composer { border-top-color: var(--line); background: rgba(250, 252, 252, .98); box-shadow: 0 -8px 22px rgba(31, 47, 55, .05); }
    html[data-theme="light"] .composer::before { background: #bdc9ce; box-shadow: none; }
    html[data-theme="light"] .composer-shell { border-color: #c9d4d9; background: #fff; box-shadow: 0 7px 22px rgba(31, 47, 55, .08); }
    html[data-theme="light"] .composer-shell:focus-within { border-color: #5b9e98; background: #fff; box-shadow: 0 8px 24px rgba(31, 47, 55, .1), 0 0 0 3px rgba(15, 118, 110, .08); }
    html[data-theme="light"] .composer .composer-shell textarea { background: transparent; color: #172126; }
    html[data-theme="light"] .composer .composer-shell textarea::placeholder { color: #84949b; }
    html[data-theme="light"] button.composer-icon-button { color: #667980; }
    html[data-theme="light"] button.composer-icon-button:hover:not(:disabled) { background: #edf3f3; color: #115e59; box-shadow: none; }
    html[data-theme="light"] button.composer-icon-button.is-listening { background: #d9f2ee; color: #0f766e; box-shadow: inset 0 0 0 1px #78b8b1; }
    html[data-theme="light"] button.composer-send-button { background: #0f766e; color: #fff; }
    html[data-theme="light"] button.composer-send-button:hover:not(:disabled) { background: #115e59; color: #fff; box-shadow: none; }
    html[data-theme="light"] .composer-attachment { border-color: #cbd6da; background: #fff; }
    html[data-theme="light"] .attachment-thumbnail-wrap { border-color: #c5d1d6; background: #edf1f3; }
    html[data-theme="light"] .attachment-copy strong { color: #26343a; }
    html[data-theme="light"] .attachment-copy span { color: var(--muted); }
    html[data-theme="light"] .agent-activity { border-color: #c9d5d9; background: #fff; color: #50636b; box-shadow: 0 6px 18px rgba(31, 47, 55, .07); }
    html[data-theme="light"] .agent-activity-orbit i { background: #0f766e; box-shadow: none; }
    html[data-theme="light"] .agent-activity-copy strong { color: #26343a; }
    html[data-theme="light"] .agent-activity-copy span { color: var(--muted); }

    html[data-theme="light"] .schema-review-field,
    html[data-theme="light"] .schema-review-editor,
    html[data-theme="light"] button.schema-review-option,
    html[data-theme="light"] .schema-port-search-results,
    html[data-theme="light"] .schema-carrier-search-results,
    html[data-theme="light"] .schema-service-code-search-results { border-color: var(--line); background: #fff; color: var(--text); }
    html[data-theme="light"] .schema-review-field.valid,
    html[data-theme="light"] .schema-review-field.confirmed { border-color: #9ecdae; background: #f2faf5; }
    html[data-theme="light"] .schema-review-field.needs-confirmation { border-color: #e5bd79; background: #fff9ed; }
    html[data-theme="light"] button.schema-review-row { color: var(--text); }
    html[data-theme="light"] button.schema-review-row:hover:not(:disabled),
    html[data-theme="light"] button.schema-review-option:hover:not(:disabled) { border-color: #6ba9a3; background: #eaf5f3; box-shadow: none; }
    html[data-theme="light"] button.schema-review-option.selected { border-color: #0f766e; background: #dcefeb; color: #173a37; box-shadow: inset 3px 0 0 #0f766e; }
    html[data-theme="light"] .schema-review-field-label,
    html[data-theme="light"] .schema-review-field-value,
    html[data-theme="light"] .clarification-choice { color: #33464e; }

    html[data-theme="light"] .preferences-backdrop { background: rgba(42, 55, 62, .32); }
    html[data-theme="light"] .preferences-panel { border-left-color: var(--line) !important; box-shadow: -18px 0 44px rgba(31, 47, 55, .14); }
    html[data-theme="light"] .quote-body,
    html[data-theme="light"] .section,
    html[data-theme="light"] .review-box,
    html[data-theme="light"] .result-box,
    html[data-theme="light"] .json-box { border-color: var(--line); background: #fff; color: #26343a; }
    html[data-theme="light"] dialog { border-color: var(--line-strong); background: #fff; color: var(--text); box-shadow: var(--shadow-deep); }
    html[data-theme="light"] dialog::backdrop { background: rgba(42, 55, 62, .38); }
    html[data-theme="light"] dialog [class*="-head"],
    html[data-theme="light"] dialog [class*="-toolbar"],
    html[data-theme="light"] dialog [class*="-summary"],
    html[data-theme="light"] dialog [class*="-footer"] { border-color: var(--line); background: #f8fafb; color: var(--text); }
    html[data-theme="light"] dialog [class*="-main"],
    html[data-theme="light"] dialog [class*="-body"],
    html[data-theme="light"] dialog [class*="-list"] { border-color: var(--line); background: #fff; color: var(--text); }

    /* Complete light-theme states for customer review and RAG audit surfaces. */
    html[data-theme="light"] .msg.schema-review {
      border-color: #b8cbc9;
      background: #fff;
      color: #26343a;
      box-shadow: 0 6px 18px rgba(31, 47, 55, .07);
    }
    html[data-theme="light"] .msg.schema-review::before { background: #0f766e; box-shadow: none; }
    html[data-theme="light"] .result-review-shortcut {
      border-color: #a9cbc6;
      background: #edf8f5;
      color: #115e59;
    }
    html[data-theme="light"] .schema-review-form { border-top-color: #dce5e8; }
    html[data-theme="light"] .schema-review-heading strong { color: #26343a; }
    html[data-theme="light"] .schema-review-field {
      border-color: #d5dfe3;
      background: #fff;
      box-shadow: none;
    }
    html[data-theme="light"] .schema-review-field.valid,
    html[data-theme="light"] .schema-review-field.confirmed {
      border-color: #9ecdae;
      background: #f2faf5;
      box-shadow: inset 3px 0 #15803d;
    }
    html[data-theme="light"] .schema-review-field.needs-confirmation {
      border-color: #e2bd78;
      background: #fff9ed;
      box-shadow: inset 3px 0 #b45309;
    }
    html[data-theme="light"] .schema-review-field.invalid {
      border-color: #e8a5af;
      background: #fff3f5;
      box-shadow: inset 3px 0 #b42338;
    }
    html[data-theme="light"] button.schema-review-row { color: #26343a; }
    html[data-theme="light"] button.schema-review-row:hover:not(:disabled),
    html[data-theme="light"] button.schema-review-row:focus-visible {
      background: #eaf5f3;
      box-shadow: inset 0 0 0 1px #67a8a1;
    }
    html[data-theme="light"] .schema-review-status-icon {
      background: #15803d;
      color: #fff;
      box-shadow: none;
    }
    html[data-theme="light"] .needs-confirmation .schema-review-status-icon {
      background: #b45309;
      color: #fff;
      animation: none;
    }
    html[data-theme="light"] .invalid .schema-review-status-icon { background: #b42338; color: #fff; }
    html[data-theme="light"] .schema-review-field-label { color: #52636b; }
    html[data-theme="light"] .schema-review-field-value { color: #1f3037; }
    html[data-theme="light"] .schema-review-chevron,
    html[data-theme="light"] .schema-review-field-note { color: #718188; }
    html[data-theme="light"] .needs-confirmation .schema-review-field-note { color: #8a4b08; }
    html[data-theme="light"] .invalid .schema-review-field-note { color: #9f2639; }
    html[data-theme="light"] .schema-review-editor {
      border-top-color: #dce5e8;
      background: #f8fafb;
    }
    html[data-theme="light"] button.schema-review-option {
      border-color: #cbd6da;
      background: #fff;
      color: #2b3c43;
    }
    html[data-theme="light"] button.schema-review-option:hover:not(:disabled),
    html[data-theme="light"] button.schema-review-option:focus-visible {
      border-color: #67a8a1;
      background: #eaf5f3;
      box-shadow: none;
    }
    html[data-theme="light"] button.schema-review-option.selected {
      border-color: #0f766e;
      background: #dcefeb;
      color: #173a37;
      box-shadow: inset 3px 0 #0f766e;
    }
    html[data-theme="light"] .schema-review-explanation { background: #fff; }
    html[data-theme="light"] .schema-port-search-results,
    html[data-theme="light"] .schema-carrier-search-results,
    html[data-theme="light"] .schema-service-code-search-results {
      border-color: #bccbd1;
      background: #fff;
      box-shadow: 0 10px 24px rgba(31, 47, 55, .13);
    }
    html[data-theme="light"] button.schema-port-search-result,
    html[data-theme="light"] button.schema-carrier-search-result,
    html[data-theme="light"] button.schema-service-code-search-result {
      border-bottom-color: #e1e7ea;
      background: #fff;
      color: #33464e;
    }
    html[data-theme="light"] button.schema-port-search-result:hover,
    html[data-theme="light"] button.schema-port-search-result:focus-visible,
    html[data-theme="light"] button.schema-port-search-result.selected,
    html[data-theme="light"] button.schema-carrier-search-result:hover,
    html[data-theme="light"] button.schema-carrier-search-result:focus-visible,
    html[data-theme="light"] button.schema-carrier-search-result.selected,
    html[data-theme="light"] button.schema-service-code-search-result:hover,
    html[data-theme="light"] button.schema-service-code-search-result:focus-visible,
    html[data-theme="light"] button.schema-service-code-search-result.selected {
      background: #eaf5f3;
      color: #173a37;
    }
    html[data-theme="light"] button.schema-port-search-result.selected,
    html[data-theme="light"] button.schema-carrier-search-result.selected,
    html[data-theme="light"] button.schema-service-code-search-result.selected { box-shadow: inset 3px 0 #0f766e; }
    html[data-theme="light"] .schema-port-selected-item,
    html[data-theme="light"] .schema-carrier-selected-item,
    html[data-theme="light"] .schema-service-code-selected-item {
      border-color: #83bdb6;
      background: #e9f5f3;
      color: #17453f;
    }
    html[data-theme="light"] button.schema-port-selected-remove,
    html[data-theme="light"] button.schema-carrier-selected-remove,
    html[data-theme="light"] button.schema-service-code-selected-remove {
      border-left-color: #add2cd;
      color: #0f766e;
    }

    html[data-theme="light"] .worldex-rag-list-wrap,
    html[data-theme="light"] .worldex-rag-list-head,
    html[data-theme="light"] .worldex-rag-footer {
      border-color: #d8e1e5;
      background: #f8fafb;
      color: #26343a;
    }
    html[data-theme="light"] .worldex-rag-toolbar { border-color: #d8e1e5; background: #f4f7f8; }
    html[data-theme="light"] .worldex-rag-toolbar label { color: #52636b; }
    html[data-theme="light"] .worldex-rag-list {
      background-color: #edf1f3;
      background-image: none;
    }
    html[data-theme="light"] .worldex-rag-item {
      border-color: #d2dde1;
      background: #fff;
      box-shadow: 0 8px 24px rgba(31, 47, 55, .08);
    }
    html[data-theme="light"] .worldex-rag-case-header { border-bottom-color: #dce5e8; }
    html[data-theme="light"] .worldex-rag-badge { box-shadow: none; }
    html[data-theme="light"] .worldex-rag-badge::before { box-shadow: none; }
    html[data-theme="light"] .worldex-rag-badge.verdict-incorrect {
      border-color: #e6a2ad;
      background: #fff0f2;
      color: #a92f42;
    }
    html[data-theme="light"] .worldex-rag-badge.verdict-correct {
      border-color: #9ccbad;
      background: #eef9f2;
      color: #16733a;
    }
    html[data-theme="light"] .worldex-rag-badge.verdict-unknown,
    html[data-theme="light"] .worldex-rag-badge.intervention-no {
      border-color: #cad5da;
      background: #f3f6f7;
      color: #667980;
    }
    html[data-theme="light"] .worldex-rag-badge.intervention-yes {
      border-color: #dfbd7e;
      background: #fff8e9;
      color: #94530b;
    }
    html[data-theme="light"] .worldex-rag-state {
      border-color: #9bc7c2;
      background: #e8f4f2;
      color: #115e59;
    }
    html[data-theme="light"] .worldex-rag-state.state-approved {
      border-color: #9ccbad;
      background: #eef9f2;
      color: #16733a;
    }
    html[data-theme="light"] .worldex-rag-state.state-reviewed {
      border-color: #dfbd7e;
      background: #fff8e9;
      color: #8a4b08;
    }
    html[data-theme="light"] .worldex-rag-state.state-revoked {
      border-color: #e6a2ad;
      background: #fff0f2;
      color: #a92f42;
    }
    html[data-theme="light"] .worldex-rag-prompt {
      border-left-color: #0f766e;
      background: #f3f8f7;
      color: #203239;
      box-shadow: none;
    }
    html[data-theme="light"] .worldex-rag-effective-query { border-top-color: #d8e2e5; color: #667980; }
    html[data-theme="light"] .worldex-rag-provenance { color: #667980; }
    html[data-theme="light"] .worldex-rag-business-note {
      border-color: #dfbd7e;
      background: #fff8e9;
      color: #8a4b08;
    }
    html[data-theme="light"] .worldex-rag-business-note strong { color: #714006; }
    html[data-theme="light"] .worldex-rag-text-block,
    html[data-theme="light"] .worldex-rag-schemas,
    html[data-theme="light"] .worldex-rag-schema-choice-row { border-color: #dce5e8; }
    html[data-theme="light"] .worldex-rag-text-label,
    html[data-theme="light"] .worldex-rag-schema-row-label,
    html[data-theme="light"] .worldex-rag-structured-label,
    html[data-theme="light"] .worldex-rag-structured-index { color: #667980; }
    html[data-theme="light"] .worldex-rag-query,
    html[data-theme="light"] .worldex-rag-schema-row-value,
    html[data-theme="light"] .worldex-rag-schema-choice-value { color: #26343a; }
    html[data-theme="light"] .worldex-rag-schema-title { color: #42555d; }
    html[data-theme="light"] .worldex-rag-schema-rows { border-top-color: #b9c8ce; }
    html[data-theme="light"] .worldex-rag-schema-row,
    html[data-theme="light"] .worldex-rag-structured-item { border-bottom-color: #e1e7ea; }
    html[data-theme="light"] .worldex-rag-schema-empty { color: #819198; }
    html[data-theme="light"] .worldex-rag-comparison-table thead th {
      border-bottom-color: #cdd8dc;
      background: #f3f6f7;
      color: #52636b;
    }
    html[data-theme="light"] .worldex-rag-comparison-table tbody th,
    html[data-theme="light"] .worldex-rag-comparison-table tbody td { border-bottom-color: #e2e8eb; }
    html[data-theme="light"] .worldex-rag-comparison-table tbody th { color: #26343a; }
    html[data-theme="light"] .worldex-rag-comparison-cell { color: #61737b; }
    html[data-theme="light"] .worldex-rag-comparison-cell.is-unchanged .worldex-rag-comparison-value,
    html[data-theme="light"] .worldex-rag-comparison-cell.is-missing .worldex-rag-comparison-value { color: #87969c; }
    html[data-theme="light"] .worldex-rag-comparison-cell.is-removed .worldex-rag-comparison-value {
      background: #fdecef;
      color: #a92f42;
    }
    html[data-theme="light"] .worldex-rag-comparison-cell.is-added .worldex-rag-comparison-value {
      background: #e8f6ed;
      color: #16733a;
    }
    html[data-theme="light"] .worldex-rag-comparison-table .worldex-rag-unparsed-summary td { background: #f8fafb; }
    html[data-theme="light"] .worldex-rag-unparsed-toggle { color: #61737b; }
    html[data-theme="light"] .worldex-rag-unparsed-toggle:hover:not(:disabled) {
      background: #eaf5f3;
      color: #115e59;
    }
    html[data-theme="light"] .worldex-rag-admin-cell .worldex-rag-structured-control,
    html[data-theme="light"] .worldex-rag-admin-details summary,
    html[data-theme="light"] .worldex-rag-admin-readonly {
      border-color: #c6d2d7;
      background: #fff;
      color: #33464e;
    }
    html[data-theme="light"] .worldex-rag-admin-cell.is-modified .worldex-rag-structured-control,
    html[data-theme="light"] .worldex-rag-admin-cell.is-modified .worldex-rag-admin-details summary,
    html[data-theme="light"] .worldex-rag-admin-cell.is-modified .worldex-rag-admin-readonly {
      border-color: #8fc4a2;
      background: #eef9f2;
      color: #165f35;
    }
    html[data-theme="light"] .worldex-rag-admin-cell.is-invalid .worldex-rag-structured-control {
      border-color: #e6a2ad;
      background: #fff0f2;
    }
    html[data-theme="light"] .worldex-rag-admin-details summary::after,
    html[data-theme="light"] .worldex-rag-raw-details { color: #0f766e; }
    html[data-theme="light"] .worldex-rag-admin-editor-host,
    html[data-theme="light"] .worldex-rag-review-comment,
    html[data-theme="light"] .worldex-rag-schema-choice-body,
    html[data-theme="light"] .worldex-rag-saved-review {
      border-color: #d5dfe3;
      background: #f8fafb;
      color: #42555d;
    }
    html[data-theme="light"] .worldex-rag-admin-subfield > span { color: #667980; }
    html[data-theme="light"] .worldex-rag-restore-button {
      border-color: #9bc7c2;
      background: #e8f4f2;
      color: #115e59;
    }
    html[data-theme="light"] .worldex-rag-raw-details pre,
    html[data-theme="light"] .worldex-rag-result-text,
    html[data-theme="light"] .worldex-rag-schema-choice-preview {
      border-color: #d5dfe3;
      background: #fff;
      color: #33464e;
    }
    html[data-theme="light"] .worldex-rag-review-editor > label:not(.worldex-rag-review-comment) { color: #52636b; }
    html[data-theme="light"] .worldex-rag-review-comment textarea { background: #fff; }
    html[data-theme="light"] .worldex-rag-intent-choices { border-color: #c6d2d7; background: #fff; }
    html[data-theme="light"] .worldex-rag-intent-choice { color: #52636b; }
    html[data-theme="light"] .worldex-rag-intent-choice:hover { background: #edf5f4; }
    html[data-theme="light"] .worldex-rag-intent-choice:has(input:checked) { background: #dcefeb; color: #115e59; }
    html[data-theme="light"] .worldex-rag-review-schema-head h3,
    html[data-theme="light"] .worldex-rag-result-head h3 { color: #26343a; }
    html[data-theme="light"] .worldex-rag-review-schema-head span,
    html[data-theme="light"] .worldex-rag-result-head span { color: #718188; }
    html[data-theme="light"] .worldex-rag-schema-choice-summary > strong { color: #52636b; }
    html[data-theme="light"] .worldex-rag-schema-choice.selected {
      border-color: #0f766e;
      background: #dcefeb;
      color: #115e59;
    }
    html[data-theme="light"] .worldex-rag-result-text.error {
      border-left-color: #b42338;
      background: #fff0f2;
      color: #9f2639;
    }
    html[data-theme="light"] .worldex-rag-result-empty,
    html[data-theme="light"] .worldex-rag-saved-review-meta,
    html[data-theme="light"] .worldex-rag-page-jump { color: #718188; }
    @media (max-width: 600px) {
      html[data-theme="light"] .worldex-rag-comparison-table tbody th { background: #f3f6f7; }
      html[data-theme="light"] .worldex-rag-comparison-table tbody tr { border-bottom-color: #d8e1e5; }
      html[data-theme="light"] .worldex-rag-comparison-table tbody td::before { color: #718188; }
    }

    /* Neutral light surfaces for schema review and non-RAG settings. */
    html[data-theme="light"] {
      --light-ui-canvas: #eef2f4;
      --light-ui-surface: #ffffff;
      --light-ui-subtle: #f5f7f8;
      --light-ui-muted: #e9eef0;
      --light-ui-border: #d5dde1;
      --light-ui-border-strong: #b8c5ca;
      --light-ui-text: #26343a;
      --light-ui-muted-text: #66777e;
      --light-ui-accent: #0f766e;
    }

    html[data-theme="light"] .msg.schema-review {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
      box-shadow: 0 5px 16px rgba(31, 47, 55, .06);
    }
    html[data-theme="light"] .schema-review-form { border-top-color: var(--light-ui-border); }
    html[data-theme="light"] .schema-review-field,
    html[data-theme="light"] .schema-review-field.valid,
    html[data-theme="light"] .schema-review-field.confirmed,
    html[data-theme="light"] .schema-review-field.needs-confirmation,
    html[data-theme="light"] .schema-review-field.invalid {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
      box-shadow: none;
    }
    html[data-theme="light"] .schema-review-field.valid,
    html[data-theme="light"] .schema-review-field.confirmed { border-left-color: var(--light-ui-accent); }
    html[data-theme="light"] .schema-review-field.needs-confirmation { border-left-color: #b7791f; }
    html[data-theme="light"] .schema-review-field.invalid { border-left-color: #b42338; }
    html[data-theme="light"] button.schema-review-row:hover:not(:disabled),
    html[data-theme="light"] button.schema-review-row:focus-visible {
      border-color: var(--light-ui-border-strong);
      background: var(--light-ui-subtle);
    }
    html[data-theme="light"] .schema-review-editor {
      border-top-color: var(--light-ui-border);
      background: var(--light-ui-subtle);
    }
    html[data-theme="light"] button.schema-review-option {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
      color: var(--light-ui-text);
    }
    html[data-theme="light"] button.schema-review-option:hover:not(:disabled),
    html[data-theme="light"] button.schema-review-option:focus-visible {
      border-color: var(--light-ui-border-strong);
      background: var(--light-ui-subtle);
    }
    html[data-theme="light"] button.schema-review-option.selected {
      border-color: var(--light-ui-accent);
      background: var(--light-ui-muted);
      color: var(--light-ui-text);
      box-shadow: inset 3px 0 0 var(--light-ui-accent);
    }
    html[data-theme="light"] .schema-review-explanation { background: var(--light-ui-surface); }
    html[data-theme="light"] .schema-port-search-results,
    html[data-theme="light"] .schema-carrier-search-results,
    html[data-theme="light"] .schema-service-code-search-results {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
    }
    html[data-theme="light"] button.schema-port-search-result:hover,
    html[data-theme="light"] button.schema-port-search-result:focus-visible,
    html[data-theme="light"] button.schema-port-search-result.selected,
    html[data-theme="light"] button.schema-carrier-search-result:hover,
    html[data-theme="light"] button.schema-carrier-search-result:focus-visible,
    html[data-theme="light"] button.schema-carrier-search-result.selected,
    html[data-theme="light"] button.schema-service-code-search-result:hover,
    html[data-theme="light"] button.schema-service-code-search-result:focus-visible,
    html[data-theme="light"] button.schema-service-code-search-result.selected {
      border-color: var(--light-ui-border-strong);
      background: var(--light-ui-subtle);
      color: var(--light-ui-text);
    }
    html[data-theme="light"] .schema-port-selected-item,
    html[data-theme="light"] .schema-carrier-selected-item,
    html[data-theme="light"] .schema-service-code-selected-item {
      border-color: var(--light-ui-border);
      background: var(--light-ui-muted);
      color: var(--light-ui-text);
    }

    html[data-theme="light"] .settings-menu {
      border-color: var(--light-ui-border-strong);
      background: var(--light-ui-surface);
      box-shadow: 0 18px 44px rgba(31, 47, 55, .16);
      backdrop-filter: none;
    }
    html[data-theme="light"] .settings-menu-head,
    html[data-theme="light"] .settings-menu-group { border-color: var(--light-ui-border); }
    html[data-theme="light"] .top-actions button.settings-menu-item {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
      color: var(--light-ui-text);
    }
    html[data-theme="light"] .top-actions button.settings-menu-item:hover:not(:disabled) {
      border-color: var(--light-ui-border-strong);
      background: var(--light-ui-subtle);
      color: var(--light-ui-text);
    }
    html[data-theme="light"] .settings-menu .app-update-notice,
    html[data-theme="light"] .settings-menu .admin-test-mode.active {
      border-color: #d7a64f;
      background: var(--light-ui-surface);
      color: #7a4a08;
      box-shadow: inset 3px 0 0 #b7791f;
    }
    html[data-theme="light"] .top-actions button.settings-logout {
      border-color: #e4c4ca;
      background: var(--light-ui-surface);
      color: #9f2639;
    }

    html[data-theme="light"] .preferences-panel {
      border-left-color: var(--light-ui-border-strong) !important;
      background: var(--light-ui-surface);
      box-shadow: -18px 0 44px rgba(31, 47, 55, .14);
    }
    html[data-theme="light"] .preferences-panel-head {
      border-bottom-color: var(--light-ui-border);
      background: var(--light-ui-surface);
    }
    html[data-theme="light"] .preferences-body {
      background: var(--light-ui-subtle);
      background-image: none;
    }
    html[data-theme="light"] .preferences-workspace {
      background: var(--light-ui-subtle);
      color: var(--light-ui-text);
    }
    html[data-theme="light"] .preferences-head { border-bottom-color: var(--light-ui-border); }
    html[data-theme="light"] .preferences-head h2,
    html[data-theme="light"] .preference-field,
    html[data-theme="light"] .preference-label,
    html[data-theme="light"] .preference-check,
    html[data-theme="light"] .preference-sort-control,
    html[data-theme="light"] .template-field-choice { color: var(--light-ui-text); }
    html[data-theme="light"] .preference-block { border-top-color: var(--light-ui-border); }
    html[data-theme="light"] .preference-sort-control {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
    }
    html[data-theme="light"] .preference-sort-control:has(input:checked) {
      border-color: var(--light-ui-accent);
      background: var(--light-ui-surface);
      box-shadow: inset 3px 0 0 var(--light-ui-accent);
    }
    html[data-theme="light"] .template-field-choices {
      border-color: var(--light-ui-border);
      background: var(--light-ui-border);
    }
    html[data-theme="light"] .template-field-choice { background: var(--light-ui-surface); }
    html[data-theme="light"] .template-field-choice:hover,
    html[data-theme="light"] .template-field-choice:has(input:checked) {
      background: var(--light-ui-muted);
      color: var(--light-ui-text);
    }
    html[data-theme="light"] .template-line {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
      box-shadow: none;
    }
    html[data-theme="light"] .template-line.drag-over {
      border-color: var(--light-ui-accent);
      background: var(--light-ui-surface);
      box-shadow: inset 3px 0 0 var(--light-ui-accent);
    }
    html[data-theme="light"] .template-line-title,
    html[data-theme="light"] .template-feedback { color: var(--light-ui-muted-text); }
    html[data-theme="light"] .template-tag {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
      color: var(--light-ui-text);
    }
    html[data-theme="light"] .template-tag:hover,
    html[data-theme="light"] .template-tag.selected,
    html[data-theme="light"] .template-tag.drop-before {
      border-color: var(--light-ui-accent);
      background: var(--light-ui-muted);
      color: var(--light-ui-text);
      box-shadow: none;
    }
    html[data-theme="light"] .preferences-actions {
      border-top-color: var(--light-ui-border);
      background: rgba(255, 255, 255, .97);
      box-shadow: 0 -10px 24px rgba(31, 47, 55, .07);
      backdrop-filter: blur(12px);
    }

    html[data-theme="light"] :is(
      .user-management-dialog,
      .announcements-dialog,
      .worldex-usage-dialog,
      .worldex-audit-dialog,
      .worldex-failures-dialog,
      .worldex-reference-dialog
    ) {
      border-color: var(--light-ui-border-strong);
      background: var(--light-ui-surface);
      color: var(--light-ui-text);
      box-shadow: 0 22px 58px rgba(31, 47, 55, .18);
    }
    html[data-theme="light"] :is(
      .user-management-dialog,
      .announcements-dialog,
      .worldex-usage-dialog,
      .worldex-audit-dialog,
      .worldex-failures-dialog,
      .worldex-reference-dialog
    )::backdrop { background: rgba(42, 55, 62, .38); backdrop-filter: blur(5px); }
    html[data-theme="light"] :is(
      .user-management-head,
      .announcements-head,
      .worldex-usage-head,
      .worldex-audit-head,
      .worldex-failures-head,
      .worldex-reference-head
    ) {
      border-bottom-color: var(--light-ui-border);
      background: var(--light-ui-surface);
      box-shadow: none;
    }
    html[data-theme="light"] :is(
      .user-management-head,
      .announcements-head,
      .worldex-usage-head,
      .worldex-audit-head,
      .worldex-failures-head
    )::before { background: var(--light-ui-accent); box-shadow: none; }
    html[data-theme="light"] :is(
      .user-management-head,
      .announcements-head,
      .worldex-usage-head,
      .worldex-audit-head,
      .worldex-failures-head,
      .worldex-reference-head
    ) h2 { color: var(--light-ui-text); }
    html[data-theme="light"] :is(
      .announcement-tabs,
      .worldex-usage-channel-tabs,
      .worldex-usage-tabs,
      .worldex-failures-tabs
    ) {
      border-bottom-color: var(--light-ui-border);
      background: var(--light-ui-subtle);
    }
    html[data-theme="light"] :is(
      .announcement-tabs,
      .worldex-usage-channel-tabs,
      .worldex-usage-tabs,
      .worldex-failures-tabs
    ) button.active {
      border-color: var(--light-ui-border);
      border-bottom-color: var(--light-ui-accent);
      background: var(--light-ui-surface);
      color: var(--light-ui-text);
      box-shadow: inset 0 -2px var(--light-ui-accent);
    }

    html[data-theme="light"] .user-management-main,
    html[data-theme="light"] .user-management-list {
      background: var(--light-ui-subtle);
    }
    html[data-theme="light"] .user-management-summary {
      border-bottom-color: var(--light-ui-border);
      background: var(--light-ui-surface);
    }
    html[data-theme="light"] .user-management-row {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
    }
    html[data-theme="light"] .user-management-row:hover {
      border-color: var(--light-ui-border-strong);
      background: var(--light-ui-surface);
      transform: none;
    }

    html[data-theme="light"] .announcement-panel { background: var(--light-ui-subtle); }
    html[data-theme="light"] #announcementUpdatesPanel,
    html[data-theme="light"] .announcement-updates-list,
    html[data-theme="light"] .announcement-update-section { background: var(--light-ui-surface); }
    html[data-theme="light"] .announcement-meta,
    html[data-theme="light"] .announcement-update-section,
    html[data-theme="light"] .announcement-requirement-form { border-color: var(--light-ui-border); }
    html[data-theme="light"] .announcement-update-section h3,
    html[data-theme="light"] .announcement-update-section li,
    html[data-theme="light"] .announcement-requirement-content { color: var(--light-ui-text); }
    html[data-theme="light"] .announcement-requirement-form { background: var(--light-ui-surface); }
    html[data-theme="light"] .announcement-requirements-list { background: var(--light-ui-subtle); }
    html[data-theme="light"] .announcement-requirement-item {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
    }
    html[data-theme="light"] .announcement-requirement-item:hover {
      border-color: var(--light-ui-border-strong);
      background: var(--light-ui-surface);
      transform: none;
    }
    html[data-theme="light"] .announcement-status-badge {
      border: 1px solid var(--light-ui-border-strong);
      background: var(--light-ui-surface);
      color: var(--light-ui-muted-text);
    }
    html[data-theme="light"] .announcement-status-badge.in_progress { border-color: #d7a64f; background: var(--light-ui-surface); color: #7a4a08; }
    html[data-theme="light"] .announcement-status-badge.completed { border-color: #85b99a; background: var(--light-ui-surface); color: #166534; }
    html[data-theme="light"] .announcement-status-badge.on_hold { border-color: var(--light-ui-border-strong); background: var(--light-ui-surface); color: #52636b; }

    html[data-theme="light"] .worldex-usage-main,
    html[data-theme="light"] .worldex-usage-list,
    html[data-theme="light"] .worldex-usage-daily-list { background: var(--light-ui-surface); }
    html[data-theme="light"] .worldex-usage-summary,
    html[data-theme="light"] .worldex-usage-columns,
    html[data-theme="light"] .worldex-usage-row,
    html[data-theme="light"] .worldex-usage-daily,
    html[data-theme="light"] .worldex-usage-daily-head,
    html[data-theme="light"] .worldex-usage-day { border-color: var(--light-ui-border); }
    html[data-theme="light"] .worldex-usage-columns,
    html[data-theme="light"] .worldex-usage-daily-head { background: var(--light-ui-subtle); }
    html[data-theme="light"] .worldex-usage-row:hover { background: var(--light-ui-subtle); }
    html[data-theme="light"] .worldex-usage-day-query { color: var(--light-ui-text); }

    html[data-theme="light"] .worldex-audit-users,
    html[data-theme="light"] .worldex-audit-toolbar,
    html[data-theme="light"] .worldex-audit-records { background: var(--light-ui-subtle); }
    html[data-theme="light"] .worldex-audit-users,
    html[data-theme="light"] .worldex-audit-summary,
    html[data-theme="light"] .worldex-audit-toolbar,
    html[data-theme="light"] .worldex-audit-footer { border-color: var(--light-ui-border); }
    html[data-theme="light"] .worldex-audit-main,
    html[data-theme="light"] .worldex-audit-summary,
    html[data-theme="light"] .worldex-audit-footer { background: var(--light-ui-surface); }
    html[data-theme="light"] .worldex-audit-user,
    html[data-theme="light"] .worldex-audit-record {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
    }
    html[data-theme="light"] .worldex-audit-user.active {
      border-color: var(--light-ui-accent);
      background: var(--light-ui-surface);
      color: var(--light-ui-text);
      box-shadow: inset 3px 0 0 var(--light-ui-accent);
    }
    html[data-theme="light"] .worldex-audit-record:hover {
      border-color: var(--light-ui-border-strong);
      background: var(--light-ui-surface);
      transform: none;
    }
    html[data-theme="light"] .worldex-audit-query { color: var(--light-ui-text); }

    html[data-theme="light"] .worldex-failures-toolbar,
    html[data-theme="light"] .worldex-quality-toolbar,
    html[data-theme="light"] .worldex-failures-list { background: var(--light-ui-subtle); }
    html[data-theme="light"] .worldex-failures-toolbar,
    html[data-theme="light"] .worldex-quality-toolbar,
    html[data-theme="light"] .worldex-failures-list-head,
    html[data-theme="light"] .worldex-failures-footer { border-color: var(--light-ui-border); }
    html[data-theme="light"] .worldex-failures-list-head,
    html[data-theme="light"] .worldex-failures-footer { background: var(--light-ui-surface); }
    html[data-theme="light"] .worldex-failure-item,
    html[data-theme="light"] .worldex-failure-item.synced {
      border-color: var(--light-ui-border);
      background: var(--light-ui-surface);
    }
    html[data-theme="light"] .worldex-failure-item.synced { border-left-color: #15803d; }
    html[data-theme="light"] .worldex-failure-item:hover {
      border-color: var(--light-ui-border-strong);
      background: var(--light-ui-surface);
      transform: none;
    }
    html[data-theme="light"] .worldex-failure-prompt { color: var(--light-ui-text); }
    html[data-theme="light"] .worldex-failure-error {
      border-color: #e4c4ca;
      border-left-color: #b42338;
      background: var(--light-ui-surface);
      color: #9f2639;
    }

    html[data-theme="light"] .worldex-reference-shell,
    html[data-theme="light"] .worldex-reference-list-wrap,
    html[data-theme="light"] .worldex-reference-list { background: var(--light-ui-subtle); }
    html[data-theme="light"] .worldex-reference-head,
    html[data-theme="light"] .worldex-reference-summary,
    html[data-theme="light"] .worldex-reference-toolbar,
    html[data-theme="light"] .worldex-reference-sync-meta,
    html[data-theme="light"] .worldex-reference-editor,
    html[data-theme="light"] .worldex-reference-list-head,
    html[data-theme="light"] .worldex-reference-row,
    html[data-theme="light"] .worldex-reference-footer { border-color: var(--light-ui-border); }
    html[data-theme="light"] .worldex-reference-head,
    html[data-theme="light"] .worldex-reference-summary > div,
    html[data-theme="light"] .worldex-reference-sync-meta,
    html[data-theme="light"] .worldex-reference-editor,
    html[data-theme="light"] .worldex-reference-list-head,
    html[data-theme="light"] .worldex-reference-row,
    html[data-theme="light"] .worldex-reference-footer { background: var(--light-ui-surface); }
    html[data-theme="light"] .worldex-reference-summary { background: var(--light-ui-border); }
    html[data-theme="light"] .worldex-reference-summary span,
    html[data-theme="light"] .worldex-reference-toolbar label,
    html[data-theme="light"] .worldex-reference-editor label,
    html[data-theme="light"] .worldex-reference-sync-meta,
    html[data-theme="light"] .worldex-reference-content span { color: var(--light-ui-muted-text); }
    html[data-theme="light"] .worldex-reference-summary strong { color: var(--light-ui-text); }
    html[data-theme="light"] .worldex-reference-toolbar { background: var(--light-ui-subtle); }
    html[data-theme="light"] .worldex-reference-editor { border-left: 3px solid var(--light-ui-accent); }
    html[data-theme="light"] .worldex-reference-editor-head strong,
    html[data-theme="light"] .worldex-reference-content strong { color: var(--light-ui-text); }
    html[data-theme="light"] .worldex-reference-row:hover { background: var(--light-ui-surface); }
    html[data-theme="light"] .worldex-reference-kind,
    html[data-theme="light"] .worldex-reference-state {
      border-color: var(--light-ui-border-strong);
      background: var(--light-ui-surface);
      color: var(--light-ui-muted-text);
    }
    html[data-theme="light"] .worldex-reference-state.enabled {
      border-color: #85b99a;
      background: var(--light-ui-surface);
      color: #166534;
    }

    /* Keep explicit module colors above the legacy dialog wildcard rules. */
    html[data-theme="light"] dialog.user-management-dialog .user-management-head,
    html[data-theme="light"] dialog.announcements-dialog .announcements-head,
    html[data-theme="light"] dialog.worldex-usage-dialog .worldex-usage-head,
    html[data-theme="light"] dialog.worldex-audit-dialog .worldex-audit-head,
    html[data-theme="light"] dialog.worldex-failures-dialog .worldex-failures-head,
    html[data-theme="light"] dialog.worldex-reference-dialog .worldex-reference-head {
      border-bottom-color: var(--light-ui-border);
      background: var(--light-ui-surface);
      color: var(--light-ui-text);
    }
    html[data-theme="light"] dialog.user-management-dialog .user-management-main,
    html[data-theme="light"] dialog.user-management-dialog .user-management-list,
    html[data-theme="light"] dialog.announcements-dialog .announcement-panel,
    html[data-theme="light"] dialog.announcements-dialog .announcement-requirements-list,
    html[data-theme="light"] dialog.worldex-audit-dialog .worldex-audit-users,
    html[data-theme="light"] dialog.worldex-audit-dialog .worldex-audit-toolbar,
    html[data-theme="light"] dialog.worldex-audit-dialog .worldex-audit-records,
    html[data-theme="light"] dialog.worldex-failures-dialog .worldex-failures-toolbar,
    html[data-theme="light"] dialog.worldex-failures-dialog .worldex-quality-toolbar,
    html[data-theme="light"] dialog.worldex-failures-dialog .worldex-failures-list,
    html[data-theme="light"] dialog.worldex-reference-dialog .worldex-reference-shell,
    html[data-theme="light"] dialog.worldex-reference-dialog .worldex-reference-list-wrap,
    html[data-theme="light"] dialog.worldex-reference-dialog .worldex-reference-list {
      background: var(--light-ui-subtle);
      color: var(--light-ui-text);
    }
    html[data-theme="light"] dialog.user-management-dialog .user-management-summary,
    html[data-theme="light"] dialog.worldex-usage-dialog .worldex-usage-main,
    html[data-theme="light"] dialog.worldex-audit-dialog .worldex-audit-main,
    html[data-theme="light"] dialog.worldex-audit-dialog .worldex-audit-summary,
    html[data-theme="light"] dialog.worldex-audit-dialog .worldex-audit-footer,
    html[data-theme="light"] dialog.worldex-failures-dialog .worldex-failures-list-head,
    html[data-theme="light"] dialog.worldex-failures-dialog .worldex-failures-footer,
    html[data-theme="light"] dialog.worldex-reference-dialog .worldex-reference-sync-meta,
    html[data-theme="light"] dialog.worldex-reference-dialog .worldex-reference-list-head,
    html[data-theme="light"] dialog.worldex-reference-dialog .worldex-reference-footer {
      background: var(--light-ui-surface);
      color: var(--light-ui-text);
    }
    html[data-theme="light"] dialog.announcements-dialog .announcement-tabs,
    html[data-theme="light"] dialog.worldex-usage-dialog .worldex-usage-channel-tabs,
    html[data-theme="light"] dialog.worldex-usage-dialog .worldex-usage-tabs,
    html[data-theme="light"] dialog.worldex-usage-dialog .worldex-usage-columns,
    html[data-theme="light"] dialog.worldex-usage-dialog .worldex-usage-daily-head,
    html[data-theme="light"] dialog.worldex-failures-dialog .worldex-failures-tabs,
    html[data-theme="light"] dialog.worldex-reference-dialog .worldex-reference-toolbar {
      background: var(--light-ui-subtle);
      color: var(--light-ui-text);
    }

    /* Unified monochrome tool icons and the two-state message composer. */
    .ui-icon-sprite {
      position: absolute;
      width: 0;
      height: 0;
      overflow: hidden;
      pointer-events: none;
    }
    .ui-icon {
      width: 20px;
      height: 20px;
      display: block;
      flex: 0 0 20px;
      overflow: visible;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.4;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    button.icon-circle,
    html[data-theme="light"] button.icon-circle {
      width: 40px;
      min-width: 40px;
      height: 40px;
      min-height: 40px;
      display: inline-grid;
      place-items: center;
      padding: 0;
      border: 2px solid #090909;
      border-radius: 50%;
      background: #fff;
      color: #090909;
      box-shadow: none;
      line-height: 1;
    }
    button.icon-circle:hover:not(:disabled),
    button.icon-circle[aria-expanded="true"],
    html[data-theme="light"] button.icon-circle:hover:not(:disabled),
    html[data-theme="light"] button.icon-circle[aria-expanded="true"] {
      border-color: #090909;
      background: #eceff1;
      color: #090909;
      box-shadow: none;
      transform: none;
    }
    button.icon-circle:focus-visible,
    html[data-theme="light"] button.icon-circle:focus-visible {
      border-color: #090909;
      outline: 2px solid #fff;
      outline-offset: 2px;
      background: #fff;
      color: #090909;
      box-shadow: 0 0 0 4px #090909;
    }
    button.icon-circle:disabled {
      border-color: #090909;
      background: #fff;
      color: #090909;
      opacity: .36;
    }
    button.icon-circle.icon-circle-small {
      width: 30px;
      min-width: 30px;
      height: 30px;
      min-height: 30px;
    }
    button.icon-circle.icon-circle-small .ui-icon {
      width: 16px;
      height: 16px;
      flex-basis: 16px;
    }
    .theme-toggle-icons {
      display: grid;
      place-items: center;
    }
    .theme-toggle-icons > .ui-icon { grid-area: 1 / 1; }
    .top-actions button.theme-toggle.icon-circle,
    .top-actions button.settings-menu-toggle.icon-circle,
    html[data-theme="light"] .top-actions button.theme-toggle.icon-circle,
    html[data-theme="light"] .top-actions button.settings-menu-toggle.icon-circle {
      width: 40px;
      min-width: 40px;
      height: 40px;
      min-height: 40px;
      border: 2px solid #090909;
      border-radius: 50%;
      background: #fff;
      color: #090909;
    }
    .settings-profile-row {
      min-width: 0;
      display: grid;
      grid-template-columns: 48px minmax(0, 1fr);
      align-items: center;
      gap: 10px;
      padding-top: 4px;
    }
    .top-actions button.settings-avatar-button,
    html[data-theme="light"] .top-actions button.settings-avatar-button {
      position: relative;
      width: 48px;
      min-width: 48px;
      height: 48px;
      min-height: 48px;
      padding: 2px;
      overflow: visible;
      border: 2px solid #090909;
      border-radius: 50%;
      background: #fff;
      color: #090909;
      box-shadow: none;
    }
    .settings-avatar-button > img,
    .settings-avatar-fallback {
      width: 100%;
      height: 100%;
      display: grid;
      place-items: center;
      overflow: hidden;
      border-radius: 50%;
      background: #eef0f1;
      color: #090909;
      object-fit: cover;
      font-size: 17px;
      font-weight: 800;
    }
    .settings-avatar-button > img.hidden,
    .settings-avatar-fallback.hidden { display: none !important; }
    .settings-avatar-badge {
      position: absolute;
      right: -4px;
      bottom: -3px;
      width: 22px;
      height: 22px;
      display: grid;
      place-items: center;
      border: 2px solid #090909;
      border-radius: 50%;
      background: #fff;
      color: #090909;
    }
    .settings-avatar-badge .ui-icon {
      width: 12px;
      height: 12px;
      flex-basis: 12px;
      stroke-width: 2.7;
    }
    .settings-profile-copy { min-width: 0; display: grid; gap: 3px; }
    .settings-avatar-status { min-height: 16px; color: #78909a; font-size: 11px; }
    .settings-avatar-status.error { color: #fb7185; }
    .settings-avatar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
    .top-actions .settings-avatar-actions button.settings-menu-item {
      min-height: 34px;
      padding: 6px 8px;
      text-align: center;
      font-size: 12px;
    }
    .message-row {
      width: fit-content;
      max-width: 94%;
      min-width: 0;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      justify-self: start;
    }
    .message-row.customer,
    .message-row.staff_final {
      flex-direction: row-reverse;
      justify-self: end;
    }
    .message-row.system_note { justify-self: center; }
    .message-row.clarification { width: min(604px, 100%); max-width: 100%; }
    .message-row.schema-review { width: min(824px, 100%); max-width: 100%; }
    .message-row.result { width: min(724px, 100%); max-width: 100%; }
    .message-row.query-error { max-width: 96%; }
    .message-row > .msg,
    .message-row > .msg.clarification,
    .message-row > .msg.schema-review,
    .message-row > .msg.result,
    .message-row > .msg.query-error {
      width: auto;
      max-width: 100%;
      min-width: 0;
      flex: 0 1 auto;
      margin: 0;
      justify-self: auto;
    }
    .message-row.clarification > .msg,
    .message-row.schema-review > .msg,
    .message-row.result > .msg {
      width: calc(100% - 44px);
      max-width: calc(100% - 44px);
      flex: 1 1 auto;
    }
    .message-row.schema-review + .message-row.result { margin-top: 4px; }
    .chat-avatar {
      width: 36px;
      min-width: 36px;
      height: 36px;
      min-height: 36px;
      display: grid;
      place-items: center;
      flex: 0 0 36px;
      overflow: hidden;
      border: 2px solid #090909;
      border-radius: 50%;
      background: #fff;
      color: #090909;
      box-shadow: 0 5px 14px rgba(0, 0, 0, .18);
    }
    .chat-avatar img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
    }
    .chat-avatar-fallback {
      font-size: 14px;
      font-weight: 800;
      line-height: 1;
    }
    .composer-shell {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) 40px 40px;
      align-items: center;
      gap: 7px;
      padding: 8px 9px;
      border-radius: 8px;
    }
    .composer-shell > .composer-tools {
      grid-column: 1;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .composer-input-row {
      grid-column: 2;
      min-width: 0;
      min-height: 44px;
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      align-items: center;
      gap: 0;
    }
    .composer-input-row > textarea,
    .composer-input-row > .composer-voice-hold {
      grid-column: 1;
      grid-row: 1;
    }
    .composer-shell > .composer-mode-toggle { grid-column: 3; }
    .composer-shell > .composer-send-button { grid-column: 4; }
    .composer .composer-shell .composer-input-row textarea {
      min-width: 0;
      min-height: 40px;
      padding: 8px 3px 5px;
    }
    .composer .composer-shell .composer-input-row textarea[hidden] {
      display: none !important;
    }
    button.composer-voice-hold {
      width: 100%;
      min-width: 0;
      height: 44px;
      min-height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 0 18px;
      border: 2px solid #090909;
      border-radius: 8px;
      background: #fff;
      color: #090909;
      box-shadow: none;
      font-size: 14px;
      font-weight: 700;
      line-height: 1;
      letter-spacing: 0;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
      transition: background-color .14s ease, transform .1s ease;
    }
    button.composer-voice-hold[hidden] { display: none !important; }
    button.composer-voice-hold:hover:not(:disabled),
    button.composer-voice-hold:focus-visible {
      border-color: #090909;
      outline: 0;
      background: #eceff1;
      color: #090909;
      box-shadow: none;
    }
    button.composer-voice-hold:active:not(:disabled),
    button.composer-voice-hold.is-listening {
      border-color: #090909;
      background: #dfe3e5;
      color: #090909;
      box-shadow: inset 0 0 0 1px #090909;
      transform: scale(.995);
    }
    button.composer-voice-hold.is-transcribing,
    button.composer-voice-hold:disabled {
      border-color: #090909;
      background: #eef0f1;
      color: #090909;
      opacity: .64;
      box-shadow: none;
    }
    button#voiceInputBtn.composer-voice-hold {
      border: 2px solid #090909;
      background: #fff;
      color: #090909;
      box-shadow: none;
    }
    button#voiceInputBtn.composer-voice-hold:hover:not(:disabled),
    button#voiceInputBtn.composer-voice-hold:focus-visible {
      border-color: #090909;
      background: #eceff1;
      color: #090909;
      box-shadow: none;
    }
    button#voiceInputBtn.composer-voice-hold:active:not(:disabled),
    button#voiceInputBtn.composer-voice-hold.is-listening {
      border-color: #090909;
      background: #dfe3e5;
      color: #090909;
      box-shadow: inset 0 0 0 1px #090909;
    }
    button#voiceInputBtn.composer-voice-hold.is-transcribing,
    button#voiceInputBtn.composer-voice-hold:disabled {
      border-color: #090909;
      background: #eef0f1;
      color: #090909;
      box-shadow: none;
    }
    button.composer-voice-hold .voice-button-label {
      display: inline;
      min-width: 0;
      overflow: hidden;
      color: currentColor;
      font-size: 14px;
      font-weight: 700;
      line-height: 1;
      text-overflow: ellipsis;
      white-space: nowrap;
      filter: none;
    }
    button.composer-voice-hold .voice-level {
      height: 20px;
      display: none;
      align-items: center;
      gap: 3px;
      color: #090909;
    }
    button.composer-voice-hold.is-listening .voice-level,
    button.composer-voice-hold.is-transcribing .voice-level { display: flex; }
    button.composer-voice-hold .voice-level i {
      width: 3px;
      height: 7px;
      border-radius: 2px;
      background: currentColor;
      animation: voice-level .72s ease-in-out infinite alternate;
    }
    button.composer-voice-hold .voice-level i:nth-child(2),
    button.composer-voice-hold .voice-level i:nth-child(4) { height: 13px; }
    button.composer-voice-hold .voice-level i:nth-child(3) { height: 19px; }
    button.composer-voice-hold .voice-level i:nth-child(2) { animation-delay: .12s; }
    button.composer-voice-hold .voice-level i:nth-child(3) { animation-delay: .24s; }
    button.composer-voice-hold .voice-level i:nth-child(4) { animation-delay: .36s; }
    button.composer-voice-hold .voice-level i:nth-child(5) { animation-delay: .48s; }
    button.composer-mode-toggle,
    button#imageUploadBtn,
    button#cameraCaptureBtn,
    button#customerSendBtn {
      width: 40px;
      min-width: 40px;
      height: 40px;
      min-height: 40px;
    }
    button.composer-send-button.is-busy::after {
      width: 17px;
      height: 17px;
      border: 2px solid rgba(9, 9, 9, .25);
      border-top-color: #090909;
    }
    button.attachment-remove { font-size: inherit; }
    .result-feedback button.icon-circle,
    html[data-theme="light"] .result-feedback button.icon-circle {
      width: 36px;
      min-width: 36px;
      height: 36px;
      min-height: 36px;
      border-color: #090909;
      background: #fff;
      color: #090909;
    }
    .result-feedback button.icon-circle .ui-icon {
      width: 18px;
      height: 18px;
      flex-basis: 18px;
    }
    .schema-review-cancel.icon-circle {
      width: 34px;
      min-width: 34px;
      height: 34px;
      min-height: 34px;
    }

    @media (max-width: 600px) {
      .message-row,
      .message-row.clarification,
      .message-row.schema-review,
      .message-row.result,
      .message-row.query-error {
        width: 100%;
        max-width: 100%;
      }
      .message-row > .msg,
      .message-row > .msg.clarification,
      .message-row > .msg.schema-review,
      .message-row > .msg.result,
      .message-row > .msg.query-error {
        width: calc(100% - 44px);
        max-width: calc(100% - 44px);
        flex: 1 1 auto;
      }
      .composer-shell {
        gap: 6px;
        grid-template-columns: auto minmax(0, 1fr) 40px 40px;
        padding: 7px 8px;
        border-radius: 8px;
      }
      .composer-input-row {
        min-height: 42px;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
      }
      .composer .composer-shell .composer-input-row textarea {
        min-height: 40px;
        max-height: 96px;
        padding-top: 7px;
      }
      button#voiceInputBtn.composer-voice-hold {
        width: 100%;
        min-width: 0;
        height: 42px;
        min-height: 42px;
        padding: 0 12px;
        border-radius: 8px;
      }
    }

    /* Keep the customer-management layout authoritative over legacy dialog rules. */
    dialog.booking-mode-dialog {
      width: min(730px, calc(100vw - 28px));
      height: auto;
      max-height: calc(var(--app-viewport-height) - 28px);
      padding: 24px;
      overflow: auto;
    }
    .booking-mode-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
    button.booking-mode-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; text-align: left; white-space: normal; padding: 24px; height: auto; min-height: 214px; }
    .booking-mode-choice strong { font-size: 20px; }
    .booking-mode-choice span { color: var(--muted); font-size: 14px; line-height: 1.75; }
    .booking-mode-choice b { margin-top: auto; font-size: 13px; color: var(--accent, #23cce4); }
    .self-booking-card { width: min(900px, 100%); flex: 0 0 auto; box-sizing: border-box; padding: 22px; border: 1px solid var(--border, #314358); border-radius: 16px; background: var(--panel, #152235); color: var(--text); margin: 14px 0; }
    .self-booking-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
    .self-booking-head strong { font-size: 19px; }
    .self-booking-number { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
    .self-booking-intro { font-size: 13px; line-height: 1.8; color: var(--muted); margin: 12px 0; }
    .self-booking-status { padding: 11px 14px; background: color-mix(in srgb, var(--accent, #23cce4) 9%, transparent); border-radius: 8px; font-size: 13px; line-height: 1.6; margin-bottom: 18px; overflow-wrap: anywhere; }
    .self-booking-form { display: grid; gap: 18px; }
    .self-booking-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; border: 0; padding: 0; margin: 0; min-width: 0; }
    .self-booking-group legend { padding: 0; font-size: 14px; font-weight: 700; margin-bottom: 12px; }
    .self-booking-field { display: flex; flex-direction: column; min-width: 0; gap: 5px; }
    .self-booking-label { font-size: 12px; font-weight: 600; }
    .self-booking-field input, .self-booking-field select, .self-booking-field textarea { width: 100%; min-width: 0; box-sizing: border-box; font-size: 14px; height: 40px; }
    .self-booking-field textarea { min-height: 72px; resize: vertical; }
    .self-booking-field input[aria-invalid="true"], .self-booking-field select[aria-invalid="true"] { border-color: #b68c47; }
    .self-booking-source { font-size: 11px; color: var(--muted); }
    .self-booking-field-error { font-size: 11px; color: var(--yellow, #d5a958); line-height: 1.5; }
    .self-booking-field.needs-review .self-booking-label { color: var(--yellow, #d5a958); }
    .booking-review-warnings { margin: 0 0 16px; padding: 10px 12px; background: color-mix(in srgb, #d5a958 8%, transparent); border-radius: 8px; font-size: 12px; color: var(--yellow, #d5a958); line-height: 1.6; }
    .booking-review-warnings p { margin: 4px 0; }
    .booking-review-warning { font-size: 12px; color: var(--yellow, #d5a958); line-height: 1.5; }
    .booking-field-source { color: var(--muted); font-size: 11px; }
    .self-booking-equipment { display: block; }
    .self-booking-containers { display: grid; gap: 8px; margin-bottom: 10px; }
    .self-booking-container-row { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(60px, 100px) auto auto; align-items: center; gap: 9px; max-width: 520px; }
    .self-booking-container-row select, .self-booking-container-row input { width: 100%; min-width: 0; box-sizing: border-box; }
    .self-booking-container-row span { color: var(--muted); font-size: 12px; }
    .self-booking-container-error { display: block; margin-top: 6px; }
    .self-booking-documents { margin-top: 18px; display: grid; gap: 8px; }
    .self-booking-document { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; padding: 9px 0; border-bottom: 1px solid var(--border, #314358); }
    .self-booking-document span { min-width: 0; overflow-wrap: anywhere; }
    .self-booking-document button { flex-shrink: 0; font-size: 11px; }
    .self-booking-warnings { color: var(--yellow, #d5a958); font-size: 12px; line-height: 1.7; }
    .self-booking-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
    .self-booking-actions button { font-size: 12px; }
    .self-booking-card[data-state="saved"] .self-booking-status { background: color-mix(in srgb, #34d399 12%, transparent); }
    .self-booking-card input:disabled, .self-booking-card textarea:disabled, .self-booking-card select:disabled { opacity: .75; }
    @media (max-width: 600px) {
      dialog.booking-mode-dialog { padding: 18px; }
      .booking-mode-choices { grid-template-columns: 1fr; gap: 12px; }
      button.booking-mode-choice { padding: 18px; min-height: 170px; }
      .self-booking-card { padding: 16px 12px; border-radius: 12px; }
      .self-booking-group { grid-template-columns: 1fr; }
      .self-booking-container-row { grid-template-columns: minmax(72px, 1fr) 64px auto auto; gap: 5px; }
      .self-booking-container-row button { padding-left: 8px; padding-right: 8px; }
      .self-booking-actions button { min-height: 40px; }
    }
    dialog.user-management-dialog {
      width: min(1180px, calc(100vw - 32px - var(--safe-area-left) - var(--safe-area-right)));
      height: min(780px, calc(var(--app-viewport-height) - 32px));
    }
    dialog.user-management-dialog .user-management-main {
      grid-template-rows: auto auto auto minmax(0, 1fr) auto;
      overflow: hidden;
    }
    @media (max-width: 760px) {
      dialog.user-management-dialog {
        width: calc(100vw - 14px - var(--safe-area-left) - var(--safe-area-right));
        height: calc(var(--app-viewport-height) - 14px - var(--safe-area-top) - var(--safe-area-bottom));
      }
    }
/* Real transfer percentages; indeterminate bars describe provider work. */
.booking-transfer-progress { display: grid; gap: 6px; width: 100%; min-width: 0; margin: 8px 0; }
.booking-transfer-label { font-size: 12px; overflow-wrap: anywhere; color: var(--text, inherit); }
.booking-transfer-progress progress { display: block; width: 100%; height: 8px; accent-color: #10b7cc; }
#bookingOmsProgress { flex: 1; min-width: 0; display: block; }
#bookingOmsProgress.hidden { display: none; }
@media (prefers-reduced-motion: reduce) { .booking-transfer-progress progress { animation: none; } }
.environment-badge { font-size: 12px; font-weight: 650; padding: 3px 8px; border: 1px solid currentColor; border-radius: 6px; color: #42b883; white-space: normal; }
.environment-badge[data-role="standby"], .environment-badge[data-role="test"] { color: #da981e; }
.environment-sync-button { font-size: 12px; padding: 3px 6px; }
