@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap");

:root {
  --font-ui: "Noto Sans JP", "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
  --font-code: "Cascadia Mono", Consolas, "Courier New", monospace;
  --navy: #062f4f;
  --navy-2: #174d73;
  --blue: #0ea5d8;
  --blue-soft: #e8f6ff;
  --blue-card: #f4fbff;
  --sky: #e6f4fb;
  --gold: #bf9842;
  --ink: #0f1f2d;
  --muted: #5b7186;
  --line: #cbddea;
  --bg: #eef8fe;
  --card: #ffffff;
  --danger: #c83b3b;
  --green: #18805b;
  --shadow: 0 18px 44px rgba(6, 47, 79, .13);
}

@media (max-width: 520px) {
  .home-screen {
    padding: 10px 9px 18px;
  }

  .home-shell {
    gap: 8px;
  }

  .home-hero {
    padding: 10px;
    border-radius: 13px;
  }

  .home-hero > p {
    display: none;
  }

  .home-brand-row {
    gap: 8px;
  }

  .home-brand-row .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    font-size: 16px;
  }

  .home-hero h1 {
    font-size: 24px;
    line-height: 1.05;
  }

  .home-hero-tags {
    gap: 5px;
    margin-top: 8px;
  }

  .home-hero-tags span {
    min-height: 27px;
    padding: 4px 9px;
    font-size: 12px;
  }

  .home-brand-tools,
  .home-research-grid {
    gap: 7px;
  }

  .home-tool-group {
    padding: 8px;
    border-radius: 13px;
  }

  .home-tool-group-head {
    display: none;
  }

  .home-menu-grid,
  .home-menu-grid.compact,
  .home-menu-grid.compact.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .home-menu-grid.compact .home-card {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 86px;
    padding: 8px;
    gap: 7px;
    border-radius: 11px;
  }

  .home-menu-grid.compact .home-card::after {
    opacity: .45;
    right: 8px;
    bottom: 8px;
    width: 84px;
    height: 28px;
  }

  .home-menu-grid.compact .home-card > .home-card-kicker,
  .home-menu-grid.compact .home-card p {
    display: none;
  }

  .home-menu-grid.compact .home-card h3 {
    min-width: 0;
    margin: 0;
    font-size: 17px;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .home-menu-grid.compact .home-card .home-primary-btn {
    width: auto;
    min-width: 92px;
    height: 30px;
    min-height: 30px;
    justify-self: start;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .home-research-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .home-finder-strip,
  .home-finder-desk {
    padding: 9px;
    border-radius: 11px;
    gap: 7px;
  }

  .home-finder-strip .home-card-kicker,
  .home-finder-desk .home-card-kicker {
    display: none;
  }

  .home-finder-strip strong,
  .home-finder-desk-head strong {
    font-size: 18px;
    line-height: 1.15;
  }

  .home-finder-strip .home-field,
  .home-finder-builder .home-field {
    gap: 4px;
    font-size: 12px;
  }

  .home-finder-strip input,
  .home-finder-builder input {
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 14px;
  }

  .home-finder-strip .home-primary-btn,
  .home-finder-desk .home-secondary-btn {
    height: 31px;
    min-height: 31px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.1;
  }

  .home-finder-desk-head {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
  }

  .home-finder-desk-head .home-secondary-btn {
    min-width: 58px;
  }

  .home-finder-builder {
    gap: 6px;
  }

  .home-finder-builder .home-secondary-btn {
    width: 100%;
  }

  .home-finder-strip .home-primary-btn {
    width: auto;
    min-width: 92px;
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .home-screen {
    padding: 10px 9px 18px;
  }

  .home-shell {
    gap: 8px;
  }

  .home-hero {
    padding: 10px;
    border-radius: 13px;
  }

  .home-hero > p {
    display: none;
  }

  .home-brand-row {
    gap: 8px;
  }

  .home-brand-row .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    font-size: 16px;
  }

  .home-hero h1 {
    font-size: 24px;
    line-height: 1.05;
  }

  .home-hero-tags {
    gap: 5px;
    margin-top: 8px;
  }

  .home-hero-tags span {
    min-height: 27px;
    padding: 4px 9px;
    font-size: 12px;
  }

  .home-brand-tools,
  .home-research-grid {
    gap: 7px;
  }

  .home-tool-group {
    padding: 8px;
    border-radius: 13px;
  }

  .home-tool-group-head {
    display: none;
  }

  .home-menu-grid,
  .home-menu-grid.compact,
  .home-menu-grid.compact.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .home-menu-grid.compact .home-card {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 86px;
    padding: 8px;
    gap: 7px;
    border-radius: 11px;
  }

  .home-menu-grid.compact .home-card::after {
    opacity: .45;
    right: 8px;
    bottom: 8px;
    width: 84px;
    height: 28px;
  }

  .home-menu-grid.compact .home-card > .home-card-kicker,
  .home-menu-grid.compact .home-card p {
    display: none;
  }

  .home-menu-grid.compact .home-card h3 {
    min-width: 0;
    margin: 0;
    font-size: 17px;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .home-menu-grid.compact .home-card .home-primary-btn {
    width: 100%;
    min-height: 30px;
    padding: 5px 6px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .home-research-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .home-finder-strip,
  .home-finder-desk {
    padding: 9px;
    border-radius: 11px;
    gap: 7px;
  }

  .home-finder-strip .home-card-kicker,
  .home-finder-desk .home-card-kicker {
    display: none;
  }

  .home-finder-strip strong,
  .home-finder-desk-head strong {
    font-size: 18px;
    line-height: 1.15;
  }

  .home-finder-strip .home-field,
  .home-finder-builder .home-field {
    gap: 4px;
    font-size: 12px;
  }

  .home-finder-strip input,
  .home-finder-builder input {
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 14px;
  }

  .home-finder-strip .home-primary-btn,
  .home-finder-desk .home-secondary-btn {
    min-height: 31px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.1;
  }

  .home-finder-desk-head {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
  }

  .home-finder-desk-head .home-secondary-btn {
    min-width: 58px;
  }

  .home-finder-builder {
    gap: 6px;
  }

  .home-finder-builder .home-secondary-btn {
    width: 100%;
  }
}

/* Production listing layout: keep the creation workflow visible above the fold. */
.shell {
  margin-top: 10px;
}

.hero-panel {
  min-height: 0;
  padding: 16px 20px;
  border-radius: 14px;
  gap: 16px;
}

.hero-panel .eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
}

.hero-panel h2 {
  font-size: clamp(28px, 3.1vw, 42px);
  line-height: 1.08;
}

.hero-panel p:last-child {
  margin-top: 6px;
  font-size: 14px;
}

.hero-actions {
  gap: 8px;
  min-width: min(100%, 460px);
}

.primary-pill,
.outline-pill {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
}

.status-grid {
  margin: 8px 0 10px;
  gap: 8px;
}

.status-grid article {
  min-height: 72px;
  padding: 9px 12px;
}

.status-grid strong {
  margin-top: 3px;
  font-size: 21px;
  line-height: 1.15;
}

.ledger-panel {
  margin-bottom: 12px;
}

.ledger-head {
  padding: 9px 12px;
}

.ledger-head .eyebrow {
  display: none;
}

.ledger-head h3 {
  font-size: 18px;
  line-height: 1.15;
}

.ledger-summary {
  margin-top: 2px;
}

.ledger-head-actions p {
  max-width: 520px;
}

.workspace {
  gap: 14px;
}

.sync-panel {
  padding-block: 7px;
}

.stepper {
  padding-block: 8px;
}

@media (max-width: 900px) {
  .hero-panel {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 10px;
  }

  .hero-panel h2 {
    font-size: clamp(26px, 7vw, 34px);
    line-height: 1.12;
  }

  .hero-panel p:last-child {
    font-size: 12px;
  }

  .hero-actions {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100%, calc(100% - 16px));
    margin-top: 8px;
  }

  .hero-panel {
    padding: 10px;
    border-radius: 12px;
  }

  .hero-panel h2 {
    font-size: 24px;
    line-height: 1.12;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .hero-panel p:last-child {
    display: none;
  }

  .hero-actions {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .primary-pill,
  .outline-pill {
    min-height: 38px;
    padding: 7px 8px;
    border-radius: 10px;
    font-size: 11px;
  }

  .status-grid {
    gap: 6px;
    margin: 7px 0 8px;
  }

  .status-grid article {
    min-height: 66px;
    padding: 8px;
  }

  .ledger-head {
    gap: 8px;
    padding: 12px;
  }

  .ledger-head-actions {
    gap: 8px;
  }

  .ledger-head-actions p {
    font-size: 11px;
    line-height: 1.45;
  }
}

@media (max-width: 520px) {
  .mobile-home-btn {
    display: none;
  }

  .status-grid {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .status-grid article {
    flex: 0 0 128px;
    min-height: 58px;
    scroll-snap-align: start;
  }

  .status-grid span {
    font-size: 10px;
  }

  .status-grid strong {
    font-size: 18px;
  }

  .ledger-head-actions p {
    display: none;
  }

  .sync-panel {
    padding: 8px 10px;
  }

  .sync-note {
    display: none;
  }
}

@media (max-width: 520px) {
  .home-menu-grid.compact .home-card .home-primary-btn {
    width: auto;
    min-width: 92px;
    height: 30px;
    min-height: 30px;
    justify-self: start;
    padding: 0 9px;
  }

  .home-finder-strip .home-primary-btn {
    width: auto;
    min-width: 92px;
    height: 31px;
    min-height: 31px;
    justify-self: start;
    padding: 0 9px;
  }

  .home-finder-desk .home-secondary-btn {
    height: 31px;
    min-height: 31px;
    padding: 0 9px;
  }
}

@media (max-width: 520px) {
  .home-brand-tools,
  .home-research-grid {
    gap: 7px;
  }

  .home-tool-group {
    padding: 8px;
  }

  .home-tool-group-head {
    display: none;
  }

  .home-menu-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .home-menu-grid.compact .home-card {
    min-height: 92px;
    padding: 9px;
    gap: 7px;
  }

  .home-menu-grid.compact .home-card h3 {
    font-size: 16px;
    line-height: 1.1;
  }

  .home-menu-grid.compact .home-card .home-primary-btn {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 11px;
    border-radius: 8px;
  }

  .home-research-grid {
    grid-template-columns: 1fr;
  }

  .home-research-grid .home-card-kicker,
  .home-finder-strip .home-card-kicker,
  .home-finder-desk .home-card-kicker {
    display: none;
  }

  .home-finder-strip,
  .home-finder-desk {
    padding: 10px;
  }

  .home-finder-strip strong,
  .home-finder-desk-head strong {
    font-size: 17px;
    line-height: 1.15;
  }

  .home-finder-strip .home-primary-btn,
  .home-finder-desk .home-secondary-btn {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 8px;
  }

  .home-finder-desk-head {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .home-finder-builder {
    gap: 6px;
  }

  .home-finder-builder .home-field {
    margin-top: 2px;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, #e8f5ff 0%, #f8fcff 32%, #edf7ff 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  letter-spacing: 0;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button, input, select, textarea {
  font: inherit;
}

h1, h2, h3, h4, strong {
  font-weight: 600;
}

button {
  cursor: pointer;
}

.home-screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  padding: 18px clamp(14px, 3.2vw, 34px) 36px;
  background:
    linear-gradient(180deg, #041020 0%, #061d37 36%, #0a3658 66%, #05101d 100%);
  color: #f5fbff;
}

.home-screen::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: -2;
  height: 54%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(4, 12, 26, .08) 15%, rgba(3, 10, 21, .96) 100%),
    linear-gradient(90deg,
      transparent 0 4%,
      rgba(6, 23, 43, .88) 4% 9%,
      transparent 10% 14%,
      rgba(8, 30, 54, .92) 14% 22%,
      transparent 22% 27%,
      rgba(4, 19, 38, .9) 27% 34%,
      transparent 34% 39%,
      rgba(7, 27, 49, .94) 39% 51%,
      transparent 51% 55%,
      rgba(5, 22, 43, .9) 55% 63%,
      transparent 63% 69%,
      rgba(9, 32, 58, .92) 69% 81%,
      transparent 81% 86%,
      rgba(5, 19, 36, .9) 86% 96%,
      transparent 96% 100%);
}

.home-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(126, 218, 255, .18) 8% 8.25%, transparent 8.25% 100%),
    linear-gradient(90deg, transparent 0 50%, rgba(191, 152, 66, .2) 50% 50.18%, transparent 50.18% 100%),
    repeating-linear-gradient(90deg,
      transparent 0 28px,
      rgba(130, 210, 255, .12) 28px 30px,
      transparent 30px 54px,
      rgba(255, 197, 93, .1) 54px 56px,
      transparent 56px 86px),
    repeating-linear-gradient(0deg,
      transparent 0 26px,
      rgba(138, 211, 255, .08) 26px 28px,
      transparent 28px 58px),
    linear-gradient(120deg, rgba(11, 77, 125, .3), transparent 42%, rgba(191, 152, 66, .14) 82%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 43%, #000 66%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, transparent 43%, #000 66%, #000 100%);
  opacity: .86;
}

body.home-mode .app-header,
body.home-mode .shell,
body.home-mode .purchase-screen {
  display: none;
}

body:not(.home-mode) .home-screen {
  display: none;
}

body.purchase-mode .shell,
body.purchase-mode .home-screen {
  display: none;
}

body:not(.home-mode) .app-header {
  display: none;
}

body:not(.purchase-mode) .purchase-screen {
  display: none;
}

.home-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.home-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(5, 16, 34, .95) 0%, rgba(7, 39, 72, .88) 56%, rgba(10, 92, 132, .8) 100%);
  color: #fff;
  border: 1px solid rgba(174, 222, 255, .3);
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(14px);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #7dd3fc, #bf9842 54%, #21a4d8);
}

.home-hero::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 20px;
  width: min(340px, 34%);
  height: 72px;
  opacity: .55;
  background:
    linear-gradient(90deg, transparent 0 6%, rgba(125, 211, 252, .45) 6% 7%, transparent 7% 18%, rgba(191, 152, 66, .48) 18% 19%, transparent 19% 35%, rgba(125, 211, 252, .38) 35% 36%, transparent 36% 100%),
    linear-gradient(180deg, transparent 0 52%, rgba(125, 211, 252, .22) 52% 55%, transparent 55% 100%);
  pointer-events: none;
}

