:root {
  --blue: #526b9b;
  --blue-hover: #405780;
  --blue-soft: #eaf0f8;
  --ink: #1c2739;
  --muted: #5f6c81;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --red: #b63832;
  --green: #1f7a58;
  --amber: #9a6415;
  --shadow-sm: 0 1px 2px rgb(24 39 75 / 5%), 0 6px 18px rgb(24 39 75 / 4%);
  --shadow-float: 0 16px 45px rgb(22 42 74 / 16%);
  --sidebar: 232px;
  --radius-control: 12px;
  --radius-panel: 16px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --feedback: 240ms;
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
::selection {
  background: #d8e3f3;
}
input,
textarea {
  caret-color: var(--blue);
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
input,
select,
textarea {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  padding: 8px 11px;
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
  max-width: 100%;
  transition: border-color var(--feedback) var(--ease-out), box-shadow var(--feedback) var(--ease-out), background-color var(--feedback) var(--ease-out);
}
input:hover,
select:hover,
textarea:hover {
  border-color: #aebdce;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(82 107 155 / 14%);
  outline: 0;
}
input::placeholder,
textarea::placeholder {
  color: #657388;
}
input[type="checkbox"] {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
  padding: 0;
}
input[type="number"] {
  font-variant-numeric: tabular-nums;
}
textarea {
  resize: vertical;
  min-height: 84px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 17px;
}
h3 {
  font-size: 15px;
}
.button {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  min-height: 36px;
  padding: 7px 13px;
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 600;
  transition: background-color var(--feedback) var(--ease-out), border-color var(--feedback) var(--ease-out), color var(--feedback) var(--ease-out), box-shadow var(--feedback) var(--ease-out), transform var(--feedback) var(--ease-out);
}
.button:hover:not(:disabled) {
  background: #f6f9fd;
  border-color: #9fb1c6;
  box-shadow: 0 3px 8px rgb(26 39 67 / 8%);
  transform: translateY(-2px);
}
.button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.button.primary:hover:not(:disabled) {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
  transform: translateY(-2px);
}
.button:active:not(:disabled),
.button.primary:active:not(:disabled) {
  transform: translateY(1px) scale(.97);
  box-shadow: none;
}
.button:disabled {
  transform: none;
  box-shadow: none;
}
.button.working,
.button[aria-busy="true"] {
  cursor: progress;
  transform: none;
}
.button.working::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-working .7s linear infinite;
}
@keyframes button-working { to { transform: rotate(360deg); } }
.button.small {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
}
.button.danger {
  color: var(--red);
  border-color: #e7c3c0;
}
.button.text {
  background: transparent;
  border-color: transparent;
  padding: 4px 8px;
  color: var(--blue);
}
.icon-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 6px;
  font-size: 22px;
  line-height: 1;
  border-radius: 10px;
  transition: background-color var(--feedback) var(--ease-out), color var(--feedback) var(--ease-out), transform var(--feedback) var(--ease-out);
}
.icon-button:hover { background: var(--blue-soft); }
.icon-button:active { transform: scale(.97); }
.icon-button svg { display:block; width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:1.7; }
.working {
  cursor: wait;
}
.initial-loading {
  padding: 40px;
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  width: var(--sidebar);
  height: 100dvh;
  background: rgb(239 243 250 / 94%);
  border-right: 1px solid #d9e1ed;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand {
  padding: 22px 20px 24px;
  font-size: 18px;
  font-weight: 650;
  color: #153866;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.sidebar .brand { color:#364b6b; font-size:17px; gap:10px; }
.sidebar .brand > span:last-child { display:block; line-height:1.25; }
.sidebar .brand small { display:block; margin-top:5px; color:#526176; font-size:10px; letter-spacing:1px; }
.sidebar .brand-mark { width:34px; height:34px; border-radius:11px; background:var(--blue); font-size:17px; }
.brand-mark {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 15px;
}
.brand small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.sidebar nav {
  padding: 1px 12px 18px;
  overflow: auto;
  flex: 1;
}
.nav-section + .nav-section { margin-top: 22px; }
.nav-section > p {
  margin: 0 0 5px;
  padding: 0 11px;
  color: #526176;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}
.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #526176;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  min-height: 41px;
  text-align: left;
  font-size: 13px;
  transition: background-color var(--feedback) var(--ease-out), color var(--feedback) var(--ease-out), transform var(--feedback) var(--ease-out);
}
.nav-item:hover {
  background: #e4ebf6;
  color: #364b6b;
  transform: translateX(2px);
}
.nav-item.active {
  background: #dfe8f6;
  color: #364b6b;
  font-weight: 600;
  box-shadow: none;
}
.nav-item:active { transform:scale(.97); }
.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.65;
  fill: none;
  flex: none;
}
.nav-separator {
  height: 1px;
  background: var(--line);
  margin: 10px 11px;
}
.sidebar-foot {
  border-top: 1px solid #d9e1ed;
  padding: 12px 20px 14px;
  font-size: 12px;
  color: #526176;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar-foot .button { color:#526176; }
.sidebar-foot .button:hover { background:#e4ebf6; border-color:#a7b8cf; }
.workspace {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 26px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 15;
}
.topbar-left,
.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.topbar select {
  padding: 6px 8px;
  border-color: transparent;
  font-weight: 600;
  color: var(--ink);
  max-width:132px;
}
.workspace-location { display:flex; align-items:center; gap:10px; font-size:12px; white-space:nowrap; padding-left:12px; border-left:1px solid var(--line); }
.workspace-location > span { color:var(--muted); }
.workspace-location > strong { font-size:13px; font-weight:600; }
.workspace-search-wrap { flex:1; max-width:320px; min-width:120px; position:relative; }
.workspace-search { display:flex; gap:8px; align-items:center; min-height:38px; padding:0 11px; border:1px solid var(--line); border-radius:var(--radius-control); background:#f3f5f9; transition:background-color var(--feedback) var(--ease-out),border-color var(--feedback) var(--ease-out),box-shadow var(--feedback) var(--ease-out); }
.workspace-search:focus-within { background:white; border-color:var(--blue); box-shadow:0 0 0 3px rgb(82 107 155 / 14%); }
.workspace-search svg { width:17px; height:17px; flex:none; stroke:var(--muted); fill:none; stroke-width:1.7; }
.workspace-search input { flex:1; width:100%; min-width:0; border:0; background:transparent; padding:7px 0; font-size:12px; border-radius:0; box-shadow:none; }
.workspace-search input:focus { box-shadow:none; }
.workspace-search kbd { color:var(--muted); font-family:inherit; font-size:10px; white-space:nowrap; border:1px solid #d8deea; border-radius:3px; padding:2px 4px; }
.workspace-search-results { position:absolute; top:calc(100% + 7px); width:100%; min-width:240px; right:0; z-index:40; padding:6px; border:1px solid var(--line); border-radius:14px; background:white; box-shadow:0 14px 34px rgb(26 39 67 / 15%); max-height:360px; overflow:auto; }
.workspace-search-results[hidden] { display:none; }
.workspace-search-result { display:flex; align-items:center; gap:10px; width:100%; border:0; border-radius:9px; background:white; padding:10px; text-align:left; color:var(--ink); transition:background-color var(--feedback) var(--ease-out),color var(--feedback) var(--ease-out); }
.workspace-search-result:hover,.workspace-search-result:focus-visible { background:var(--blue-soft); color:var(--blue); }
.workspace-search-result svg { width:18px; height:18px; flex:none; stroke:currentColor; fill:none; stroke-width:1.7; }
.workspace-search-result span { flex:1; display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:13px; }
.workspace-search-result small { font-size:10px; color:var(--muted); }
.workspace-search-empty { padding:12px 10px; font-size:12px; color:var(--muted); line-height:1.6; }
.environment {
  font-size: 12px;
  color: #7b693e;
  background: #fff7e8;
  padding: 4px 8px;
  border-radius: 999px;
}
.topbar-right {
  font-size: 12px;
  color: var(--muted);
  flex-shrink:0;
}
.menu-toggle {
  display: none;
}
main {
  padding: 24px 26px 42px;
  min-width: 0;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  min-width:0;
}
.page-head > div { min-width:0; }
.page-head h1 { font-size:21px; }
.page-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: none;
}
.panel-head {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.panel-body {
  padding: 18px;
}
.muted {
  color: var(--muted);
}
.small-text {
  font-size: 12px;
}
.mono {
  font-variant-numeric: tabular-nums;
}
.tag {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: #526176;
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 7px;
  white-space: nowrap;
}
.tag.good {
  background: #e7f3ed;
  color: #276f53;
}
.tag.warn {
  background: #fcf1dc;
  color: #89621d;
}
.tag.bad {
  background: #fae9e7;
  color: #a83227;
}
.table-scroll {
  overflow: auto;
  max-width: 100%;
  min-width:0;
  overscroll-behavior-x:contain;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 13px;
}
th {
  background: #f2f4f8;
  color: #526176;
  font-weight: 600;
  white-space: nowrap;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}
td {
  border-bottom: 1px solid #edf0f5;
  padding: 10px 12px;
  vertical-align: middle;
  line-height: 1.5;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #f2f6fb;
}
td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.empty {
  padding: 30px 18px;
  text-align: center;
  color: var(--muted);
}
.empty p {
  margin-bottom: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > span {
  font-size: 12px;
  color: #536176;
}
.field b {
  color: var(--red);
  font-weight: 500;
}
.span-2 {
  grid-column: 1/-1;
}
.form-error {
  color: var(--red);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 12px;
}
.check-label {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}
.password-feedback {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  font-weight: 400;
}
.dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: min(620px, calc(100vw - 26px));
  width: 620px;
  padding: 0;
  box-shadow: var(--shadow-float);
  color: var(--ink);
}
.dialog.wide {
  width: 1000px;
  max-width: min(1000px, calc(100vw - 26px));
}
.dialog::backdrop {
  background: rgb(38 53 76 / 38%);
}
.dialog[open] { animation: dialog-arrival 300ms var(--ease-out); }
.dialog[open]::backdrop { animation: overlay-arrival 240ms var(--ease-out); }
@keyframes dialog-arrival {
  from { opacity: .72; transform: translateY(2px); clip-path: inset(0 0 3% 0 round 18px); }
  to { opacity: 1; transform: translateY(0); clip-path: inset(0 round 18px); }
}
@keyframes overlay-arrival { from { opacity: .4; } to { opacity: 1; } }
.dialog-head {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.dialog-body {
  padding: 20px;
  max-height: 80vh;
  overflow: auto;
}
.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}
.dialog iframe {
  width: 100%;
  height: 67vh;
  border: 1px solid var(--line);
}
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 2px);
  background: #45566f;
  color: #fff;
  max-width: calc(100vw - 32px);
  padding: 11px 17px;
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 260ms var(--ease-out),
    transform 260ms var(--ease-out);
  z-index: 1000;
  font-size: 13px;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.error {
  background: #a62e28;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 490px;
  background: var(--bg);
}
.login-intro {
  /* 与 polish.css 同一套"向中间靠拢"的内边距：左内边距大、右内边距小 */
  padding: 72px clamp(28px, 3.5vw, 48px) 72px clamp(72px, 13vw, 188px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-intro .brand {
  padding: 0;
  margin-bottom: 32px;
}
.login-intro h1 {
  font-size: 29px;
  line-height: 1.6;
}
.login-intro p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
  margin-top: 20px;
  max-width: 520px;
}
.login-steps {
  display: flex;
  gap: 16px;
  color: #405575;
  margin-top: 32px;
  font-size: 13px;
}
.login-side {
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-left: 1px solid var(--line);
}
.login-form {
  width: 100%;
  max-width: 300px;
}
.login-form h2 {
  font-size: 23px;
  margin-bottom: 20px;
}
.login-form .field {
  margin-bottom: 16px;
}
.login-form .button.primary {
  width: 100%;
  margin-top: 5px;
  min-height: 42px;
}
.login-foot {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.quote-meta {
  display: grid;
  grid-template-columns: 1.15fr 1.3fr 1fr 1fr;
  gap: 12px;
  padding: 14px 15px;
}
.quote-meta .field > span {
  font-size: 12px;
}
.meta-more {
  padding: 0 15px 14px;
}
.meta-more summary {
  font-size: 12px;
  color: var(--blue);
  cursor: pointer;
  margin-bottom: 10px;
}
.meta-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.quote-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  flex-wrap: wrap;
}
.catalog-toolbar input {
  flex: 1;
  min-width: 180px;
}
.catalog-toolbar select {
  max-width: 160px;
}
.category-pills {
  display: flex;
  gap: 6px;
  overflow: auto;
  padding: 0 15px 11px;
  scrollbar-width: thin;
}
.category-pills button {
  border: 1px solid var(--line);
  background: white;
  padding: 5px 9px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 12px;
  color: #59677a;
}
.category-pills button.active {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: #a9c1e2;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 0 15px 15px;
  max-height: 340px;
  overflow: auto;
}
.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.product-card:hover {
  border-color: #9eb8dd;
  background: #fcfdff;
  box-shadow: 0 7px 18px rgb(36 69 110 / 9%);
}
.product-image {
  height: 93px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafc;
  border-radius: 6px;
  margin-bottom: 3px;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-image .image-missing {
  font-size: 11px;
  color: #8794a5;
}
.product-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  min-height: 35px;
  overflow-wrap: anywhere;
}
.product-zh {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  min-height: 16px;
}
.product-price {
  font-size: 14px;
  font-weight: 600;
  color: #a84b22;
}
.product-price small {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}
.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: auto;
}
.catalog-count {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}
.demand-area {
  padding: 15px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.demand-area textarea {
  width: 100%;
  min-height: 120px;
}
.drop-zone {
  border: 1px dashed #afbdd0;
  border-radius: 4px;
  padding: 15px;
  text-align: center;
  color: #677990;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  background: #f8faff;
  font-size: 12px;
}
.drop-zone.dragover {
  background: #e4efff;
  border-color: var(--blue);
}
.drop-zone input[type="file"] {
  max-width: 100%;
  border: 0;
  padding: 4px;
  background: transparent;
}
.demand-results {
  padding: 0 15px 15px;
}
.result-row {
  border-top: 1px solid var(--line);
  padding: 10px 0;
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 70px 70px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.result-original {
  overflow-wrap: anywhere;
  color: #59677a;
}
.line-toolbar {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
}
.line-toolbar .toolbar-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.quote-lines table {
  min-width: 850px;
}
.quote-lines td {
  padding: 8px;
}
.quote-lines th {
  padding: 9px 8px;
  position: sticky;
  top: 0;
}
.quote-lines input,
.quote-lines select {
  font-size: 12px;
  padding: 6px 7px;
  min-height: 30px;
  border-radius: 8px;
}
.quote-lines input.numeric {
  width: 72px;
  text-align: right;
}
.quote-lines .name-cell {
  min-width: 180px;
  max-width: 300px;
}
.name-cell strong {
  font-weight: 600;
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.name-cell small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.line-child {
  background: #fafbfd;
  font-size: 12px;
}
.line-child .name-cell {
  padding-left: 22px;
}
.line-row .number {
  white-space: nowrap;
  text-align: right;
}
.line-row .note-input {
  width: 125px;
}
.delete-line {
  font-size: 17px;
  color: #9b5a58;
  padding: 4px;
}
.person-sub {
  font-size: 11px;
  color: var(--muted);
}
.quote-bottom {
  position: sticky;
  bottom: 0;
  z-index: 12;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 15px;
  box-shadow: 0 -3px 14px #263b5610;
  margin-top: 14px;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c9d4e1; border: 3px solid transparent; border-radius: 999px; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #9cacc0; }
.quote-totals {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.total-detail {
  font-size: 12px;
  color: #647185;
}
.total-detail b {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.grand-total {
  margin-left: auto;
  text-align: right;
  color: var(--blue);
  font-size: 12px;
  white-space: nowrap;
}
.grand-total strong {
  font-size: 25px;
  font-weight: 650;
  margin-left: 7px;
  font-variant-numeric: tabular-nums;
}
.quote-bottom-actions {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.quote-issues {
  font-size: 11px;
  color: #9b6714;
  line-height: 1.6;
  max-width: 65%;
}
.quote-issues.error {
  color: var(--red);
}
.quote-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.discount-input {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}
.discount-input input {
  width: 66px;
  padding: 5px;
  text-align: right;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  background: white;
  border-radius: 5px;
  margin-bottom: 18px;
}
.summary-stat {
  padding: 17px;
  border-right: 1px solid var(--line);
}
.summary-stat:last-child {
  border-right: 0;
}
.summary-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 9px;
}
.summary-stat strong {
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.inline-notice {
  padding: 11px 14px;
  background: #fbf4e7;
  color: #836121;
  font-size: 12px;
  line-height: 1.7;
  border-bottom: 1px solid #efdfc0;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.detail-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
}
.detail-field span {
  font-size: 11px;
  color: var(--muted);
}
.detail-section {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.detail-section h3 {
  margin-bottom: 12px;
}
.detail-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.detail-metrics {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 13px 0;
}
.detail-metrics span {
  font-size: 12px;
  color: var(--muted);
}
.detail-metrics strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  margin-top: 5px;
}
.tabs {
  display: flex;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 15px;
  overflow: auto;
}
.tabs button {
  padding: 11px 15px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.tabs button.active {
  box-shadow: inset 0 -2px var(--blue);
  color: var(--blue);
  font-weight: 600;
}
.schedule-grid {
  display: grid;
  grid-template-columns: 180px repeat(5, minmax(140px, 1fr));
  min-width: 890px;
  background: var(--line);
  gap: 1px;
}
.schedule-cell {
  background: white;
  padding: 12px;
  min-height: 80px;
}
.schedule-cell.header {
  min-height: auto;
  background: #f8fafd;
  font-weight: 600;
  text-align: center;
}
.schedule-person {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.schedule-task {
  display: block;
  padding: 8px;
  background: #edf3fb;
  border: 1px solid #c5d5ec;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.7;
  width: 100%;
  text-align: left;
  margin-bottom: 7px;
  color: #2c4d7b;
}
.calendar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  flex-wrap: wrap;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}
.month-day {
  min-height: 100px;
  padding: 8px;
  background: white;
  font-size: 12px;
}
.month-day.today {
  background: #f0f6ff;
}
.stock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.stock-track {
  height: 22px;
  position: relative;
  background: #eef2f7;
  min-width: 220px;
  border-radius: 3px;
}
.stock-block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  background: #a8bedf;
  border: 1px solid #6389bd;
  border-radius: 2px;
  font-size: 10px;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 4px;
  color: #244572;
}
.shop-shell {
  background: #f5f7fa;
  min-height: 100vh;
}
.shop-top {
  background: var(--blue);
  color: white;
  padding: 9px max(20px, calc((100vw - 1240px) / 2));
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  gap: 12px;
}
.shop-top a {
  color: white;
}
.shop-header {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 22px max(20px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  gap: 28px;
}
.shop-brand {
  font-size: 24px;
  font-weight: 650;
  color: var(--blue);
  white-space: nowrap;
}
.shop-search {
  display: flex;
  flex: 1;
  max-width: 580px;
}
.shop-search input {
  flex: 1;
  border: 1px solid var(--blue);
  border-radius: 4px 0 0 4px;
}
.shop-search button {
  border-radius: 0 4px 4px 0;
}
.shop-body {
  max-width: 1280px;
  margin: auto;
  padding: 20px;
}
.shop-controls {
  background: white;
  border: 1px solid var(--line);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.shop-layout {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr);
  gap: 16px;
}
.shop-categories {
  border: 1px solid var(--line);
  background: white;
  padding: 8px;
  height: max-content;
}
.shop-categories button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px;
  font-size: 13px;
  color: #4c5d73;
}
.shop-categories button.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 600;
}
.shop-products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.shop-products .product-image {
  height: 155px;
  background: white;
}
.shop-products .product-card {
  padding: 13px;
  gap: 9px;
}
.shop-products .product-name {
  font-size: 14px;
  min-height: 40px;
}
.shop-products .product-price {
  font-size: 18px;
}
.shop-footer {
  padding: 25px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.9;
}
.cart-row {
  display: grid;
  grid-template-columns: 75px 1.5fr 90px 130px 80px;
  gap: 15px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font-size: 13px;
}
.cart-row img {
  width: 65px;
  height: 60px;
  object-fit: contain;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  padding-top: 20px;
}
.file-list a {
  display: block;
  font-size: 12px;
  margin: 8px 0;
}
.save-state {
  font-size: 11px;
  color: var(--muted);
}
.toolbar-input {
  max-width: 320px;
}
.upload-input {
  max-width: 100%;
  font-size: 12px;
}
.mobile-shade {
  display: none;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.7;
  background: #f6f8fb;
  padding: 12px;
  border-radius: 4px;
}
.code-value {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.print-code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
}
.file-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
@media (max-width: 1200px) {
  :root {
    --sidebar: 210px;
  }
  main {
    padding: 17px;
  }
  .topbar {
    padding: 10px 17px;
  }
  .workspace-location > span { display:none; }
  .workspace-search-wrap { max-width:240px; }
  .workspace-search kbd { display:none; }
  .topbar-right { gap:7px; }
  .topbar-right .environment { display:none; }
  .quote-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .meta-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shop-products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .quote-totals {
    gap: 13px;
  }
  .grand-total strong {
    font-size: 23px;
  }
}
@media (max-width: 900px) {
  .quote-bottom {
    position: static;
    box-shadow: none;
  }
  :root {
    --sidebar: 0px;
  }
  .shell {
    display:block;
  }
  .workspace {
    width:100%;
  }
  .sidebar {
    width:244px;
    transform:translateX(-100%);
    transition:transform 280ms var(--ease-out);
    box-shadow:0 12px 32px rgb(13 25 47 / 24%);
  }
  .sidebar.open {
    transform:translateX(0);
  }
  .mobile-shade.visible {
    display:block;
    position:fixed;
    inset:0;
    background:rgb(16 29 50 / 44%);
    z-index:19;
    animation:overlay-arrival 240ms var(--ease-out);
  }
  .menu-toggle {
    display:block;
    flex:none;
  }
  .topbar-left { gap:8px; }
  .workspace-search-wrap { max-width:260px; }
  .environment {
    font-size: 10px;
  }
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-stat:nth-child(2) {
    border-right: 0;
  }
  .summary-stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shop-header {
    gap: 14px;
    padding: 18px;
  }
  .shop-brand {
    font-size: 20px;
  }
  .shop-layout {
    grid-template-columns: 130px 1fr;
  }
  .shop-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quote-issues {
    max-width: 50%;
  }
}
@media (max-width: 640px) {
  :root {
    --sidebar: 0px;
  }
  .shell {
    display: block;
  }
  .workspace {
    width: 100%;
  }
  .sidebar {
    width: 244px;
    transform: translateX(-100%);
    transition: transform 280ms var(--ease-out);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar.open .brand > span,
  .sidebar.open .nav-item > span,
  .sidebar.open .sidebar-foot > span {
    display: inline;
  }
  .sidebar.open .nav-item {
    justify-content: flex-start;
    padding: 10px 11px;
  }
  .mobile-shade.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: #20304765;
    z-index: 19;
  }
  .menu-toggle {
    display: block;
  }
  .topbar {
    min-height: 100px;
    padding: 9px 12px;
    gap: 7px;
    flex-wrap:wrap;
  }
  .topbar-left,
  .topbar-right {
    gap: 7px;
  }
  .topbar select {
    font-size: 13px;
    max-width: 115px;
  }
  .workspace-location { display:none; }
  .workspace-search-wrap { order:3; flex:1 1 100%; max-width:none; }
  .workspace-search { min-height:35px; }
  .workspace-search-results { max-height:50vh; }
  .topbar-right { margin-left:auto; }
  .topbar-right .account { max-width:100px; text-overflow:ellipsis; overflow:hidden; }
  .environment {
    display: none;
  }
  main {
    padding: 13px 11px 24px;
  }
  .page-head {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap:wrap;
  }
  .page-head h1 {
    font-size: 19px;
  }
  .head-actions {
    justify-content: flex-start;
    gap: 6px;
    max-width:100%;
  }
  .button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 12px;
  }
  .button.small {
    min-height: 32px;
  }
  .quote-meta {
    padding: 12px;
    gap: 10px;
  }
  .field > span {
    font-size: 11px;
  }
  .quote-meta input {
    padding: 8px;
    font-size: 12px;
  }
  .panel-head {
    padding: 11px 12px;
  }
  .catalog-toolbar {
    padding: 10px 12px;
    gap: 7px;
  }
  .catalog-toolbar input {
    min-width: 100%;
    order: -1;
  }
  .catalog-toolbar select {
    max-width: 135px;
    font-size: 12px;
    padding: 7px;
  }
  .category-pills {
    padding: 0 12px 10px;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 12px 12px;
    max-height: 350px;
    gap: 8px;
  }
  .product-card {
    padding: 8px;
  }
  .product-image {
    height: 87px;
  }
  .product-name {
    font-size: 12px;
    min-height: 33px;
  }
  .product-price {
    font-size: 13px;
  }
  .demand-area {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .drop-zone {
    min-height: 100px;
  }
  .result-row {
    grid-template-columns: 1fr 65px 65px;
    gap: 7px;
  }
  .result-original {
    grid-column: 1/-1;
  }
  .line-toolbar {
    padding: 10px 12px;
    gap: 5px;
  }
  .line-toolbar .toolbar-right {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .quote-lines table {
    min-width: 0;
    display: block;
  }
  .quote-lines thead {
    display: none;
  }
  .quote-lines tbody {
    display: block;
  }
  .quote-lines tr {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    gap: 4px;
  }
  .quote-lines td {
    border: 0;
    padding: 3px;
    display: block;
  }
  .quote-lines td.name-cell {
    grid-column: 1/3;
    min-width: 0;
    max-width: none;
  }
  .quote-lines td.source-cell {
    grid-column: 3;
    grid-row: 1;
  }
  .quote-lines td[data-label]:before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-bottom: 4px;
  }
  .quote-lines td.line-note {
    grid-column: 1/3;
  }
  .quote-lines td.line-delete {
    grid-column: 3;
    text-align: right;
  }
  .quote-lines input.numeric {
    width: 100%;
    font-size: 12px;
  }
  .quote-lines .note-input {
    width: 100%;
  }
  .quote-lines .number {
    white-space: normal;
  }
  .line-child {
    padding-left: 21px !important;
  }
  .line-child .name-cell {
    padding-left: 0;
  }
  .quote-bottom {
    padding: 10px 12px;
    position: static;
  }
  .quote-totals {
    gap: 9px;
  }
  .total-detail {
    font-size: 10px;
  }
  .total-detail b {
    font-size: 12px;
  }
  .grand-total {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 5px;
    border-top: 1px solid var(--line);
  }
  .grand-total strong {
    font-size: 24px;
  }
  .quote-bottom-actions {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
  }
  .quote-issues {
    max-width: 100%;
    font-size: 10px;
    margin-bottom: 8px;
  }
  .quote-actions {
    justify-content: flex-end;
    gap: 6px;
  }
  .quote-actions .button {
    min-height: 38px;
  }
  .meta-options {
    grid-template-columns: 1fr 1fr;
  }
  .summary-stat {
    padding: 12px;
  }
  .summary-stat strong {
    font-size: 19px;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dialog-body {
    padding: 15px;
    max-height: 82vh;
  }
  .dialog-head {
    padding: 12px 15px;
  }
  .form-grid {
    gap: 11px;
  }
  .form-grid .field {
    grid-column: 1/-1;
  }
  .dialog .button {
    min-height: 40px;
  }
  .login-screen {
    display: block;
    min-height: 100vh;
  }
  .login-intro {
    padding: 28px 25px 15px;
  }
  .login-intro .brand {
    margin-bottom: 14px;
  }
  .login-intro h1 {
    font-size: 22px;
  }
  .login-intro p,
  .login-steps {
    display: none;
  }
  .login-side {
    padding: 25px;
    border: 0;
    background: transparent;
  }
  .login-form {
    max-width: 300px;
    background: var(--surface-solid);
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 5px;
  }
  .login-form h2 {
    font-size: 20px;
  }
  .shop-top {
    padding: 8px 12px;
    font-size: 10px;
  }
  .shop-header {
    flex-wrap: wrap;
    padding: 15px 12px;
    gap: 12px;
  }
  .shop-brand {
    font-size: 21px;
  }
  .shop-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .shop-body {
    padding: 12px;
  }
  .shop-controls {
    padding: 11px;
    gap: 8px;
    font-size: 12px;
  }
  .shop-controls input {
    font-size: 12px;
    max-width: 145px;
    padding: 7px;
  }
  .shop-layout {
    display: block;
  }
  .shop-categories {
    display: flex;
    overflow: auto;
    padding: 5px;
    margin-bottom: 12px;
  }
  .shop-categories button {
    width: auto;
    white-space: nowrap;
    padding: 8px;
    font-size: 12px;
  }
  .shop-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .shop-products .product-card {
    padding: 10px;
    gap: 7px;
  }
  .shop-products .product-image {
    height: 116px;
  }
  .shop-products .product-name {
    font-size: 12px;
    min-height: 35px;
  }
  .shop-products .product-price {
    font-size: 15px;
  }
  .cart-row {
    grid-template-columns: 48px 1fr 65px;
    gap: 8px;
  }
  .cart-row img {
    width: 44px;
    height: 45px;
  }
  .cart-row .cart-amount {
    grid-column: 2;
  }
  .cart-row .cart-remove {
    grid-column: 3;
  }
  .cart-total {
    flex-wrap: wrap;
  }
  .calendar-tools input {
    max-width: 145px;
  }
  .month-day {
    min-height: 90px;
    font-size: 10px;
    padding: 5px;
  }
  .month-day .schedule-task {
    font-size: 9px;
    padding: 3px;
  }
  .discount-input input {
    width: 55px;
  }
  th,
  td {
    padding: 9px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-property: background-color, color, border-color, box-shadow, opacity !important;
    transition-duration: 100ms !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .button, .icon-button, .nav-item { transform: none !important; }
  .toast { transform: translate(-50%, 0); }
}
.quantity-unit {
  display: block;
  text-align: right;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.original-materials {
  padding: 12px 16px;
  border-top: 1px solid var(--border, #d9e0e9);
}
.original-materials summary {
  cursor: pointer;
  font-weight: 600;
}
.source-material {
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #d9e0e9);
}
.source-material pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  max-height: 160px;
  overflow: auto;
  background: #f5f7fa;
  padding: 10px;
}
.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
@media (max-width: 900px) {
  .topbar .environment {
    display: inline-block;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
  }
}
@media (max-width: 640px) {
  .topbar .environment {
    max-width: 82px;
    padding: 3px 4px;
  }
  .menu-toggle {
    min-width: 28px;
  }
}
