:root {
  color-scheme: light;
  --page: #f3f5f8;
  --white: #fff;
  --ink: #0a1a2e;
  --navy: #0a1a2e;
  --navy-mid: #14365e;
  --blue: #355b80;
  --blue-soft: #e5ebf1;
  --muted: #505d6c;
  --line: #d2dbe5;
  --field: #f3f6fa;
  --panel: rgb(255 255 255 / 92%);
  --glass: rgb(243 245 248 / 82%);
  --action: #082039;
  --action-text: #fff;
  --action-hover: #14365e;
  --radius: 26px;
  --header-height: 76px;
  --shadow: 0 1px 0 rgb(255 255 255 / 80%) inset, 0 18px 40px -25px rgb(8 32 57 / 28%);
  --atmosphere:
    radial-gradient(55% 45% at 72% 38%, rgb(255 122 0 / 7%), transparent 70%),
    radial-gradient(70% 60% at 15% 0%, rgb(20 54 94 / 8%), transparent 70%);
  --ray: rgb(255 255 255 / 75%);
  --title-font: "SF Pro Display", "SF Pro", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --body-font: "SF Pro Text", "SF Pro", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #060d17;
  --white: #0b1626;
  --ink: #e7e7e7;
  --navy: #e7e7e7;
  --navy-mid: #c4d2e0;
  --blue: #a7c2dd;
  --blue-soft: #1b2c42;
  --muted: #aab5c4;
  --line: #2b3a50;
  --field: #10203a;
  --panel: rgb(11 22 38 / 94%);
  --glass: rgb(6 13 23 / 74%);
  --action: #fff;
  --action-text: #050a12;
  --action-hover: #e9edf2;
  --amber: #f4bf7f;
  --amber-bg: #31261e;
  --amber-line: #67482a;
  --orange-dark: #f6bc85;
  --red: #ffb3a5;
  --red-bg: #321d24;
  --red-line: #703e49;
  --green: #a8d1bc;
  --green-bg: #172e30;
  --shadow: 0 1px 0 rgb(255 255 255 / 5%) inset, 0 20px 42px -26px rgb(0 0 0 / 56%);
  --atmosphere:
    radial-gradient(60% 50% at 72% 38%, rgb(255 122 0 / 10%), transparent 70%),
    radial-gradient(70% 60% at 20% 0%, rgb(20 54 94 / 55%), transparent 70%),
    radial-gradient(90% 70% at 50% 110%, rgb(8 32 57 / 90%), transparent 70%);
  --ray: rgb(128 168 210 / 14%);
}

body { font-family: var(--body-font); isolation: isolate; }
h1, h2, h3 { font-family: var(--title-font); }

body::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 10px 10px auto;
  height: min(91vh, 820px);
  min-height: 620px;
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: 30px;
  background: var(--atmosphere);
  pointer-events: none;
}

#app { padding-top: 23px; }
.masthead {
  top: 8px;
  width: calc(100% - 48px);
  max-width: 1260px;
  margin: 0 auto;
  background: var(--glass);
  border: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  border-radius: 999px;
  backdrop-filter: blur(24px) saturate(125%);
  box-shadow: var(--shadow);
}

.masthead-inner {
  max-width: none;
  min-height: 60px;
  padding: 7px 13px 7px 17px;
  gap: 12px;
}

.lister-brand { width: fit-content; gap: 12px; font: 650 14px/1.1 var(--body-font); letter-spacing: -.02em; }
.lister-brand > span { padding-inline-start: 12px; border-inline-start: 1px solid var(--line); }
.wme-logo { display: block; width: 154px; height: auto; max-width: 100%; }
.wme-logo-dark, [data-theme="dark"] .wme-logo-light { display: none; }
[data-theme="dark"] .wme-logo-dark { display: block; }

.tabs-inner .tab { min-height: 38px; padding: 7px 13px; border-radius: 999px; white-space: nowrap; }
.tabs-inner .tab:hover, .tabs-inner .tab.is-active { background: var(--blue-soft); color: var(--ink); box-shadow: none; }

