:root {
  color: #25343d;
  background: #f4f6f7;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --blue: #2c619d;
  --blue-hover: #235181;
  --line: #d8e0e3;
  --muted: #55656d;
  --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input, textarea { font: inherit; color: inherit; }
button, input, select, textarea { min-height: 32px; border: 1px solid #b9c6cd; border-radius: 4px; background: var(--white); }
input, select, textarea { padding: 5px 8px; min-width: 0; }
textarea { resize: vertical; }
button { padding: 4px 10px; cursor: pointer; }
button:hover:not(:disabled) { background: #eef4f7; border-color: #8ba6b5; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.primary { color: white; background: var(--blue); border-color: var(--blue); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--blue-hover); }
:focus-visible { outline: 2px solid #bd7616; outline-offset: 2px; }
input[type=checkbox] { min-height: auto; width: 16px; height: 16px; margin: 0; vertical-align: middle; accent-color: var(--blue); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; font-weight: 700; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
.top { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 18px; background: var(--blue); color: white; }
.brand { color: white; font-size: 20px; font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.edition { background: #225e53; color: #f0f9f5; border: 1px solid #80ac9c; border-radius: 3px; padding: 1px 6px; font-size: 11px; }
.account { margin-left: auto; min-width: 0; overflow-wrap: anywhere; text-align: right; }
.top button { min-height: 29px; background: transparent; border-color: #a4c2de; color: white; }
.top button:hover:not(:disabled) { background: #204e7e; }
.layout { display: grid; min-height: calc(100dvh - 52px); grid-template-columns: 172px minmax(0, 1fr); }
aside { background: #f7f9f9; border-right: 1px solid var(--line); padding: 14px 8px; }
nav h2 { font-size: 13px; padding: 1px 10px 10px; color: var(--muted); }
nav a { display: block; min-height: 34px; color: #344753; padding: 7px 10px; border-radius: 3px; border-left: 3px solid transparent; }
nav a:hover { background: #edf2f3; text-decoration: none; }
nav a[aria-current="page"] { color: #214f75; background: #dbeaf4; border-left-color: var(--blue); font-weight: 600; }
main { min-width: 0; background: white; }
.title, .toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 16px; }
.title { justify-content: space-between; padding-block: 14px 10px; }
.crumb, .muted, .message, .list-tools { color: var(--muted); }
.crumb { font-size: 12px; margin-bottom: 2px; }
.toolbar { background: #f7f9fa; border-block: 1px solid var(--line); }
.toolbar label { display: flex; align-items: center; gap: 6px; margin: 0; }
.toolbar input { width: min(240px, 60vw); }
.list-tools { min-height: 39px; padding-block: 4px; justify-content: space-between; background: white; border-top: 0; }
#recovery { padding: 9px 16px; border-block: 1px solid #e5d0a1; background: #fff8e8; overflow-wrap: anywhere; }
#recovery h2 { font-size: 14px; }
.recovery-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; }
.recovery-row span { flex: 1 1 230px; min-width: 0; }
.icon { width: 31px; min-width: 31px; padding-inline: 0; font-size: 18px; line-height: 1; }
.grid { overflow: auto; }
.main-grid { max-height: calc(100dvh - 225px); min-height: 80px; }
table { width: 100%; border-spacing: 0; font-size: 13px; text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: #e8edef; color: #3b4d56; font-weight: 650; border-bottom: 1px solid #cbd6dc; }
th, td { height: 33px; padding: 4px 10px; }
td { border-bottom: 1px solid #edf0f1; }
tbody tr:nth-child(even) td { background: #f6f8f8; }
tbody tr:hover td, tbody tr:focus-within td { background: #edf4f7; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.link { background: transparent; border: 0; padding: 0; min-height: 24px; color: var(--blue); font-weight: 650; }
.link:hover:not(:disabled) { background: transparent; text-decoration: underline; }
.badge { display: inline-block; padding: 2px 6px; color: #4b5d68; background: #edf2f4; border-radius: 3px; font-size: 12px; }
.badge.partial { color: #7c4e14; background: #fff1d6; }
.badge.received { color: #246044; background: #e5f3e9; }
.message, .error { margin: 8px 0; overflow-wrap: anywhere; }
#feedback { padding-inline: 16px; }
.message:empty, .error:empty { display: none; }
.error, .is-error { color: #9e302a; }
dialog { width: min(800px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px); border: 1px solid #b9c6cc; border-radius: 6px; padding: 0; color: inherit; box-shadow: 0 12px 40px #192d4040; }
dialog::backdrop { background: #18293666; }
#order { width: min(1080px, calc(100% - 24px)); }
#picker { width: min(590px, calc(100% - 24px)); }
.modal-head, .modal-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; background: #f7f9fa; }
.modal-head { border-bottom: 1px solid var(--line); }
.modal-head h2 { min-width: 0; overflow-wrap: anywhere; }
.modal-foot { border-top: 1px solid var(--line); justify-content: flex-end; }
.modal-body { padding: 12px 14px; }
.modal-body .grid { max-height: 46dvh; border: 1px solid var(--line); }
.modal-body h3 { margin-block: 12px 6px; }
.modal-body details { padding: 5px 0; border-bottom: 1px solid var(--line); }
.modal-body summary { cursor: pointer; color: var(--blue); }
.fields, .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; margin: 0 0 12px; }
.fields label, .paste label { display: block; min-width: 0; }
.fields input, .fields select, .paste textarea { display: block; width: 100%; margin-top: 3px; }
.fields b { color: #9e302a; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.section-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.section-tools h3 { margin: 0 auto 0 0; }
.paste { padding: 9px; margin-bottom: 10px; background: #f4f7f8; border: 1px solid var(--line); border-radius: 4px; }
.paste button { margin-top: 7px; }
#order-lines input, #receipt-lines input[type=number] { width: 90px; text-align: right; }
.total { margin-top: 9px; text-align: right; font-variant-numeric: tabular-nums; }
.total strong { font-size: 17px; }
.picker-tools { margin-bottom: 8px; padding: 6px 0; border: 0; background: white; }
#receipt-facts { margin-bottom: 9px; overflow-wrap: anywhere; }
.login-panel { width: min(380px, calc(100% - 32px)); margin: 10vh auto 0; padding: 20px; border: 1px solid var(--line); border-radius: 6px; }
.login-panel form, .login-panel label { display: grid; gap: 5px; }
.login-panel form { gap: 12px; margin-top: 14px; }
.login-panel button { margin-top: 4px; }
@media (max-width: 700px) {
  .top { padding-inline: 10px; gap: 7px; }
  .brand { font-size: 17px; }
  .layout { display: block; }
  aside { padding: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  nav { display: flex; overflow-x: auto; padding: 0 4px; }
  nav h2 { display: none; }
  nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  nav a[aria-current="page"] { border-bottom-color: var(--blue); }
  .title, .toolbar { padding-inline: 10px; }
  .main-grid { max-height: calc(100dvh - 275px); }
  .fields, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-head, .modal-foot, .modal-body { padding-inline: 10px; }
}
@media (max-width: 365px) {
  .edition { display: none; }
  .fields { grid-template-columns: 1fr; }
}

/* The operations shell is deliberately scoped away from login and invitation pages. */
.workbench {
  --blue: #17674f; --blue-hover: #10533f; --line: #dce2df; --muted: #5e6b65;
  --ink: #202d28; --rail: #202c27; --rail-width: 194px;
  color: var(--ink); background: white; font-variant-numeric: tabular-nums;
}
.glyph { width: 16px; height: 16px; flex: none; vertical-align: middle; pointer-events: none; }
.workbench button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; border-color: #bcc9c2; padding: 5px 12px; }
.workbench button.primary { border-color: var(--blue); }
.workbench button:hover:not(:disabled):not(.primary):not(.link) { background: #f0f5f2; border-color: #97a9a0; }
.workbench button:disabled { opacity: .5; }
.workbench input, .workbench select, .workbench textarea { border-color: #bdc9c2; min-height: 34px; }
.workbench input[type=checkbox] { min-height: 0; }
.workbench input::placeholder { color: #75827a; }
.workbench :focus-visible { outline: 2px solid #35876c; outline-offset: 2px; }
.workbench .icon { width: 34px; min-width: 34px; padding: 0; }
.workbench .link { padding: 0; min-height: 26px; }
.skip, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { z-index: 10; top: 8px; left: 8px; width: auto; height: auto; padding: 8px 14px; clip-path: none; background: white; }
.mast { display: flex; align-items: center; min-height: 62px; border-bottom: 1px solid var(--line); gap: 16px; padding-right: 24px; }
.wordmark { width: var(--rail-width); flex: none; align-self: stretch; display: flex; align-items: center; gap: 11px; padding: 0 20px; color: white; background: var(--rail); font-size: 21px; font-weight: 700; }
.wordmark:hover { text-decoration: none; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; background: #a0d6ad; color: #173f30; border-radius: 6px; }
.brand-mark svg { width: 22px; height: 22px; }
.mast-section { color: #35473d; font-size: 14px; font-weight: 600; padding-left: 14px; }
.uat { display: inline-flex; flex: none; align-items: center; gap: 5px; border: 1px solid #cad9ce; border-radius: 4px; background: #f2f7f3; color: #43634e; font-size: 11px; font-weight: 650; padding: 3px 7px; }
.uat .glyph { width: 13px; height: 13px; }
.identity { margin-left: auto; display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: 13px; }
.identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mast form { padding-left: 12px; border-left: 1px solid var(--line); }
.mast .icon { border: 0; color: var(--muted); }
.workbench .layout { grid-template-columns: var(--rail-width) minmax(0,1fr); min-height: calc(100dvh - 62px); }
.workbench aside { background: var(--rail); border: 0; padding: 17px 12px; }
#nav-toggle { display: none; }
.workbench nav { display: block; padding: 0; overflow: visible; }
.workbench nav section { margin-bottom: 16px; }
.workbench nav section + section { border-top: 1px solid #394740; padding-top: 15px; }
.workbench nav h2 { display: block; color: #a7b8ad; font-size: 11px; font-weight: 550; padding: 0 12px 6px; }
.workbench nav a { display: flex; align-items: center; min-height: 38px; gap: 11px; padding: 8px 12px; color: #e0e8e3; border: 0; border-radius: 4px; font-size: 13px; }
.workbench nav a .glyph { color: #99b0a1; }
.workbench nav a:hover { background: #2c3a32; }
.workbench nav a[aria-current="page"] { background: #d8ecdf; color: #173d2d; font-weight: 650; }
.workbench nav a[aria-current="page"] .glyph { color: #206444; }
.workbench main { padding: 22px 30px 32px; min-width: 0; }
.workbench .crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.crumb .glyph { width: 14px; height: 14px; }
.crumb .glyph:nth-child(2) { width: 11px; }
.workbench .title { padding: 26px 0 23px; flex-wrap: nowrap; }
.workbench h1 { font-size: 29px; line-height: 1.28; font-weight: 700; }
.folio { color: #446d59; font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; margin-bottom: 6px; }
.workbench #filters { display: flex; align-items: center; gap: 9px; padding: 13px 0; background: white; border-block: 1px solid var(--line); }
.workbench #filters label { color: var(--muted); font-size: 12px; }
.workbench #filters select { font-size: 13px; background: white; }
.workbench .search-box { position: relative; flex: 1 1 200px; max-width: 360px; }
.workbench .search-box .glyph { position: absolute; left: 10px; color: #718278; }
.workbench .search-box input { width: 100%; padding-left: 33px; color: var(--ink); font-size: 13px; }
.workbench #clear { border-color: transparent; color: var(--muted); }
.workbench .list-tools { display: flex; align-items: center; justify-content: flex-start; gap: 10px; border: 0; padding: 16px 0 10px; }
.list-tools h2 { display: flex; align-items: center; gap: 7px; font-size: 15px; color: var(--ink); }
.list-tools h2 .glyph { color: #537260; }
.list-tools #count { font-size: 12px; color: var(--muted); }
.list-tools #reload { margin-left: auto; }
.workbench .main-grid { min-height: 0; max-height: min(68dvh,900px); border-block: 1px solid var(--line); }
.workbench table { font-size: 13px; }
.workbench th { color: #54635b; font-size: 12px; font-weight: 600; background: #f1f4f2; border-color: var(--line); height: 35px; }
.workbench td { height: 42px; border-color: #e9edea; }
.workbench th, .workbench td { padding-inline: 12px; }
.workbench tbody tr:nth-child(even) td { background: white; }
.workbench tbody tr:hover td, .workbench tbody tr:focus-within td { background: #f5f8f6; }
.workbench code, .identifier, .workbench #rows .link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.trace-link { font-size: 12px; font-weight: 550; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.open { color: #456176; background: #eef3f7; }
.workbench #feedback { margin: 0; padding: 30px 12px; text-align: center; background: #fafbf9; border-bottom: 1px solid var(--line); }
#paging { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; color: var(--muted); font-size: 12px; }
#paging div { display: flex; align-items: center; gap: 9px; }
#page-number { min-width: 32px; text-align: center; }
#paging .icon { min-height: 29px; min-width: 29px; width: 29px; }
#recovery, #master-pending { margin-bottom: 10px; padding: 12px 14px; border: 1px solid #decd9f; border-radius: 4px; background: #fff9e9; }
#master-pending { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.workbench dialog { padding: 0; border-radius: 8px; border-color: var(--line); }
.workbench dialog[open], .workbench dialog > form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.workbench dialog .modal-body { min-height: 0; overflow: auto; }
.workbench dialog .modal-head, .workbench dialog .modal-foot { flex: none; }
.workbench dialog::backdrop { background: #17291f73; }
.workbench .modal-head, .workbench .modal-foot { padding: 14px 20px; background: #fafcfb; }
.workbench .modal-head h2 { font-size: 17px; }
.workbench .modal-body { padding: 16px 20px; }
.workbench .fields { gap: 12px; }
.workbench .fields label, .map-row label { font-size: 12px; color: #53665a; }
.workbench .fields input, .workbench .fields select { color: var(--ink); }
.workbench .wide { grid-column: 1 / -1; }
#style-detail, #master-editor { width: min(900px,calc(100% - 24px)); }
#master-editor:has(#simple-fields:not([hidden])) { width: min(540px,calc(100% - 24px)); }
#simple-fields, .spec-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
#editor-fields { margin: 0; padding: 0; min-width: 0; border: 0; }
.optional { color: #69776f; font-size: 11px; margin-left: 6px; font-weight: normal; }
.photo { display: inline-grid; place-items: center; width: 36px; height: 36px; overflow: hidden; border: 1px solid #e0e6e2; border-radius: 4px; background: white; vertical-align: middle; }
.photo.empty { color: #65746a; background: #f6f8f6; font-size: 10px; }
.photo img { width: 100%; height: 100%; object-fit: contain; }
body[data-view=catalog] #rows td { height: 52px; }
body[data-view=catalog] #head th:first-child { width: 60px; }
body[data-view=catalog] #head th:last-child { text-align: right; }
.style-identity { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; overflow-wrap: anywhere; }
.style-identity .photo { width: 76px; height: 76px; }
.style-identity h3 { font-size: 20px; margin: 0 0 4px; }
.mappings { display: grid; gap: 3px; }
.spec-row { padding: 12px 0; border-top: 1px solid var(--line); }
.spec-row .section-tools { margin-top: 0; }
.spec-row .section-tools h3 { color: var(--muted); font-size: 12px; }
.map-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 8px; }
.map-row label { flex: 1; min-width: 0; }
.map-row input { display: block; width: 100%; }
.adopt-option { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; width: fit-content; font-size: 13px; margin-bottom: 10px; }
.adopt-option span { color: var(--muted); font-size: 11px; }
@media (max-width: 1080px) {
  .workbench { --rail-width: 163px; }
  .workbench main { padding-inline: 20px; }
  .workbench .search-box { max-width: 320px; }
}
@media (max-width: 760px) {
  .mast { min-height: 50px; gap: 8px; padding-right: 8px; }
  .wordmark { width: auto; background: white; color: var(--ink); padding: 0 5px 0 14px; font-size: 17px; gap: 7px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .mast-section, .identity .glyph { display: none; }
  .identity { font-size: 12px; }
  .mast form { padding-left: 2px; }
  .uat { padding: 2px 5px; font-size: 10px; }
  .workbench .layout { display: block; }
  .workbench aside { padding: 0; }
  #nav-toggle { width: 100%; display: flex; justify-content: flex-start; gap: 8px; min-height: 39px; border: 0; border-radius: 0; padding-inline: 16px; color: white; background: var(--rail); font-size: 13px; }
  .workbench #nav-toggle:hover:not(:disabled) { background: #304439; }
  #mobile-location { margin-left: auto; font-size: 11px; color: #c4d4c9; }
  #nav-toggle[aria-expanded=false] + nav { display: none; }
  .workbench nav { padding: 12px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .workbench nav section, .workbench nav section + section { margin: 0; padding: 0; border: 0; }
  .workbench main { padding: 17px 14px 28px; }
  .workbench .crumb { display: none; }
  .workbench .title { padding: 4px 0 16px; }
  .workbench h1 { font-size: 24px; }
  .workbench #filters { gap: 8px; }
  .workbench .search-box { flex: 1 0 100%; max-width: none; }
  .workbench .main-grid { max-height: 62dvh; }
  .workbench .list-tools { padding-top: 10px; }
  .workbench .modal-head, .workbench .modal-foot, .workbench .modal-body { padding: 12px; }
  .workbench .fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workbench .modal-head .icon { flex: none; }
  .workbench th, .workbench td { padding-inline: 9px; }
}