.home-brand-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-screen .brand-mark {
  background: linear-gradient(145deg, rgba(255,255,255,.2), rgba(191, 152, 66, .28));
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 26px rgba(0,0,0,.25);
}

.home-hero h1 {
  margin: 0;
  font-size: clamp(31px, 3.4vw, 46px);
  line-height: 1.18;
  text-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

.home-hero > p {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
  color: #d8efff;
  font-size: 15px;
  max-width: 900px;
}

.home-hero-tags {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.home-hero-tags span {
  border: 1px solid rgba(185, 225, 255, .24);
  border-radius: 999px;
  background: rgba(4, 20, 41, .42);
  color: #e3f5ff;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
}

.home-finder-strip {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(150px, .42fr) minmax(340px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(161, 213, 248, .24);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(11, 45, 78, .9), rgba(7, 22, 42, .8)),
    linear-gradient(90deg, rgba(191, 152, 66, .18), transparent 34%);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
}

.home-finder-strip > div {
  display: grid;
  gap: 7px;
}

.home-finder-strip strong {
  color: #f7fbff;
  font-size: 20px;
  line-height: 1.2;
}

.home-finder-desk {
  position: relative;
  z-index: 10;
  display: grid;
  gap: 12px;
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(161, 213, 248, .18);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(7, 28, 52, .76), rgba(7, 20, 37, .6));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter: blur(12px);
}

.home-finder-desk-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.home-finder-desk-head > div {
  display: grid;
  gap: 7px;
}

.home-finder-desk-head strong {
  color: #f7fbff;
  font-size: 18px;
}

.home-finder-builder {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
}

.home-keyword-ideas,
.home-keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.home-keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border: 1px solid rgba(166, 218, 255, .22);
  border-radius: 999px;
  background: rgba(4, 15, 31, .58);
  color: #e9f7ff;
  padding: 7px 9px 7px 12px;
  font-size: 12px;
  font-weight: 600;
}

.home-keyword-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-keyword-chip button {
  border: 0;
  border-radius: 999px;
  background: rgba(14, 165, 216, .22);
  color: #e9f7ff;
  min-width: 28px;
  height: 26px;
  padding: 0 9px;
  font-weight: 700;
}

.home-keyword-chip button:hover,
.home-keyword-chip button:focus {
  background: rgba(14, 165, 216, .38);
}

.home-keyword-chip .keyword-remove {
  background: rgba(248, 113, 113, .14);
  color: #fecaca;
}

.home-menu-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.home-brand-tools {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.home-research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-tool-group {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid rgba(161, 213, 248, .2);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(8, 28, 52, .72), rgba(5, 17, 34, .54));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter: blur(12px);
}

.home-tool-group::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #7dd3fc, #bf9842, #14b8a6);
}

.home-tool-group-camera::before {
  background: linear-gradient(90deg, #7dd3fc, #bf9842);
}

.home-tool-group-tcg::before {
  background: linear-gradient(90deg, #14b8a6, #48b8e2);
}

.home-tool-group-research::before {
  background: linear-gradient(90deg, #4ba3d5, #234966);
}

.home-tool-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.home-tool-group-head h2 {
  margin: 0;
  color: #f7fbff;
  font-size: 20px;
  line-height: 1.25;
}

.home-menu-grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.home-menu-grid.compact.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-menu-grid.compact.single {
  grid-template-columns: minmax(0, 1fr);
}

.home-research-grid .home-finder-strip,
.home-research-grid .home-finder-desk {
  margin-top: 0;
}

.home-research-grid .home-finder-strip {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.home-research-grid .home-finder-strip .home-primary-btn {
  grid-column: auto;
}

.home-research-grid .home-finder-builder {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.home-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(12, 37, 66, .9), rgba(7, 20, 39, .82));
  border: 1px solid rgba(161, 213, 248, .26);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 52px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255,255,255,.09);
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: auto;
  min-height: auto;
  color: #f7fbff;
  backdrop-filter: blur(12px);
}

.home-card > * {
  position: relative;
  z-index: 1;
}

.home-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--blue);
}

.home-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 12px auto;
  width: 118px;
  height: 42px;
  opacity: .38;
  background:
    repeating-linear-gradient(90deg, rgba(125, 211, 252, .34) 0 2px, transparent 2px 13px),
    linear-gradient(180deg, transparent 0 72%, rgba(191, 152, 66, .24) 72% 76%, transparent 76%);
  pointer-events: none;
}

.home-card-primary {
  background:
    linear-gradient(180deg, rgba(13, 48, 84, .86) 0%, rgba(8, 24, 48, .78) 100%);
}

.home-card-listing {
  border-color: #b9d9ec;
}

.home-card-listing::before {
  background: linear-gradient(90deg, #0ea5d8, #7dd3fc);
}

.home-card-create::before {
  background: linear-gradient(90deg, #7dd3fc, #bf9842);
}

.home-card-purchase::before {
  background: linear-gradient(90deg, #bf9842, #48b8e2);
}

.home-card-tcg::before {
  background: linear-gradient(90deg, #14b8a6, #e5b853);
}

.home-card-finance::before {
  background: linear-gradient(90deg, #22c55e, #7dd3fc);
}

.home-card-profit::before {
  background: linear-gradient(90deg, #e5b853, #70c9eb);
}

.home-card-kicker {
  width: fit-content;
  border-radius: 999px;
  background: rgba(111, 194, 239, .18);
  color: #bcecff;
  padding: 5px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid rgba(125, 211, 252, .14);
}

.home-card h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
}

.home-card h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.home-card p {
  margin: 0;
  color: #c7e3f3;
  font-size: 12px;
  line-height: 1.42;
}

.home-action-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.camera-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-field {
  position: relative;
  color: #c5def0;
  font-size: 13px;
  font-weight: 600;
}

.home-field input,
.home-field select {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  border: 1px solid rgba(166, 218, 255, .26);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(4, 15, 31, .78);
  color: #f7fbff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.home-field select {
  appearance: auto;
}

.home-field input::placeholder {
  color: rgba(214, 235, 249, .56);
}

.home-finder-suggestions {
  position: absolute;
  z-index: 60;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  display: none;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(166, 218, 255, .28);
  border-radius: 12px;
  background: rgba(4, 15, 31, .96);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .35);
}

.home-finder-suggestions.show {
  display: grid;
}

.home-finder-option {
  border: 0;
  border-bottom: 1px solid rgba(166, 218, 255, .12);
  background: transparent;
  color: #e9f7ff;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
}

.home-finder-option:last-child {
  border-bottom: 0;
}

.home-finder-option:hover,
.home-finder-option:focus {
  background: rgba(14, 165, 216, .18);
}

.home-finder-option span {
  display: block;
  margin-top: 3px;
  color: #93b9d0;
  font-size: 11px;
}

.home-card-actions {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  gap: 10px;
}

.home-primary-btn,
.home-secondary-btn,
.mobile-home-btn {
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 600;
}

.home-primary-btn {
  background: linear-gradient(135deg, #16b7e6, #0f79b2);
  color: #fff;
  box-shadow: 0 14px 28px rgba(14, 165, 216, .28), inset 0 1px 0 rgba(255,255,255,.18);
}

.home-primary-btn:hover,
.home-primary-btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(14, 165, 216, .36), inset 0 1px 0 rgba(255,255,255,.22);
}

.home-primary-btn:disabled,
.home-secondary-btn:disabled,
.ghost-btn:disabled,
.profile-btn:disabled {
  cursor: not-allowed;
  opacity: .48;
  filter: grayscale(.22);
  box-shadow: none;
}

.home-secondary-btn,
.mobile-home-btn {
  background: rgba(5, 20, 39, .62);
  color: #e8f7ff;
  border: 1px solid rgba(166, 218, 255, .28);
}

.danger-lite {
  color: #fee2e2;
  background: rgba(127, 29, 29, .42);
  border: 1px solid rgba(248, 113, 113, .26);
}

.mobile-home-btn {
  display: none;
  width: calc(100% - 24px);
  margin: 10px 12px;
}

.purchase-screen {
  min-height: calc(100vh - 88px);
  background: linear-gradient(180deg, #e8f5ff 0%, #f8fcff 42%, #eef8fe 100%);
  padding: 18px clamp(14px, 3vw, 34px) 36px;
}

.purchase-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.purchase-hero {
  background:
    linear-gradient(135deg, rgba(6,47,79,.98), rgba(23,77,115,.94)),
    radial-gradient(circle at 86% 16%, rgba(14,165,216,.24), transparent 34%);
  color: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 18px 44px rgba(6, 47, 79, .16);
}

.purchase-hero .eyebrow {
  color: #e7d39c;
}

.purchase-hero h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.18;
}

.purchase-hero p:last-child {
  margin: 8px 0 0;
  color: #d7e9f5;
  font-size: 14px;
}

.purchase-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.purchase-status-grid {
  margin: 12px 0 14px;
}

.purchase-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.purchase-kpi-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  box-shadow: 0 10px 24px rgba(30, 93, 145, .07);
}

.purchase-kpi-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.purchase-kpi-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 25px;
}

.purchase-sync-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px 10px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 10px;
  box-shadow: 0 8px 18px rgba(30, 93, 145, .06);
}

.purchase-sync-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.purchase-sync-head strong {
  color: var(--navy);
  font-size: 14px;
}

.purchase-sync-head span {
  color: var(--muted);
  font-size: 12px;
}

.purchase-db-scope {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(188, 214, 235, .9);
  border-radius: 9px;
  background: #eff8ff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.purchase-db-scope strong {
  color: var(--navy);
  font-size: 12px;
}

.purchase-report-links {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.purchase-report-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--navy);
  background: #f8fcff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.purchase-maintenance-details {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(188, 214, 235, .7);
  padding-top: 7px;
}