.mode-toggle, .profile-trigger {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
}
.mode-toggle { display: grid; place-items: center; width: 38px; padding: 0; cursor: pointer; }
.profile-trigger { padding: 3px 8px 3px 3px; }
.profile-avatar { width: 30px; height: 30px; }
.mode-toggle:hover, .profile-trigger:hover, .profile-trigger[aria-expanded="true"] { background: var(--blue-soft); }
.login-brand { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.login-wrap .lister-brand { margin: 0; }

#app > main { width: min(100%, 1208px); padding: 0 24px 44px; }
#app > main:not(:has(#view-shopify:not(.hidden))) { padding-top: 24px; }

.card { background: var(--panel); box-shadow: var(--shadow); }
#app .btn, .login-wrap .btn { border-radius: 999px; }
#app .btn-secondary { background: var(--field); color: var(--ink); }
#app .btn-secondary:hover:not(:disabled) { background: var(--blue-soft); }

#app .btn-primary, .login-wrap .btn-primary,
#view-shopify #wt-generate, #view-shopify .wt-handoff-actions .btn-primary,
#app .wb-actions .wb-send {
  background: var(--action);
  color: var(--action-text);
}
#app .btn-primary:hover:not(:disabled), .login-wrap .btn-primary:hover:not(:disabled),
#view-shopify #wt-generate:hover:not(:disabled),
#view-shopify .wt-handoff-actions .btn-primary:hover:not(:disabled),
#app .wb-actions .wb-send:hover:not(:disabled) { background: var(--action-hover); }

:is(#app, #login) :is(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea, .editable),
#view-shopify :is(input:not([type="checkbox"]), select, textarea, .editable) {
  background: var(--field);
  border-color: var(--line);
  color: var(--ink);
}
:is(#app, #login) :is(input, textarea)::placeholder, #wt-source-form input::placeholder { color: var(--muted); }
:is(#app, #login) :is(input, textarea, select, .editable):focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 24%, transparent);
}

.wt-page-heading.wt-bevel-heading {
  isolation: isolate;
  position: relative;
  margin: 0;
  padding: clamp(24px, 3vw, 40px) 0 clamp(20px, 2.3vw, 30px);
  text-align: center;
}
.wt-bevel-heading::before {
  position: absolute;
  z-index: -1;
  inset: 0 5%;
  content: "";
  background: radial-gradient(ellipse 48% 30% at 50% 65%, var(--ray), transparent 92%);
  transform: rotate(-3deg);
  pointer-events: none;
}
.wt-bevel-heading h1 { font-size: clamp(1.95rem, 3.3vw, 3.2rem); font-weight: 650; line-height: 1.08; letter-spacing: -.045em; }
.wt-bevel-heading p { margin: 8px auto 0; max-width: 580px; color: var(--muted); font-size: clamp(.9rem, 1.1vw, 1rem); line-height: 1.4; }
.wt-workbench-main { min-width: 0; }
.wt-with-recent { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(270px, 1fr); gap: 20px; align-items: start; }
.wt-workbench-aside { min-width: 0; position: sticky; top: calc(var(--header-height) + 12px); }

.wt-steps { margin: 0; padding: 10px 19px; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--panel); }
.wt-steps ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0; border: 0; background: none; }
.wt-steps button { min-height: 36px; width: auto; padding: 4px 10px 4px 6px; border-radius: 999px; }
.wt-step-number, .wt-steps .is-done .wt-step-number { border-color: var(--line); background: var(--field); color: var(--muted); }
.wt-steps button[aria-current="step"] { border-color: transparent; background: var(--blue-soft); }
.wt-steps button[aria-current="step"] .wt-step-number {
  border-color: var(--line);
  background: var(--field);
  color: var(--blue);
}

#view-shopify .wt-steps ~ #wt-source-card,
#view-shopify .wt-steps ~ #wt-review-host > .card:first-child {
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}

#view-shopify .wt-step-guide {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}
#view-shopify #wt-status { color: var(--ink); }
#view-shopify :is(input, select, textarea, .editable), .wt-workbench .card { min-width: 0; }
.wt-recent { margin: 0 0 14px; padding: 19px; }
.wt-recent-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.wt-recent-heading h2 { font-size: 17px; font-weight: 650; letter-spacing: -.025em; }
.wt-recent-heading .btn-link { font-size: 13px; }
.wt-recent-expanded { max-block-size: min(360px, 46dvh); overflow: auto; overscroll-behavior: contain; }
.wt-recent-actions { padding-top: 10px; border-top: 1px solid var(--line); }
.wt-recent-actions button { font-size: 12px; }

.wt-recent-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  padding: 9px 4px;
  gap: 10px;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-top: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.wt-recent-row:hover { background: var(--blue-soft); }
.wt-recent-photo { display: block; width: 38px; height: 38px; overflow: hidden; border-radius: 8px; background: var(--field); }
.wt-recent-photo img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.wt-recent-copy strong, .wt-recent-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-recent-copy small { color: var(--muted); font-size: 11px; }
.wt-recent-row .wt-saved-state { padding: 2px 6px; border-radius: 999px; background: var(--field); white-space: nowrap; }

