:root {
  color-scheme: light;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7f4;
  color: #192821;
  --green: #205f43;
  --green-dark: #164730;
  --soft: #f0f6ef;
  --border: #dde5dd;
  --muted: #56665d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, .upload:focus-within {
  outline: 2px solid #317a55;
  outline-offset: 3px;
}
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.topbar-inner, .intro, .section-title, .file-top, .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.topbar-inner { min-height: 65px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 720; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: white;
  background: var(--green);
  border-radius: 8px;
  font-size: 23px;
  line-height: 1;
}
.plain-link { color: var(--green); font-size: .86rem; text-decoration: none; }
.plain-link:hover { text-decoration: underline; }
.site-account { position: relative; }
.site-account summary { font-size: .85rem; color: var(--green-dark); overflow-wrap: anywhere; }
.site-account div { position: absolute; z-index: 5; top: calc(100% + 8px); right: 0; display: grid; gap: 9px; min-width: 125px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: white; }
.intro { padding: 42px 0 26px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 4.5vw, 3.15rem); line-height: 1.15; letter-spacing: -.055em; }
.intro p { margin-top: 11px; color: var(--muted); }
.global-message {
  margin-bottom: 16px;
  padding: 11px 15px;
  border-left: 3px solid #419267;
  border-radius: 4px;
  background: #e9f3e9;
  overflow-wrap: anywhere;
}
.global-message.error { border-color: #b85134; background: #fff1e8; color: #843523; }
.section {
  margin-bottom: 16px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 3px 14px #13362406;
}
.section-title { min-height: 34px; margin-bottom: 13px; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
.muted, .section-note, .footer { color: var(--muted); font-size: .85rem; }
.file-grid, .lookup-inner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.file-card { min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: 10px; background: #fafcf9; }
.file-card.loaded { border-color: #accbb5; background: #f4faf3; }
.file-card.dragover { border-color: var(--green); outline: 2px solid #90b69d; }
.file-top p { margin-top: 4px; color: var(--muted); font-size: .82rem; }
.filename { margin-top: 12px; overflow-wrap: anywhere; }
.file-options { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.file-options label { display: flex; align-items: center; gap: 7px; font-size: .8rem; }
select, input[type="number"], input[type="text"] {
  min-width: 0;
  max-width: 100%;
  min-height: 35px;
  padding: 5px 8px;
  border: 1px solid #cdd8ce;
  border-radius: 6px;
  color: inherit;
  background: #fff;
}
.file-options .sheet { max-width: min(185px, 49vw); }
.header-row { width: 80px; }
.button {
  flex: 0 0 auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .86rem;
  font-weight: 650;
  white-space: nowrap;
}
.secondary, .upload { border-color: #cdd9cf; color: var(--green-dark); background: #fff; }
.secondary:hover:not(:disabled), .upload:hover { background: var(--soft); border-color: #95b3a0; }
.upload { cursor: pointer; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.primary { color: #fff; background: var(--green); }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.small { min-height: 31px; }
.lookup { margin-top: 11px; border: 1px solid var(--border); border-radius: 9px; }
.lookup summary { padding: 10px 13px; color: var(--green-dark); font-size: .9rem; font-weight: 650; }
.lookup summary span { margin-left: 5px; font-weight: 400; }
.lookup-inner { padding: 0 12px 12px; }
.lookup-keys { display: grid; align-content: start; gap: 8px; padding: 4px 0; }
.lookup-keys label { display: grid; grid-template-columns: 145px minmax(0, 1fr); align-items: center; font-size: .85rem; }
.section-note { margin-bottom: 11px; }
.order-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.order-brand label { font-size: .9rem; font-weight: 650; }
.order-brand p { margin: 0; }
.empty { padding: 21px 14px; border-radius: 8px; background: #f7f9f6; color: var(--muted); text-align: center; font-size: .88rem; }
.empty.ready { background: #edf6ed; color: #225a3c; }
.empty.error { background: #fff2e9; color: #8d3c24; }
.table-frame { overflow: auto; max-height: 445px; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e6ece5; font-size: .86rem; }
th { position: sticky; top: 0; z-index: 1; background: #f3f7f2; color: #425449; font-weight: 650; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.mapping-table { min-width: 610px; }
.mapping-table td:first-child { width: 27%; min-width: 145px; overflow-wrap: anywhere; font-weight: 650; }
.mapping-table td:nth-child(2) { width: 49%; }
.mapping-table select, .fixed-value { width: 100%; }
.fixed-value { margin-top: 6px; }
.mapping-table th:last-child, .mapping-table td:last-child { width: 64px; text-align: center; }
.letter { margin-right: 7px; color: var(--muted); font-size: .72rem; font-weight: 450; }
input[type="checkbox"] { accent-color: var(--green); }
.actions { gap: 8px; }
.csv-option { display: flex; align-items: center; gap: 5px; margin-bottom: 9px; color: var(--muted); font-size: .82rem; }
.preview-frame { margin-top: 11px; }
.preview-frame td { min-width: 100px; max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.preview-frame td:first-child { min-width: 72px; color: var(--muted); }
.preview-frame td.invalid { background: #fff1e8; }
#issues { margin-top: 8px; color: #813821; font-size: .85rem; }
#issues details { max-height: 200px; overflow: auto; }
#issues ul { margin: 6px 0 0; padding-left: 23px; }
.footer { padding: 4px 0 25px; }
.price-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: calc(100dvh - 36px);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: inherit;
  background: #fff;
  box-shadow: 0 20px 65px #11291a30;
}
.price-dialog::backdrop { background: #10271c66; }
.price-dialog h2 { margin-bottom: 3px; }
.price-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.price-tabs [aria-pressed="true"] { background: var(--soft); border-color: #95b3a0; }
.price-form { display: grid; grid-template-columns: 1.3fr 1fr .75fr auto; align-items: end; gap: 9px; }
.price-form[data-view="base"] { grid-template-columns: 1.3fr 1.05fr .8fr auto; }
.price-form[data-view="adjustments"] { grid-template-columns: 1.3fr 1.05fr .8fr .8fr auto; }
.price-form label { display: grid; gap: 4px; font-size: .84rem; font-weight: 600; }
.price-hint { margin-top: 7px; }
.price-import > div { padding: 0 13px 12px; }
.price-import-actions, .price-search { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 8px; }
.price-search { justify-content: space-between; margin: 10px 0; }
.price-search input { width: min(245px, 100%); }
.price-storage { margin-top: 12px; }
.price-dialog .global-message { margin: 11px 0 0; white-space: pre-line; }
.price-table { max-height: 320px; }
.price-table th:last-child { width: 115px; }
.price-table td { overflow-wrap: anywhere; }
.price-table td:last-child { white-space: nowrap; }
.color-option { margin-top: 7px; }
.color-exceptions summary { color: #8d3c24; }
.color-exceptions .preview-frame, .sku-conversions .preview-frame { margin: 0 9px 9px; max-height: 270px; }
#color-form[data-mode="sku"] { grid-template-columns: 1.3fr 1fr 1fr .8fr auto; }
.result-title .actions { flex-wrap: wrap; justify-content: flex-start; }
.price-row-action { padding: 4px 6px; border: 0; background: transparent; color: var(--green); }
.price-row-action:hover { text-decoration: underline; }
.price-row-action.remove { color: #8d3c24; }
@media (max-width: 720px) {
  .shell { width: calc(100% - 24px); }
  .intro { align-items: flex-start; flex-direction: column; padding-top: 27px; }
  .section { padding: 15px 12px; }
  .file-grid, .lookup-inner { grid-template-columns: minmax(0, 1fr); }
  .lookup-inner { gap: 8px; }
  .result-title { align-items: start; flex-direction: column; gap: 8px; }
}
@media (max-width: 490px) {
  .topbar-inner { gap: 7px; }
  .topbar .actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding-block: 6px; }
  .topbar .brand { white-space: nowrap; }
  .topbar .plain-link, .topbar .button { font-size: .75rem; }
  .topbar .button { padding-inline: 7px; }
  .brand-mark { display: none; }
  .price-dialog { padding: 14px; }
  .price-form, .price-form[data-view="base"], .price-form[data-view="adjustments"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #color-form[data-mode="sku"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
