:root {
  color-scheme: light;
  --bg: #f7f3fb;
  --surface: #ffffff;
  --surface-soft: #fbf9ff;
  --ink: #1c1328;
  --muted: #6c6078;
  --line: #dfd4ec;
  --accent: #300060;
  --accent-dark: #200050;
  --accent-soft: #efe6fa;
  --warn: #b45309;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(48, 0, 96, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:target {
  scroll-margin-top: 74px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.auth-locked .app-header,
body.auth-locked .mobile-quick-nav,
body.auth-locked .workflow-strip,
body.auth-locked .layout {
  display: none;
}

body:not(.auth-locked) .auth-panel {
  display: none;
}

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

button {
  cursor: pointer;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 44px) 20px;
}

.auth-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(480px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-logo {
  width: 78px;
  height: 78px;
  border-radius: 18px;
}

.auth-card h1 {
  margin: 0;
  font-size: 28px;
}

.auth-copy {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.6;
}

.auth-form,
.auth-actions {
  display: grid;
  gap: 12px;
}

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

.app-header h1,
h2,
h3,
p {
  margin: 0;
}

.brand-title {
  min-width: 0;
}

.brand-wordmark {
  display: block;
  width: min(560px, 58vw);
  max-height: 86px;
  object-fit: contain;
  object-position: left center;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.session-label {
  max-width: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: right;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(48, 0, 96, 0.18);
  object-fit: cover;
}

.mobile-quick-nav {
  display: none;
}

.view-hidden {
  display: none !important;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 clamp(18px, 4vw, 44px) 16px;
}

.workflow-strip div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(48, 0, 96, 0.08);
}

.workflow-strip span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.workflow-strip strong {
  font-size: 15px;
}

.workflow-strip p {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.layout {
  display: grid;
  grid-template-columns: 210px minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
  padding: 0 clamp(18px, 4vw, 44px) 36px;
  align-items: start;
}

.app-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sidebar-link,
.mobile-nav-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  text-align: left;
}

.sidebar-link {
  padding: 0 12px;
}

.sidebar-link.active,
.mobile-nav-button.active {
  border-color: var(--line);
  background: var(--accent);
  color: #fff;
}

.form-panel,
.summary-panel,
.market-panel,
.import-panel,
.settings-panel,
.sales-overview,
.publishing-queue,
.inventory-overview,
.stock-alerts,
.list-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel {
  grid-column: 2;
  position: sticky;
  top: 16px;
  padding: 18px;
}

.title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.modal-close-button {
  display: none;
}

body.edit-modal-open {
  overflow: hidden;
}

body.edit-modal-open::before {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(28, 19, 40, 0.56);
  content: "";
}

body.edit-modal-open #formPanel {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 31;
  display: block !important;
  width: min(720px, calc(100vw - 28px));
  max-height: min(88vh, 920px);
  overflow: auto;
  transform: translate(-50%, -50%);
}

body.edit-modal-open .modal-close-button {
  display: inline-flex;
}

.content-area {
  grid-column: 3;
  min-width: 0;
  display: grid;
  gap: 16px;
}

body:not([data-view="register"]) .content-area {
  grid-column: 2 / -1;
}

body[data-view="register"] .content-area {
  display: none;
}

.summary-panel,
.market-panel,
.import-panel,
.settings-panel,
.sales-overview,
.inventory-overview,
.list-panel {
  padding: 18px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title-row h2 {
  font-size: 20px;
}

.panel-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

form {
  display: grid;
  gap: 14px;
}

.image-uploader {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  color: var(--accent-dark);
  font-weight: 900;
  overflow: hidden;
}

.image-uploader::before {
  content: "";
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 15px #fff,
    0 10px 24px rgba(48, 0, 96, 0.12);
}

.image-uploader.has-image::before {
  display: none;
}

.image-uploader input,
.file-import input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

#imagePreview {
  display: none;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.image-uploader.has-image #imagePreview {
  display: block;
}

.image-uploader.has-image #imagePlaceholder {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 12px;
}

.field,
.search-box {
  display: grid;
  gap: 7px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  color: #39443f;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd6d0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(48, 0, 96, 0.18);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

.inline-button {
  min-height: 30px;
  white-space: nowrap;
}

.profit-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.generated-panel {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.compact-title-row {
  margin-bottom: 0;
}

.compact-title-row h3 {
  font-size: 16px;
}

.generated-output {
  display: grid;
  gap: 10px;
}

.generated-output div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 6px;
  background: #fff;
}

.generated-output span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.generated-output p {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.generated-output textarea {
  min-height: 148px;
  border-color: rgba(48, 0, 96, 0.24);
  font-size: 13px;
  font-weight: 700;
}

.generated-links {
  margin-bottom: 0;
}

.profit-preview span {
  font-weight: 800;
}

.profit-preview strong {
  font-size: 22px;
}

.primary-button,
.ghost-button,
.text-button,
.small-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.ghost-button,
.text-button,
.small-button {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost-button,
.file-import {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 13px;
  white-space: nowrap;
}

.text-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--accent-dark);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.market-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  margin-bottom: 12px;
}

.search-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 8px;
}