.purchase-maintenance-details summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.purchase-maintenance-body {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 7px;
}

.purchase-sync-panel label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.purchase-sync-panel input {
  min-height: 40px;
  border-width: 1px;
}

.purchase-sync-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.purchase-sync-actions .primary-btn,
.purchase-sync-actions .secondary-btn {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12px;
  white-space: nowrap;
}

.listing-audit {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(188, 214, 235, .9);
  border-radius: 10px;
  background: #f8fcff;
  padding: 10px;
}

.listing-audit[hidden] {
  display: none;
}

.listing-audit-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--navy);
  font-weight: 900;
}

.listing-audit-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.listing-audit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.listing-audit-grid div {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 8px;
}

.listing-audit-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.listing-audit-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 18px;
}

.listing-audit-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}

.listing-audit-list li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-audit-ok {
  color: #08725b;
  font-weight: 900;
}

.listing-audit-warn {
  color: #9f2416;
  font-weight: 900;
}

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(300px, .86fr) minmax(0, 1.14fr);
  gap: 14px;
}

.purchase-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(30, 93, 145, .09);
  padding: 16px;
}

.purchase-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.purchase-panel-search {
  min-width: min(360px, 100%);
  flex: 0 1 420px;
}

.purchase-panel-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.purchase-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.purchase-form-mode {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fcff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.purchase-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.purchase-form-actions button {
  min-height: 40px;
  white-space: nowrap;
}

.purchase-form-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.purchase-form-grid input,
.purchase-form-grid select,
.purchase-form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdff;
  color: var(--ink);
  padding: 10px 11px;
}

.purchase-form-grid input[readonly] {
  background: #edf7ff;
  border-color: #a8d3ef;
  color: var(--ink);
  font-weight: 800;
}

.purchase-form-grid textarea {
  min-height: 76px;
  resize: vertical;
}

.purchase-add-btn {
  width: 100%;
  margin-top: 12px;
}

.purchase-search-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: end;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fcff;
}

.purchase-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 44px;
  padding: 5px;
  border: 1px solid #b9d3e8;
  border-radius: 14px;
  background: #eef7ff;
  white-space: nowrap;
  flex-wrap: nowrap;
  overflow: hidden;
}

.purchase-filter-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  padding: 0 1px;
}

.purchase-filter-divider {
  width: 1px;
  align-self: stretch;
  background: #b9d3e8;
  margin: 4px 2px;
}

.purchase-search-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.purchase-search-field input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.purchase-check {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  word-break: keep-all;
}

.purchase-check input {
  width: 13px;
  height: 13px;
  margin: 0;
}

.purchase-clear-filters {
  min-width: 32px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.purchase-clear-filters:disabled {
  opacity: .48;
  cursor: default;
}

.purchase-list {
  display: grid;
  gap: 10px;
}

.purchase-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-card);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.purchase-row.empty {
  grid-template-columns: 1fr;
  align-items: start;
}

.purchase-row.empty strong,
.purchase-row.empty span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.purchase-row-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  min-width: 0;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.purchase-detail-line {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-filter-summary {
  margin: 8px 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.purchase-supplier-meta {
  display: block;
  min-width: 0;
  margin-top: 3px;
  color: #49647d;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-mall-comparison {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.purchase-mall-label {
  color: #6a7d8f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.purchase-mall-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 210px;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid #d5e3ec;
  border-radius: 999px;
  background: #fff;
  color: #49647d;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-mall-chip.best {
  border-color: #96d7be;
  background: #e9faf2;
  color: #086341;
}

.purchase-mall-chip.limit-within {
  border-color: #96d7be;
  background: #e9faf2;
  color: #086341;
}

.purchase-mall-chip.limit-over {
  border-color: #efcc86;
  background: #fff8e7;
  color: #795000;
}

.purchase-mall-chip.pending {
  border-color: #d5e3ec;
  background: #f4f8fb;
  color: #6a7d8f;
}

.purchase-row-details b {
  color: var(--navy);
  font-weight: 700;
  margin-left: 0;
}

.purchase-row.empty strong {
  font-size: 18px;
}

.purchase-row.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, .16);
}

.candidate-row {
  background: #fffdf5;
  border-color: #eadcae;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  padding: 10px 12px;
}

.candidate-row.candidate-adopted {
  background: #eefaf5;
  border-color: #b9dfcf;
}

.candidate-row.candidate-soldout,
.candidate-row.candidate-ignored {
  background: #f4f6f8;
  border-color: #d8e0e6;
  opacity: .78;
}

.purchase-product-row.purchase-condition-out {
  border-color: #59636d;
  background: #323941;
  color: #f5f7f9;
}

.purchase-product-row.purchase-condition-out .purchase-row-meta,
.purchase-product-row.purchase-condition-out .purchase-row-note,
.purchase-product-row.purchase-condition-out .purchase-row-details,
.purchase-product-row.purchase-condition-out .purchase-row-details b {
  color: #d4dbe2;
}

.purchase-product-row.purchase-condition-out .purchase-unit-badge,
.purchase-product-row.purchase-condition-out .purchase-condition-badge {
  border-color: #707b86;
  background: #48515b;
  color: #f5f7f9;
}

.purchase-product-row.purchase-missing-url:not(.purchase-condition-out) {
  border-color: #b8c2cc;
  border-style: dashed;
  background: #f6f8fa;
}

.purchase-product-row.purchase-missing-url:not(.purchase-condition-out) .purchase-row-meta,
.purchase-product-row.purchase-missing-url:not(.purchase-condition-out) .purchase-row-note {
  color: #5c6b78;
}

.purchase-missing-url-label {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  padding: 3px 8px;
  border: 1px solid #b8c2cc;
  border-radius: 999px;
  background: #eef2f5;
  color: #31404d;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.purchase-product-row {
  background: #fff;
  cursor: pointer;
}

.purchase-product-row:focus-visible {
  outline: 3px solid rgba(74, 144, 217, .36);
  outline-offset: 2px;
}

.purchase-intent-restock {
  border-color: #eed7a5;
  background: #fff8e8;
}

.purchase-intent-additional {
  border-color: #b9dfcf;
  background: #eefaf5;
}

.purchase-intent-new {
  border-color: #c8def0;
  background: #f4fbff;
}

.purchase-selected-product {
  background: #f2f8fd;
  border-color: #b9d3e8;
}

.purchase-product-row,
.purchase-selected-product {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.purchase-row-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.purchase-row-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.purchase-row-title strong {
  font-size: 15px;
  line-height: 1.35;
}

.purchase-row-meta,
.purchase-row-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-row-meta {
  display: block;
}

.purchase-condition-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #a7cfe0;
  background: #e8f7f1;
  color: #063a58;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.purchase-condition-out-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #707b86;
  background: #20262d;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.purchase-unit-status {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

.purchase-unit-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #d5e3ec;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.purchase-unit-badge.active,
.purchase-unit-badge.intent-restock,
.purchase-unit-badge.intent-additional {
  border-color: #9fd6c3;
  background: #eafaf3;
  color: #116a4a;
}

.purchase-unit-badge.intent-new {
  border-color: #bfd7eb;
  background: #edf7ff;
  color: #0a4267;
}

.purchase-workflow-badges {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.purchase-status-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.workflow-badge {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.workflow-badge.inventory-live,
.workflow-badge.photo-ready {
  border-color: #98d9c2;
  background: #eafaf3;
  color: #13704d;
}

.workflow-badge.seal-needed,
.workflow-badge.photo-waiting {
  border-color: #efd08b;
  background: #fff7df;
  color: #8a5c00;
}

.workflow-badge.seal-done,
.workflow-badge.photo-done {
  border-color: #bfd4e4;
  background: #eef6ff;
  color: #173a5e;
}

.workflow-badge.photo-blocked,
.workflow-badge.inventory-sold {
  border-color: #e9b7b7;
  background: #fff0f0;
  color: #9c3a3a;
}

.purchase-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  align-self: start;
  justify-self: stretch;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.purchase-row-actions::-webkit-scrollbar {
  display: none;
}

.candidate-row .purchase-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
}

.purchase-row-actions button,
.purchase-row-actions a {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid #b8d2e8;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f9ff 100%);
  color: var(--navy);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 1px 2px rgba(23, 58, 94, .08);
  cursor: pointer;
}

.purchase-row-actions button:hover,
.purchase-row-actions a:hover {
  border-color: #7fb7df;
  background: linear-gradient(180deg, #ffffff 0%, #eaf6ff 100%);
  transform: translateY(-1px);
}

.purchase-row-actions button:active,
.purchase-row-actions a:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(23, 58, 94, .08) inset;
}

.candidate-row .purchase-row-actions button,
.candidate-row .purchase-row-actions a {
  min-height: 38px;
  padding: 8px 12px;
  text-align: center;
}

.candidate-row .purchase-row-actions .purchase-send-draft,
.candidate-row .purchase-row-actions .purchase-undo-draft,
.candidate-row .purchase-row-actions button:disabled {
  min-width: max-content;
}

.purchase-row-actions .danger-link {
  color: #9c3a3a;
  border-color: #ead2d2;
  background: #fff7f7;
}

.purchase-row-actions button:disabled {
  opacity: .62;
  cursor: default;
  background: #eef2f5;
  color: #596875;
}

.app-header {
  background: linear-gradient(90deg, #10283e, #1e4f72);
  color: #fff;
  min-height: 88px;
  padding: 16px clamp(18px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(191,152,66,.28));
  display: grid;
  place-items: center;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.22);
}

.brand h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1;
  font-weight: 600;
}

.brand p {
  margin: 5px 0 0;
  color: #b9d3ee;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.ghost-btn, .profile-btn {
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  color: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 600;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 14px auto 36px;
}

.hero-panel {
  background:
    linear-gradient(135deg, rgba(16,40,62,.97), rgba(37,75,101,.94)),
    radial-gradient(circle at 92% 18%, rgba(47,142,219,.28), transparent 38%),
    radial-gradient(circle at 8% 18%, rgba(191,152,66,.22), transparent 30%);
  color: #fff;
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #7b91aa;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
}

.hero-panel .eyebrow {
  color: #e7d39c;
}

.hero-panel h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.15;
  max-width: 620px;
}

