/* IBM Plex Sans — self-hosted (SIL OFL). Latin/numeric only; CJK falls back to system fonts. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/vendor/fonts/IBMPlexSans-Light.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/vendor/fonts/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/vendor/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}

html,
body {
  min-height: 100%;
}
:root {
  --bg: #f4f4f4;
  --paper: #ffffff;
  --ink: #161616;
  --muted: #525252;
  --line: #e0e0e0;
  --line-strong: #8c8c8c;
  --accent: #0f62fe;
  --accent-hover: #0050e6;
  --accent-soft: #edf5ff;
  --accent-border: #b8d3fe;
  --focus-ring: rgba(15, 98, 254, 0.2);
  --deep: #002d9c;
  --inverse-surface: #262626;
  --sidebar: #ffffff;
  --sidebar-muted: #8c8c8c;
  --surface-soft: #f4f4f4;
  --surface-muted: #e0e0e0;
  --success: #24a148;
  --success-bg: #defbe6;
  --success-border: #6fdc8c;
  --warning: #f1c21b;
  --warning-bg: #fff8e1;
  --warning-border: #fdd13a;
  --danger: #da1e28;
  --danger-bg: #fff0f1;
  --danger-border: #ffb3b8;
  --shadow: none;
  --shadow-soft: none;
  --shadow-lift: none;
  --ink-secondary: var(--muted);
  --border: var(--line);
  --surface: var(--paper);
  --text: var(--ink);
  --canvas: var(--surface-muted);
  --cost-border-strong: var(--line-strong);
  --cost-surface: var(--paper);
  --cost-text: var(--muted);
  --cost-primary: var(--accent);
  --cost-danger-border: var(--danger-border);
  --cost-danger-soft: var(--danger-bg);
  --cost-danger: var(--danger);
  --cost-border: var(--line);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  height: 100vh;
  overflow: hidden;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.16px;
}
.build-update-banner {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding:
    calc(8px + env(safe-area-inset-top))
    calc(24px + env(safe-area-inset-right))
    8px
    calc(24px + env(safe-area-inset-left));
  border-bottom: 1px solid var(--accent);
  background: var(--paper);
  color: var(--ink);
}
.build-update-banner[hidden] {
  display: none;
}
.build-update-banner p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.build-update-banner button {
  flex: 0 0 auto;
}
.app-startup-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
}
.app-startup-gate[hidden] {
  display: none;
}
.app-startup-panel {
  width: min(480px, 100%);
  padding: 32px 0;
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--line);
}
.app-startup-brand,
.app-startup-status,
.app-startup-count {
  margin: 0;
}
.app-startup-brand {
  color: var(--muted);
  font-size: 12px;
}
.app-startup-panel h1 {
  margin: 8px 0 24px;
  font-size: 20px;
  font-weight: 400;
}
.app-startup-status {
  min-height: 20px;
  color: var(--ink);
  font-size: 14px;
}
.app-startup-gate progress {
  display: block;
  width: 100%;
  height: 8px;
  margin: 16px 0 8px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface-muted);
  color: var(--accent);
  appearance: none;
}
.app-startup-gate progress::-webkit-progress-bar {
  background: var(--surface-muted);
}
.app-startup-gate progress::-webkit-progress-value {
  background: var(--accent);
}
.app-startup-gate progress::-moz-progress-bar {
  background: var(--accent);
}
.app-startup-count {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}
.app-startup-actions {
  margin-top: 24px;
}
.app-startup-gate.failed .app-startup-panel {
  border-top-color: var(--danger);
}
.app-startup-gate.failed .app-startup-status {
  color: var(--danger);
}
.app-shell {
  min-height: 100vh;
}
.app-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  max-width: none;
  height: 100vh;
  margin: 0;
  padding: 0;
}
.app-sidebar {
  grid-row: 2;
  position: static;
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  overflow-y: auto;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  border-right: 1px solid var(--line);
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
}
.app-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0;
}
.app-brand strong,
.app-brand span {
  display: block;
}
.app-brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}
.app-main {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  height: 100vh;
}
.app-topbar {
  position: static;
  z-index: 45;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 10px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.app-topbar h1 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}
.app-topbar-meta {
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-soft);
  padding: 8px 10px;
}
.app-topbar-meta span,
.app-sidebar-status span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}
.app-topbar-meta strong,
.app-sidebar-status strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}
.app-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  block-size: 100%;
  overflow-y: auto;
  padding: 0;
}
.tab-panel:not(#quote-panel) {
  padding: 0;
}
.global-tool-nav {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  min-block-size: 48px;
  padding: 0 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  scrollbar-width: none;
}
.global-tool-nav-brand {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-family: "LiSu", "STLiti", "华文隶书", serif;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}
.global-tool-nav::-webkit-scrollbar {
  display: none;
}
.global-tool-nav-item {
  align-self: stretch;
  flex: 0 0 auto;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.16px;
  white-space: nowrap;
  cursor: pointer;
}
.global-tool-nav-item:hover {
  color: var(--ink);
}
.global-tool-nav-item.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 12px;
  padding: 10px 14px;
  border-radius: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: none;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero h1 {
  margin: 0 0 6px;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  font-size: clamp(1.3rem, 2vw, 1.85rem);
  line-height: 1.06;
}
.hero-text {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}
.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}
.meta-card {
  padding: 8px 10px;
  border-radius: 0;
  background: var(--paper);
  border: 1px solid var(--line);
}
.meta-card.accent {
  background: var(--accent);
  color: var(--paper);
}
.meta-card span {
  display: block;
  font-size: 0.75rem;
  color: inherit;
  opacity: 0.72;
}
.meta-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
  line-height: 1.2;
}
.mode-tabs {
  display: flex;
  gap: 10px;
  margin: 10px 0 12px;
}
.app-nav {
  display: grid;
  align-content: start;
  gap: 2px;
  margin: 0;
  padding: 16px 12px;
}
.tab-button {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 20px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}
.app-nav .tab-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border-color: transparent;
  border-radius: 0;
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.app-nav .tab-button:hover {
  background: var(--bg);
}
.app-nav .tab-button.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.app-nav .tab-button strong {
  flex: 1;
  font-size: 1rem;
}
.nav-kicker {
  min-width: 34px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.app-nav .tab-button.active .nav-kicker {
  color: var(--accent);
}
.app-sidebar-status {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.app-sidebar-status div {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  background: var(--surface-soft);
}
.app-sidebar-status span {
  color: var(--sidebar-muted);
}
.app-sidebar-status strong {
  color: var(--ink);
}
.tab-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--accent);
  border-radius: 0;
  padding: 12px 20px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  background: var(--paper);
}
.tab-button.active {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.grid-two {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 20px;
  align-items: stretch;
}
.card {
  padding: 20px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.card h2 {
  margin-top: 0;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: 1.25rem;
}
.message {
  max-width: 85%;
  padding: 14px 16px;
  border-radius: 0;
  line-height: 1.55;
}
.message.user {
  align-self: flex-end;
  background: var(--deep);
  color: var(--paper);
}
.message.assistant {
  align-self: flex-start;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.message.assistant.assistant-interaction {
  min-width: min(100%, 520px);
}
.input-bar,
.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.input-bar {
  margin-top: auto;
}
textarea:not(.quote-cost-univer-container *),
select:not(.quote-cost-univer-container *),
button:where(:not(.quote-cost-univer-container *)) {
  font: inherit;
}
textarea:not(.quote-cost-univer-container *),
select:not(.quote-cost-univer-container *),
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="file"])):not(.quote-cost-univer-container *) {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 12px 16px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
}
input:is([type="checkbox"], [type="radio"]):not(.quote-cost-univer-container *) {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}
button:where(:not(.quote-cost-univer-container *)) {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 0;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
  font-weight: 400;
  letter-spacing: 0.16px;
}
button:where(:not(.quote-cost-univer-container *)):where(:hover:not(:disabled)) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}
button:where(:not(.quote-cost-univer-container *)):where(:active:not(:disabled)) {
  border-color: var(--deep);
  background: var(--deep);
}
button:where(:not(.quote-cost-univer-container *)):disabled,
input:not(.quote-cost-univer-container *):disabled,
select:not(.quote-cost-univer-container *):disabled,
textarea:not(.quote-cost-univer-container *):disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button:where(:not(.quote-cost-univer-container *))[aria-busy="true"] {
  cursor: progress;
  opacity: 0.72;
}
button:where(:not(.quote-cost-univer-container *))[aria-busy="true"]::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  vertical-align: -1px;
  animation: ai-intake-spin 0.6s linear infinite;
}
:where(button, a):not(.quote-cost-univer-container *):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Carbon input focus: replace the bottom hairline with a 2px blue underline, no perimeter ring. */
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):not(.quote-cost-univer-container *):focus {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
input:is([type="checkbox"], [type="radio"]):not(.quote-cost-univer-container *):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:where(input, select, textarea):not(.quote-cost-univer-container *):is(.error, [aria-invalid="true"]) {
  border-bottom-color: var(--danger);
  box-shadow: inset 0 -2px 0 var(--danger);
}
.form-actions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.composer-attach-button {
  padding: 10px 14px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}
.attachment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.attachment-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-soft);
}
.attachment-chip img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--paper);
}
.attachment-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.attachment-copy strong,
.attachment-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-remove {
  padding: 6px 10px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--ink);
}
.example-select-wrap {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}
.example-select-wrap select {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface-soft);
}
.answer-box {
  min-height: 160px;
  line-height: 1.6;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 16px;
}
.answer-box:empty,
.quote-step-action:empty,
.quote-field-source:empty,
.quote-review-hero:empty,
.quote-review-grid:empty,
.quote-summary-grid:empty,
.quote-inline-card:empty {
  display: none !important;
}
.message.assistant p,
.message.assistant ul,
.message.assistant li,
.answer-box p,
.answer-box ul,
.answer-box li {
  margin: 0;
}
.message-interaction-copy {
  display: grid;
  gap: 10px;
}
.message-select-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.message-select-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}
.message-select-field select:disabled,
.message-select-submit:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
.message-select-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.message-select-submit {
  padding: 12px 16px;
  border-radius: 0;
}
.message-select-status,
.message-select-summary {
  margin: 0;
}
.message-select-summary {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.875rem;
}
.answer-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 12px;
}
.answer-list li {
  line-height: 1.65;
}
.answer-refs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 6px;
}
.muted {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.875rem;
}
.hidden {
  display: none !important;
}
.compact-card {
  min-height: auto;
}
.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 0;
  padding: 8px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
}
#export-doc-panel .card-head {
  margin-bottom: 8px;
}
#export-doc-panel .card-head h2 {
  font-size: 1rem;
}
#export-doc-panel .quote-side-global .card-head {
  margin-bottom: 8px;
}
#export-doc-panel .quote-side-global .card-head h2 {
  font-size: 0.875rem;
}
.quote-topbar-actions-group .example-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}
.quote-topbar-actions-group .example-select-wrap > span {
  white-space: nowrap;
}
.quote-topbar-actions-group .example-select-wrap select {
  padding: 4px 10px;
  background: var(--paper);
  font-size: 12px;
  min-width: 160px;
}
.quote-module-session-head .ghost-button {
  max-width: 100%;
  white-space: nowrap;
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}
.quote-module-workspace .quote-card > .card-head {
  display: none;
}
.module-session-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.module-session-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.module-invoice-goods-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.module-invoice-goods-card-head strong,
.module-invoice-goods-card-head span {
  display: block;
}
.module-invoice-goods-card-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.875rem;
}
.stage-chip {
  flex: 0 0 auto;
  border-radius: 0;
  padding: 8px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  font-family: inherit;
  cursor: pointer;
}
.stage-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.stage-chip-secondary {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink);
}
.stage-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.quote-side-global .card-head {
  margin-bottom: 12px;
}
.quote-side-global .card-head h2 {
  font-size: 1rem;
}
.compact-card {
  min-height: auto;
}
.ghost-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--accent);
  border-radius: 0;
  font-weight: 400;
}
.tertiary-button {
  border: 1px solid var(--accent);
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 400;
}
.ghost-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.tertiary-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.secondary-button {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  font-weight: 400;
  cursor: pointer;
}
.secondary-button:hover:not(:disabled) {
  border-color: var(--muted);
  background: var(--surface-soft);
}
button.danger,
.danger-button,
.ghost-button.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--paper);
}
button.danger:hover:not(:disabled),
.danger-button:hover:not(:disabled),
.ghost-button.danger:hover:not(:disabled) {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--paper);
}
@media (hover: none), (pointer: coarse) {
  button:where(:not(.quote-cost-univer-container *)),
  input:not(.quote-cost-univer-container *),
  select:not(.quote-cost-univer-container *),
  textarea:not(.quote-cost-univer-container *) {
    min-height: 48px;
  }
}
.export-doc-container-card-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.export-doc-container-card-head button {
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
}
.export-doc-container-card-head button:hover {
  background: var(--danger-bg);
}
.readiness-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.readiness-item {
  padding: 8px 10px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--paper);
}
.readiness-item strong,
.readiness-item span {
  display: block;
}
.readiness-item span {
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.readiness-item.ok {
  background: var(--success-bg);
}
.readiness-item.warn {
  background: var(--warning-bg);
}
.plain-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 10px;
  line-height: 1.55;
}
.missing-stack {
  display: grid;
  gap: 8px;
}
.missing-item {
  padding: 8px 10px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--paper);
}
.missing-item.high {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}
.missing-item.medium {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}
.origin-certificate-query {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-soft);
}
.origin-certificate-query > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 0.875rem;
}
.origin-certificate-query-fields {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.origin-certificate-query-link {
  justify-self: start;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.origin-certificate-shell {
  --tool-content-max: 1280px;
  --tool-search-max: 1280px;
}
.origin-certificate-workgrid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 24px 32px 32px;
}
.origin-certificate-service {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
}
.origin-certificate-service-head {
  margin-bottom: 20px;
}
.origin-certificate-service-head.compact {
  margin-bottom: 12px;
}
.origin-certificate-service-head h3,
.origin-certificate-service-head h4,
.origin-certificate-service-head p {
  margin-top: 0;
}
.origin-certificate-service-head h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}
.origin-certificate-service-head h4 {
  margin-bottom: 0;
  font-size: 1rem;
}
.origin-certificate-service-head > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}
.origin-certificate-official-links {
  display: grid;
  gap: 12px;
}
.origin-certificate-official-link {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  text-decoration: none;
}
.origin-certificate-official-link:hover {
  border-color: var(--accent);
}
.origin-certificate-official-link span {
  color: var(--muted);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}