.market-search-button {
  min-height: 42px;
}

.source-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.source-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.source-links a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.price-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.price-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
}

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

.price-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.price-table tr:last-child td {
  border-bottom: 0;
}

.price-table input {
  min-height: 38px;
}

.market-source-input {
  min-width: 150px;
}

.market-price-input {
  min-width: 120px;
}

.market-url-cell {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 54px;
  gap: 6px;
  align-items: center;
}

.market-url-input {
  min-width: 220px;
}

.market-url-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.market-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.market-summary {
  margin-top: 12px;
}

.market-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

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

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

.import-card h3 {
  font-size: 18px;
}

.import-drop {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 148px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.import-drop strong {
  font-size: 18px;
}

.import-drop span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.import-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.paper-preview {
  display: none;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.paper-preview.has-image {
  display: block;
}

.import-status {
  margin-top: 12px;
}

.settings-panel {
  display: grid;
  gap: 12px;
}

.settings-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.settings-checklist div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.settings-checklist span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-checklist strong {
  overflow-wrap: anywhere;
}

.settings-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px 18px 14px 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.settings-steps li {
  padding-left: 4px;
}

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

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

.copy-field span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.copy-field code {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font: 800 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.env-sample {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1f1230;
  color: #fff;
  font: 700 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-x: auto;
}

.handoff-textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 700 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.member-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  align-items: end;
  gap: 12px;
}

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

.member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.member-item div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.member-item strong,
.member-item span {
  overflow-wrap: anywhere;
}

.member-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.role-pill {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

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

.activity-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.activity-item strong {
  font-size: 14px;
}

.activity-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.activity-item p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}

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

.readiness-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.readiness-item > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.readiness-item strong,
.readiness-item span {
  overflow-wrap: anywhere;
}

.readiness-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.readiness-item b {
  flex: 0 0 auto;
  min-width: 58px;
  text-align: center;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.readiness-ok b {
  background: rgba(48, 0, 96, 0.1);
  color: var(--accent);
}

.readiness-warn b {
  background: rgba(187, 129, 32, 0.14);
  color: #765116;
}

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

.launch-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.launch-step > b {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 950;
}

.launch-step > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.launch-step strong,
.launch-step span {
  overflow-wrap: anywhere;
}

.launch-step span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.launch-step em {
  min-width: 72px;
  padding: 6px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.launch-step-done em {
  background: rgba(48, 0, 96, 0.1);
  color: var(--accent);
}

.launch-step-todo em {
  background: rgba(187, 129, 32, 0.14);
  color: #765116;
}

.metric {
  display: grid;
  gap: 7px;
  min-height: 94px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  align-self: end;
  font-size: clamp(20px, 2vw, 27px);
}

.sales-overview,
.publishing-queue,
.inventory-overview,
.stock-alerts {
  display: grid;
  gap: 14px;
}

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

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

.publishing-item > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.publishing-item strong,
.publishing-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publishing-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.publishing-badges,
.publishing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.publishing-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.publishing-badge.done {
  background: rgba(48, 0, 96, 0.1);
  color: var(--accent);
}

.publishing-badge.todo {
  background: rgba(174, 20, 20, 0.08);
  color: #9a1b1b;
}

.inventory-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.inventory-kpi,
.store-stock-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.inventory-kpi {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 12px;
}

.inventory-kpi span,
.store-stock-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.inventory-kpi strong {
  font-size: 27px;
}

.store-stock-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.store-stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

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

.stock-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.stock-alert-item > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stock-alert-item strong,
.stock-alert-item span {
  overflow-wrap: anywhere;
}

.stock-alert-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.stock-alert-critical {
  border-color: rgba(174, 20, 20, 0.28);
  background: rgba(174, 20, 20, 0.06);
}

.stock-alert-warning {
  border-color: rgba(187, 129, 32, 0.35);
  background: rgba(187, 129, 32, 0.08);
}

.stock-alert-notice {
  border-color: rgba(48, 0, 96, 0.18);
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
}

.search-box {
  width: min(360px, 100%);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  min-width: min(820px, 100%);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.store-add-button {
  min-height: 48px;
  white-space: nowrap;
}

.segment {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  background: var(--accent);
  color: #fff;
}

.count-label {
  color: var(--muted);
  font-weight: 800;
}

.product-list {
  display: grid;
  gap: 12px;
}

.product-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.thumb-wrap {
  position: relative;
  width: 128px;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #e8eeea;
}

.product-thumb {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-wrap.has-image .product-thumb {
  display: block;
}

.thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.thumb-wrap.has-image .thumb-fallback {
  display: none;
}

.product-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.product-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.product-name {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.product-category {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.status-badge.sold {
  background: #fff7ed;
  color: var(--warn);
}

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

.product-details div {
  min-width: 0;
  padding: 10px;
  border-radius: 6px;
  background: var(--surface-soft);
}

.product-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-details dd {
  margin: 4px 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.product-notes {
  display: grid;
  gap: 8px;
}

.summary-detail,
.market-summary-detail {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.summary-detail:empty,
.market-summary-detail:empty {
  display: none;
}

.profit-positive {
  color: var(--accent-dark);
}

.profit-negative {
  color: var(--danger);
}

.card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
}

.danger-button {
  color: var(--danger);
}

.sold-button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.sold-button:hover {
  background: var(--accent-dark);
}

.caption-button,
.sold-comment-button,
.instagram-posted-button,
.website-published-button {
  color: var(--accent-dark);
}

.empty-state {
  display: none;
  padding: 44px 16px;
  text-align: center;
  color: var(--muted);
}

.empty-state h3 {
  margin-bottom: 8px;
  color: var(--ink);
}

.empty-state.show {
  display: block;
}

.empty-action {
  margin-top: 16px;
  padding-inline: 18px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .form-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  :target {
    scroll-margin-top: 122px;
  }

  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .app-header,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .app-header {
    gap: 14px;
    padding: 18px 14px 12px;
  }

  .brand-wordmark {
    width: min(100%, 380px);
    max-height: 58px;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions > * {
    flex: 1;
  }

  .header-right {
    align-items: stretch;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .mobile-quick-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px 14px;
    background: rgba(247, 243, 251, 0.96);
    border-block: 1px solid rgba(223, 212, 236, 0.9);
    backdrop-filter: blur(10px);
  }

  .mobile-quick-nav button {
    display: grid;
    place-items: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
  }

  .mobile-quick-nav button.active {
    background: var(--accent);
    color: #fff;
  }

  .workflow-strip {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 14px 0;
  }

  .workflow-strip div {
    min-height: 58px;
    padding: 10px 12px;
  }

  .workflow-strip p {
    font-size: 11px;
  }

  .layout {
    gap: 14px;
    padding: 14px 14px 28px;
  }

  .content-area {
    grid-column: 1;
    order: 2;
  }

  .form-panel {
    grid-column: 1;
    order: 1;
  }

  .form-panel,
  .summary-panel,
  .market-panel,
  .import-panel,
  .settings-panel,
  .sales-overview,
  .publishing-queue,
  .inventory-overview,
  .stock-alerts,
  .list-panel {
    padding: 14px;
  }

  .image-uploader {
    min-height: min(58vh, 360px);
    border-style: solid;
    background:
      linear-gradient(rgba(48, 0, 96, 0.06), rgba(48, 0, 96, 0.06)),
      var(--surface-soft);
    font-size: 18px;
  }

  #imagePreview {
    height: min(58vh, 360px);
  }

  .primary-button,
  .ghost-button,
  .small-button,
  input,
  select,
  textarea {
    min-height: 44px;
  }

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

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

  .import-grid {
    grid-template-columns: 1fr;
  }

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

  .settings-checklist {
    grid-template-columns: 1fr;
  }

  .settings-copy-grid {
    grid-template-columns: 1fr;
  }

  .search-action-row {
    grid-template-columns: 1fr;
  }

  .source-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-links a {
    border-radius: 6px;
  }

  .market-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .publishing-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .publishing-badges,
  .publishing-actions {
    justify-content: flex-start;
  }

  .metric {
    min-height: 78px;
    padding: 12px;
  }

  .segmented-control,
  .search-box {
    width: 100%;
    min-width: 0;
  }

  .segmented-control {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toolbar {
    gap: 10px;
    padding: 4px 0 0;
  }

  .product-card {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
  }

  .thumb-wrap {
    width: 92px;
  }

  .product-title-row,
  .card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .product-details {
    grid-template-columns: 1fr;
  }

  .small-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .field-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .mobile-quick-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding-inline: 8px;
  }

  .mobile-quick-nav button {
    min-height: 38px;
    padding-inline: 4px;
    font-size: 12px;
  }

  .segment {
    font-size: 12px;
  }

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

  .thumb-wrap {
    width: 100%;
    aspect-ratio: 16 / 10;
  }
}