.hero-panel p:last-child {
  margin: 10px 0 0;
  color: #dce7ed;
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  min-width: min(100%, 520px);
}

.primary-pill, .outline-pill {
  border: 0;
  background: #f7f3e8;
  color: var(--navy);
  border-radius: 14px;
  padding: 14px 22px;
  font-weight: 800;
  white-space: nowrap;
  font-size: 16px;
}

.outline-pill {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.34);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.status-grid article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.status-card-action {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.status-card-action:hover {
  border-color: rgba(24,168,216,.52);
  box-shadow: 0 10px 22px rgba(30,93,145,.12);
  transform: translateY(-1px);
}

.status-card-action.active {
  border-color: rgba(24,168,216,.72);
  box-shadow: inset 0 -4px 0 rgba(24,168,216,.36), 0 10px 22px rgba(30,93,145,.1);
}

.status-card-action:focus-visible {
  outline: 2px solid rgba(24,168,216,.46);
  outline-offset: 2px;
}

.status-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.status-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.listed-dialog[hidden] {
  display: none;
}

.listed-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.listed-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 22, 38, .46);
}

.listed-dialog-panel {
  position: relative;
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(4,22,38,.24);
}

.listed-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f7fcff, #eef8fe);
}

.listed-dialog-head h3 {
  margin: 2px 0 0;
  color: var(--navy);
  font-size: 22px;
}

.listed-dialog-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.listed-dialog-title-row a {
  border: 1px solid rgba(24,168,216,.34);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.listed-dialog-close {
  flex: 0 0 auto;
}

.listed-dialog-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 148px);
  overflow: auto;
  padding: 14px;
}

.listed-dialog-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 12px;
}

.listed-dialog-item strong {
  display: block;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.35;
}

.listed-dialog-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.listed-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.listed-dialog-actions button,
.listed-dialog-actions a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.listed-dialog-empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
  font-weight: 700;
}

.ledger-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(30,93,145,.08);
  margin: 0 0 14px;
  overflow: hidden;
}

.ledger-panel-collapsed {
  margin-bottom: 10px;
}

.ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.ledger-head h3 {
  margin: 0;
  font-size: 17px;
}

.ledger-summary {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ledger-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.ledger-head-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.ledger-head-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fcff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.ledger-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 14px;
  border: 1px solid #9fd2eb;
  border-radius: 999px;
  background: #0d3b5c;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.ledger-panel-collapsed .ledger-scroll {
  display: none;
}

.ledger-scroll {
  max-height: 440px;
  overflow-x: auto;
  overflow-y: auto;
}

.ledger-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.ledger-table th,
.ledger-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: middle;
  text-align: left;
  white-space: nowrap;
}

.ledger-table th {
  position: sticky;
  top: 0;
  background: #f2f8fd;
  color: var(--navy);
  font-weight: 700;
}

.ledger-table th:nth-child(1),
.ledger-table td:nth-child(1) {
  width: 272px;
}

.ledger-table th:nth-child(2),
.ledger-table td:nth-child(2) {
  width: 118px;
}

.ledger-table th:nth-child(4),
.ledger-table td:nth-child(4) {
  width: 120px;
}

.ledger-table th:nth-child(5),
.ledger-table td:nth-child(5) {
  width: 82px;
}

.ledger-table th:nth-child(6),
.ledger-table td:nth-child(6) {
  width: 86px;
}

.ledger-table th:nth-child(7),
.ledger-table td:nth-child(7) {
  width: 72px;
}

.ledger-table th:nth-child(8),
.ledger-table td:nth-child(8) {
  width: 54px;
}

.ledger-table tr.selected td {
  background: #fff8df;
}

.ledger-title {
  width: 42%;
  min-width: 0;
  white-space: normal;
}

.ledger-title strong,
.ledger-title span {
  display: block;
}

.ledger-title strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ledger-purchase-fields {
  display: grid;
  grid-template-columns: minmax(112px, .95fr) minmax(124px, 1fr);
  gap: 5px;
  width: 256px;
}

.ledger-order-input,
.ledger-edit-input {
  width: 112px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 7px;
  font: inherit;
  background: #fff;
}

.ledger-edit-input {
  width: 100%;
  min-width: 0;
}

.ledger-sku-input {
  width: 116px;
}

.ledger-price-input {
  width: 76px;
  text-align: right;
}

.ledger-order-input:focus,
.ledger-edit-input:focus {
  outline: 2px solid rgba(33, 164, 216, .28);
  border-color: #21a4d8;
}

.ledger-table .number {
  text-align: right;
}

.ledger-edit {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  padding: 5px 8px;
  font-weight: 700;
  cursor: pointer;
}

.ledger-empty {
  color: var(--muted);
  text-align: center;
}

.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
}

.side-panel, .editor {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(30,93,145,.09);
}

.sync-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px 10px;
  align-items: center;
  padding: 8px 12px;
  background: #eef7ff;
  border-bottom: 1px solid var(--line);
}

.sync-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.sync-head strong {
  font-size: 14px;
  color: var(--navy);
}

.sync-head span {
  color: var(--muted);
  font-size: 12px;
}

.sync-url-label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sync-url-label input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.sync-url-details {
  position: relative;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sync-url-details summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
}

.sync-url-details label {
  width: min(520px, 78vw);
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  right: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(30, 93, 145, .16);
}

.sync-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.sync-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sync-actions .primary-btn,
.sync-actions .secondary-btn {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12px;
  white-space: nowrap;
}

.side-panel {
  padding: 14px;
  height: fit-content;
  position: sticky;
  top: 16px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title h3 {
  margin: 0;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 0;
  background: var(--navy);
  color: #fff;
  font-size: 24px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
}

.filter-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 6px;
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  white-space: normal;
}

.filter-chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.draft-list {
  display: grid;
  gap: 10px;
}

.side-workflow-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff, #eef8fe);
  padding: 10px;
}

.side-workflow-summary div {
  display: grid;
  grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px solid rgba(190, 214, 232, .72);
  padding-bottom: 7px;
}

.side-workflow-summary div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.side-workflow-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.side-workflow-summary strong {
  color: var(--navy);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.draft-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px;
  background: var(--blue-card);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.draft-card.selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.draft-card.empty {
  display: block;
  padding: 12px;
}

.draft-open {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px 6px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.draft-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.draft-card span {
  color: var(--muted);
  font-size: 12px;
  display: block;
  margin-top: 4px;
}

.draft-delete {
  border: 1px solid #ead2d2;
  border-radius: 999px;
  background: #fff7f7;
  color: #9c3a3a;
  font-size: 11px;
  font-weight: 500;
  padding: 7px 9px;
  cursor: pointer;
}

.editor {
  overflow: hidden;
}

.stepper {
  background: linear-gradient(90deg, var(--navy), #174b72);
  color: #fff;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding: 12px;
}

.step {
  border: 0;
  background: transparent;
  color: #a9c2dc;
  font-weight: 600;
  display: grid;
  gap: 5px;
  font-size: 13px;
  justify-items: center;
}

.step span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.18);
  color: #fff;
}

.step.active {
  color: #fff;
}

.step.active span {
  background: var(--gold);
  color: var(--navy);
}

form {
  padding: clamp(14px, 2.6vw, 24px);
}

.top-step-nav {
  position: sticky;
  top: 0;
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(130px, auto) 1fr minmax(180px, auto);
  align-items: center;
  gap: 10px;
  margin: calc(clamp(14px, 2.6vw, 24px) * -1) calc(clamp(14px, 2.6vw, 24px) * -1) 18px;
  padding: 10px clamp(14px, 2.6vw, 24px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 252, 255, .96);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(28, 82, 124, .08);
}

.top-step-current {
  min-height: 48px;
  border: 1px solid #cfe4f4;
  border-radius: 14px;
  background: #fff;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 7px 12px;
  color: var(--navy);
}

.top-step-current span {
  color: #6c7f92;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.top-step-current strong {
  font-size: 18px;
  line-height: 1.2;
}

.top-step-btn {
  min-height: 48px;
  white-space: nowrap;
}

.form-section {
  display: none;
}

.form-section.active {
  display: block;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading h3 {
  margin: 0;
  font-size: 23px;
}

.group-title {
  margin: 13px 0 8px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 600;
}

.group-title span {
  color: #e12121;
  font-size: 13px;
  margin-left: 4px;
}

.choice-grid, .grade-row, .accessory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}

.choice, .grade, .accessory, .pill {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 12px;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 500;
  text-align: left;
}

.choice.active, .grade.active, .accessory.active, .pill.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.ai-inline-card {
  border: 2px solid #cfe7ff;
  border-radius: 16px;
  background: var(--blue-soft);
  padding: 12px;
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
}

.ai-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-inline-card strong {
  display: block;
  color: #1258d8;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.ai-inline-card p {
  margin: 0;
  color: #2261d8;
  font-size: 14px;
  line-height: 1.6;
}

.ai-cost-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-cost-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #b9d5ec;
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.ai-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-upload-actions .primary-btn,
.ai-upload-actions .secondary-btn,
.ai-upload-actions .upload-box {
  flex: 1 1 170px;
}

.ai-preview.compact {
  min-height: 92px;
}

.ai-preview.has-multiple {
  position: relative;
  align-items: stretch;
  justify-items: stretch;
  padding: 8px;
  background: #111923;
}

.ai-preview-strip {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
}

.ai-preview-strip figure {
  position: relative;
  min-height: 88px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  overflow: hidden;
  background: #111923;
}

.ai-preview-strip img {
  width: 100%;
  height: 100%;
  max-height: 128px;
  object-fit: contain;
}

.ai-preview-strip figcaption,
.ai-preview-count {
  position: absolute;
  background: rgba(2, 22, 37, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.ai-preview-strip figcaption {
  left: 6px;
  top: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.ai-preview-count {
  right: 10px;
  bottom: 10px;
  border-radius: 999px;
  padding: 4px 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.rate-label {
  position: relative;
}

.rate-label span {
  float: right;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}

.rate-label span.rate-error {
  color: var(--danger);
}

.rate-refresh-btn {
  align-self: end;
  min-height: 52px;
}

.business-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.policy-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fcff;
}

.policy-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.policy-panel select,
.policy-panel input {
  width: 100%;
  min-width: 0;
}

.policy-manager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0;
}

.policy-manager.has-delete {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.policy-add-btn {
  min-height: 44px;
  padding-inline: 18px;
}

.policy-delete-btn {
  min-height: 44px;
  padding-inline: 14px;
  border-color: #f0b4ac;
  background: #fff7f5;
  color: var(--danger);
}

.policy-field-grid {
  margin-bottom: 12px;
}

.start-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.start-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--blue-card);
  display: grid;
  gap: 12px;
  align-content: start;
}

.start-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}

.start-icon.gold {
  background: var(--gold);
  color: var(--navy);
}

.start-icon.steel {
  background: var(--sky);
  color: var(--navy);
  border: 1px solid var(--line);
}

.start-card h4 {
  margin: 0 0 6px;
  font-size: 18px;
}

.start-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.upload-box {
  border: 2px dashed #cbd6de;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  min-height: 54px;
  color: var(--navy);
  font-weight: 500;
}

.upload-box input {
  display: none;
}

.ai-preview {
  min-height: 112px;
  border-radius: 14px;
  background: var(--sky);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  text-align: center;
}

.ai-preview img {
  width: 100%;
  height: 100%;
  max-height: 160px;
  object-fit: contain;
  background: #111923;
}

.ai-result {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.ai-result-head {
  display: grid;
  gap: 4px;
}

.ai-result-head strong {
  color: var(--ink);
  line-height: 1.35;
}

.ai-result-head span {
  color: var(--green);
  font-size: 12px;
  font-weight: 500;
}

.ai-result-error span {
  color: #9f2416;
}

.ai-error-lines {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #9f2416;
  font-size: 13px;
  line-height: 1.55;
}

.ai-result-grid {
  margin: 0;
  display: grid;
  gap: 8px;
}

.ai-result-grid div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
}

.ai-result-grid dt,
.ai-result-grid dd {
  margin: 0;
  font-size: 12px;
}

.ai-result-grid dt {
  color: var(--muted);
  font-weight: 500;
}

.ai-result-grid dd {
  color: var(--ink);
}

.ai-draft-fields {
  border: 1px solid #cfe1ee;
  border-radius: 12px;
  background: #f7fbfe;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-draft-fields-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ai-draft-fields-head strong {
  color: var(--ink);
  font-size: 14px;
}

.ai-draft-fields-head span {
  color: var(--muted);
  font-size: 12px;
}

.ai-draft-fields label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  gap: 5px;
}