.origin-certificate-official-link em {
  color: var(--accent);
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 700;
}
.origin-certificate-review-service .origin-certificate-query {
  display: none;
}
.missing-item h3,
.quote-output-block h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.missing-item p {
  margin: 0;
  color: var(--muted);
}
.evidence-stack {
  display: grid;
  gap: 12px;
}
.evidence-item {
  padding: 14px 16px;
  border-radius: 0;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cost-composer-shell .ghost-button,
.cost-composer-shell .remove-line-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--cost-border-strong);
  border-radius: 0;
  background: var(--cost-surface);
  color: var(--cost-text);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}
.cost-composer-shell .ghost-button:hover,
.cost-composer-shell .remove-line-button:hover {
  border-color: var(--cost-primary);
  color: var(--cost-primary);
}
.cost-composer-shell .ghost-button.danger,
.cost-composer-shell .remove-line-button {
  border-color: var(--cost-danger-border);
  background: var(--cost-danger-soft);
  color: var(--cost-danger);
}
.cost-history-chip .ghost-button {
  padding: 4px 8px;
  border-radius: 0;
  font-size: 0.75rem;
}
.cost-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-bottom: 1px solid var(--cost-border);
}
.cost-card-head > strong {
  color: var(--cost-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.strategy-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
}
.strategy-params {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.strategy-params label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.strategy-coo-summary {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-soft);
  font-size: 0.875rem;
}
.strategy-coo-summary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.strategy-coo-summary span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 0;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.75rem;
}
.scenario-comparison {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.scenario-selected-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 0;
  border: 1px solid var(--success);
  background: var(--success-bg);
}
.scenario-selected-banner.pending {
  border-color: var(--warning);
  background: var(--warning-bg);
}
.scenario-selected-banner span,
.scenario-selected-banner em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
}
.scenario-selected-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-bg);
  font-size: 0.75rem;
  font-weight: 700;
}
.delta-positive {
  color: var(--success);
}
.delta-negative {
  color: var(--danger);
}
.scenario-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}
@keyframes quote-focus-flash {
  0%, 100% { outline-color: transparent; }
  45% { outline-color: var(--accent); }
}
.remove-line-button {
  background: var(--danger-bg);
  color: var(--danger);
  white-space: nowrap;
}
.joint-search-form .ghost-button,
.joint-action-bar .ghost-button {
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
}
.joint-option-actions .ghost-button,
.joint-option-actions button {
  flex: 1;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
}
.joint-option-actions .ghost-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
}
.joint-option-actions button:not(.ghost-button) {
  background: var(--accent);
  color: var(--paper);
}
.joint-search-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.joint-search-card-head h3,
.joint-search-summary-copy,
.joint-search-candidate p {
  margin: 0;
}
@media (max-width: 960px) {
  .global-tool-nav {
    justify-content: flex-start;
  }

  .origin-certificate-workgrid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }

  .app-frame {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .app-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-sidebar-status {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .app-topbar-meta {
    width: 100%;
  }

  .app-content {
    padding: 0;
  }

  .tab-panel:not(#quote-panel) {
    padding: 0;
  }

  .quote-module-workbench {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  #export-doc-panel .quote-shell {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  #export-doc-panel .quote-intake-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  #export-doc-panel .export-doc-goods-layout,
  #export-doc-panel .export-doc-goods-summary-body {
    grid-template-columns: 1fr;
  }

  #export-doc-panel .export-doc-goods-description,
  #export-doc-panel .export-doc-goods-summary {
    min-height: auto;
  }

  #export-doc-panel .quote-intake-main,
  #export-doc-panel .quote-side {
    max-height: none;
  }

  #export-doc-panel .quote-side {
    position: static;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .hero,
  .grid-two,
  .quote-intake-layout,
  .quote-grid {
    grid-template-columns: 1fr;
  }

  .quote-side {
    position: static;
  }

  .quote-prep-grid {
    grid-template-columns: 1fr;
  }

  .quote-cost-derivation-grid {
    grid-template-columns: 1fr;
  }

  .quote-materials-metrics,
  .quote-materials-highlights {
    grid-template-columns: 1fr;
  }

  .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    min-height: auto;
  }

  .quote-form-grid,
  .export-doc-form-group-body,
  .export-doc-fieldset,
  .export-doc-party-fieldset,
  .export-doc-party-fieldset .export-doc-form-group-body,
  .export-doc-preview-summary-grid,
  .export-doc-preview-container-card,
  .export-doc-container-field-grid,
  .export-review-meta,
  .export-review-controls,
  .readiness-grid,
  .quote-summary-grid,
  .quote-review-grid,
  .schedule-sync-grid,
  .schedule-summary-grid,
  .schedule-result-panel,
  .schedule-more-grid {
    grid-template-columns: 1fr;
  }

  .schedule-kpi-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-kpi-days {
    border-left: 0;
    border-top: 1px dashed var(--line);
    padding: 10px 0 0;
  }

  .schedule-more-grid,
  .schedule-leg-row {
    grid-template-columns: 1fr;
  }

  .schedule-detail-row {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .schedule-detail-row:last-child {
    border-bottom: 0;
  }

  .schedule-leg-row {
    gap: 4px;
  }

  .schedule-leg-row-head {
    display: none;
  }

  .schedule-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .schedule-form-actions {
    align-items: stretch;
  }

  .schedule-quick-routes {
    width: 100%;
  }

  .schedule-route-tag {
    flex: 1 1 220px;
    justify-content: center;
  }

  .schedule-form-actions #schedule-status {
    margin-left: 0;
  }

  .quote-strategy-grid {
    grid-template-columns: 1fr;
  }

  .quote-step-action {
    flex-direction: column;
    align-items: stretch;
  }

  .quote-cost-detail-grid {
    grid-template-columns: 1fr;
  }

  .quote-module-grid {
    grid-template-columns: 1fr;
  }

  .quote-preview-rail {
    grid-column: 1;
    max-height: none;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .quote-module-topline {
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .global-tool-nav {
    gap: 16px;
    padding-inline: 16px;
  }

  .global-tool-nav-brand {
    position: static;
    flex: 0 0 auto;
    transform: none;
    font-size: 16px;
  }
}
/* ===== quote topbar (mockup-aligned) ===== */.quote-topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
}
.primary-button {
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
  min-height: 40px;
  padding: 12px 16px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.primary-button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.primary-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* ===== modal ===== */.quote-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 22, 22, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.ai-intake-attachment-chip {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  min-height: 20px;
  padding: 2px 8px;
  font-size: 11px;
  background: var(--surface-soft);
  color: var(--ink);
  border-radius: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  gap: 4px;
}
.ai-intake-attachment-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
}
.ai-intake-attachment-remove:hover {
  opacity: 1;
  background: rgba(0,0,0,0.08);
}

