:root {
  color-scheme: light;
  --ink: #12221f;
  --ink-soft: #5b6c67;
  --paper: #f3f5f0;
  --surface: #fff;
  --surface-soft: #edf3ef;
  --line: #d5e0da;
  --green-950: #0b2823;
  --green-900: #10362f;
  --green-800: #16483f;
  --green-700: #176457;
  --green-100: #dcece7;
  --mint: #9bd0bd;
  --red: #a7483a;
  --red-soft: #f7e5e0;
  --shadow: 0 14px 42px rgba(24, 52, 45, 0.09);
  --shadow-strong: 0 28px 90px rgba(8, 30, 26, 0.24);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shell: min(1920px, calc(100% - 48px));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 86% 12%, rgba(155, 208, 189, 0.16), transparent 26rem), var(--paper);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.shell { width: var(--shell); margin-inline: auto; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #fff;
  background: var(--green-950);
  border-radius: 8px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.auth-view {
  display: grid;
  min-height: 100vh;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 15%, rgba(155, 208, 189, 0.24), transparent 26rem),
    linear-gradient(145deg, var(--green-950), var(--green-800));
  place-items: center;
}
.auth-card {
  display: grid;
  width: min(460px, 100%);
  gap: 30px;
  padding: clamp(28px, 6vw, 48px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-strong);
}
.auth-card h1 { margin: 0; font-size: clamp(2rem, 8vw, 3rem); line-height: 1.08; letter-spacing: -0.045em; }
.auth-copy { margin: 10px 0 0; color: var(--ink-soft); }
.auth-form { display: grid; gap: 18px; }
.brand--auth { color: var(--ink); }
.brand--auth .brand__mark { color: #fff; background: var(--green-700); }
.brand--auth small { color: var(--ink-soft); }

.workspace-header { position: relative; z-index: 20; color: #fff; background: var(--green-950); border-bottom: 1px solid rgba(255,255,255,.1); }
.workspace-header__inner { display: flex; min-height: 76px; align-items: center; gap: 22px; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 11px; text-decoration: none; }
.brand__mark { display: grid; width: 38px; height: 38px; color: var(--green-950); background: var(--mint); border-radius: 11px; font-size: .9rem; font-weight: 800; place-items: center; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .92rem; letter-spacing: .02em; }
.brand small { margin-top: 1px; color: rgba(255,255,255,.52); font-size: .56rem; letter-spacing: .13em; }
.workspace-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.workspace-nav a { padding: 9px 13px; color: rgba(255,255,255,.64); border-radius: 9px; font-size: .78rem; font-weight: 650; text-decoration: none; }
.workspace-nav a:hover, .workspace-nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.1); }
.account-tools { display: flex; align-items: center; gap: 9px; }
.account-chip { display: flex; min-width: 130px; flex-direction: column; padding: 7px 11px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; }
.account-chip span { overflow: hidden; font-size: .78rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.account-chip small { color: rgba(255,255,255,.58); font-size: .65rem; }

.manual-hero { color: #fff; background: radial-gradient(circle at 80% 10%, rgba(155,208,189,.2), transparent 25rem), linear-gradient(118deg, var(--green-950), var(--green-800)); }
.manual-hero__inner { display: grid; min-height: 270px; grid-template-columns: minmax(0, 1fr) minmax(250px, 340px); align-items: center; gap: 72px; padding-block: 48px; }
.eyebrow, .section-kicker { margin: 0 0 9px; color: var(--green-700); font-size: .68rem; font-weight: 780; letter-spacing: .15em; }
.manual-hero .eyebrow { color: var(--mint); }
.manual-hero h1 { margin: 0; font-size: clamp(2.35rem, 4.8vw, 4.2rem); line-height: 1.06; letter-spacing: -.055em; }
.manual-hero__lede { max-width: 720px; margin: 18px 0 0; color: rgba(255,255,255,.7); }
.hero-actions { padding: 23px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0,0,0,.14); }
.hero-actions p { margin: 10px 0 0; color: rgba(255,255,255,.6); font-size: .7rem; text-align: center; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: .79rem; font-weight: 730; line-height: 1.2; transition: transform 150ms ease, background 150ms ease, opacity 150ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .manual-card__media:focus-visible, .image-editor:focus-visible { outline: 3px solid rgba(23,100,87,.25); outline-offset: 2px; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button--primary { color: #fff; background: var(--green-700); }
.button--primary:hover:not(:disabled) { background: var(--green-800); }
.button--accent { color: #3e2808; background: #f2ca79; border-color: #ddb358; }
.button--accent:hover:not(:disabled) { background: #e8bb62; }
.button--quiet { color: var(--green-800); background: var(--surface-soft); border-color: var(--line); }
.button--danger { color: var(--red); background: var(--red-soft); border-color: #edc7bd; }
.button--hero { width: 100%; min-height: 50px; color: var(--green-950); background: var(--mint); }
.button--header { min-height: 38px; padding: 7px 11px; color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
.button--wide { width: 100%; }

.overview, .library { padding-block: 52px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.4rem); letter-spacing: -.04em; }
.sync-status, .result-count { margin: 0; color: var(--ink-soft); font-size: .78rem; }
.sync-status[data-state="error"] { color: var(--red); }
.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.overview-card { min-height: 145px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.overview-card--primary { color: #fff; background: var(--green-800); border-color: transparent; }
.overview-card span, .overview-card small { display: block; color: var(--ink-soft); }
.overview-card--primary span, .overview-card--primary small { color: rgba(255,255,255,.65); }
.overview-card span { font-size: .75rem; font-weight: 720; }
.overview-card strong { display: block; margin: 13px 0 4px; font-size: 2.2rem; line-height: 1; }
.overview-card small { font-size: .72rem; }

.library { padding-bottom: 76px; }
.library-intro { max-width: 860px; margin: -7px 0 20px; color: var(--ink-soft); font-size: .8rem; }
.library-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.field > span, .image-editor__head > span { color: var(--ink-soft); font-size: .73rem; font-weight: 720; }
.field em { color: var(--red); font-style: normal; }
.field small, .image-editor__head small { color: #7b8b86; font-size: .68rem; }
.field input, .field select, .field textarea { width: 100%; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.field input, .field select { min-height: 45px; padding: 9px 12px; }
.field textarea { min-height: 120px; padding: 12px; line-height: 1.55; resize: vertical; }
.field input[readonly] { color: var(--ink-soft); background: var(--surface-soft); }
.field--wide { grid-column: 1 / -1; }
.filter-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 10px; }
.inline-link { width: fit-content; color: var(--green-700); font-size: .72rem; font-weight: 700; }

.notice, .form-error { padding: 12px 14px; color: var(--red); background: var(--red-soft); border: 1px solid #edc7bd; border-radius: 10px; white-space: pre-line; }
.notice { margin-top: 18px; }
.form-error { margin: 0; font-size: .76rem; }
.loading-state { display: flex; min-height: 110px; align-items: center; justify-content: center; gap: 10px; color: var(--ink-soft); }
.loading-state__dot { width: 9px; height: 9px; background: var(--green-700); border-radius: 50%; animation: pulse 1.2s infinite alternate; }
@keyframes pulse { to { opacity: .25; transform: scale(.7); } }

.manual-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.manual-card { overflow: hidden; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.manual-card__media { position: relative; display: block; width: 100%; height: 300px; padding: 0; overflow: hidden; background: #e8eeea; border: 0; cursor: zoom-in; }
.manual-card__media:disabled { cursor: default; }
.manual-card__image { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 220ms ease; }
.manual-card__media:hover:not(:disabled) .manual-card__image { transform: scale(1.025); }
.image-placeholder { display: grid; width: 100%; height: 100%; color: #80918b; place-items: center; align-content: center; gap: 8px; }
.image-placeholder > span { font-size: 2.2rem; }
.record-status { position: absolute; top: 14px; left: 14px; padding: 6px 10px; color: #fff; background: rgba(11,40,35,.86); border-radius: 999px; font-size: .67rem; font-weight: 750; }
.record-status[data-state="archived"] { background: rgba(103,65,59,.88); }
.image-quality-badge { position: absolute; z-index: 2; top: 14px; right: 14px; padding: 6px 10px; color: #76420b; background: rgba(255,235,198,.97); border: 1px solid rgba(255,255,255,.8); border-radius: 999px; box-shadow: 0 5px 16px rgba(0,0,0,.11); font-size: .67rem; font-weight: 780; }
.launch-status { position: absolute; right: 14px; bottom: 14px; max-width: calc(100% - 28px); padding: 7px 10px; color: #152f29; background: rgba(220,236,231,.96); border: 1px solid rgba(255,255,255,.7); border-radius: 999px; box-shadow: 0 5px 15px rgba(0,0,0,.12); font-size: .67rem; font-weight: 780; overflow-wrap: anywhere; }
.snapshot-version-badge { position: absolute; z-index: 2; top: 14px; right: 14px; padding: 6px 10px; color: #17382f; background: rgba(220,236,231,.96); border: 1px solid rgba(255,255,255,.8); border-radius: 999px; box-shadow: 0 5px 16px rgba(0,0,0,.11); font-size: .67rem; font-weight: 780; }
.manual-card__body { display: grid; gap: 17px; padding: 22px; }
.manual-card__heading h3 { margin: 8px 0 0; font-size: 1.14rem; line-height: 1.35; }
.record-labels { display: flex; flex-wrap: wrap; gap: 7px; }
.category-tag, .owner-tag, .market-tag { padding: 4px 8px; border-radius: 999px; font-size: .66rem; font-weight: 720; }
.category-tag { color: var(--green-800); background: var(--green-100); }
.owner-tag { color: #49605a; background: var(--surface-soft); }
.market-tag { color: #704614; background: #fbebca; }
.record-date { margin: 7px 0 0; color: var(--ink-soft); font-size: .68rem; }
.purchase-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: var(--radius-md); }
.purchase-metrics div { padding: 13px; }
.purchase-metrics div + div { border-left: 1px solid var(--line); }
.purchase-metrics dt { color: var(--ink-soft); font-size: .65rem; }
.purchase-metrics dd { margin: 4px 0 0; font-size: .94rem; font-weight: 760; }
.manual-note { min-height: 82px; padding: 13px; background: var(--surface-soft); border-radius: var(--radius-md); }
.manual-note span { color: var(--green-700); font-size: .66rem; font-weight: 760; }
.manual-note p { display: -webkit-box; overflow: hidden; margin: 6px 0 0; color: #435650; font-size: .77rem; line-height: 1.55; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.source-links, .source-1688-links { display: flex; flex-wrap: wrap; gap: 8px; }
.source-1688-links:empty { display: none; }
.source-link { padding: 7px 10px; color: var(--green-700); background: #f5faf7; border: 1px solid var(--line); border-radius: 8px; font-size: .69rem; font-weight: 720; text-decoration: none; }
.source-link:hover { text-decoration: underline; }
.card-actions { display: flex; gap: 8px; }
.card-actions .button { flex: 1; }
.card-actions--wrap { flex-wrap: wrap; }
.card-actions--wrap .button { min-width: calc(33.333% - 6px); }
.launch-markers { display: grid; gap: 6px; padding: 11px 12px; color: #315048; background: #eef8f4; border: 1px solid #cfe4dc; border-radius: var(--radius-md); font-size: .7rem; }
.launch-markers strong { color: var(--green-800); font-size: .71rem; }
.launch-markers span { overflow-wrap: anywhere; }
.image-review-pending { padding: 10px 12px; color: #74500c; background: #fff6dd; border: 1px solid #ecd9a8; border-radius: var(--radius-md); font-size: .7rem; font-weight: 720; }
.launch-image-meta { margin: -8px 0 0; color: var(--ink-soft); font-size: .68rem; overflow-wrap: anywhere; }

.empty-state { padding: 64px 20px; color: var(--ink-soft); text-align: center; }
.empty-state > span { font-size: 2rem; }
.empty-state h3 { margin: 8px 0 3px; color: var(--ink); }
.empty-state p { margin: 0 0 18px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 28px; }
.pagination span { min-width: 80px; color: var(--ink-soft); font-size: .76rem; text-align: center; }
.pagination-size { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: .74rem; }
.pagination-size span { min-width: 0; }
.pagination-size select { min-height: 40px; padding: 7px 32px 7px 11px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; }

.dialog { width: min(940px, calc(100% - 30px)); max-height: calc(100dvh - 30px); padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-xl); }
.dialog::backdrop { background: rgba(6,29,25,.73); backdrop-filter: blur(5px); }
.dialog__surface { overflow: hidden auto; max-height: calc(100dvh - 30px); margin: 0; background: var(--surface); border: 1px solid rgba(255,255,255,.7); border-radius: var(--radius-xl); box-shadow: var(--shadow-strong); }
.dialog__header, .dialog__footer { position: sticky; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 28px; background: rgba(255,255,255,.97); }
.dialog__header { top: 0; border-bottom: 1px solid var(--line); }
.dialog__footer { bottom: 0; justify-content: flex-end; border-top: 1px solid var(--line); }
.dialog__header h2 { margin: 0; font-size: 1.65rem; letter-spacing: -.035em; }
.dialog-close { display: grid; flex: 0 0 auto; width: 42px; height: 42px; color: #52635e; background: var(--surface-soft); border: 0; border-radius: 50%; cursor: pointer; font-size: 1.7rem; place-items: center; }
.dialog__body { padding: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dialog-subtitle { margin: 4px 0 0; color: var(--ink-soft); font-size: .76rem; }

.source-editor { padding: 16px; background: #f7faf8; border: 1px solid var(--line); border-radius: var(--radius-md); }
.source-editor__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.source-editor__heading > span { color: var(--ink-soft); font-size: .73rem; font-weight: 720; }
.source-editor__rows { display: grid; gap: 10px; margin-top: 12px; }
.source-editor__row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 8px; }
.source-editor__input-wrap { display: grid; gap: 5px; }
.source-editor__input-wrap input { width: 100%; min-height: 45px; padding: 9px 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.source-editor__input-wrap input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 2px rgba(167,72,58,.1); }
.source-editor__error { color: var(--red); font-size: .67rem; }
.source-editor__open, .source-editor__remove { min-width: 78px; }

.launch-form-grid { display: grid; gap: 17px; }
.launch-product-preview { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 13px; padding: 12px; background: var(--surface-soft); border-radius: var(--radius-md); }
.launch-product-preview:has(img[hidden]) { grid-template-columns: 1fr; }
.launch-product-preview img { width: 84px; height: 84px; object-fit: cover; background: #fff; border-radius: 10px; }
.launch-product-preview span, .launch-product-preview strong { display: block; }
.launch-product-preview span { color: var(--green-700); font-size: .68rem; font-weight: 760; }
.launch-product-preview strong { margin-top: 5px; line-height: 1.35; }
.launch-details { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); margin: 0; border: 1px solid var(--line); border-radius: var(--radius-md); }
.launch-details div { padding: 13px; min-width: 0; }
.launch-details div + div { border-left: 1px solid var(--line); }
.launch-details dt { color: var(--ink-soft); font-size: .65rem; }
.launch-details dd { margin: 4px 0 0; font-size: .83rem; font-weight: 760; overflow-wrap: anywhere; }
.erp-sku-list { display: flex; flex-wrap: wrap; gap: 6px; }
.erp-sku-list span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: .72rem; overflow-wrap: anywhere; }
.erp-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: var(--radius-md); }
.erp-metrics div { padding: 12px; min-width: 0; }
.erp-metrics div + div { border-left: 1px solid var(--line); }
.erp-metrics dt { color: var(--ink-soft); font-size: .65rem; }
.erp-metrics dd { margin: 4px 0 0; font-size: .9rem; font-weight: 760; }
.launch-erp-sync-status { margin: -8px 0 0; color: var(--ink-soft); font-size: .68rem; }
.launch-card__media { height: 245px; }

.image-editor { padding: 18px; background: #f5faf7; border: 2px dashed #9cbab0; border-radius: var(--radius-lg); }
.image-editor[data-dragging="true"] { background: var(--green-100); border-color: var(--green-700); }
.image-editor__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.image-editor__content { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 20px; }
.image-editor__preview { display: grid; overflow: hidden; min-height: 150px; background: #e6ede9; border-radius: var(--radius-md); place-items: center; }
.image-editor__preview img { width: 100%; height: 180px; object-fit: contain; background: #fff; }
.image-editor__preview span { padding: 20px; color: #748680; font-size: .75rem; text-align: center; }
.image-editor__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.image-editor__actions p { flex-basis: 100%; margin: 4px 0 0; color: var(--ink-soft); font-size: .72rem; overflow-wrap: anywhere; }

.dialog--image { width: min(1180px, calc(100% - 24px)); }
.image-viewer { overflow: hidden; background: #091612; border-radius: var(--radius-lg); box-shadow: var(--shadow-strong); }
.image-viewer header { display: flex; align-items: center; justify-content: space-between; padding: 14px 17px; color: #fff; }
.image-viewer h2 { overflow: hidden; margin: 0; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.image-viewer .dialog-close { color: #fff; background: rgba(255,255,255,.12); }
.image-viewer img { display: block; width: 100%; max-height: calc(100dvh - 270px); object-fit: contain; }
.image-viewer__details { padding: 11px 17px 17px; }
.image-viewer p { margin: 0 0 10px; color: rgba(255,255,255,.62); font-size: .7rem; }
.image-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin: 0; }
.image-meta-grid div { min-width: 0; padding: 9px 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 9px; }
.image-meta-grid dt { color: rgba(255,255,255,.52); font-size: .62rem; }
.image-meta-grid dd { margin: 3px 0 0; color: rgba(255,255,255,.88); font-size: .7rem; font-weight: 680; overflow-wrap: anywhere; }

.duplicate-review-toolbar { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.duplicate-group-list { display: grid; gap: 18px; }
.duplicate-group-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.duplicate-group-card > header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.duplicate-group-id { color: var(--green-700); font-size: .66rem; font-weight: 790; letter-spacing: .06em; overflow-wrap: anywhere; }
.duplicate-group-reason { margin: 5px 0 3px; font-size: 1.05rem; }
.duplicate-group-meta { margin: 0; color: var(--ink-soft); font-size: .7rem; }
.duplicate-member-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.duplicate-member { min-width: 0; overflow: hidden; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-md); }
.duplicate-member__media { display: grid; width: 100%; height: 180px; padding: 0; color: var(--ink-soft); background: #e5ece8; border: 0; cursor: zoom-in; place-items: center; }
.duplicate-member__media:disabled { cursor: default; }
.duplicate-member__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.duplicate-member__body { display: grid; gap: 4px; padding: 12px; }
.duplicate-member__body strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.duplicate-member__body span { color: var(--ink-soft); font-size: .66rem; overflow-wrap: anywhere; }

.dialog--accounts { width: min(1100px, calc(100% - 30px)); }
.account-layout { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(380px, 1.3fr); gap: 28px; }
.account-layout h3 { margin: 0 0 16px; font-size: 1.05rem; }
.account-create { display: grid; align-content: start; gap: 15px; padding: 20px; background: var(--surface-soft); border-radius: var(--radius-lg); }
.account-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-list { display: grid; gap: 10px; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.account-row strong { display: block; font-size: .84rem; }
.account-row p { margin: 3px 0 0; color: var(--ink-soft); font-size: .68rem; }
.account-row__actions { display: flex; flex: 0 0 auto; gap: 7px; }
.account-row__actions .button { min-height: 36px; padding: 7px 10px; }
.muted-copy { color: var(--ink-soft); font-size: .78rem; }
.dialog--compact { width: min(520px, calc(100% - 30px)); }

.toast { position: fixed; z-index: 200; right: 24px; bottom: 24px; max-width: min(420px, calc(100% - 48px)); padding: 13px 16px; color: #fff; background: var(--green-800); border-radius: 10px; box-shadow: var(--shadow-strong); font-size: .78rem; }
.toast[data-kind="error"] { background: var(--red); }
.footer { padding: 27px 0; color: rgba(255,255,255,.6); background: var(--green-950); }
.footer__inner { display: flex; justify-content: space-between; gap: 22px; }
.footer p { margin: 0; font-size: .7rem; }

@media (max-width: 1100px) {
  .workspace-header__inner { flex-wrap: wrap; padding-block: 12px; }
  .workspace-nav { order: 3; width: 100%; }
  .account-tools { margin-left: auto; }
  .library-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --shell: min(100% - 28px, 1920px); }
  .workspace-header__inner { gap: 12px; }
  .workspace-nav { overflow-x: auto; }
  .account-chip { min-width: 0; max-width: 130px; }
  .button--header { padding-inline: 9px; }
  .manual-hero__inner { min-height: 0; grid-template-columns: 1fr; gap: 25px; padding-block: 38px; }
  .overview, .library { padding-top: 38px; }
  .section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .overview-grid, .manual-grid { grid-template-columns: 1fr; }
  .overview-card { min-height: 125px; }
  .library-filters, .form-grid { grid-template-columns: 1fr; }
  .field--wide, .filter-actions { grid-column: 1; }
  .manual-card__media { height: min(100vw - 30px, 420px); }
  .dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .dialog__surface { max-height: calc(100dvh - 16px); border-radius: 18px; }
  .dialog__header, .dialog__footer { padding: 17px; }
  .dialog__body { padding: 17px; }
  .image-editor__content { grid-template-columns: 1fr; }
  .image-editor__preview img { height: min(58vw, 260px); }
  .image-meta-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .duplicate-group-card > header { align-items: stretch; flex-direction: column; }
  .duplicate-member-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .account-row { align-items: stretch; flex-direction: column; }
  .account-row__actions .button { flex: 1; }
  .footer__inner { flex-direction: column; gap: 5px; }
  .source-editor__row { grid-template-columns: minmax(0, 1fr) auto; }
  .source-editor__input-wrap { grid-column: 1 / -1; }
}

@media (max-width: 470px) {
  .brand small, .account-chip small { display: none; }
  .workspace-nav a { flex: 0 0 auto; padding-inline: 10px; }
  .account-tools { gap: 5px; }
  .account-chip { padding: 7px 8px; }
  .account-chip span { max-width: 85px; }
  .library-filters { padding: 14px; }
  .card-actions { flex-direction: column; }
  .dialog__footer .button { flex: 1; }
  .image-editor { padding: 13px; }
  .image-editor__head { align-items: start; flex-direction: column; }
  .toast { right: 14px; bottom: 14px; max-width: calc(100% - 28px); }
  .source-editor__heading { align-items: stretch; flex-direction: column; }
  .source-editor__row { grid-template-columns: 1fr 1fr; }
  .pagination { flex-wrap: wrap; gap: 10px; }
  .pagination-size { order: 4; width: 100%; justify-content: center; }
  .source-editor__open, .source-editor__remove { min-width: 0; }
  .launch-details { grid-template-columns: 1fr; }
  .launch-details div + div { border-top: 1px solid var(--line); border-left: 0; }
  .erp-metrics { grid-template-columns: 1fr; }
  .erp-metrics div + div { border-top: 1px solid var(--line); border-left: 0; }
  .image-meta-grid, .duplicate-member-grid { grid-template-columns: 1fr; }
  .duplicate-member__media { height: min(68vw, 300px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