.ai-draft-fields input,
.ai-draft-fields select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 7px 10px;
}

.ai-draft-fields input:focus,
.ai-draft-fields select:focus {
  outline: 2px solid rgba(28, 168, 215, 0.18);
  border-color: var(--accent);
}

.hint {
  font-size: 13px;
}

.history-search {
  font-size: 14px;
}

.history-results {
  display: grid;
  gap: 10px;
  max-height: 190px;
  overflow: auto;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  text-align: left;
}

.history-item strong {
  display: block;
  margin-bottom: 5px;
}

.history-item span {
  color: var(--muted);
  font-size: 13px;
}

.compact-start {
  width: 100%;
}

.compact-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

label, .wide-label {
  display: grid;
  gap: 5px;
  color: #41546a;
  font-weight: 500;
  font-size: 13px;
}

input, select, textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 10px;
  min-height: 46px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.shell input:not([type="file"]),
.shell select,
.shell textarea,
.purchase-screen input,
.purchase-screen select,
.purchase-screen textarea {
  background: #fff;
  color: #102033;
  -webkit-text-fill-color: #102033;
  caret-color: var(--navy);
}

.shell input::placeholder,
.shell textarea::placeholder,
.purchase-screen input::placeholder,
.purchase-screen textarea::placeholder {
  color: #7a8ea1;
  -webkit-text-fill-color: #7a8ea1;
}

.shell input:-webkit-autofill,
.shell select:-webkit-autofill,
.shell textarea:-webkit-autofill,
.purchase-screen input:-webkit-autofill,
.purchase-screen select:-webkit-autofill,
.purchase-screen textarea:-webkit-autofill {
  box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: #102033;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(66,125,168,.14);
}

.condition-groups {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
}

fieldset {
  border: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

legend {
  font-weight: 600;
  grid-column: 1 / -1;
  padding: 0;
  margin-bottom: 1px;
  color: var(--navy);
  font-size: 15px;
}

.note-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
}

.note-chip-row button {
  border: 1px solid #9ec9ff;
  background: var(--blue-soft);
  color: #1265ff;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 500;
}

.profit-card {
  margin-top: 13px;
  padding: 15px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7fbff, #eaf4ff);
  border: 1px solid #c8def7;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.profit-card strong {
  font-size: 28px;
  color: var(--green);
}

.photo-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.photo-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.photo-toolbar p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.file-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.listing-design-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #d7e5ef;
  border-left: 6px solid #3b8edb;
  border-radius: 10px;
  background: #f3f8fd;
  padding: 13px 14px;
  margin-bottom: 13px;
}

.listing-design-card strong {
  display: block;
  color: #173a5e;
  font-size: 15px;
  margin-bottom: 3px;
}

.listing-design-card p {
  margin: 0;
  color: #50677b;
  font-size: 13px;
  line-height: 1.45;
}

.listing-design-swatch {
  flex: 0 0 112px;
  height: 34px;
  border: 1px solid rgba(23, 58, 94, .14);
  border-radius: 999px;
  background: linear-gradient(90deg, #173a5e 0 38%, #3b8edb 38% 70%, #c59b35 70% 82%, #f3f8fd 82%);
}

.photo-list {
  display: grid;
  gap: 8px;
}

.photo-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-card);
  padding: 8px;
}

.photo-thumb {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: var(--sky);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 500;
  overflow: hidden;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-fields {
  display: grid;
  gap: 5px;
}

.photo-fields small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}

.photo-clear {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 10px;
  font-weight: 600;
  cursor: pointer;
}

.photo-help {
  border-radius: 14px;
  background: var(--blue-soft);
  color: #1265ff;
  padding: 11px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.7;
}

.photo-help ol {
  margin: 6px 0 0;
  padding-left: 20px;
}

.form-navigation {
  display: none;
}

.form-navigation.split {
  justify-content: space-between;
}

.form-navigation .primary-btn,
.form-navigation .secondary-btn {
  min-width: 170px;
}

.output-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: -6px -6px 16px;
}

.output-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  background: #fff;
  color: #52657a;
  min-height: 52px;
  padding: 10px;
  font-weight: 500;
  font-size: 16px;
}

.output-tab:focus-visible {
  outline: 2px solid rgba(24,168,216,.38);
  outline-offset: -2px;
}

.output-tab.active {
  color: var(--navy);
  border-color: #18a8d8;
  box-shadow: inset 0 0 0 2px rgba(24,168,216,.18);
}

.output-panel {
  display: none;
}

.output-panel.active {
  display: block;
}

.summary-grid {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.summary-card,
.item-specifics-card,
.missing-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-card);
  padding: 11px;
}

.summary-hero-card {
  border: 1px solid #bfd4e4;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(18,48,74,.98), rgba(37,75,101,.93)),
    radial-gradient(circle at 92% 12%, rgba(47,142,219,.26), transparent 34%);
  color: #fff;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.summary-title-block {
  display: grid;
  gap: 7px;
}

.summary-title-label {
  color: #9fc1da;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.summary-title-block h4 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.22;
}

.summary-title-block p {
  margin: 0;
  color: #c9d8e2;
  font-size: 13px;
  font-weight: 500;
}

.status-badge {
  width: fit-content;
  border-radius: 999px;
  background: #f7f3e8;
  color: var(--navy);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.status-listed {
  border: 1px solid rgba(72, 202, 163, .72);
  background: #e9fbf5;
  color: #075e4b;
  box-shadow: 0 0 0 3px rgba(72, 202, 163, .14);
}

.summary-price-block {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.summary-price-block div {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  border-radius: 13px;
  padding: 10px 12px;
}

.summary-price-block .metric-filled {
  border-color: rgba(74, 218, 202, .58);
  background:
    linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.08));
  box-shadow: inset 0 -3px 0 rgba(74, 218, 202, .58);
}

.summary-price-block .metric-empty {
  opacity: .72;
  border-style: dashed;
}

.summary-price-block span {
  display: block;
  color: #bfd0dd;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.summary-price-block strong {
  display: block;
  color: #fff;
  font-size: 20px;
}

.summary-price-block .profit-good strong {
  color: #d8f7e9;
}

.summary-price-block .profit-bad strong {
  color: #ffd7d7;
}

.summary-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
}

.summary-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.summary-card.is-filled {
  border-color: rgba(24,168,216,.52);
  border-left: 5px solid #18a8d8;
  background:
    linear-gradient(180deg, #f9fdff, #eef8fe);
  box-shadow: inset 0 -2px 0 rgba(24,168,216,.2);
}

.summary-card.is-filled span {
  color: #315f80;
  font-weight: 700;
}

.summary-card.is-empty {
  border-style: dashed;
  opacity: .74;
}

.item-specifics-card {
  background: #fff;
  margin-bottom: 12px;
}

.summary-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.summary-card-head h4 {
  margin: 0;
  font-size: 18px;
}

.summary-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.specifics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.specifics-grid div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--blue-card);
  padding: 9px 10px;
}

.specifics-grid dt,
.specifics-grid dd {
  margin: 0;
}

.specifics-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
}

.specifics-grid dd {
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
}

.missing-card {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.missing-card strong {
  font-size: 15px;
}

.missing-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.missing-card.warn {
  border-color: #eed7a5;
  background: #fff8e8;
}

.missing-card.ok {
  border-color: #b9dfcf;
  background: #eefaf5;
}

.missing-card.danger {
  border-color: #efb4aa;
  background: #fff2f0;
}

.final-check-card {
  gap: 10px;
}

.final-check-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.final-check-list {
  display: grid;
  gap: 7px;
}

.final-check-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: start;
  gap: 8px;
  border: 1px solid rgba(126, 152, 174, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
  padding: 8px 9px;
}

.final-check-item b {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1.2;
}

.final-check-item span {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.final-check-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.final-check-issue b {
  background: #ffe1dc;
  color: #9f2416;
}

.final-check-warn b {
  background: #fff0c9;
  color: #7a5200;
}

.final-check-ok b {
  background: #dff6eb;
  color: #0b6b50;
}

.listing-status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue);
  border-radius: 14px;
  background: linear-gradient(135deg, #f7fcff, #eef8fe);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.listing-status-panel > div:first-child {
  flex: 0 0 148px;
}

.listing-status-panel span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.listing-status-panel strong {
  display: block;
  margin-top: 2px;
  color: var(--navy);
  font-size: 22px;
  line-height: 1.2;
}

.listing-status-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.22fr 1fr 1fr;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
}