/* AI table update overlay — semi-transparent cover + "更新中" */
.quote-table-update-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  align-items: center;
  justify-content: center;
}
.quote-table-update-overlay.visible {
  display: flex;
}
.quote-table-update-overlay-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--paper);
  border: 1px solid var(--accent);
  border-radius: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  box-shadow: none;
}
.quote-updating-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: ai-intake-spin 0.6s linear infinite;
}
#global-toast-container {
  position: fixed;
  top: 60px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
#global-toast-transient {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.global-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(560px, 90vw);
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
  font-size: 0.95rem;
  line-height: 1.5;
  pointer-events: auto;
}
.global-toast.is-success {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}
.global-toast.is-error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}
.global-toast-spinner {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: ai-intake-spin 0.6s linear infinite;
}
.ai-undo-button {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 6px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--paper);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.5;
}
.quote-controlled-cell.user-edited {
  outline: 1px dashed var(--accent-soft);
  outline-offset: -1px;
}
.quote-cell-candidate {
  display: block;
  padding: 1px 4px;
  margin-top: 2px;
  border-radius: 0;
  background: var(--canvas);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
@keyframes ai-intake-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .quote-updating-spinner,
  .global-toast-spinner,
  button:where(:not(.quote-cost-univer-container *))[aria-busy="true"]::before {
    animation: none;
  }
}

@keyframes ai-intake-pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}
@keyframes ai-intake-dot {
  0%, 100% { opacity: 0.45; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes quote-sync-flash {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }
  15% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-2px);
  }
}
/* 复用商品面板 */.product-reuse-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}
/* ===== back-to-workbench banner on tool panels ===== */.tool-return-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 8px 24px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.tool-return-banner .example-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
  white-space: nowrap;
}
/* ===== empty workbench (welcome) ===== */.quote-module-overview-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 32px;
}
/* recent project card on empty workbench */.quote-recent-project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 480px;
  padding: 20px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: none;
}
/* empty workbench action buttons */.quote-module-empty-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
/* subtle session head (below project header) */.quote-module-session-head-subtle {
  padding-top: 0;
  padding-bottom: 8px;
}
