:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #17202a;
  background: #eef1f4;
  --border: #dce2e7;
  --border-strong: #c8d0d8;
  --muted: #687481;
  --subtle: #f6f8f9;
  --green: #147657;
  --green-hover: #0f6549;
  --green-soft: #e8f4ef;
  --blue: #2367b2;
  --blue-soft: #eaf2fb;
  --amber: #8d5b0a;
  --amber-soft: #fff3dc;
  --red: #ad3737;
  --red-soft: #fcecec;
  --shadow: 0 1px 2px rgba(17, 30, 43, 0.08);
}

* { box-sizing: border-box; letter-spacing: 0; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { display: grid; grid-template-rows: 62px minmax(0, 1fr); background: #eef1f4; }
body.has-history-translation-progress { grid-template-rows: 62px auto minmax(0, 1fr); }
body.has-translation-cost-summary { grid-template-rows: 62px auto minmax(0, 1fr); }
.translation-cost-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; padding: 7px 14px; background: #f3faf8; border-bottom: 1px solid var(--border); font-size: 12px; color: #375950; }
.translation-cost-summary [data-cost="total"] { text-align: right; }
.translation-cost-summary [data-cost="bar"], .translation-cost-summary [data-cost="days"] { grid-column: 1 / -1; }
.translation-cost-summary [data-cost="status"] { text-align: right; font-size: 11px; color: #677d86; }
.translation-cost-summary[data-stale="true"] { background: #fff9e9; }
.translation-cost-summary progress { display: block; width: 100%; height: 7px; margin: 5px 0; accent-color: #167459; }
.translation-cost-summary small { color: #677d86; }
.manual-refund-amount { font-size: 19px; font-weight: 700; color: #17664c; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }

.topbar {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(400px, 1fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 10;
}
.brand-block, .top-actions, .case-title-line, .case-toolbar-actions, .composer-heading, .composer-footer, .message-meta, .shipment-item > div, .legacy-item > div { display: flex; align-items: center; }
.brand-block { min-width: 0; gap: 9px; }
.brand-mark { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 5px; background: var(--green); color: #fff; font-size: 17px; font-weight: 750; }
.brand-copy { flex: 1 1 170px; min-width: 120px; }
.brand-copy h1 { overflow: hidden; font-size: 15px; font-weight: 730; line-height: 19px; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy span { color: var(--muted); font-size: 11px; }
.shop-selector { display: grid; flex: 0 1 210px; min-width: 140px; gap: 2px; color: var(--muted); font-size: 9px; }
.shop-selector select { width: 100%; min-width: 0; height: 28px; padding: 0 24px 0 7px; border: 1px solid var(--border); border-radius: 5px; color: #263640; background: #fff; font-size: 10px; font-weight: 650; }
.shop-read-only-badge { flex: 0 0 auto; padding: 4px 7px; border: 1px solid #ddbe72; border-radius: 999px; color: #7a5207; background: #fff8e8; font-size: 9px; font-weight: 700; white-space: nowrap; }

.view-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--border); border-radius: 6px; background: #f5f7f8; }
.view-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 4px; color: #52606d; background: transparent; font-weight: 650; white-space: nowrap; }
.view-button.active { color: #173f32; background: #fff; box-shadow: var(--shadow); }
.view-button svg, button svg, .search-box svg { width: 16px; height: 16px; stroke-width: 2; }

.top-actions { justify-content: flex-end; min-width: 0; gap: 7px; }
.prepare-computer-button { flex: 0 0 auto; height: 32px; min-height: 32px; color: #185b46; border-color: #a9cdbf; background: #f4fbf8; }
.prepare-computer-button:hover { background: #e9f6f0; }
.prepare-computer-button.prepared { color: #116344; border-color: #83bca6; background: #e8f5ef; }
.coverage-summary, .discussion-sync-summary, .proxy-status { display: inline-flex; align-items: center; gap: 7px; min-width: 0; height: 32px; padding: 0 9px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); background: var(--subtle); font-size: 11px; white-space: nowrap; }
.coverage-summary { max-width: 330px; }
.discussion-sync-summary { max-width: 270px; cursor: pointer; }
.coverage-summary span, .discussion-sync-summary span, .proxy-status span:last-child { overflow: hidden; text-overflow: ellipsis; }
.discussion-sync-summary.sync-ok { color: #14674c; border-color: #b6d8ca; background: #f2faf6; }
.discussion-sync-summary.sync-error { color: #a02f2f; border-color: #e6b4b4; background: #fff7f7; }
.discussion-sync-summary.sync-running { color: #8a6413; border-color: #e4cf9f; background: #fffbef; }
.proxy-status { max-width: 210px; }
.status-dot { display: inline-block; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: #8c98a3; }
.status-dot.ok { background: #16a36a; box-shadow: 0 0 0 3px rgba(22,163,106,.12); }
.status-dot.error { background: #c94141; box-shadow: 0 0 0 3px rgba(201,65,65,.12); }
.status-dot.checking { background: #c17a13; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.icon-button, .command-button, .secondary-button, .danger-button, .text-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 34px; border-radius: 5px; font-weight: 650; white-space: nowrap;
}
[hidden] { display: none !important; }
.icon-button { flex: 0 0 34px; width: 34px; padding: 0; border: 1px solid var(--border); color: #485563; background: #fff; }
.icon-button.small { flex-basis: 30px; width: 30px; min-height: 30px; }
.command-button { padding: 0 12px; border: 1px solid #0d654a; color: #fff; background: var(--green); }
.command-button:hover { background: var(--green-hover); }
.secondary-button { padding: 0 11px; border: 1px solid var(--border-strong); color: #2d3945; background: #fff; }
.secondary-button:hover, .icon-button:hover { background: #f2f5f7; }
.danger-button { padding: 0 11px; border: 1px solid #edc2c2; color: var(--red); background: var(--red-soft); }
.text-button { min-height: 30px; padding: 0 7px; border: 0; color: var(--blue); background: transparent; }
.locked { color: #7c6464; border-color: #e0caca; background: #faf5f5; }
.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.full-width { width: 100%; }

.app-main { min-width: 0; min-height: 0; }
.history-translation-progress { padding: 7px 16px; border-bottom: 1px solid var(--border); background: #f5fbf8; font-size: 11px; }
.history-progress-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 16px; line-height: 17px; }
.history-progress-heading strong { color: var(--green); }
#historyTranslationUpdated { margin-left: auto; color: var(--muted); }
#historyTranslationDetail { color: var(--muted); line-height: 16px; }
#historyTranslationBar { display: block; width: 100%; height: 7px; margin: 5px 0; border: 0; border-radius: 4px; overflow: hidden; accent-color: var(--green); }
#historyTranslationBar::-webkit-progress-bar { background: #dceae3; border-radius: 4px; }
#historyTranslationBar::-webkit-progress-value { background: var(--green); border-radius: 4px; }
#historyTranslationBar::-moz-progress-bar { background: var(--green); border-radius: 4px; }
.discussion-view { display: grid; grid-template-columns: minmax(280px, 330px) minmax(520px, 1fr) minmax(300px, 360px); width: 100%; height: 100%; min-height: 0; }
.queue-panel, .conversation-panel, .context-panel { min-width: 0; min-height: 0; background: #fff; }
.queue-panel { display: grid; grid-template-rows: auto auto auto auto auto minmax(0, 1fr); border-right: 1px solid var(--border); }
.case-time-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 0 12px 10px; color: var(--muted); font-size: 11px; }
.conversation-panel { position: relative; border-right: 1px solid var(--border); }
.context-panel { display: grid; grid-template-rows: 43px minmax(0, 1fr); }

.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px 8px; }
.panel-heading h2, .orders-toolbar h2 { font-size: 15px; line-height: 20px; }
.panel-heading span, .orders-toolbar span { color: var(--muted); font-size: 11px; }
.queue-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 0 10px 8px; border-bottom: 1px solid var(--border); }
.queue-tab { min-width: 0; padding: 8px 2px 7px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 11px; white-space: nowrap; }
.queue-tab strong { display: block; margin-top: 2px; color: #26313c; font-size: 12px; }
.queue-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 700; }
.queue-count-note { display: flex; align-items: flex-start; gap: 5px; padding: 6px 12px 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.queue-count-note svg { flex: 0 0 13px; width: 13px; height: 13px; margin-top: 1px; }
.search-box { display: flex; align-items: center; gap: 8px; min-width: 0; height: 36px; margin: 9px 10px; padding: 0 10px; border: 1px solid var(--border); border-radius: 5px; color: #788491; background: #fafbfc; }
.search-box:focus-within { border-color: #75aa96; box-shadow: 0 0 0 2px rgba(20,118,87,.10); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; }
.case-list { min-height: 0; overflow: auto; }
.case-row { display: block; width: 100%; min-height: 96px; padding: 11px 12px; border: 0; border-bottom: 1px solid #edf0f2; border-left: 3px solid transparent; color: inherit; text-align: left; background: #fff; }
.case-row:hover { background: #f6f9f8; }
.case-row.active { border-left-color: var(--green); background: var(--green-soft); }
.case-row.unread { background: #f4f8fd; }
.case-row.active.unread { background: #e8f3f0; }
.case-load-more { display: block; width: calc(100% - 20px); margin: 12px 10px; padding: 10px 12px; border: 1px solid #cfdad6; border-radius: 8px; background: #fff; color: var(--green); font-weight: 700; cursor: pointer; }
.case-load-more:hover { background: var(--green-soft); }
.case-load-more:disabled { cursor: wait; opacity: .65; }
.case-row-top, .case-row-middle, .case-row-bottom { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: 8px; }
.case-row-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.case-row-top time { flex: 0 0 auto; color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.case-row-middle { margin-top: 7px; }
.case-row-middle > span:first-child, .case-row-bottom > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-row-middle > span:first-child { font-size: 12px; }
.case-row-bottom { margin-top: 6px; color: var(--muted); font-size: 11px; }
.unread-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--blue); }
.state-mini, .platform-mini { flex: 0 0 auto; padding: 2px 5px; border-radius: 4px; font-size: 10px; }
.state-mini { color: #385247; background: #eef3f1; }
.platform-mini.to_treat { color: var(--amber); background: var(--amber-soft); }
.platform-mini.treated { color: var(--blue); background: var(--blue-soft); }
.platform-mini.local_replied { color: var(--green); background: var(--green-soft); }
.platform-mini.closed { color: #596572; background: #eef1f4; }
.empty-list, .table-empty { padding: 34px 18px; color: var(--muted); text-align: center; }

.empty-state { display: grid; place-items: center; align-content: center; gap: 8px; height: 100%; color: var(--muted); }
.empty-state svg { width: 34px; height: 34px; }
.empty-state strong { color: #2f3b47; }
.case-workspace { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: 100%; min-height: 0; }
.case-toolbar { display: flex; align-items: center; justify-content: space-between; min-width: 0; min-height: 72px; padding: 10px 15px; border-bottom: 1px solid var(--border); background: #fff; }
.case-title-wrap { min-width: 0; }
.case-title-line { min-width: 0; gap: 7px; }
.case-title-line h2 { max-width: 270px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.case-title-wrap p { max-width: 650px; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.case-toolbar-actions { gap: 8px; }
.batch-suggest-button { min-width: 170px; white-space: nowrap; }
.batch-suggest-button.busy { min-width: 190px; }
.compact-field { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.compact-field select { height: 32px; padding: 0 24px 0 8px; border: 1px solid var(--border); border-radius: 4px; color: #26313c; background: #fff; }
.state-pill, .platform-pill, .unread-badge, .intent-tag { display: inline-flex; align-items: center; min-height: 23px; padding: 0 7px; border-radius: 4px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.state-pill { color: #315347; background: var(--green-soft); }
.platform-pill.to_treat { color: var(--amber); background: var(--amber-soft); }
.platform-pill.treated { color: var(--blue); background: var(--blue-soft); }
.platform-pill.local_replied { color: var(--green); background: var(--green-soft); }
.platform-pill.closed, .platform-pill.unknown { color: #5f6974; background: #eef1f4; }
.unread-badge { color: var(--blue); background: var(--blue-soft); }
.intent-tag { margin-left: 7px; color: #385d50; background: var(--green-soft); }

.history-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 6px 15px; border-bottom: 1px solid var(--border); background: #f9fafb; }
.history-toolbar strong { font-size: 13px; }
.history-toolbar span { margin-left: 7px; color: var(--muted); font-size: 11px; }
.subtle-status.warning { color: var(--amber); }
.conversation-scroll { min-height: 0; overflow: auto; background: #f4f6f7; }
.history-list { display: flex; flex-direction: column; gap: 12px; max-width: 920px; margin: 0 auto; padding: 18px 24px 30px; }
.message-entry { width: min(82%, 720px); padding: 11px 13px; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); background: #fff; }
.message-entry.customer { align-self: flex-start; border-left: 3px solid #4086c6; }
.message-entry.seller { align-self: flex-end; border-right: 3px solid var(--green); background: #f5fbf8; }
.message-entry.platform { align-self: center; border-left: 3px solid #a57321; background: #fffaf0; }
.message-meta { justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }
.message-meta strong { color: #34414e; font-size: 11px; }
.message-original, .message-translation { overflow-wrap: anywhere; white-space: normal; }
.message-original { margin-top: 7px; margin-bottom: 0; color: #1f2a34; line-height: 1.45; }
.message-translation { margin-top: 9px; padding-top: 9px; border-top: 1px dashed #cfd7dd; color: #315744; line-height: 1.52; }
.message-translation::before { content: "简体中文："; font-weight: 700; }
.message-translation.pending { color: #8a6b36; }
.message-translation.pending::before { content: ""; }
.attachment-list { display: grid; gap: 6px; margin-top: 10px; }
.attachment-link { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 6px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 4px; color: var(--blue); text-decoration: none; background: #fff; }
.attachment-link svg { grid-row: 1 / span 2; width: 16px; height: 16px; }
.attachment-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-link small { color: var(--muted); }
.history-empty { display: grid; place-items: center; gap: 8px; min-height: 220px; color: var(--muted); }

.composer-panel { padding: 10px 14px 11px; border-top: 1px solid var(--border); background: #fff; }
.composer-heading, .composer-footer { justify-content: space-between; gap: 8px; }
.composer-heading strong { font-size: 12px; }
.composer-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.reply-template-toolbar { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.reply-template-category { white-space: nowrap; border: 1px solid #b6cfe9; border-radius: 5px; padding: 5px 8px; background: #f8fbff; color: #2468a9; font-size: 12px; cursor: pointer; }
.reply-template-category[aria-expanded="true"], .reply-template-category:hover { background: #eaf3ff; border-color: #78a9d9; }
.reply-template-category:disabled { opacity: .5; cursor: not-allowed; }
.reply-template-popup { position: fixed; z-index: 1100; overflow-y: auto; border: 1px solid #d7e1eb; border-radius: 7px; background: white; padding: 6px; box-shadow: 0 8px 24px #18314f25; }
.reply-template-menu-title { display: block; padding: 7px 8px; font-size: 13px; }
.reply-template-item { display: flex; width: 100%; gap: 8px; align-items: center; justify-content: space-between; border: 0; border-radius: 4px; background: white; text-align: left; padding: 9px 8px; color: #25384c; font-size: 13px; cursor: pointer; }
.reply-template-item:hover, .reply-template-item:focus-visible { background: #eaf3ff; outline: 2px solid #83b0df; outline-offset: -2px; }
.reply-template-badge { flex-shrink: 0; color: #996010; background: #fff2cf; padding: 2px 4px; border-radius: 3px; font-size: 11px; }
.reply-template-modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; }
.reply-template-backdrop { position: absolute; inset: 0; border: 0; background: #18263866; width: 100%; height: 100%; cursor: default; }
.reply-template-dialog { position: relative; width: min(840px, 100%); max-height: 88vh; overflow-y: auto; padding: 22px; border-radius: 9px; background: white; box-shadow: 0 16px 60px #0003; }
.reply-template-dialog h2 { margin: 0 0 10px; font-size: 18px; }
.reply-template-description { color: #627184; line-height: 1.5; }
.reply-template-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reply-template-preview pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13px; line-height: 1.6; border: 1px solid #dfe7ed; border-radius: 5px; padding: 12px; max-height: 280px; overflow-y: auto; margin: 0; }
.reply-template-review { display: flex; align-items: flex-start; gap: 8px; margin: 15px 0; padding: 12px; border: 1px solid #f0d192; background: #fff7e7; color: #805217; line-height: 1.6; font-size: 13px; }
.reply-template-review input { flex-shrink: 0; margin-top: 5px; }
.reply-template-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
@media (max-width: 700px) {
  .reply-template-preview { grid-template-columns: 1fr; }
  .reply-template-category { padding: 5px 6px; }
  .reply-template-dialog { padding: 16px; }
  .reply-template-dialog-actions { flex-wrap: wrap; }
}
.composer-panel textarea, .form-field textarea, .form-field input { width: 100%; border: 1px solid var(--border); border-radius: 5px; outline: 0; background: #fff; }
.composer-panel textarea { min-height: 76px; max-height: 160px; margin-top: 7px; padding: 9px 10px; resize: vertical; line-height: 1.45; }
.composer-panel textarea:focus, .form-field textarea:focus, .form-field input:focus { border-color: #72a994; box-shadow: 0 0 0 2px rgba(20,118,87,.09); }
.bilingual-composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 7px; }
.draft-language-panel { display: grid; gap: 5px; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: #f8faf9; }
.draft-language-panel-fr { border-color: #a9cdbf; background: #fff; }
.draft-language-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.draft-language-heading small, .composer-translation-row span { color: var(--muted); font-size: 10px; }
.composer-panel .draft-language-panel textarea { min-height: 132px; max-height: 240px; margin-top: 0; }
.composer-translation-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.composer-footer { margin-top: 7px; }
.composer-footer > span { margin-right: auto; color: var(--muted); font-size: 10px; }

.composer-attachment-row { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.composer-attachment-row > span { color: var(--muted); font-size: 10px; }
.outgoing-attachment-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 7px; }
.outgoing-attachment-item { display: grid; grid-template-columns: 17px minmax(0, 1fr) auto 30px; align-items: center; gap: 5px; min-width: 0; min-height: 34px; padding: 2px 2px 2px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--subtle); }
.outgoing-attachment-item > svg { width: 15px; height: 15px; color: var(--muted); }
.outgoing-attachment-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.outgoing-attachment-item > small { color: var(--muted); font-size: 9px; white-space: nowrap; }

.context-heading { display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 0 14px; border-bottom: 1px solid var(--border); background: #fff; }
.context-heading h2 { font-size: 13px; }
.context-heading span { color: var(--muted); font-size: 10px; }
.context-scroll { min-height: 0; overflow: auto; }
.context-section { padding: 14px; border-bottom: 1px solid var(--border); }
.context-section h3 { margin-bottom: 10px; font-size: 12px; }
.detail-list { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(0, 1.5fr); gap: 7px 10px; margin: 0; font-size: 11px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; color: #25313d; text-align: right; }
.line-items, .return-items, .legacy-items, .shipment-items, .audit-items { display: grid; gap: 8px; }
.line-item, .return-item, .shipment-item, .legacy-item, .audit-item { padding: 9px; border: 1px solid var(--border); border-radius: 5px; background: var(--subtle); }
.line-item { display: grid; gap: 4px; }
.line-item strong { overflow-wrap: anywhere; font-size: 11px; }
.line-item span, .return-item span, .return-item small, .shipment-item small, .legacy-item small, .audit-item small { color: var(--muted); font-size: 10px; }
.line-item small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.line-unit-list { display: grid; gap: 5px; margin: 2px 0; padding: 0; list-style: none; }
.line-unit-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 6px; border-radius: 4px; background: #fff; }
.line-unit-list li span { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.refund-evidence-summary { display: grid; gap: 5px; margin-bottom: 8px; padding: 9px 10px; border: 1px solid #cbd8e5; border-radius: 7px; background: #f6f9fc; }
.refund-decision-copy { display: grid; gap: 4px; }
.refund-evidence-summary span, .refund-evidence-summary small { color: var(--muted); }
.refund-evidence-summary p { margin: 0; color: #a33a2b; line-height: 1.45; }
.refund-evidence-summary.ready { border-color: #9bc5ac; background: #eef9f2; color: #17633b; }
.refund-evidence-summary.ready span { color: #17633b; }
.refund-evidence-summary.blocked { border-color: #e7c0bb; background: #fff2f0; color: #9b3027; }
.refund-evidence-summary.blocked span { color: #9b3027; }
.refund-evidence-summary .simple-refund-button { margin-top: 3px; }
.refund-action-dialog { width: min(620px, 100%); }
.refund-action-body { min-height: 0; overflow: auto; padding: 20px; display: grid; gap: 15px; }
.refund-action-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.refund-action-option { text-align: left; border: 1px solid var(--border-strong); border-radius: 7px; background: #fff; padding: 13px; color: inherit; }
.refund-action-option[aria-pressed="true"] { border-color: #177b55; background: #eef8f2; }
.refund-action-option strong, .refund-action-option small { display: block; }
.refund-action-option small { margin-top: 5px; color: var(--muted); line-height: 1.4; }
.refund-action-facts { display: grid; gap: 5px; padding: 11px 13px; background: #f6f9fc; border-radius: 6px; }
.refund-action-facts p { margin: 0; }
.refund-action-amount { font-size: 23px; font-weight: 700; }
.refund-action-field { display: grid; gap: 5px; }
.refund-action-field input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 5px; font: inherit; }
.refund-action-notice { margin: 0; line-height: 1.5; color: var(--muted); }
.refund-action-notice.blocked { color: #9b3027; }
.refund-action-controls { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.refund-action-result { display: grid; gap: 8px; }
.refund-action-result h3, .refund-action-result p { margin: 0; }
.refund-action-result code { overflow-wrap: anywhere; }
@media (max-width: 520px) { .refund-action-options { grid-template-columns: 1fr; } .refund-action-body { padding: 14px; } }
.refund-unit-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 5px; }
.refund-unit-counts span { padding: 5px 4px; border-radius: 5px; background: #eef3f8; color: var(--muted); text-align: center; }
.refund-unit-counts strong { display: block; color: var(--ink); font-size: 13px; }
.refund-line-selection { display: flex; align-items: flex-start; gap: 7px; margin-top: 6px; padding: 7px 8px; border: 1px solid #a9c8b6; border-radius: 6px; background: #eff9f2; color: #17633b; }
.refund-line-selection.disabled { border-color: #e7c0bb; background: #fff2f0; color: #9b3027; }
.refund-line-selection > span { color: inherit; }
.refund-line-selection input { margin-top: 2px; }
.manual-product-match-review { display: grid; gap: 5px; margin-top: 7px; padding: 9px; border: 1px solid #e6bd70; border-radius: 7px; background: #fff8e8; color: #744b08; }
.manual-product-match-review.confirmed { border-color: #9bc5ac; background: #eef9f2; color: #17633b; }
.manual-product-match-review > span, .manual-product-match-review > small { color: inherit; overflow-wrap: anywhere; }
.manual-product-match-review .secondary-button { margin-top: 2px; min-height: 38px; }
.order-line-facts-refresh { display: grid; gap: 5px; padding: 8px; border: 1px solid #cbd8e5; border-radius: 6px; background: #f6f9fc; }
.order-line-facts-refresh small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.action-boundary-note { margin: 4px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.unit-refund-button { flex: 0 0 auto; min-height: 26px; padding: 4px 7px; font-size: 9px; }
.return-item, .audit-item { display: grid; gap: 4px; }
.return-item strong, .return-item span, .return-item small { min-width: 0; overflow-wrap: anywhere; }
.return-item p, .shipment-item p, .audit-item p { overflow-wrap: anywhere; font-size: 11px; line-height: 1.4; }
.shipment-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.shipment-item > div { min-width: 0; gap: 6px; }
.shipment-item > div strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.shipment-item > div span { color: var(--muted); font-size: 10px; }
.shipment-actions { justify-content: flex-end; align-self: start; }
.shipment-actions .icon-button { flex: 0 0 auto; }
.shipment-delete-button { border-color: #edc2c2; color: var(--red); background: var(--red-soft); }
.shipment-delete-button:hover { background: #f8dede; }
.shipment-item p, .shipment-item small, .shipment-item a { grid-column: 1 / -1; }
.shipment-item a { color: var(--blue); font-size: 10px; }
.shipment-refresh-results { grid-column: 1 / -1; display: grid; gap: 3px; padding: 7px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.shipment-item > .shipment-refresh-results { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.shipment-refresh-results p { margin: 0; }
.shipment-refresh-results p { min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
.shipment-refresh-results .success { color: var(--green); }
.shipment-refresh-results .warning { color: var(--amber); }
.shipment-refresh-results .error { color: var(--red); }
.shipment-status { align-self: start; padding: 2px 5px; border-radius: 4px; color: var(--amber); background: var(--amber-soft); font-size: 10px; }
.shipment-status.delivered { color: var(--green); background: var(--green-soft); }
.shipment-status.exception { color: var(--red); background: var(--red-soft); }
.legacy-item { display: grid; gap: 8px; }
.legacy-item > div { justify-content: space-between; gap: 8px; }
.legacy-item > div span { color: var(--muted); font-size: 10px; }
.legacy-item dl { grid-template-columns: minmax(70px, .75fr) minmax(0, 1.5fr); }
.audit-item { grid-template-columns: minmax(0, 1fr) auto; }
.audit-item p, .audit-item small { grid-column: 1 / -1; }
.audit-item time { color: var(--muted); font-size: 9px; }
.tracking-status-band p, .empty-inline { color: var(--muted); font-size: 11px; line-height: 1.45; }
.ok-text { color: var(--green) !important; }
.warning-text { color: var(--amber) !important; }
.form-field { display: grid; gap: 5px; margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.form-field input, .form-field select { height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 5px; color: #26313c; background: #fff; }
.form-field textarea { padding: 8px; resize: vertical; color: #26313c; }

.ai-change-section { background: #fbfdfc; }
.ai-change-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ai-change-heading h3 { margin-bottom: 3px; }
.ai-change-heading p { color: var(--muted); font-size: 10px; line-height: 1.45; }
.ai-change-heading > span { flex: 0 0 auto; padding: 3px 7px; border-radius: 9px; color: var(--muted); background: var(--subtle); font-size: 9px; font-weight: 700; }
.ai-change-heading > span.active { color: var(--green); background: var(--green-soft); }
.ai-change-input-field textarea { min-height: 92px; line-height: 1.5; }
.ai-change-attachment-tools { display: flex; align-items: center; gap: 8px; margin: -2px 0 6px; }
.ai-change-attachment-tools button { flex: 0 0 auto; min-height: 32px; }
.ai-change-attachment-tools span { color: var(--muted); font-size: 9px; line-height: 1.35; }
.ai-change-screenshot-hint { display: flex; align-items: center; gap: 5px; margin: 0 0 8px; color: #536471; font-size: 9px; line-height: 1.4; }
.ai-change-screenshot-hint svg { flex: 0 0 13px; width: 13px; height: 13px; color: var(--green); }
.ai-change-attachment-card { display: grid; gap: 7px; margin-bottom: 9px; padding: 8px; border: 1px solid #cddbd6; border-radius: 6px; background: #f7fbf9; }
.ai-change-attachment-summary { display: grid; grid-template-columns: 42px minmax(0, 1fr) 30px; align-items: center; gap: 8px; }
.ai-change-attachment-preview { display: grid; width: 42px; height: 42px; overflow: hidden; place-items: center; border: 1px solid #d8e2de; border-radius: 5px; color: var(--green); background: #fff; }
.ai-change-attachment-preview span { display: grid; place-items: center; }
.ai-change-attachment-preview svg { width: 18px; height: 18px; }
.ai-change-attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.ai-change-attachment-summary > div:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.ai-change-attachment-summary strong { overflow: hidden; color: #2b3842; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ai-change-attachment-summary small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.ai-change-attachment-card pre { max-height: 130px; margin: 0; padding: 7px; overflow: auto; border: 1px solid #dce5e1; border-radius: 4px; color: #33434d; background: #fff; font: 9px/1.45 "Microsoft YaHei", sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-change-attachment-card > p { color: var(--muted); font-size: 8px; line-height: 1.4; }
.ai-change-proposal { display: grid; gap: 9px; margin-top: 10px; padding: 10px; border: 1px solid #9bc7b5; border-radius: 6px; background: #f5fbf8; }
.ai-change-proposal.blocked { border-color: #dfc99b; background: #fffaf0; }
.ai-change-proposal.applied { border-color: #76b59d; background: #edf8f3; }
.ai-change-proposal-state { display: flex; justify-content: flex-end; }
.ai-change-proposal-state span { padding: 2px 7px; border-radius: 8px; color: var(--green); background: #dcefe7; font-size: 9px; font-weight: 700; }
.ai-change-proposal.blocked .ai-change-proposal-state span { color: var(--amber); background: var(--amber-soft); }
.ai-change-proposal dl { display: grid; gap: 8px; margin: 0; }
.ai-change-proposal dl > div { display: grid; gap: 3px; }
.ai-change-proposal dt { color: var(--muted); font-size: 9px; }
.ai-change-proposal dd { margin: 0; overflow-wrap: anywhere; color: #26313c; font-size: 10px; line-height: 1.5; white-space: pre-wrap; }
.ai-change-block-reason { padding: 8px; border-radius: 5px; color: #76520f; background: var(--amber-soft); font-size: 10px; line-height: 1.45; }
.ai-change-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.ai-change-actions button { min-height: 34px; }
.ai-change-status { margin-top: 8px; color: var(--muted); font-size: 9px; line-height: 1.45; text-align: center; }
.ai-change-status.warning { color: var(--amber); }
.ai-change-status.blocked { color: #76520f; }
.ai-change-status.saved { color: var(--green); }

.orders-view { display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; width: 100%; height: 100%; min-height: 0; background: #fff; }
.orders-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.orders-title { min-width: 148px; }
.orders-title > span { display: block; }
.orders-title .order-column-status { margin-top: 2px; color: var(--muted); white-space: nowrap; }
.orders-title .order-column-status.saved { color: var(--success); }
.orders-title .order-column-status.error { color: var(--danger); }
.order-search { flex: 1 1 420px; width: min(620px, 60vw); max-width: 720px; margin: 0; }
.order-page-size { flex: 0 0 auto; }
.order-export-button { flex: 0 0 auto; min-height: 34px; white-space: nowrap; }
.order-recall-button { flex: 0 0 auto; min-height: 34px; white-space: nowrap; }
.order-recall-button:not(:disabled) { color: #6d4300; border-color: #d8b56b; background: #fff9eb; }
.integration-strip { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 5px 16px; border-bottom: 1px solid var(--border); background: #fafbfc; }
.integration-status { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 10px; }
.integration-status + .integration-status { margin-left: 10px; padding-left: 18px; border-left: 1px solid var(--border); }
.integration-status svg { flex: 0 0 14px; width: 14px; height: 14px; }
.integration-status.ok { color: var(--green); }
.integration-status.warning { color: var(--amber); }
.integration-status.error { color: var(--red); }
.integration-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
.integration-actions .secondary-button { min-height: 30px; font-size: 10px; }
.integration-actions .secondary-button > svg { flex: 0 0 auto; }
.sync-action-copy { display: grid; gap: 1px; min-width: 0; text-align: left; line-height: 1.2; }
.sync-action-label { min-width: 0; }
.sync-action-copy small { color: var(--muted); font-size: 8px; font-weight: 500; white-space: nowrap; }
.order-filter-bar { display: flex; align-items: flex-end; gap: 8px; min-height: 57px; padding: 7px 16px 8px; border-bottom: 1px solid var(--border); background: #fff; overflow-x: auto; }
.order-filter-bar label { display: grid; flex: 0 0 auto; gap: 4px; color: var(--muted); font-size: 9px; }
.order-filter-bar select { height: 30px; min-width: 112px; padding: 0 24px 0 7px; border: 1px solid var(--border); border-radius: 4px; color: #26313c; background: #fff; }
.order-filter-bar #fundsFilter { min-width: 132px; }
.order-filter-bar #amountRangeFilter,
.order-filter-bar #trackingFilter,
.order-filter-bar #trackingComparisonFilter,
.order-filter-bar #refundReviewFilter { min-width: 154px; }
.order-filter-bar .secondary-button { min-height: 30px; margin-left: auto; }
.unlinked-bet-search { display: grid; gap: 8px; max-height: 210px; padding: 10px 16px; overflow: auto; border-bottom: 1px solid #efc7c7; background: #fff8f7; }
.unlinked-bet-search > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.unlinked-bet-search h3 { color: #8c2929; font-size: 12px; line-height: 1.4; }
.unlinked-bet-search h3 span { font-weight: 500; }
.unlinked-bet-search p { max-width: 980px; margin-top: 2px; color: #6e4a4a; font-size: 10px; line-height: 1.45; }
.manual-review-badge { flex: 0 0 auto; padding: 3px 7px; border: 1px solid #e7b4b4; border-radius: 4px; color: var(--red); background: #fff; font-size: 9px; font-weight: 700; }
.unlinked-bet-search-list { display: grid; gap: 6px; }
.unlinked-bet-search-row { display: grid; grid-template-columns: minmax(160px, .65fr) minmax(260px, 1.6fr) minmax(220px, 1fr); align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid #ead1d1; border-radius: 5px; background: #fff; }
.unlinked-bet-search-row > div:first-child { display: grid; gap: 2px; }
.unlinked-bet-search-row small { color: var(--muted); font-size: 9px; }
.unlinked-bet-search-row strong { color: #2f4658; font-size: 11px; }
.unlinked-bet-search-details { display: flex; flex-wrap: wrap; gap: 5px 12px; color: #4a5660; font-size: 10px; }
.unlinked-bet-reason { justify-self: start; padding: 3px 6px; border: 1px solid #efbcbc; border-radius: 4px; color: var(--red); background: var(--red-soft); font-size: 9px; font-weight: 700; line-height: 1.35; }
.unlinked-bet-reason.ambiguous { color: #8b5a00; border-color: #e7c98d; background: #fff7e3; }
.order-table-wrap { min-height: 0; overflow: auto; }
.order-table { width: 100%; min-width: 2380px; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.order-table.columns-resizable { width: var(--order-table-width); min-width: var(--order-table-width); table-layout: fixed; }
.order-table th { position: sticky; top: 0; z-index: 2; height: 38px; padding: 0 14px 0 9px; border-bottom: 1px solid var(--border-strong); color: #475461; text-align: left; background: #f4f6f7; white-space: nowrap; }
.order-table th.order-select-column,
.order-table td.order-select-column { width: 44px; min-width: 44px; max-width: 44px; padding-right: 6px; padding-left: 6px; text-align: center; }
.order-select-control { display: inline-grid; width: 26px; height: 28px; place-items: center; cursor: pointer; }
.order-select-control input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); cursor: pointer; }
.sort-button { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 32px; padding: 0; overflow: hidden; border: 0; color: inherit; background: transparent; cursor: pointer; font-size: inherit; font-weight: 650; white-space: nowrap; }
.sort-button svg { width: 13px; height: 13px; color: #8a96a2; }
.sort-button.active { color: var(--green); }
.sort-button.active svg { display: none; }
.sort-button.active::after { content: attr(data-direction-label); color: var(--green); font-size: 13px; }
.column-resizer { position: absolute; top: 0; right: 0; z-index: 4; width: 10px; height: 100%; cursor: col-resize; touch-action: none; user-select: none; }
.column-resizer::after { content: ""; position: absolute; top: 6px; bottom: 6px; left: 5px; width: 1px; background: #d7dde1; transition: width .12s ease, background .12s ease; }
.column-resizer:hover::after,
.column-resizer:focus-visible::after,
.column-resizer.active::after { width: 2px; background: var(--green); }
.column-resizer:focus-visible { outline: 2px solid rgba(20, 118, 87, .28); outline-offset: -2px; }
body.resizing-order-column,
body.resizing-order-column * { cursor: col-resize !important; user-select: none !important; }
.order-table td { max-width: 240px; padding: 8px 9px; border-bottom: 1px solid #edf0f2; overflow-wrap: anywhere; vertical-align: top; }
.order-table.columns-resizable td { max-width: none; overflow: hidden; }
.order-table tbody tr:hover { background: #f6f9f8; }
.order-table tbody tr.order-row-selected { background: #edf8f3; box-shadow: inset 3px 0 0 var(--green); }
.order-table tbody tr.order-row-selected:hover { background: #e7f5ef; }
.order-table td small { display: block; margin-top: 3px; color: var(--muted); }
.order-table .note-cell { max-width: 300px; }
.order-table.columns-resizable .note-cell { max-width: none; }
.order-ref-cell { display: flex; align-items: center; gap: 5px; min-width: 150px; }
.order-ref-cell strong { flex: 1 1 auto; }
.order-shop-badge { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; margin-top: 5px; padding: 2px 7px; border: 1px solid #b8dccc; border-radius: 999px; background: #edf8f3; color: #166c53; font-size: 12px; font-weight: 700; line-height: 1.35; white-space: normal; }
.global-order-search .order-select-column { opacity: .48; }
.order-actions { display: flex; align-items: center; gap: 5px; min-width: 118px; }
.order-table.columns-resizable .order-ref-cell,
.order-table.columns-resizable .order-actions,
.order-table.columns-resizable .tracking-number-list { min-width: 0; }
.table-ok { color: var(--green); font-weight: 650; }
.tracking-link { color: var(--blue); font-weight: 650; text-decoration: none; }
.tracking-link:hover { text-decoration: underline; }
.tracking-number-list { display: grid; gap: 3px; min-width: 112px; font-weight: 650; }
.tracking-number-list.bet { color: #2f4658; }
.tracking-comparison { display: inline-block; min-width: 72px; padding: 3px 6px; border: 1px solid transparent; border-radius: 4px; font-size: 10px; font-weight: 700; line-height: 1.35; }
.tracking-comparison.same { color: var(--green); background: var(--green-soft); }
.tracking-comparison.candidate_equal,
.tracking-comparison.mismatch,
.tracking-comparison.bet_only,
.tracking-comparison.shipment_only,
.tracking-comparison.bet_missing,
.tracking-comparison.candidate_missing { color: var(--red); border-color: #efbcbc; background: var(--red-soft); }
.tracking-comparison.missing { color: var(--muted); background: #eef1f4; }
.tracking-comparison.product.exact,
.tracking-comparison.product.fuzzy { color: var(--green); background: var(--green-soft); }
.tracking-comparison.product.review,
.tracking-comparison.product.missing_bet,
.tracking-comparison.product.missing_order { color: var(--amber); border-color: #ead6a5; background: #fff7df; }
.tracking-comparison.product.conflict,
.tracking-comparison.product.different { color: var(--red); border-color: #efbcbc; background: var(--red-soft); }
.bet-reconciliation { display: grid; gap: 7px; margin-bottom: 10px; padding: 9px; border: 1px solid var(--border); border-radius: 6px; background: #f8faf9; }
.bet-reconciliation, .return-item { min-width: 0; }
.bet-reconciliation > div { display: grid; gap: 2px; }
.bet-reconciliation small { color: var(--muted); font-size: 10px; }
.bet-reconciliation strong { display: flex; flex-wrap: wrap; gap: 5px; color: var(--ink); font-size: 11px; }
.bet-reconciliation strong span { padding: 2px 5px; border: 1px solid #dce4e1; border-radius: 4px; background: #fff; }
.bet-reconciliation strong span { max-width: 100%; overflow-wrap: anywhere; }
.returns-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.return-remove-button { border: 1px solid var(--red); background: transparent; color: var(--red); border-radius: 4px; padding: 3px 6px; font-size: 10px; cursor: pointer; }
.return-remove-button:disabled, .return-restore-link:disabled { opacity: .45; cursor: not-allowed; }
.return-panel-row { display: grid; gap: 3px; min-width: 0; padding: 7px 0; border-top: 1px solid #dce4e1; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.return-panel-row-title { display: flex; align-items: center; gap: 6px; }
.return-panel-row-title input { width: 14px; height: 14px; margin: 0; flex: 0 0 auto; }
.return-review-row .return-original-note { color: #806127; }
.return-original-note { white-space: pre-wrap; }
.returns-view-warning { display: block; color: var(--amber) !important; white-space: pre-wrap; line-height: 1.45; }
.order-prematched-return { display: grid; gap: 3px; margin-top: 3px; color: #806127; overflow-wrap: anywhere; }
.order-prematched-return small { white-space: pre-wrap; font-size: 10px; }
.order-prematch-status { color: #806127; font-size: 11px; }
.return-removed-row { opacity: .7; }
.return-restore-link { justify-self: start; border: 0; padding: 0; background: none; color: var(--muted); font-size: 10px; text-decoration: underline; cursor: pointer; }
.product-match-hints { color: var(--muted); font-size: 10px; }
.live-bet-display-boundary,
.historical-bet-evidence-boundary { color: var(--amber); line-height: 1.35; }
.no-octopia-discussion { display: inline-block; color: var(--amber); font-size: 9px; font-weight: 650; line-height: 1.25; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--border); color: var(--muted); }

.modal-open { overflow: hidden; }
.status-dialog.recognition-details-dialog { width: min(1180px, 96vw); }
.recognition-details-body { padding: 20px; overflow: auto; }
.recognition-details-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.recognition-details-filters label { display: grid; gap: 5px; }
.recognition-details-filters select { max-width: 330px; padding: 8px; }
.recognition-details-table { overflow: auto; }
.recognition-details-table table { width: 100%; border-collapse: collapse; }
.recognition-details-table th, .recognition-details-table td { padding: 12px; border-bottom: 1px solid #dde5e8; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.recognition-details-table td:last-child { min-width: 125px; line-height: 2; }
.recognition-details-table small { display: block; color: #697888; }
.recognition-details-pager { display: flex; gap: 14px; align-items: center; justify-content: flex-end; padding-top: 16px; }
.status-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; }
.status-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(20, 29, 38, .48); cursor: default; }
.status-dialog { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(860px, 100%); max-height: min(760px, calc(100vh - 48px)); border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; background: #fff; box-shadow: 0 20px 60px rgba(13, 25, 35, .24); }
.status-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: #fff; }
.status-dialog-header h2 { font-size: 16px; line-height: 22px; }
.status-dialog-header p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.status-dialog-actions { display: flex; align-items: center; gap: 7px; }
.status-dialog-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; min-height: 0; overflow: auto; background: #f7f9fa; }
.status-group { min-width: 0; border-bottom: 1px solid var(--border); background: #fff; }
.status-group:nth-child(odd) { border-right: 1px solid var(--border); }
.status-group h3 { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-bottom: 1px solid #edf0f2; color: #34414d; background: #fafbfc; font-size: 12px; }
.status-group h3 svg { width: 15px; height: 15px; color: var(--green); }
.status-rows { padding: 4px 14px 8px; }
.status-row { display: grid; grid-template-columns: minmax(110px, .75fr) minmax(0, 1.45fr); gap: 14px; min-height: 32px; padding: 7px 0; border-bottom: 1px solid #f0f2f4; font-size: 11px; line-height: 1.5; }
.status-row:last-child { border-bottom: 0; }
.status-row span { color: var(--muted); }
.status-row strong { overflow-wrap: anywhere; color: #2c3945; text-align: right; font-weight: 650; }
.status-good { color: var(--green) !important; }
.status-bad { color: var(--red) !important; }
.status-loading { grid-column: 1 / -1; padding: 48px 20px; color: var(--muted); text-align: center; }
.status-dialog-footer { min-height: 38px; padding: 11px 16px; border-top: 1px solid var(--border); color: var(--muted); background: #fff; font-size: 10px; text-align: center; }
.preparation-dialog { width: min(720px, 100%); }
.ambiguous-intent-dialog { width: min(560px, 100%); grid-template-rows: auto auto auto; }
.ambiguous-intent-body { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 13px; align-items: start; padding: 22px 20px; background: #fffaf0; }
.ambiguous-intent-body > svg { width: 34px; height: 34px; padding: 7px; border-radius: 50%; color: #8a5b00; background: #ffe9b0; }
.ambiguous-intent-body strong { display: block; color: #3c3424; font-size: 14px; line-height: 1.55; }
.ambiguous-intent-body p { margin-top: 7px; color: #6f6247; font-size: 12px; line-height: 1.65; }
.ambiguous-intent-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; padding: 10px 16px; border-top: 1px solid var(--border); background: #fff; }
.ambiguous-intent-footer span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.preparation-body { min-height: 0; overflow: auto; padding: 16px; background: #f6f8f9; }
.preparation-overview { display: grid; gap: 9px; margin-bottom: 13px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.preparation-overview > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preparation-overview strong { color: #1f493c; font-size: 13px; }
.preparation-overview span { color: var(--muted); font-size: 10px; }
.preparation-progress-bar { height: 7px; overflow: hidden; border-radius: 99px; background: #e4e9ec; }
.preparation-progress-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .2s ease; }
.preparation-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.preparation-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 58px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.preparation-step-marker { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #66737f; background: #eef1f3; font-size: 11px; font-weight: 750; }
.preparation-step strong, .preparation-step small { display: block; }
.preparation-step strong { color: #2b3944; font-size: 11px; }
.preparation-step small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.preparation-step.running { border-color: #d7bd78; background: #fffdf6; }
.preparation-step.running .preparation-step-marker { color: #805805; background: #fff0c6; animation: pulse 1.2s ease-in-out infinite; }
.preparation-step.complete { border-color: #afd4c5; background: #f5fbf8; }
.preparation-step.complete .preparation-step-marker { color: #fff; background: var(--green); }
.preparation-step.warning { border-color: #e4c67c; background: #fffaf0; }
.preparation-step.warning .preparation-step-marker { color: #805805; background: #ffe9b0; }
.preparation-step.error { border-color: #e4aaaa; background: #fff7f7; }
.preparation-step.error .preparation-step-marker { color: #fff; background: var(--red); }
.preparation-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; padding: 9px 14px; border-top: 1px solid var(--border); background: #fff; }
.preparation-footer p { max-width: 520px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.multi-shop-progress { grid-column: 1 / -1; border-right: 0 !important; }
.multi-shop-progress-summary { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 14px 2px; color: var(--muted); font-size: 10px; }
.multi-shop-progress-summary span { padding: 4px 7px; border: 1px solid var(--border); border-radius: 999px; background: #f8faf9; }
.multi-shop-progress-list { display: grid; gap: 8px; padding: 10px 14px 14px; }
.multi-shop-progress-card { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(130px, .7fr) minmax(260px, 1.8fr); gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.multi-shop-progress-card.selected { border-color: #82b8a4; box-shadow: 0 0 0 2px rgba(20,118,87,.08); }
.multi-shop-progress-card.blocked { border-color: #e4b1b1; background: #fffafa; }
.multi-shop-progress-identity { min-width: 0; }
.multi-shop-progress-identity strong, .multi-shop-progress-identity span, .multi-shop-progress-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-shop-progress-identity strong { color: #25353f; font-size: 11px; }
.multi-shop-progress-identity span, .multi-shop-progress-identity small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.multi-shop-progress-phase { display: grid; gap: 4px; font-size: 9px; }
.multi-shop-progress-phase strong { font-size: 10px; }
.multi-shop-progress-bar { height: 6px; overflow: hidden; border-radius: 99px; background: #e8edef; }
.multi-shop-progress-bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.multi-shop-progress-counts { display: flex; flex-wrap: wrap; gap: 5px; }
.multi-shop-progress-counts span { padding: 3px 5px; border-radius: 4px; color: #4b5964; background: #f1f4f5; font-size: 9px; }
.multi-shop-progress-incremental { margin-top: 5px; color: #8a6413; font-size: 9px; }
body.shop-read-only .composer-panel,
body.shop-read-only .ai-change-section { background: #fbfaf6; }

.recall-letter-dialog { width: min(1120px, 100%); height: min(880px, calc(100vh - 48px)); max-height: min(880px, calc(100vh - 48px)); grid-template-rows: auto minmax(0, 1.25fr) minmax(0, 1fr) auto; }
.recall-letter-body { min-height: 0; padding: 14px; overflow: auto; background: #f5f7f8; }
.recall-workspace-controls { min-height: 0; padding: 14px; overflow: auto; border-bottom: 1px solid #d9e1e7; }
.recall-workspace-controls section + section { margin-top: 14px; }
.recall-workspace-controls p { font-size: 13px; line-height: 1.6; margin: 8px 0; }
.recall-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 8px; }
.recall-choice { display: block; padding: 10px; border: 1px solid #d9e1e7; border-radius: 8px; cursor: pointer; }
.recall-choice:has(input:checked) { border-color: #2573b9; background: #edf6ff; }
.recall-choice small, .recall-billing-form small { display: block; margin-top: 6px; }
.recall-billing-edit-list { max-height: 360px; overflow: auto; }
.recall-billing-form { padding: 12px 0; border-bottom: 1px solid #d9e1e7; }
.recall-billing-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 10px 0; }
.recall-billing-fields label { font-size: 12px; }
.recall-billing-fields input { display: block; width: 100%; padding: 6px; border: 1px solid #d9e1e7; border-radius: 4px; }
.recall-quote-result { padding: 10px; background: #f1f6fa; margin-top: 8px; border-radius: 8px; }
.recall-quote-result small { display: block; margin-bottom: 8px; }
.recall-preview-section { min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.recall-preview-section h3 { margin-bottom: 9px; color: #263640; font-size: 12px; }
.recall-safety-note { margin-bottom: 12px; color: #74500c; border-color: #e5c785; background: #fffaf0; }
.recall-safety-note ul { display: grid; gap: 4px; padding-left: 18px; font-size: 10px; line-height: 1.5; }
.recall-validation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.recall-order-list { display: grid; gap: 7px; max-height: 260px; overflow: auto; }
.recall-order-item { padding: 9px 10px; border: 1px solid #dfe6e9; border-radius: 5px; background: #fafcfc; }
.recall-order-item > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recall-order-item strong { color: #263640; font-size: 11px; }
.recall-order-item span { color: var(--green); font-size: 9px; font-weight: 700; }
.recall-order-item p { margin: 4px 0 2px; overflow-wrap: anywhere; color: #41505b; font-size: 10px; line-height: 1.45; }
.recall-order-item small { display: block; overflow-wrap: anywhere; color: var(--muted); font-size: 9px; }
.recall-order-item.blocked { border-color: #e8b8b8; background: #fff8f7; }
.recall-order-item.blocked span,
.recall-order-item.blocked p { color: var(--red); }
.recall-sample { margin-top: 12px; }
.recall-sample-recipient { margin-bottom: 8px; color: var(--muted); font-size: 10px; }
.recall-sample pre { max-height: 360px; margin: 0; padding: 12px; overflow: auto; border: 1px solid #e1e6e9; border-radius: 5px; color: #263640; background: #fbfcfc; font-family: Arial, sans-serif; font-size: 10px; line-height: 1.55; white-space: pre-wrap; }
.recall-letter-footer { display: grid; gap: 9px; min-height: 66px; padding: 10px 14px; border-top: 1px solid var(--border); background: #fff; }
.recall-letter-lock-note { color: var(--muted); font-size: 10px; line-height: 1.45; text-align: center; }
.recall-letter-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.recall-letter-actions .secondary-button,
.recall-letter-actions .danger-button { min-height: 34px; text-decoration: none; }

.finance-operation-list { display: grid; gap: 7px; margin-top: 10px; }
.finance-operation-item { padding: 8px 9px; border: 1px solid #dfe6e9; border-radius: 5px; background: #f8faf9; }
.finance-operation-item > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.finance-operation-item strong { color: #263640; font-size: 11px; }
.finance-operation-item time, .finance-operation-item small { color: var(--muted); font-size: 9px; }
.finance-operation-item p { margin: 5px 0 3px; color: #34434d; font-size: 10px; }

.order-record-dialog { width: min(1180px, 100%); max-height: min(880px, calc(100vh - 48px)); }
.order-record-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; min-height: 0; overflow: auto; background: #f5f7f8; }
.order-record-section { min-width: 0; padding: 14px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #fff; }
.order-record-section:nth-child(even) { border-right: 0; }
.order-record-section.record-wide { grid-column: 1 / -1; border-right: 0; }
.order-record-section h3 { margin-bottom: 10px; color: #22323d; font-size: 12px; }
.record-detail-grid { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 1.4fr); gap: 0 14px; }
.record-detail-grid dt, .record-detail-grid dd { min-width: 0; padding: 6px 0; border-bottom: 1px solid #eef1f2; font-size: 10px; line-height: 1.5; }
.record-detail-grid dt { color: var(--muted); }
.record-detail-grid dd { overflow-wrap: anywhere; color: #2e3a44; text-align: right; }
.record-subheading { margin: 12px 0 7px; color: var(--muted); font-size: 10px; font-weight: 650; }
.record-compact-item { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid #eef1f2; }
.record-compact-item:last-child { border-bottom: 0; }
.record-compact-item strong { color: #263640; font-size: 10px; }
.record-compact-item span { overflow-wrap: anywhere; color: var(--muted); font-size: 9px; line-height: 1.5; }
.record-discussion { margin-bottom: 12px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.record-discussion:last-child { margin-bottom: 0; }
.record-discussion > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-bottom: 1px solid var(--border); background: #f8faf9; }
.record-discussion > header strong { font-size: 11px; }
.record-discussion > header span { color: var(--muted); font-size: 9px; }
.record-warning, .record-verified { padding: 8px 11px; border-bottom: 1px solid #f1dfb8; color: #82570e; background: #fff9ed; font-size: 10px; line-height: 1.5; }
.record-verified { border-color: #cfe6dc; color: #166247; background: #f0faf6; }
.record-message-list { display: grid; gap: 8px; padding: 10px; background: #f7f9fa; }
.record-message { width: min(82%, 760px); padding: 9px 11px; border: 1px solid #dce3e7; border-radius: 6px; background: #fff; }
.record-message.seller { justify-self: end; border-color: #b9ddcf; background: #f1faf6; }
.record-message > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.record-message strong { font-size: 10px; }
.record-message time, .record-message-translation, .record-attachment { color: var(--muted); font-size: 9px; }
.record-message > p { margin: 0; overflow-wrap: anywhere; font-size: 10px; line-height: 1.55; }
.record-message .record-message-translation { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #dfe5e8; }
.record-attachment { display: block; margin-top: 5px; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 100; max-width: min(460px, calc(100vw - 36px)); padding: 11px 14px; border: 1px solid #c9d2d9; border-radius: 5px; color: #26313c; background: #fff; box-shadow: 0 8px 28px rgba(23,32,42,.16); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: #9bcbb8; color: #145f46; }
.toast.warning { border-color: #e4c577; color: #8a5b00; }
.toast.error { border-color: #e5aaaa; color: #9a3030; }

@media (max-width: 1280px) {
  .topbar { grid-template-columns: minmax(210px, 1fr) auto minmax(300px, 1fr); gap: 8px; padding: 0 10px; }
  .coverage-summary { display: none; }
  .shop-read-only-badge { display: none !important; }
  .shop-selector { flex-basis: 160px; }
  .discussion-view { grid-template-columns: 290px minmax(480px, 1fr) 310px; }
  .prepare-computer-button { width: 34px; padding: 0; }
  .prepare-computer-button span { display: none; }
  .message-entry { width: 90%; }
}

@media (max-width: 900px) {
  html, body { height: auto; min-height: 100%; overflow: auto; }
  body { display: block; }
  .translation-cost-summary { display: block; }
  .translation-cost-summary [data-cost="total"], .translation-cost-summary [data-cost="status"] { text-align: left; }
  .topbar { position: sticky; top: 0; grid-template-columns: 1fr auto; min-height: 104px; padding: 8px 10px; }
  .brand-block { flex-wrap: wrap; }
  .shop-selector { flex: 1 1 160px; }
  .view-switch { grid-column: 1 / -1; grid-row: 2; }
  .top-actions { grid-column: 2; }
  .discussion-sync-summary, .proxy-status, .syncButton { display: none; }
  .top-actions .command-button { display: none; }
  .discussion-view { display: block; height: auto; }
  .queue-panel { height: 44vh; min-height: 360px; border-right: 0; border-bottom: 1px solid var(--border); }
  .conversation-panel { height: 88vh; min-height: 660px; border-right: 0; border-bottom: 1px solid var(--border); }
  .context-panel { height: auto; min-height: 520px; }
  .context-scroll { overflow: visible; }
  .case-toolbar { align-items: flex-start; gap: 10px; }
  .case-toolbar-actions { flex-direction: column; align-items: flex-end; }
  .history-list { padding: 14px 10px 24px; }
  .message-entry { width: 96%; }
  .order-record-body { grid-template-columns: 1fr; }
  .order-record-section, .order-record-section:nth-child(even) { border-right: 0; }
  .bilingual-composer-grid { grid-template-columns: 1fr; }
  .composer-panel .draft-language-panel textarea { min-height: 92px; max-height: 160px; }
  .outgoing-attachment-list { grid-template-columns: 1fr; }
  .orders-view { height: calc(100vh - 104px); }
  .orders-toolbar { align-items: flex-start; flex-direction: column; }
  .order-search { width: 100%; }
  .order-export-button, .order-recall-button { width: 100%; }
  .integration-strip { align-items: flex-start; flex-wrap: wrap; }
  .integration-status + .integration-status { margin-left: 0; padding-left: 0; border-left: 0; }
  .integration-actions { width: 100%; margin-left: 0; }
  .unlinked-bet-search > header { display: grid; gap: 7px; }
  .manual-review-badge { justify-self: start; }
  .unlinked-bet-search-row { grid-template-columns: 1fr; gap: 7px; }
  .status-modal { padding: 10px; }
  .status-dialog { max-height: calc(100vh - 20px); }
  .status-dialog-header { align-items: flex-start; }
  .status-dialog-actions .secondary-button { width: 34px; padding: 0; font-size: 0; }
  .status-dialog-body { grid-template-columns: 1fr; }
  .recall-validation-grid { grid-template-columns: 1fr; }
  .recall-letter-actions { justify-content: stretch; }
  .recall-letter-actions > * { flex: 1 1 100%; justify-content: center; }
  .status-group:nth-child(odd) { border-right: 0; }
  .status-row { grid-template-columns: minmax(100px, .7fr) minmax(0, 1.3fr); }
  .preparation-footer { align-items: stretch; flex-direction: column; }
  .preparation-footer .secondary-button { width: 100%; }
  .multi-shop-progress-card { grid-template-columns: 1fr; }
}
/* Application login and current-user controls. */
.workbench-user { display:flex; align-items:center; gap:7px; padding:7px 10px; border:1px solid #d8e1e8; border-radius:8px; background:#fff; color:#334155; white-space:nowrap; }
.workbench-user svg { width:17px; height:17px; }
.user-logout-button { border:0; border-left:1px solid #d8e1e8; background:transparent; color:#64748b; padding:1px 0 1px 8px; cursor:pointer; font:inherit; }
.user-logout-button:hover { color:#b42318; }
.user-logout-button:disabled { opacity:.55; cursor:wait; }
.login-page { min-height:100vh; display:grid; place-items:center; padding:24px; background:radial-gradient(circle at top,#e7f6ef 0,#f5f7fa 42%,#eef2f5 100%); }
.login-card { width:min(440px,100%); padding:34px; border:1px solid #d7e1e7; border-radius:18px; background:#fff; box-shadow:0 18px 55px rgba(15,47,65,.14); }
.login-brand-mark { width:54px; height:54px; display:grid; place-items:center; margin-bottom:18px; border-radius:13px; background:#147d60; color:#fff; font-size:27px; font-weight:800; }
.login-copy h1 { margin:0; color:#142335; font-size:25px; }
.login-copy p { margin:8px 0 24px; color:#64748b; line-height:1.55; }
.login-form { display:grid; gap:17px; }
.login-form label:not(.remember-login) { display:grid; gap:7px; color:#475569; font-weight:600; }
.login-form select,.login-form input[type="password"] { width:100%; min-height:46px; padding:0 13px; border:1px solid #cbd5df; border-radius:8px; background:#fff; color:#172033; font:inherit; }
.login-form select:focus,.login-form input[type="password"]:focus { outline:3px solid rgba(20,125,96,.15); border-color:#147d60; }
.remember-login { display:flex; align-items:center; gap:9px; color:#475569; }
.remember-login input { width:18px; height:18px; accent-color:#147d60; }
.login-error { min-height:22px; margin:0; color:#b42318; font-size:14px; }
.login-submit { width:100%; min-height:48px; justify-content:center; }
.login-privacy { margin:20px 0 0; color:#7b8794; font-size:12px; line-height:1.5; text-align:center; }
@media (max-width:700px) { .login-card { padding:25px 20px; } .workbench-user { max-width:180px; } #currentUserName { overflow:hidden; text-overflow:ellipsis; } }
.translation-cost-summary progress[hidden] { display: none !important; }
.local-return-entry { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.local-return-entry input { min-width: 0; width: 100%; flex: 1; padding: 8px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
.local-return-entry button { flex: none; padding: 8px 12px; }
[data-local-return-notice] { display: block; }
.parcel-match { margin: 12px 0; padding: 12px; border: 1px solid #d4dfeb; border-radius: 8px; background: #f3f7fc; font-size: 13px; line-height: 1.5; }
.parcel-match-complete { border-color: #91cbae; background: #edf8f2; }
.parcel-match-review { border-color: #e9c785; background: #fff8e7; }
.parcel-match-number { overflow-wrap: anywhere; font-weight: 600; margin-top: 4px; }
.parcel-match p { margin: 6px 0; font-size: inherit; }
.parcel-match-item { padding: 9px 0; border-top: 1px solid #dce4eb; overflow-wrap: anywhere; }
.parcel-match small { display: block; font-size: 12px; color: #637489; }
.shipment-bet-job-status { margin: 0 0 10px; padding: 8px 10px; border: 1px solid #d4dfeb; border-radius: 6px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.order-stage { margin: 10px 0; padding: 10px 14px; background: #f7faf9; border: 1px solid #dce7e3; border-radius: 8px; }
.order-stage[hidden] { display: none; }
.order-stage-labels { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.order-stage-label { border-radius: 16px; padding: 5px 14px; color: #687981; background: #eaf0ee; font-weight: 600; }
.order-stage-label.active.waiting { background: #fff0cd; color: #8a5200; }
.order-stage-label.active.received { background: #d7f2e4; color: #086b43; }
.order-stage-label.active.refunded { background: #dbeafe; color: #18549b; }
.order-stage small { display: block; color: #52676f; line-height: 1.5; }

/* Compact discussion layout: retain the controls and give height to messages. */
.case-workspace { grid-template-rows: auto minmax(0, 1fr) 10px auto; }
.history-toolbar[hidden] { display: none !important; }
.case-toolbar { flex-wrap: wrap; gap: 6px; padding-top: 8px; padding-bottom: 8px; }
.case-toolbar-actions { flex-wrap: wrap; margin-left: auto; }
.message-translation { margin-top: 7px; margin-bottom: 0; padding-top: 7px; line-height: 1.45; }
.composer-resize-handle { display: flex; justify-content: center; align-items: center; height: 10px; cursor: row-resize; touch-action: none; user-select: none; color: #82939c; background: #f4f7f8; border-block: 1px solid #e4eaed; }
.composer-resize-handle:hover, .composer-resize-handle:focus-visible { background: #e1f1eb; outline: 2px solid #72a994; outline-offset: -2px; }
.composer-panel { position: relative; padding: 6px 10px 7px; border-top: 0; }
.composer-heading { flex-wrap: wrap; gap: 4px; }
.composer-heading-actions { gap: 4px; }
.bilingual-composer-grid { margin-top: 5px; }
.draft-language-panel { padding: 5px; gap: 3px; }
.composer-panel .draft-language-panel textarea { height: var(--reply-editor-height, 76px); min-height: 60px; max-height: none; resize: none; padding: 6px 8px; }
.composer-action-strip { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; margin-top: 5px; min-height: 39px; overflow-x: auto; }
.composer-action-strip > button { flex-shrink: 0; white-space: nowrap; }
.composer-action-strip .order-stage { display: flex; align-items: center; flex: 0 0 auto; gap: 7px; margin: 0; padding: 0; border: 0; background: none; }
.composer-action-strip .order-stage[hidden] { display: none; }
.composer-action-strip .order-stage-labels { flex-wrap: nowrap; gap: 5px; margin: 0; }
.composer-action-strip .order-stage-label { padding: 5px 9px; font-size: 11px; white-space: nowrap; }
.composer-action-strip .order-stage small { font-size: 10px; white-space: nowrap; }
.composer-action-strip #draftStatus { flex: 1 1 110px; min-width: 70px; max-width: 260px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-action-strip #saveDraftButton { margin-left: auto; }
.composer-info-popover { position: absolute; z-index: 30; left: 10px; bottom: 53px; width: min(430px, calc(100% - 20px)); padding: 10px 14px; border: 1px solid #cbded5; border-radius: 7px; background: #fff; box-shadow: 0 5px 24px #172c3526; color: #435b50; line-height: 1.5; }
.composer-info-popover[hidden] { display: none; }
.composer-info-popover p { margin: 4px 0; overflow-wrap: anywhere; }
#fullscreenButton { white-space: nowrap; }
.related-discussions { display: flex; align-items: center; gap: 8px; margin-top: 8px; max-width: 100%; color: var(--muted); font-size: 12px; }
.related-discussions[hidden] { display: none; }
.related-discussions > span { flex: 0 0 auto; }
.related-discussions select { min-width: 0; max-width: 520px; width: 100%; }
@media (max-width: 700px) {
  .composer-info-popover { bottom: 58px; }
  .composer-action-strip { padding-bottom: 4px; }
}
.case-context-loading .context-scroll { visibility: hidden; }
.case-loading { padding: 32px; text-align: center; }
.case-row[aria-busy="true"] { outline: 2px solid #2a8069; outline-offset: -2px; }
/* Internal Chinese preview is independent of the official French document. */
.recall-bilingual-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.recall-letter-scroll { height: 360px; overflow: auto; overscroll-behavior: contain; padding: 16px; border: 1px solid #dbe3ea; border-radius: 8px; color: #111; background: #fff; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.recall-letter-scroll p { margin: 0 0 12px; }
.recall-letter-scroll strong { color: #000; font-weight: 700; }
.recall-billing-progress progress { width: 100%; height: 14px; }
@media (max-width: 900px) { .recall-bilingual-grid { grid-template-columns: 1fr; } }