.listing-status-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  min-height: 38px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.listing-status-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 8px 18px rgba(6, 47, 79, .18);
}

.output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.html-editor-card,
.preview-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(30,93,145,.08);
}

.output-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.output-card-head h4 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
}

.html-copy-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-card);
  padding: 12px 14px;
}

.html-copy-card h4 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
}

.html-copy-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.listing-copy-stack {
  display: grid;
  gap: 10px;
}

.copy-output-block {
  display: grid;
  gap: 8px;
}

.copy-output-label {
  display: block;
}

.copy-output-details {
  margin-top: 0;
}

.copy-output-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.copy-output-details label {
  margin-top: 8px;
}

.copy-output-textarea {
  min-height: 92px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  background: #fbfdff;
}

#itemSpecificsOutput {
  min-height: 132px;
}

.compact-copy {
  min-height: 42px;
  padding: 9px 16px;
  background: var(--navy);
  white-space: nowrap;
}

.html-code-details {
  margin-top: 0;
}

.html-code-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.html-code-details label {
  display: block;
  margin-top: 8px;
}

.preview-toggle {
  display: inline-flex;
  gap: 4px;
  border-radius: 12px;
  background: var(--sky);
  padding: 4px;
}

.preview-mode-btn {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #52657a;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 500;
}

.preview-mode-btn.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 4px 12px rgba(15,45,75,.12);
}

.preview-shell {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--blue-soft);
  overflow: hidden;
  margin: 0 auto;
}

.preview-shell.desktop {
  width: min(100%, 820px);
}

.preview-shell.mobile {
  width: min(100%, 390px);
}

.browser-bar {
  display: grid;
  grid-template-columns: 12px 12px 12px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--blue-card);
}