.wt-workbench-guide {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 14px 17px;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.wt-guide-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); }
.wt-workbench-guide small { display: block; color: var(--muted); }

.lister-guide-dialog {
  width: min(38rem, calc(100% - 28px));
  max-height: min(80dvh, 44rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.lister-guide-dialog::backdrop { background: rgb(6 13 23 / 60%); }
.lister-guide-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.lister-guide-header h2 { font-size: 20px; }
.lister-guide-dialog > .guide { padding: 18px 20px 23px; overflow-wrap: anywhere; }
.lister-guide-dialog > .guide h2 { margin-bottom: 12px; font-size: 18px; }

#view-shopify #wt-description-card.wt-wmm-review { padding: clamp(16px, 2vw, 26px); container-type: inline-size; }
.wt-wmm-review :is(.wt-essentials, .wt-listing-identity) { gap: 7px 10px; }
.wt-wmm-review :is(.wt-essentials, .wt-listing-identity) label { margin-bottom: 3px; }
.wt-review-content { display: grid; gap: 12px 18px; align-items: start; }
.wt-review-copy, .wt-review-content .wt-photos { min-width: 0; }
#view-shopify .wt-wmm-review .wt-summary-field textarea {
  min-height: 76px;
  max-height: 152px;
  field-sizing: content;
  font-weight: 400;
}
#view-shopify .wt-wmm-review :is(#wt-description, #wt-description-html) {
  min-height: 92px;
  max-height: 180px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.48;
  overflow-wrap: anywhere;
}
.wt-review-content .wt-photos { margin-top: 2px; padding-top: 12px; }
.wt-review-content .wt-photos .hint, .wt-review-content .wt-photos p { font-size: 13px; }
.wt-wmm-review .wt-gallery { max-height: 276px; overflow: auto; padding: 3px; }
.wt-wmm-review :is(.wt-disclosure, #wt-filing) { overflow-wrap: anywhere; }

@container (min-width: 570px) {
  .wt-review-content { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .wt-review-content .wt-photos { margin-top: 0; padding-top: 0; border: 0; }
}

[data-theme="dark"] :is(.preview-body, .image-pick, .tag-picker, .tag-content, details.raw > pre, .spend-card,
.source-summary-card, .source-store, .source-table th, .guide table th, .who button, .listing-bulk > summary,
.approval-hover-preview, .reliability-table thead) { background: var(--white); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] :is(.image-pick.on, .spend-card.over, .guide .rule, .guide .rule.good, .guide table.numbers tr.best,
.guide code, .guide .pill.info, .bar-row .track, .budget-track, .who button:hover) { background: var(--field); }
[data-theme="dark"] :is(.image-pick .num, .guide .step > .n, .who button.on, .ebay-draft-banner, .preview-head) {
  background: var(--blue-soft);
  color: var(--ink);
}
[data-theme="dark"] :is(.spend-card .label, .spend-card .sub, .bar-row .name, .bar-row .amt, .guide .lead, .guide h3,
.guide h4, .guide .note, .guide .rule > strong:first-child, .source-table th, .guide table th, .dims label, .image-folder-help summary) { color: var(--muted); }
[data-theme="dark"] :is(.spend-card.over .value, .hover-flags) { color: var(--amber); }
[data-theme="dark"] :is(.step-badge.check, .dims input.hand-entered, .guide .pill.warn) { background: var(--amber-bg); color: var(--amber); }
[data-theme="dark"] .guide .pill.err { background: var(--red-bg); color: var(--red); }
[data-theme="dark"] .guide table td.free { color: var(--green); }

@media (max-width: 850px) {
  .wt-with-recent { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .wt-workbench-aside { position: static; }
}
@media (max-width: 760px) {
  #app { padding-top: 14px; }
  .masthead { top: auto; width: calc(100% - 28px); border-radius: 22px; }
  .masthead-inner { gap: 6px 10px; padding: 8px 10px; }
  #app > main { width: 100%; padding-inline: 16px; }
  .wme-logo { width: 124px; }
}
@media (max-width: 480px) {
  body::before { inset: 6px 6px auto; border-radius: 24px; }
  .lister-brand { gap: 6px; }
  .lister-brand > span { padding-inline-start: 6px; }
  .wme-logo { width: 106px; }
  .masthead-actions { gap: 5px; }
  .masthead .profile-chevron { display: none; }
  .masthead .profile-trigger { padding: 3px; }
  .tabs-inner .tab { padding-inline: 5px; }
}
@media (max-width: 400px) {
  .wme-logo { width: 96px; }
}
