/* Multi-Sell: one stylesheet for the website and the iOS/Android apps. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --surface-3: #e9ebf0;
  --border: #e5e7ec;
  --border-strong: #d1d5dd;
  --text: #111827;
  --text-2: #374151;
  --text-muted: #6b7280;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-text: #4338ca;
  --on-accent: #ffffff;
  --ok: #15803d;
  --ok-soft: #e8f6ee;
  --warn: #a15c07;
  --warn-soft: #fff5e0;
  --error: #c0262d;
  --error-soft: #fdeceb;
  --pending: #3156c4;
  --pending-soft: #eaf0ff;
  --sold: #6d3fc0;
  --sold-soft: #f3edff;
  --muted-soft: #eff1f4;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 2px 6px rgba(17, 24, 39, 0.05);
  --shadow-lg: 0 24px 48px -16px rgba(17, 24, 39, 0.28);
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 9px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Notch / home-indicator space. Capacitor injects --safe-area-inset-* on Android; iOS and
     browsers provide env(). Both are 0 on desktop. */
  --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --sal: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
  --sar: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --surface: #171a21;
    --surface-2: #1e222b;
    --surface-3: #272c37;
    --border: #2a2f3a;
    --border-strong: #3b4251;
    --text: #eceef2;
    --text-2: #c9ced8;
    --text-muted: #9aa3b2;
    --accent: #8e88ff;
    --accent-hover: #a7a2ff;
    --accent-soft: #23224a;
    --accent-text: #b4b0ff;
    --on-accent: #0e1014;
    --ok: #4fd18e;
    --ok-soft: #12291d;
    --warn: #f3bb52;
    --warn-soft: #2d2410;
    --error: #ff8077;
    --error-soft: #341a19;
    --pending: #93b2ff;
    --pending-soft: #19233f;
    --sold: #c6a6ff;
    --sold-soft: #261c3b;
    --muted-soft: #232831;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  padding-left: var(--sal);
  padding-right: var(--sar);
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--text); }
h1 { font-size: 26px; font-weight: 720; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 660; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 640; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

.boot { min-height: 60vh; display: grid; place-items: center; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.hidden, [hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: var(--sat);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-weight: 750; font-size: 17px; letter-spacing: -0.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-muted);
  font-weight: 560; white-space: nowrap; display: flex; align-items: center; gap: 7px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav svg { display: none; }
.nav .count {
  background: var(--warn); color: #fff; font-size: 11px; font-weight: 750;
  border-radius: 999px; padding: 0 6px; line-height: 18px; min-width: 18px; text-align: center;
}
.user-menu { display: flex; align-items: center; gap: 8px; }
.page { max-width: 1200px; margin: 0 auto; padding: 28px 20px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }

.route-progress {
  position: fixed; top: 0; left: 0; z-index: 100; height: 3px; width: 0;
  background: var(--accent); opacity: 0; transition: opacity 0.2s;
}
.route-progress.on { opacity: 1; animation: route-progress 1.6s ease-out forwards; }
@keyframes route-progress { from { width: 0; } to { width: 85%; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap; line-height: 1.2;
  box-shadow: var(--shadow-sm); transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--error); }
.btn.danger:hover { background: var(--error-soft); border-color: var(--error-soft); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: 8px; gap: 5px; }
.btn.large { min-height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.small svg { width: 15px; height: 15px; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy > * { visibility: hidden; }
.btn.busy::after {
  content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--text-muted); border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
.btn.primary.busy::after { border-color: var(--on-accent); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  background: none; border: none; cursor: pointer; padding: 7px; color: var(--text-muted);
  border-radius: 9px; display: inline-grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn svg { width: 19px; height: 19px; }

.icon-chip {
  width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent-text);
}
.icon-chip.ok { background: var(--ok-soft); color: var(--ok); }
.icon-chip svg { width: 17px; height: 17px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-weight: 400; color: var(--text-muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 400; transition: border-color 0.12s, box-shadow 0.12s;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.75; }
input:disabled { background: var(--surface-2); color: var(--text-muted); }
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.counter { font-weight: 500; font-size: 12px; color: var(--text-muted); }
.counter.over { color: var(--warn); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex: none; }
.form-error { color: var(--error); font-size: 14px; }
.form-error:empty { display: none; }

/* On/off switch */
.switch {
  position: relative; width: 46px; height: 28px; flex: none; border-radius: 999px; cursor: pointer;
  border: none; padding: 0; background: var(--surface-3); transition: background 0.15s;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"] .knob { transform: translateX(18px); }
.switch:disabled { opacity: 0.6; cursor: progress; }

/* ---------- Cards & sections ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head .section-head { flex: 1; }
.section-title { margin: 32px 0 14px; display: flex; flex-direction: column; gap: 4px; }
.section-head { display: flex; align-items: center; gap: 10px; }
.section-head h2 { flex: 0 1 auto; }
.section-head .section-extra { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.step-num {
  width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 12.5px; font-weight: 750;
}

.notice { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; background: var(--surface-2); color: var(--text-2); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.error { background: var(--error-soft); color: var(--error); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.info { background: var(--accent-soft); color: var(--text); }
.notice svg { width: 18px; height: 18px; flex: none; }
.next-step, .notice-link { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.notice-link { font-weight: 600; }
.notice-link:hover { text-decoration: none; filter: brightness(0.98); }

.empty { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty p { color: var(--text-muted); max-width: 440px; margin-bottom: 10px; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 6px; }
.empty-icon.ok { background: var(--ok-soft); color: var(--ok); }
.empty-icon svg { width: 28px; height: 28px; }

/* ---------- Pills & logos ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; line-height: 20px; white-space: nowrap;
  background: var(--muted-soft); color: var(--text-muted);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.error { background: var(--error-soft); color: var(--error); }
.pill.pending { background: var(--pending-soft); color: var(--pending); }
.pill.pending::before { animation: pulse 1.2s ease-in-out infinite; }
.pill.sold { background: var(--sold-soft); color: var(--sold); }
.pill.draft { background: var(--muted-soft); color: var(--text-muted); }
@keyframes pulse { 50% { opacity: 0.3; } }
.chip { font-size: 11.5px; padding: 1px 8px; }
.mp-logo {
  width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 780; font-size: 11.5px; letter-spacing: -0.2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* ---------- Home ---------- */
.onboard { margin-bottom: 22px; overflow: hidden; }
.onboard-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 14px; }
.onboard-head p { margin-top: 3px; }
.progress { height: 6px; background: var(--surface-3); margin: 0 20px; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--ok); border-radius: 999px; transition: width 0.4s; }
.onboard-steps { list-style: none; margin: 10px 0 6px; padding: 0; }
.onboard-steps li { display: flex; align-items: center; gap: 14px; padding: 13px 20px; }
.onboard-steps li + li { border-top: 1px solid var(--border); }
.onboard-steps .check {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 2px solid var(--border-strong); color: var(--text-muted); font-weight: 700; font-size: 13px;
}
.onboard-steps .check svg { width: 16px; height: 16px; }
.onboard-steps li.current .check { border-color: var(--accent); color: var(--accent-text); }
.onboard-steps li.done .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.onboard-steps li.done h3 { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 22px; overflow: hidden; }
.stat { padding: 16px 20px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat .label { font-size: 13px; color: var(--text-muted); font-weight: 520; }
.stat .value { font-size: 24px; font-weight: 740; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .value.warn { color: var(--warn); }
.stat .value.error { color: var(--error); }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: 11px; gap: 2px; }
.tabs a { padding: 6px 14px; border-radius: 8px; color: var(--text-muted); font-weight: 600; font-size: 14px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.toolbar input[type="search"] { max-width: 300px; margin-left: auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.item-card { overflow: hidden; display: flex; flex-direction: column; color: var(--text); transition: box-shadow 0.16s, transform 0.16s; }
.item-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.thumb { aspect-ratio: 1 / 1; background: var(--surface-2); position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--border-strong); }
.thumb .placeholder svg { width: 40px; height: 40px; }
.thumb .badge-corner { position: absolute; top: 10px; left: 10px; }
.thumb .badge-corner .pill { box-shadow: var(--shadow); }
.item-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.item-title { font-weight: 620; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { font-size: 13px; color: var(--text-muted); }
.item-price { font-weight: 740; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 6px; }

/* ---------- Listing editor ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 14px; font-weight: 560; margin-bottom: 10px; }
.back svg { width: 17px; height: 17px; }
.back:hover { color: var(--text); text-decoration: none; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 22px; align-items: start; }
.editor-main { display: flex; flex-direction: column; gap: 22px; }
.side { position: sticky; top: calc(84px + var(--sat)); display: flex; flex-direction: column; gap: 18px; }
.savebar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.savebar .state { margin-right: auto; font-size: 13px; color: var(--text-muted); }
.savebar .state.dirty { color: var(--warn); font-weight: 600; }
.action-bar { display: none; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px; }
.photo { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); cursor: grab; }
.photo img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo.dragging { opacity: 0.4; }
.photo.drop-target { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo .cover { position: absolute; left: 7px; bottom: 7px; background: rgba(17, 24, 39, 0.72); color: #fff; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 99px; }
.photo .tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.photo:hover .tools, .photo:focus-within .tools { opacity: 1; }
@media (hover: none) { .photo .tools { opacity: 1; } }
.photo .tools button {
  width: 30px; height: 30px; border-radius: 8px; border: none; cursor: pointer;
  background: rgba(17, 24, 39, 0.72); color: #fff; display: grid; place-items: center; padding: 0;
}
.photo .tools button svg { width: 15px; height: 15px; }
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: 12px; aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-muted); font-size: 13.5px; font-weight: 560; cursor: pointer; text-align: center; padding: 10px; background: var(--surface-2);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.dropzone svg { width: 24px; height: 24px; }
.dropzone.wide { aspect-ratio: auto; grid-column: 1 / -1; padding: 40px 16px; font-weight: 400; }
.dropzone.wide strong { font-size: 15px; color: var(--text); }

details.more { border-top: 1px solid var(--border); padding-top: 6px; }
details.more > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; font-weight: 640; color: var(--text);
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg); transition: transform 0.15s; margin: 0 3px;
}
details.more[open] > summary::before { transform: rotate(45deg); }
details.more[open] > summary { margin-bottom: 8px; }
.subsection { padding: 14px; border-radius: var(--radius); background: var(--surface-2); }
.subsection p { margin-top: 2px; }

.mp-list { display: flex; flex-direction: column; }
.mp-row { display: flex; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--border); align-items: flex-start; }
.mp-row:first-child { border-top: none; }
.mp-row.disabled { opacity: 0.55; }
.mp-row .mp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mp-row .mp-name { font-weight: 620; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; }
.mp-row .mp-error { color: var(--error); font-size: 13px; overflow-wrap: anywhere; }
.mp-row .mp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.mp-row label.pick { display: flex; align-items: center; gap: 12px; cursor: pointer; flex: 1; margin: -4px 0; padding: 4px 0; }
.mp-row label.pick .mp-main { gap: 0; }
.mp-row label.pick .mp-name { min-height: 0; }
.side-foot { padding: 16px 20px 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.readiness { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: var(--radius-sm); }
.readiness svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.sold-banner { padding: 15px 20px; background: var(--sold-soft); color: var(--sold); border-radius: var(--radius-lg) var(--radius-lg) 0 0; font-weight: 620; }

.activity { list-style: none; margin: 0; padding: 4px 0; }
.activity li { padding: 10px 20px; font-size: 13.5px; display: flex; gap: 11px; align-items: flex-start; }
.activity li + li { border-top: 1px solid var(--border); }
.activity .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--border-strong); }
.activity .dot.success { background: var(--ok); }
.activity .dot.warn { background: var(--warn); }
.activity .dot.error { background: var(--error); }
.activity time { color: var(--text-muted); font-size: 12px; white-space: nowrap; margin-top: 1px; }

/* ---------- Connections ---------- */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.conn { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.conn.on { border-color: var(--border-strong); border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.conn-head { display: flex; align-items: center; gap: 12px; }
.conn-head .mp-logo { width: 42px; height: 42px; font-size: 14px; border-radius: 12px; }
.conn dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.conn dt { color: var(--text-muted); }
.conn dd { margin: 0; overflow-wrap: anywhere; font-weight: 520; }
.conn .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.helper-list { list-style: none; margin: 0; padding: 4px 0; }
.helper-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
.helper-row + .helper-row { border-top: 1px solid var(--border); }
.helper-name { font-weight: 620; }
.helper-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; }

/* ---------- To-do ---------- */
.task-group.warn { border-color: var(--border-strong); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.task-group.warn .card-head { background: var(--warn-soft); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.task-group.warn .card-head h2 { color: var(--warn); }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 14px; padding: 13px 20px; }
.task + .task { border-top: 1px solid var(--border); }
.task .thumb-sm { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: none; display: grid; place-items: center; color: var(--border-strong); }
.task .thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.task-title { display: flex; align-items: center; gap: 8px; }
.task-title .mp-logo { width: 22px; height: 22px; font-size: 9px; border-radius: 6px; }

/* ---------- Settings & help ---------- */
.settings-form { max-width: 640px; width: 100%; }
.link-list { display: flex; flex-direction: column; overflow: hidden; }
.link-list > a, .link-list > button {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px; color: var(--text); font-weight: 560;
  background: none; border: none; text-align: left; cursor: pointer; width: 100%;
}
.link-list > * + * { border-top: 1px solid var(--border); }
.link-list > a:hover, .link-list > button:hover { background: var(--surface-2); text-decoration: none; }
.link-list svg { width: 19px; height: 19px; color: var(--text-muted); flex: none; }

.how { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.how-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.how-cards > li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.how-cards p { color: var(--text-muted); font-size: 14px; margin-top: 5px; }
.how-icon { position: relative; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.how-icon svg { width: 23px; height: 23px; }
.how-num {
  position: absolute; top: -7px; right: -7px; width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 760; box-shadow: 0 0 0 3px var(--surface);
}
.how-compact { gap: 14px; }
.how-compact > li { display: flex; gap: 14px; align-items: flex-start; }
.how-compact .how-icon { width: 40px; height: 40px; border-radius: 12px; }
.how-compact .how-icon svg { width: 20px; height: 20px; }
.how-compact h3 { font-size: 15px; }
.how-compact p { font-size: 13.5px; color: var(--text-muted); margin-top: 2px; }

.faq details { padding: 0 20px; }
.faq details + details { border-top: 1px solid var(--border); }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 620; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-muted); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 16px; color: var(--text-2); }
.help-actions { margin-top: 22px; }

/* ---------- Sign in / sign up ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 0.9fr) 1.1fr; }
.auth-aside {
  padding: calc(40px + var(--sat)) 48px 40px; display: flex; flex-direction: column; gap: 28px;
  background: linear-gradient(160deg, #4f46e5 0%, #3b2fc9 55%, #2a1f9e 100%); color: #fff;
}
.auth-aside .brand { color: #fff; }
.auth-aside h2 { color: #fff; font-size: 30px; font-weight: 760; letter-spacing: -0.02em; line-height: 1.15; max-width: 440px; text-wrap: balance; }
.auth-aside .how-icon { background: rgba(255, 255, 255, 0.14); color: #fff; }
.auth-aside .how-num { background: #fff; color: #3b2fc9; box-shadow: 0 0 0 3px #3b2fc9; }
.auth-aside h3 { color: #fff; }
.auth-aside .how-compact p { color: rgba(255, 255, 255, 0.78); }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: calc(32px + var(--sat)) 20px calc(32px + var(--sab)); position: relative; }
.auth-main > .back { position: absolute; top: calc(20px + var(--sat)); left: 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { width: 48px; height: 48px; margin-bottom: 18px; display: none; }
.auth-card h1 { font-size: 28px; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-muted); margin-bottom: 26px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card form .btn { margin-top: 4px; }
.auth-alt { text-align: center; margin-top: 22px; font-size: 14px; color: var(--text-muted); }
.auth-alt a { font-weight: 600; }
.social-signin { display: grid; gap: 10px; margin-bottom: 18px; }
.social-btn { justify-content: center; gap: 10px; }
.social-btn svg { width: 20px; height: 20px; flex: none; }
.social-btn.apple { background: var(--text); color: var(--surface); border-color: var(--text); }
.or-divider { display: flex; align-items: center; gap: 12px; margin-top: 8px; color: var(--text-muted); font-size: 13px; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.auth-terms { text-align: center; margin-top: 12px; font-size: 13px; color: var(--text-muted); }

/* ---------- Welcome (website) ---------- */
.landing { overflow-x: hidden; }
.landing-top {
  max-width: 1160px; margin: 0 auto; padding: calc(18px + var(--sat)) 24px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.hero {
  max-width: 1160px; margin: 0 auto; padding: 48px 24px 72px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
}
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; color: var(--accent-text); background: var(--accent-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(40px, 5.2vw, 60px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; }
.lead { font-size: 18px; color: var(--text-2); margin-top: 18px; max-width: 540px; line-height: 1.6; }
.cta-row { margin: 28px 0 14px; gap: 12px; }
.hero-art { position: relative; padding: 10px 10px 76px; isolation: isolate; }
.hero-art::before {
  content: ""; position: absolute; inset: 0 -40px 0 30px; border-radius: 40px; z-index: -1;
  background: radial-gradient(circle at 70% 30%, var(--accent-soft), transparent 65%);
}
.mock-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; max-width: 380px; margin-left: auto; transform: rotate(1.5deg); }
.mock-photo {
  aspect-ratio: 16 / 10; position: relative;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 120'%3E%3Cpath d='M27 8h46l7 104H59L50 42l-9 70H20z' fill='%233a5aa8'/%3E%3Cpath d='M27 8h46v9H27z' fill='%232f4a8f'/%3E%3Cpath d='M50 17v20M33 22c3 6 9 8 14 8M67 22c-3 6-9 8-14 8' stroke='%23c9a35b' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") center 58% / auto 78% no-repeat,
    linear-gradient(160deg, #eef1f7, #dfe5f0);
}
.mock-badge { position: absolute; left: 14px; top: 14px; background: rgba(255, 255, 255, 0.92); color: #111827; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; z-index: 1; }
.mock-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.mock-site { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 560; }
.mock-site .mp-logo { width: 26px; height: 26px; font-size: 9.5px; border-radius: 7px; }
.mock-toast {
  position: absolute; left: 0; bottom: 0; display: flex; align-items: center; gap: 10px; max-width: 330px;
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14px;
}
.mock-toast svg { width: 20px; height: 20px; flex: none; color: #4fd18e; }
.landing-section { max-width: 1160px; margin: 0 auto; padding: 24px 24px 56px; }
.landing-section > h2 { font-size: 30px; font-weight: 760; letter-spacing: -0.02em; margin-bottom: 24px; }
.site-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.site-groups .card { display: flex; flex-direction: column; gap: 10px; }
.site-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.site-list li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.site-list .mp-logo { width: 26px; height: 26px; font-size: 9.5px; border-radius: 50%; }
.cta-band {
  max-width: 1112px; margin: 8px auto 48px; padding: 44px 32px; border-radius: 24px; text-align: center;
  background: linear-gradient(135deg, #4f46e5, #3b2fc9); color: #fff; display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.cta-band h2 { color: #fff; font-size: 28px; font-weight: 760; letter-spacing: -0.02em; }
.cta-band .btn.primary { background: #fff; color: #3b2fc9; border-color: #fff; }
.landing-foot { text-align: center; padding: 0 24px calc(32px + var(--sab)); }

/* ---------- Welcome (phone app) ---------- */
.app-welcome {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  padding: calc(36px + var(--sat)) 24px calc(24px + var(--sab));
  background: linear-gradient(180deg, var(--accent-soft), var(--bg) 45%);
}
.app-welcome-logo { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow-lg); margin-bottom: 26px; }
.app-welcome h1 { font-size: 36px; line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; }
.app-welcome .lead { font-size: 16px; margin: 14px 0 28px; }
.app-welcome-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9, 11, 16, 0.5); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto;
  padding: calc(6vh + var(--sat)) 16px calc(6vh + var(--sab));
  animation: fade-in 0.15s ease-out;
}
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: rise-in 0.18s ease-out; }
.modal.wide { max-width: 720px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } }

.copy-field { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.copy-field .copy-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 14px; background: var(--surface-2); font-size: 13px; font-weight: 650; color: var(--text-muted); }
.copy-field .copy-value { padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow-y: auto; font-size: 14.5px; }
.copy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.copy-mini { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 6px 8px 12px; display: flex; align-items: center; gap: 6px; }
.copy-mini .k { font-size: 12px; color: var(--text-muted); }
.copy-mini .v { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.photo-strip > * { aspect-ratio: 1 / 1; border-radius: 9px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; color: var(--text-2); }

/* ---------- Toasts ---------- */
#toasts {
  position: fixed; bottom: calc(20px + var(--sab)); left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.toast {
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 560; animation: rise-in 0.2s ease-out; pointer-events: auto;
}
.toast.error { background: var(--error); color: #fff; }

/* ---------- Tablets ---------- */
@media (max-width: 980px) {
  .editor { grid-template-columns: 1fr; }
  .side { position: static; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 24px; }
  .mock-card { margin: 0 auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-logo { display: block; }
}

/* ---------- Phones: app-style layout ---------- */
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  h1 { font-size: 24px; }
  /* backdrop-filter would make the fixed tab bar position itself inside the header */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .topbar-inner { height: 54px; padding: 0 16px; justify-content: space-between; }
  .user-menu .email, .user-menu .btn { display: none; }

  /* bottom tab bar */
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--border);
    padding: 6px calc(6px + var(--sar)) calc(6px + var(--sab)) calc(6px + var(--sal));
  }
  .nav a { position: relative; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 2px; font-size: 11px; font-weight: 650; border-radius: 10px; }
  .nav a.active, .nav a:hover { background: transparent; }
  .nav a.active svg { stroke-width: 2.4; }
  .nav svg { display: block; width: 24px; height: 24px; }
  .nav .count { position: absolute; top: 0; left: calc(50% + 6px); font-size: 10px; padding: 0 5px; line-height: 17px; min-width: 17px; }
  body[data-layout="detail"] .nav { display: none; }

  .page { padding: 18px 16px calc(100px + var(--sab)); }
  .page-head { margin-bottom: 18px; }
  #toasts { bottom: calc(88px + var(--sab)); }

  .card-pad { padding: 18px 16px; }
  .card-head, .mp-row, .side-foot, .activity li, .task, .helper-row, .onboard-steps li, .link-list > a, .link-list > button { padding-left: 16px; padding-right: 16px; }
  .onboard-head { padding: 18px 16px 12px; }
  .progress { margin: 0 16px; }
  .onboard-steps li { flex-wrap: wrap; }
  .onboard-steps li .btn { margin-left: 44px; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 12px 16px; }
  .stat + .stat { border-left: none; }
  .stat:nth-child(even) { border-left: 1px solid var(--border); }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .stat .value { font-size: 20px; }
  .toolbar input[type="search"] { max-width: none; margin-left: 0; }
  .tabs { width: 100%; }
  .tabs a { flex: 1; text-align: center; padding: 7px 4px; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .item-body { padding: 10px 11px 12px; }
  .item-title { font-size: 14px; }
  .item-card:hover { transform: none; }

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

  /* the listing screen gets a pinned Save / Publish bar instead of the tab bar */
  body[data-layout="detail"] .page { padding-bottom: calc(96px + var(--sab)); }
  body[data-layout="detail"] #toasts { bottom: calc(84px + var(--sab)); }
  .action-bar {
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px calc(16px + var(--sar)) calc(10px + var(--sab)) calc(16px + var(--sal));
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--border);
  }
  .action-bar .btn { min-height: 48px; font-size: 16px; }
  .savebar .btn.primary { display: none; }

  .conn-grid { grid-template-columns: 1fr; }
  .task { flex-wrap: wrap; }
  .task .row.actions { width: 100%; justify-content: flex-end; }

  .hero h1 { font-size: 42px; }
  .landing-top { padding-left: 16px; padding-right: 16px; }
  .landing-top .btn.ghost { display: none; }
  .landing-top .btn { min-height: 40px; }
  .hero { padding-left: 16px; padding-right: 16px; }
  .landing-section { padding-left: 16px; padding-right: 16px; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .lead { font-size: 16.5px; }
  .landing-section > h2 { font-size: 24px; }
  .cta-band { margin: 8px 16px 40px; padding: 32px 20px; }
  .cta-band h2 { font-size: 22px; }

  .modal-backdrop { padding: calc(12px + var(--sat)) 0 0; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: calc(100vh - 12px - var(--sat)); overflow-y: auto; padding-bottom: var(--sab); animation: sheet-in 0.22s ease-out; }
  .modal-head { position: sticky; top: 0; background: var(--surface); z-index: 1; border-radius: 20px 20px 0 0; }
  .modal-foot { position: sticky; bottom: 0; background: var(--surface); }
  .modal-foot .btn { flex: 1; min-height: 46px; }

  /* touch targets and no zoom-on-focus in iOS (inputs must be 16px+) */
  .btn { min-height: 44px; }
  .btn.small { min-height: 36px; }
  input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], select, textarea { font-size: 16px; min-height: 46px; }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0.6; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.boot img { width: 52px; height: 52px; animation: pulse 1.2s ease-in-out infinite; }
.modal:focus { outline: none; }