.browser-bar span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.browser-bar span:nth-child(1) { background: #ff5f57; }
.browser-bar span:nth-child(2) { background: #ffbd2e; }
.browser-bar span:nth-child(3) { background: #28c840; }

.browser-bar strong {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #52657a;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#htmlPreviewFrame {
  display: block;
  width: 100%;
  height: 500px;
  border: 0;
  background: #fff;
}

.primary-btn, .secondary-btn {
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 600;
}

.primary-btn {
  border: 0;
  background: var(--blue);
  color: #fff;
}

.secondary-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
}

.html-output {
  font-family: var(--font-code);
  min-height: 220px;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: var(--navy);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1100px) {
  .home-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-menu-grid.compact,
  .home-menu-grid.compact.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-finder-strip {
    grid-template-columns: minmax(150px, .45fr) minmax(240px, 1fr);
  }

  .home-finder-strip .home-primary-btn {
    grid-column: 2;
  }

  .home-finder-builder {
    grid-template-columns: 1fr 1fr;
  }

  .home-finder-builder .home-field {
    grid-column: 1 / -1;
  }

  .home-card-listing {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .home-screen {
    padding: 12px;
  }

  .home-hero {
    border-radius: 14px;
    padding: 18px;
  }

  .home-hero::after {
    width: 42%;
    opacity: .32;
  }

  .home-hero h1 {
    font-size: 26px;
  }

  .home-hero > p {
    font-size: 14px;
  }

  .home-menu-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-tool-group {
    padding: 14px;
    border-radius: 14px;
  }

  .home-research-grid {
    grid-template-columns: 1fr;
  }

  .home-tool-group-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .home-menu-grid.compact,
  .home-menu-grid.compact.two {
    grid-template-columns: 1fr;
  }

  .home-finder-strip {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
  }

  .home-finder-strip .home-primary-btn {
    grid-column: auto;
  }

  .home-finder-desk-head,
  .home-finder-builder {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .home-research-grid .home-finder-builder {
    grid-template-columns: 1fr;
  }

  .home-finder-desk-head {
    display: grid;
  }

  .home-finder-builder .home-field {
    grid-column: auto;
  }

  .home-card-listing {
    min-height: auto;
  }

  .home-card {
    padding: 16px;
    min-height: auto;
  }

  .home-card::after {
    opacity: .22;
  }

  .home-card h2 {
    font-size: 23px;
  }

  .home-card h3 {
    font-size: 21px;
  }

  .html-copy-card {
    align-items: stretch;
    flex-direction: column;
  }

  .listing-status-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .listing-status-panel > div:first-child {
    flex-basis: auto;
  }

  .listing-status-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .listing-status-btn {
    padding: 7px 6px;
    font-size: 11px;
  }

  .purchase-screen {
    padding: 12px;
  }

  .purchase-hero {
    align-items: stretch;
    flex-direction: column;
    border-radius: 14px;
    padding: 16px;
  }

  .purchase-hero h1 {
    font-size: 26px;
  }

  .purchase-hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .purchase-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purchase-sync-panel {
    grid-template-columns: 1fr;
    padding: 9px 10px;
  }

  .purchase-sync-head {
    justify-content: space-between;
  }

  .purchase-db-scope {
    justify-content: flex-start;
  }

  .purchase-report-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .purchase-sync-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .purchase-sync-actions .primary-btn,
  .purchase-sync-actions .secondary-btn {
    min-height: 34px;
    padding: 6px;
  }

  .purchase-maintenance-body {
    grid-template-columns: 1fr;
  }

  .purchase-maintenance-body .purchase-sync-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .purchase-layout {
    grid-template-columns: 1fr;
  }

  .purchase-panel {
    border-radius: 14px;
    padding: 14px;
  }

  .purchase-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-search-panel {
    grid-template-columns: 1fr 1fr;
  }

  .purchase-search-field,
  .purchase-filter-group {
    grid-column: 1 / -1;
  }

  .purchase-filter-group {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .mobile-home-btn {
    display: block;
  }

  .app-header {
    display: none;
    min-height: 0;
    padding: 12px 14px;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .shell {
    width: 100%;
    margin: 0;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand h1 {
    font-size: 21px;
  }

  .brand p {
    margin-top: 3px;
    font-size: 12px;
  }

  .header-actions {
    margin-left: auto;
  }

  .ghost-btn, .profile-btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .hero-panel {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
    gap: 12px;
  }

  .hero-panel h2 {
    max-width: none;
    font-size: 28px;
    line-height: 1.15;
    word-break: keep-all;
  }

  .hero-panel p:last-child {
    display: block;
    max-width: none;
    font-size: 13px;
    line-height: 1.5;
    word-break: keep-all;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }

  .hero-actions .primary-pill,
  .hero-actions .outline-pill {
    width: 100%;
    text-align: center;
  }

  #downloadUploadWaitingCsvBtn {
    grid-column: 1 / -1;
    order: 3;
  }

  .primary-pill, .outline-pill {
    padding: 8px 11px;
    font-size: 12px;
  }

  .status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(74px, 1fr));
    gap: 8px;
  }

  .status-grid article {
    padding: 9px 8px;
  }

  .status-grid span {
    font-size: 11px;
  }

  .status-grid strong {
    font-size: 20px;
  }

  .listed-dialog {
    padding: 10px;
  }

  .listed-dialog-panel {
    max-height: calc(100vh - 20px);
  }

  .listed-dialog-item {
    grid-template-columns: 1fr;
  }

  .listed-dialog-actions {
    justify-content: flex-start;
  }

  .ledger-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ledger-head-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .ledger-head-actions p {
    flex-basis: 100%;
  }

  .ledger-scroll {
    margin: 0 -1px;
    max-height: 56vh;
    overflow-x: visible;
    overflow-y: auto;
  }

  .ledger-table {
    display: block;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
  }

  .ledger-table thead {
    display: none;
  }

  .ledger-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .ledger-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }

  .ledger-table tr.selected {
    border-color: #8cbbe4;
    background: #f2f8fd;
  }

  .ledger-table th,
  .ledger-table td,
  .ledger-table th:nth-child(n),
  .ledger-table td:nth-child(n) {
    display: block;
    width: auto;
    min-width: 0;
    border-bottom: 0;
    padding: 0;
    white-space: normal;
  }

  .ledger-table td::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
  }

  .ledger-table td:nth-child(1)::before {
    content: "購入情報";
  }

  .ledger-table td:nth-child(2)::before {
    content: "注文番号";
  }

  .ledger-table td:nth-child(4)::before {
    content: "管理番号";
  }

  .ledger-table td:nth-child(5)::before {
    content: "グレード";
  }

  .ledger-table td:nth-child(6)::before {
    content: "仕入値";
  }

  .ledger-table td:nth-child(7)::before {
    content: "状態";
  }

  .ledger-table td:nth-child(3) {
    grid-column: 1 / -1;
    order: -2;
  }

  .ledger-table td:nth-child(8) {
    order: -1;
    justify-self: start;
  }

  .ledger-title {
    width: auto;
  }

  .ledger-title strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.35;
  }

  .ledger-empty {
    grid-column: 1 / -1;
  }

  .ledger-purchase-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .ledger-order-input,
  .ledger-edit-input {
    width: 100%;
    min-height: 28px;
    padding: 4px 6px;
  }

  .ledger-sku-input {
    width: 100%;
  }

  .ledger-price-input {
    width: 100%;
  }

  .ledger-edit {
    min-height: 30px;
    padding: 6px 12px;
  }

  .workspace {
    display: block;
  }

  .sync-panel {
    grid-template-columns: 1fr;
    padding: 9px 10px;
  }

  .sync-note {
    grid-column: auto;
  }

  .sync-head {
    justify-content: space-between;
  }

  .sync-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .ai-draft-fields {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .ai-draft-fields-head {
    display: grid;
    gap: 3px;
  }

  .sync-url-details label {
    position: static;
    width: 100%;
    margin-top: 4px;
  }

  .sync-actions .primary-btn,
  .sync-actions .secondary-btn {
    padding: 8px 6px;
    font-size: 12px;
  }

  .side-panel {
    display: none;
  }

  .editor {
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .stepper {
    overflow-x: auto;
    grid-template-columns: repeat(7, minmax(54px, 1fr));
    padding: 9px 6px;
    position: static;
    border-radius: 0;
  }

  .step {
    font-size: 11px;
    gap: 4px;
  }

  .step span {
    width: 24px;
    height: 24px;
  }

  .field-grid, .start-options, .summary-detail-grid, .specifics-grid {
    grid-template-columns: 1fr;
  }

  .ai-card-head {
    display: grid;
    gap: 8px;
  }

  .ai-cost-links a {
    flex: 1 1 120px;
  }

  .purchase-form-grid {
    grid-template-columns: 1fr;
  }

  .purchase-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .purchase-row-actions {
    justify-content: flex-start;
  }

  .business-policy-grid,
  .policy-manager {
    grid-template-columns: 1fr;
  }

  .policy-manager.has-delete {
    grid-template-columns: 1fr;
  }

  form {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
  }

  .top-step-nav {
    top: 0;
    grid-template-columns: 1fr 1fr;
    margin: -16px -16px 14px;
    padding: 8px 12px;
    gap: 8px;
  }

  .top-step-current {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 42px;
    padding: 6px 10px;
  }

  .top-step-current strong {
    font-size: 16px;
  }

  .top-step-btn {
    min-height: 42px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .top-step-nav--only-next #topNextStepBtn,
  .top-step-nav--only-prev #topPrevStepBtn {
    grid-column: 1 / -1;
  }

  .choice-grid, .grade-row, .accessory-grid, fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice, .grade, .accessory, .pill {
    min-height: 42px;
    padding: 9px 10px;
    font-size: 13px;
  }

  .group-title {
    font-size: 15px;
  }

  .summary-hero-card {
    grid-template-columns: 1fr;
  }

  .summary-price-block {
    grid-template-columns: 1fr;
  }

  .photo-toolbar, .profit-card {
    align-items: stretch;
    flex-direction: column;
  }

  .photo-toolbar-actions {
    justify-content: stretch;
  }

  .photo-toolbar-actions .secondary-btn {
    flex: 1;
  }

  .form-navigation {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin: 14px -14px -14px;
    padding: 9px 14px;
    background: rgba(246, 251, 255, .97);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 24px rgba(30, 93, 145, .12);
  }

  .form-navigation .primary-btn,
  .form-navigation .secondary-btn {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .home-screen {
    padding: 10px;
  }

  .home-brand-row {
    gap: 10px;
  }

  .home-hero {
    padding: 14px;
  }

  .home-hero::after {
    display: none;
  }

  .home-hero h1 {
    font-size: 23px;
  }

  .home-card {
    border-radius: 14px;
    padding: 14px;
  }

  .home-card-actions {
    grid-template-columns: 1fr;
  }

  .home-action-stack {
    grid-template-columns: 1fr;
  }

  .home-hero-tags span {
    padding: 6px 10px;
  }

  .app-header {
    padding: 10px 12px;
    gap: 8px;
  }

  .shell {
    width: 100%;
    margin: 0;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .brand h1 {
    font-size: 18px;
    white-space: nowrap;
  }

  .brand p {
    display: none;
  }

  .header-actions {
    width: auto;
    margin-left: auto;
    gap: 6px;
  }

  .ghost-btn, .profile-btn {
    flex: initial;
    padding: 7px 9px;
    font-size: 11px;
  }

  .profile-btn {
    display: none;
  }

  .hero-panel {
    border-radius: 12px;
    padding: 16px 14px;
    align-items: stretch;
    gap: 12px;
  }

  .hero-panel .eyebrow {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .hero-panel h2 {
    max-width: none;
    font-size: clamp(26px, 8vw, 34px);
    line-height: 1.15;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    justify-content: stretch;
  }

  .primary-pill, .outline-pill {
    padding: 9px 8px;
    font-size: 12px;
    min-height: 42px;
    text-align: center;
  }

  #downloadUploadWaitingCsvBtn {
    grid-column: 1 / -1;
    order: 3;
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .status-grid article {
    padding: 8px 7px;
    border-radius: 10px;
  }

  .status-grid span {
    font-size: 10px;
  }

  .status-grid strong {
    font-size: 18px;
  }

  .side-panel {
    padding: 12px;
  }

  .stepper {
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    padding: 7px 4px;
  }

  .step {
    font-size: 9px;
  }

  .step span {
    width: 21px;
    height: 21px;
  }

  form {
    padding: 12px;
  }

  .top-step-nav {
    top: 0;
    margin: -12px -12px 12px;
    padding: 7px 10px;
  }

  .top-step-current {
    min-height: 38px;
  }

  .top-step-current span {
    font-size: 10px;
  }

  .top-step-current strong {
    font-size: 15px;
  }

  .section-heading {
    margin-bottom: 9px;
  }

  .section-heading h3 {
    font-size: 21px;
  }

  .choice-grid, .grade-row, .accessory-grid, fieldset {
    gap: 7px;
  }

  .choice, .grade, .accessory, .pill {
    min-height: 40px;
    padding: 8px 9px;
    border-radius: 9px;
    font-size: 12px;
  }

  input, select, textarea {
    min-height: 42px;
    padding: 9px 10px;
  }

  textarea {
    min-height: 84px;
  }

  .form-navigation {
    margin: 12px -12px -12px;
    padding: 8px 12px;
  }

  .primary-btn, .secondary-btn {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 13px;
  }

  .photo-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .photo-thumb {
    width: 52px;
    height: 52px;
  }

  .photo-clear {
    grid-column: 2;
    width: fit-content;
  }

  .output-tab {
    min-height: 46px;
    font-size: 14px;
  }

  #htmlPreviewFrame {
    height: 420px;
  }
}

@media (max-width: 520px) {
  body {
    line-height: 1.42;
  }

  .home-screen {
    padding: 7px;
  }

  .home-shell {
    width: 100%;
  }

  .home-hero {
    border-radius: 11px;
    padding: 10px 11px;
  }

  .home-screen .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 12px;
  }

  .home-hero .eyebrow {
    margin-bottom: 1px;
    font-size: 10px;
  }

  .home-hero h1 {
    font-size: 19px;
    line-height: 1.18;
  }

  .home-hero > p {
    display: none;
  }

  .home-hero-tags {
    margin-top: 8px;
    gap: 5px;
  }

  .home-hero-tags span {
    padding: 3px 7px;
    font-size: 10px;
  }

  .home-brand-tools,
  .home-menu-grid,
  .home-menu-grid.compact,
  .home-research-grid {
    gap: 8px;
  }

  .home-tool-group {
    padding: 9px;
    border-radius: 11px;
  }

  .home-tool-group-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
  }

  .home-tool-group-head h2 {
    font-size: 16px;
    line-height: 1.2;
  }

  .home-card {
    border-radius: 11px;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 6px;
  }

  .home-card-kicker {
    padding: 3px 7px;
    font-size: 10px;
  }

  .home-card > .home-card-kicker {
    display: none;
  }

  .home-card h3 {
    min-width: 0;
    font-size: 18px;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  .home-card p {
    display: none;
  }

  .home-card .home-primary-btn,
  .home-primary-btn,
  .home-secondary-btn {
    min-height: 36px;
    padding: 7px 9px;
    border-radius: 10px;
    font-size: 13px;
  }

  .home-card .home-primary-btn {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
  }

  .home-finder-strip,
  .home-finder-desk {
    border-radius: 11px;
    padding: 9px;
    gap: 7px;
  }

  .home-finder-strip strong,
  .home-finder-desk-head strong {
    font-size: 16px;
  }

  .home-field {
    gap: 3px;
    font-size: 11px;
  }

  .home-field input,
  .home-field select {
    min-height: 38px;
    padding: 7px 9px;
    border-radius: 10px;
    font-size: 14px;
  }

  .home-finder-desk-head,
  .home-finder-builder {
    gap: 7px;
  }

  .home-keyword-ideas,
  .home-keyword-list {
    gap: 5px;
  }

  .home-keyword-chip {
    padding: 5px 7px 5px 9px;
    font-size: 11px;
  }

  .home-finder-suggestions {
    max-height: min(260px, 48vh);
  }

  .home-finder-option {
    padding: 8px 9px;
  }

  .purchase-screen {
    min-height: 100vh;
    padding: 7px;
  }

  .purchase-hero {
    border-radius: 11px;
    padding: 10px;
    gap: 8px;
  }

  .purchase-hero .eyebrow {
    margin-bottom: 1px;
    font-size: 10px;
  }

  .purchase-hero h1 {
    font-size: 20px;
    line-height: 1.15;
  }

  .purchase-hero p:last-child {
    display: none;
  }

  .purchase-hero-actions {
    gap: 6px;
  }

  .purchase-hero-actions .home-primary-btn,
  .purchase-hero-actions .home-secondary-btn {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .purchase-status-grid,
  .purchase-kpi-grid {
    gap: 5px;
    margin: 7px 0;
  }

  .purchase-kpi-grid article,
  .purchase-status-grid article {
    min-height: auto;
    padding: 6px 7px;
    border-radius: 9px;
  }

  .purchase-kpi-grid span,
  .purchase-status-grid span {
    font-size: 10px;
  }

  .purchase-kpi-grid strong,
  .purchase-status-grid strong {
    margin-top: 1px;
    font-size: 16px;
  }

  .purchase-sync-panel {
    gap: 6px;
    margin-bottom: 7px;
    padding: 7px;
    border-radius: 10px;
  }

  .purchase-sync-panel .sync-note,
  .purchase-sync-panel .purchase-db-scope {
    display: none;
  }

  .purchase-sync-head strong {
    font-size: 13px;
  }

  .purchase-db-scope,
  .purchase-report-link,
  .purchase-sync-actions .primary-btn,
  .purchase-sync-actions .secondary-btn {
    min-height: 30px;
    padding: 5px 7px;
    border-radius: 9px;
    font-size: 11px;
  }

  .purchase-report-links,
  .purchase-sync-actions {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  .purchase-report-links::-webkit-scrollbar,
  .purchase-sync-actions::-webkit-scrollbar {
    display: none;
  }

  .purchase-report-link,
  .purchase-sync-actions .primary-btn,
  .purchase-sync-actions .secondary-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .purchase-maintenance-details {
    padding-top: 4px;
  }

  .purchase-maintenance-details summary {
    font-size: 11px;
  }

  .purchase-layout {
    gap: 8px;
  }

  .purchase-list-panel {
    order: 1;
  }

  .purchase-form-panel {
    order: 2;
  }

  .purchase-panel {
    border-radius: 11px;
    padding: 9px;
  }

  .purchase-panel-head {
    gap: 7px;
    margin-bottom: 7px;
  }

  .purchase-panel-head h2 {
    font-size: 17px;
  }

  .purchase-form-grid {
    gap: 7px;
  }

  .purchase-form-grid label {
    gap: 3px;
    font-size: 11px;
  }

  .purchase-form-grid input,
  .purchase-form-grid select,
  .purchase-form-grid textarea,
  .purchase-search-field input,
  .purchase-sync-panel input {
    min-height: 36px;
    padding: 7px 8px;
    border-radius: 9px;
    font-size: 13px;
  }

  .purchase-form-grid textarea {
    min-height: 58px;
  }

  .purchase-form-actions {
    gap: 6px;
    margin-top: 7px;
  }

  .purchase-form-actions button {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .purchase-search-panel {
    gap: 6px;
    margin-bottom: 7px;
    padding: 7px;
    border-radius: 10px;
  }

  .purchase-filter-group {
    min-height: 0;
    gap: 4px;
    padding: 4px;
  }

  .purchase-check,
  .purchase-clear-filters {
    min-height: 28px;
    padding: 0 6px;
    font-size: 11px;
  }

  .purchase-list {
    gap: 7px;
  }

  .purchase-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 9px;
    border-radius: 10px;
  }

  .purchase-row-title strong {
    font-size: 13px;
  }

  .purchase-row-title {
    font-size: 13px;
  }

  .purchase-row-meta,
  .purchase-row-note,
  .purchase-detail-line {
    font-size: 11px;
    line-height: 1.35;
  }

  .purchase-row-details {
    gap: 4px 8px;
  }

  .purchase-unit-badge,
  .purchase-condition-badge,
  .purchase-condition-out-label,
  .workflow-badge {
    min-height: 19px;
    padding: 2px 6px;
    font-size: 10px;
  }

  .purchase-row-actions,
  .candidate-row .purchase-row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
  }

  .purchase-row-actions button,
  .purchase-row-actions a,
  .candidate-row .purchase-row-actions button,
  .candidate-row .purchase-row-actions a {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
  }
}

@media (max-width: 520px) {
  .home-screen {
    padding: 10px 9px 18px;
  }

  .home-shell {
    gap: 8px;
  }

  .home-hero {
    padding: 10px;
    border-radius: 13px;
  }

  .home-hero > p {
    display: none;
  }

  .home-brand-row {
    gap: 8px;
  }

  .home-brand-row .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    font-size: 16px;
  }

  .home-hero h1 {
    font-size: 24px;
    line-height: 1.05;
  }

  .home-hero-tags {
    gap: 5px;
    margin-top: 8px;
  }

  .home-hero-tags span {
    min-height: 27px;
    padding: 4px 9px;
    font-size: 12px;
  }

  .home-brand-tools,
  .home-research-grid {
    gap: 7px;
  }

  .home-tool-group {
    padding: 8px;
    border-radius: 13px;
  }

  .home-tool-group-head {
    display: none;
  }

  .home-menu-grid,
  .home-menu-grid.compact,
  .home-menu-grid.compact.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .home-menu-grid.compact .home-card {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 86px;
    padding: 8px;
    gap: 7px;
    border-radius: 11px;
  }

  .home-menu-grid.compact .home-card::after {
    opacity: .45;
    right: 8px;
    bottom: 8px;
    width: 84px;
    height: 28px;
  }

  .home-menu-grid.compact .home-card > .home-card-kicker,
  .home-menu-grid.compact .home-card p {
    display: none;
  }

  .home-menu-grid.compact .home-card h3 {
    min-width: 0;
    margin: 0;
    font-size: 17px;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .home-menu-grid.compact .home-card .home-primary-btn {
    width: 100%;
    min-height: 30px;
    padding: 5px 6px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .home-research-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .home-finder-strip,
  .home-finder-desk {
    padding: 9px;
    border-radius: 11px;
    gap: 7px;
  }

  .home-finder-strip .home-card-kicker,
  .home-finder-desk .home-card-kicker {
    display: none;
  }

  .home-finder-strip strong,
  .home-finder-desk-head strong {
    font-size: 18px;
    line-height: 1.15;
  }

  .home-finder-strip .home-field,
  .home-finder-builder .home-field {
    gap: 4px;
    font-size: 12px;
  }

  .home-finder-strip input,
  .home-finder-builder input {
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 14px;
  }

  .home-finder-strip .home-primary-btn,
  .home-finder-desk .home-secondary-btn {
    min-height: 31px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.1;
  }

  .home-finder-desk-head {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
  }

  .home-finder-desk-head .home-secondary-btn {
    min-width: 58px;
  }

  .home-finder-builder {
    gap: 6px;
  }

  .home-finder-builder .home-secondary-btn {
    width: 100%;
  }
}

/* Final mobile density override for the listing desk. */
@media (max-width: 520px) {
  .mobile-home-btn {
    display: none !important;
  }

  .status-grid {
    display: flex !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .status-grid::-webkit-scrollbar {
    display: none;
  }

  .status-grid article {
    flex: 0 0 128px;
    min-height: 58px;
    scroll-snap-align: start;
  }

  .ledger-head-actions p,
  .sync-note {
    display: none !important;
  }

  .sync-panel {
    padding: 8px 10px;
  }
}

/* Final production density override for desktop and mobile listing screens. */
.shell {
  margin-top: 10px;
}

.hero-panel {
  min-height: 0;
  padding: 16px 20px;
  border-radius: 14px;
  gap: 16px;
}

.hero-panel .eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
}

.hero-panel h2 {
  font-size: clamp(28px, 3.1vw, 42px);
  line-height: 1.08;
}

.hero-panel p:last-child {
  margin-top: 6px;
  font-size: 14px;
}

.hero-actions {
  gap: 8px;
  min-width: min(100%, 460px);
}

.primary-pill,
.outline-pill {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
}

.status-grid {
  margin: 8px 0 10px;
  gap: 8px;
}

.status-grid article {
  min-height: 72px;
  padding: 9px 12px;
}

.status-grid strong {
  margin-top: 3px;
  font-size: 21px;
  line-height: 1.15;
}

.ledger-head {
  padding: 9px 12px;
}

.ledger-head .eyebrow {
  display: none;
}

.ledger-head h3 {
  font-size: 18px;
  line-height: 1.15;
}

.workspace {
  gap: 14px;
}

.sync-panel {
  padding-block: 7px;
}

.stepper {
  padding-block: 8px;
}

@media (max-width: 900px) {
  .hero-panel {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 10px;
  }

  .hero-actions {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .hero-panel {
    padding: 10px;
    border-radius: 12px;
  }

  .hero-panel h2 {
    font-size: 24px;
    line-height: 1.12;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .hero-panel p:last-child,
  .mobile-home-btn,
  .ledger-head-actions p,
  .sync-note {
    display: none !important;
  }

  .hero-actions {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .primary-pill,
  .outline-pill {
    min-height: 38px;
    padding: 7px 8px;
    border-radius: 10px;
    font-size: 11px;
  }

  .status-grid {
    display: flex !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    margin: 7px 0 8px;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .status-grid::-webkit-scrollbar {
    display: none;
  }

  .status-grid article {
    flex: 0 0 128px;
    min-height: 58px;
    padding: 8px;
    scroll-snap-align: start;
  }

  .status-grid span {
    font-size: 10px;
  }

  .status-grid strong {
    font-size: 18px;
  }
}

/* Final small-phone polish: keep the listing form visible immediately. */
@media (max-width: 520px) {
  .hero-panel {
    padding: 8px 10px;
    gap: 7px;
  }

  .hero-panel .eyebrow {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .hero-panel h2 {
    font-size: 22px;
  }

  .hero-actions {
    gap: 5px;
  }

  .primary-pill,
  .outline-pill {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 10px;
  }

  #downloadUploadWaitingCsvBtn {
    grid-column: 1 / -1;
  }
}

.btn-label-short {
  display: none;
}

/* Mobile header actions: keep all three route buttons on one row. */
@media (max-width: 520px) {
  .hero-actions {
    display: grid;
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, .72fr) minmax(0, 1fr);
    gap: 5px;
  }

  .hero-actions .primary-pill,
  .hero-actions .outline-pill {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding: 5px 4px;
    white-space: nowrap;
  }

  #listingHomeBtn {
    order: 1;
  }

  #listingPurchaseBtn {
    order: 2;
  }

  #downloadUploadWaitingCsvBtn {
    grid-column: auto !important;
    order: 3;
  }

  .btn-label-full {
    display: none;
  }

  .btn-label-short {
    display: inline;
  }
}


/* Listing final polish: keep the active workflow status visible on every step. */
.listing-status-panel--global {
  position: relative;
  z-index: 19;
  margin: 0;
  border-left-width: 4px;
  border-radius: 0;
  padding: 8px 14px;
  box-shadow: 0 8px 18px rgba(28, 82, 124, .06);
}

.listing-status-panel--global > div:first-child {
  flex-basis: 126px;
}

.listing-status-panel--global strong {
  font-size: 20px;
}

.listing-status-panel--global .listing-status-btn {
  min-height: 34px;
}

.top-step-current strong {
  overflow-wrap: anywhere;
}

.sync-panel {
  grid-template-columns: minmax(280px, 1fr) auto auto;
  grid-template-areas:
    "head url actions"
    "note url actions";
  padding: 7px 10px;
}

.sync-head {
  grid-area: head;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.sync-note {
  grid-area: note;
  max-width: 420px;
  font-size: 11px;
}

.sync-url-details {
  grid-area: url;
}

.sync-actions {
  grid-area: actions;
}

.hero-panel {
  padding: 14px 20px;
  border-radius: 14px;
}

.hero-panel h2 {
  font-size: clamp(27px, 3vw, 38px);
}

.hero-panel p:last-child {
  margin-top: 5px;
  font-size: 14px;
}

@media (max-width: 720px) {
  .listing-status-panel--global {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 8px 10px;
  }

  .listing-status-panel--global > div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-basis: auto;
    gap: 10px;
  }

  .listing-status-panel--global strong {
    font-size: 18px;
  }

  .listing-status-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .listing-status-btn {
    min-height: 32px;
    padding: 6px 5px;
    font-size: 11px;
  }

  .sync-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "note"
      "url"
      "actions";
    gap: 6px;
  }

  .sync-note {
    display: block !important;
    max-width: none;
    font-size: 11px;
  }
}

@media (max-width: 520px) {
  .hero-panel {
    padding: 8px 10px;
    gap: 6px;
  }

  .hero-panel h2 {
    font-size: 21px;
  }

  .hero-panel p:last-child {
    display: block !important;
    max-width: 15em;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.35;
  }

  .top-step-nav {
    margin-bottom: 10px;
    padding-block: 8px;
  }
}

.ai-queue-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ai-queue-actions .secondary-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
}

.ai-queue-actions .ai-queue-analyze {
  flex: 1 1 180px;
}

.ai-queue-actions .ai-queue-clear {
  flex: 0 0 auto;
}

.ai-queue-actions button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  .ai-queue-actions {
    display: grid;
    grid-template-columns: 1fr 82px;
    gap: 6px;
  }

  .ai-queue-actions .secondary-btn {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 12px;
  }
}


button.upload-box {
  font: inherit;
  cursor: pointer;
}

.ai-upload-actions .ai-paste-btn {
  white-space: nowrap;
}

.ai-paste-hint {
  margin: -3px 0 0;
  color: #55708a;
  font-size: 12px;
  line-height: 1.45;
}

.ai-drop-zone {
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.ai-drop-zone:focus-visible {
  outline: 3px solid rgba(21, 163, 210, .28);
  outline-offset: 3px;
}

.ai-drop-zone.is-drag-over {
  border-color: #15a3d2 !important;
  box-shadow: 0 0 0 4px rgba(21, 163, 210, .16);
  background: #e9f8ff;
}

@media (max-width: 520px) {
  .ai-upload-actions .ai-paste-btn,
  .ai-paste-hint {
    display: none;
  }
}
