/* checkin-setup-v1 — visitor check-in advertiser settings. Self-contained. */

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input { font: inherit; color: inherit; }

/* ============ APP SHELL ============ */
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 720px);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* ============ SIDEBAR ============ */
.sidebar { position: sticky; top: 24px; height: calc(100vh - 48px); display: flex; flex-direction: column; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 14px; font-size: 32px; font-weight: 800; margin-bottom: 36px; color: var(--text); }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.sidebar nav { display: flex; flex-direction: column; gap: 8px; }
.sidebar nav a {
  padding: 14px 18px;
  color: var(--text-soft);
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.sidebar nav a.active,
.sidebar nav a:hover {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
}
.new-post {
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-text);
  font-weight: 700;
  padding: 14px 22px;
  font-size: 16px;
}

/* ============ MAIN ============ */
.main { min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; min-height: 44px; gap: 12px;
}
.topbar .back {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  font-size: 22px; color: var(--text);
}
.topbar h1 { font-size: 26px; margin: 0; font-weight: 700; letter-spacing: -0.01em; flex: 1; }
.topbar-brand { display: none; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.topbar-brand img { width: 24px; height: 24px; object-fit: contain; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 18px 22px;
  margin-bottom: 14px;
}

/* ============ OWNER ============ */
.owner-card {
  background: linear-gradient(135deg, #fce7f3, #fde68a);
  border: 1px solid rgba(236, 72, 153, 0.18);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.owner-row { display: flex; align-items: center; gap: 14px; }
.owner-row .avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  flex-shrink: 0;
}
.owner-who { flex: 1; min-width: 0; }
.owner-who small {
  display: block; font-size: 11px; color: #9d174d; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.owner-who b { display: block; font-size: 16px; font-weight: 800; color: #831843; margin-top: 2px; }
.active-pill {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.active-pill.paused {
  background: rgba(245, 158, 11, 0.18);
  color: var(--warning);
}

/* ============ SECTION HEAD ============ */
.sec-head { margin-bottom: 14px; }
.sec-head h2 { font-size: 15px; margin: 0; font-weight: 700; }
.sec-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ============ SETUP ROW (label + input) ============ */
.setup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.setup-row:last-of-type { border-bottom: 0; }
.setup-label b { display: block; font-size: 14px; font-weight: 700; }
.setup-label small { display: block; font-size: 11px; color: var(--text-soft); margin-top: 2px; }

.setup-input {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.setup-input input {
  width: 100px;
  background: var(--surface-soft);
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 10px;
  text-align: right;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.setup-input input:focus { border-color: var(--primary); background: var(--surface); }
.setup-input input::-webkit-outer-spin-button,
.setup-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.setup-input input[type="number"] { -moz-appearance: textfield; }
.setup-input .suffix {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
}
.setup-input .equiv {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ============ RADIO GROUP ============ */
.radio-group { display: flex; flex-direction: column; gap: 4px; }
.radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.radio-row:hover { background: var(--surface-soft); }
.radio-row input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.radio-row .rr-box {
  width: 20px; height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  flex-shrink: 0;
  transition: border-color 0.15s;
  position: relative;
}
.radio-row input:checked + .rr-box {
  border-color: var(--primary);
}
.radio-row input:checked + .rr-box::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--primary);
}
.radio-row .rr-text { min-width: 0; flex: 1; }
.radio-row .rr-text b { display: block; font-size: 14px; font-weight: 700; }
.radio-row .rr-text small { display: block; font-size: 11px; color: var(--text-soft); margin-top: 2px; }

.sub-panel {
  margin: 4px 0 10px 36px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border-radius: 10px;
}
.sub-panel[hidden] { display: none !important; }

.country-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
.country-toolbar .ct-count {
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.country-toolbar .ct-count b { color: var(--primary-dark); }
.country-toolbar .ct-actions { display: flex; gap: 6px; }
.country-toolbar .ct-btn {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.country-toolbar .ct-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}
.country-grid::-webkit-scrollbar { width: 8px; }
.country-grid::-webkit-scrollbar-track { background: transparent; }
.country-grid::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
  border: 2px solid var(--surface);
}
.country-grid::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.country-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  outline: none;
}
.country-chip:focus-visible {
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.country-chip .cc-tick {
  display: inline-grid;
  place-items: center;
  width: 14px; height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  color: transparent;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.country-chip.checked {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}
.country-chip.checked .cc-tick {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.addr-wrap {
  position: relative;
  margin-bottom: 10px;
}
.addr-input {
  width: 100%;
  padding: 10px 42px 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.addr-input:focus { border-color: var(--primary); }
.addr-locate {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s;
}
.addr-locate:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.addr-locate.loading {
  pointer-events: none;
  color: var(--primary);
}
.addr-locate.loading svg {
  animation: addr-spin 0.9s linear infinite;
}
@keyframes addr-spin {
  to { transform: rotate(360deg); }
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.slider-row small { color: var(--text-soft); font-size: 12px; font-weight: 600; }
.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}
.slider-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  min-width: 70px;
  text-align: right;
}
.slider-val b { color: var(--primary-dark); font-weight: 800; font-size: 14px; }

.addr-map {
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.addr-map iframe {
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
}
.addr-map .map-foot {
  margin: 0;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-soft);
  line-height: 1.5;
  border-top: 1px solid var(--line);
}
.addr-map .map-foot svg { display: inline; vertical-align: -1px; }
.addr-map[hidden] { display: none !important; }

/* ============ PILL GROUP (gender) ============ */
.pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill-group .pill {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-weight: 700;
  font-size: 13px;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.pill-group .pill:hover { background: var(--primary-soft); color: var(--primary-dark); }
.pill-group .pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============ AGE RANGE ============ */
.age-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.age-range input {
  width: 64px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 10px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.age-range input:focus { border-color: var(--primary); }
.age-range input::-webkit-outer-spin-button,
.age-range input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.age-range input[type="number"] { -moz-appearance: textfield; }
.age-range .range-sep {
  color: var(--text-muted);
  font-weight: 700;
}
.age-range .age-unit {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
  margin-left: 2px;
}

/* ============ COLOR PICKER ============ */
.setup-row.stack {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text);
}
.color-swatch.active::after {
  content: "";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / 60% no-repeat;
}
.color-swatch[data-color="rose"]    { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.color-swatch[data-color="red"]     { background: linear-gradient(135deg, #ef4444, #dc2626); }
.color-swatch[data-color="orange"]  { background: linear-gradient(135deg, #f97316, #ea580c); }
.color-swatch[data-color="amber"]   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.color-swatch[data-color="gold"]    { background: linear-gradient(135deg, #eab308, #ca8a04); }
.color-swatch[data-color="sunset"]  { background: linear-gradient(135deg, #fb923c, #f43f5e 55%, #a855f7); }
.color-swatch[data-color="lime"]    { background: linear-gradient(135deg, #84cc16, #65a30d); }
.color-swatch[data-color="emerald"] { background: linear-gradient(135deg, #10b981, #059669); }
.color-swatch[data-color="teal"]    { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.color-swatch[data-color="cyan"]    { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.color-swatch[data-color="sky"]     { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.color-swatch[data-color="indigo"]  { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.color-swatch[data-color="violet"]  { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.color-swatch[data-color="fuchsia"] { background: linear-gradient(135deg, #d946ef, #c026d3); }
.color-swatch[data-color="pink"]    { background: linear-gradient(135deg, #ec4899, #db2777); }
.color-swatch[data-color="slate"]   { background: linear-gradient(135deg, #475569, #334155); }

/* ============ TOGGLE SWITCH ============ */
.switch {
  width: 44px; height: 26px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
  cursor: pointer;
}
.switch[aria-checked="true"] { background: var(--primary); }
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 0.2s;
}
.switch[aria-checked="true"] .switch-thumb { transform: translateX(18px); }

/* ============ CHECKIN PREVIEW (matches profile-v1 block style) ============ */
.checkin-preview {
  margin-top: 14px;
  padding: 14px;
  background: var(--surface-soft);
  border-radius: 12px;
}
.cp-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-align: center;
}
.checkin-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--cb-bg, linear-gradient(135deg, #e0e7ff, #c7d2fe));
  border: 1px solid var(--cb-border, rgba(99, 102, 241, 0.22));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: background 0.2s, border-color 0.2s;
}
.checkin-block .checkin-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.checkin-block .checkin-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-c1), var(--cb-c2));
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--cb-shadow);
}
.checkin-block .checkin-icon[hidden] { display: none; }
.checkin-block .checkin-text { min-width: 0; }
.checkin-block .checkin-text b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--cb-text);
}
.checkin-block .checkin-text b span { color: var(--cb-text-soft); font-weight: 800; }
.checkin-block .checkin-text small {
  display: block;
  font-size: 11px;
  color: var(--cb-text-soft);
  opacity: 0.85;
  margin-top: 2px;
}
.checkin-block .checkin-text small[hidden] { display: none; }
.checkin-block .checkin-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cb-c1), var(--cb-c2-dark));
  color: white;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 12px var(--cb-shadow);
  transition: transform 0.05s;
}
.checkin-block .checkin-btn:hover { transform: translateY(-1px); }

.checkin-block[data-color="indigo"] {
  --cb-bg: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  --cb-border: rgba(99, 102, 241, 0.22);
  --cb-c1: #6366f1; --cb-c2: #4f46e5; --cb-c2-dark: #4338ca;
  --cb-shadow: rgba(99, 102, 241, 0.4);
  --cb-text: #312e81; --cb-text-soft: #4338ca;
}
.checkin-block[data-color="pink"] {
  --cb-bg: linear-gradient(135deg, #fce7f3, #fbcfe8);
  --cb-border: rgba(219, 39, 119, 0.18);
  --cb-c1: #ec4899; --cb-c2: #db2777; --cb-c2-dark: #be185d;
  --cb-shadow: rgba(219, 39, 119, 0.4);
  --cb-text: #831843; --cb-text-soft: #9d174d;
}
.checkin-block[data-color="emerald"] {
  --cb-bg: linear-gradient(135deg, #d1fae5, #a7f3d0);
  --cb-border: rgba(16, 185, 129, 0.22);
  --cb-c1: #10b981; --cb-c2: #059669; --cb-c2-dark: #047857;
  --cb-shadow: rgba(16, 185, 129, 0.4);
  --cb-text: #064e3b; --cb-text-soft: #047857;
}
.checkin-block[data-color="amber"] {
  --cb-bg: linear-gradient(135deg, #fef3c7, #fde68a);
  --cb-border: rgba(245, 158, 11, 0.22);
  --cb-c1: #f59e0b; --cb-c2: #d97706; --cb-c2-dark: #b45309;
  --cb-shadow: rgba(245, 158, 11, 0.4);
  --cb-text: #78350f; --cb-text-soft: #b45309;
}
.checkin-block[data-color="sky"] {
  --cb-bg: linear-gradient(135deg, #e0f2fe, #bae6fd);
  --cb-border: rgba(14, 165, 233, 0.22);
  --cb-c1: #0ea5e9; --cb-c2: #0284c7; --cb-c2-dark: #0369a1;
  --cb-shadow: rgba(14, 165, 233, 0.4);
  --cb-text: #0c4a6e; --cb-text-soft: #0369a1;
}
.checkin-block[data-color="slate"] {
  --cb-bg: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  --cb-border: rgba(71, 85, 105, 0.22);
  --cb-c1: #475569; --cb-c2: #334155; --cb-c2-dark: #1e293b;
  --cb-shadow: rgba(15, 23, 42, 0.3);
  --cb-text: #1e293b; --cb-text-soft: #334155;
}
.checkin-block[data-color="rose"] {
  --cb-bg: linear-gradient(135deg, #ffe4e6, #fecdd3);
  --cb-border: rgba(244, 63, 94, 0.22);
  --cb-c1: #f43f5e; --cb-c2: #e11d48; --cb-c2-dark: #be123c;
  --cb-shadow: rgba(244, 63, 94, 0.4);
  --cb-text: #881337; --cb-text-soft: #be123c;
}
.checkin-block[data-color="red"] {
  --cb-bg: linear-gradient(135deg, #fee2e2, #fecaca);
  --cb-border: rgba(239, 68, 68, 0.22);
  --cb-c1: #ef4444; --cb-c2: #dc2626; --cb-c2-dark: #b91c1c;
  --cb-shadow: rgba(239, 68, 68, 0.4);
  --cb-text: #7f1d1d; --cb-text-soft: #b91c1c;
}
.checkin-block[data-color="orange"] {
  --cb-bg: linear-gradient(135deg, #ffedd5, #fed7aa);
  --cb-border: rgba(249, 115, 22, 0.22);
  --cb-c1: #f97316; --cb-c2: #ea580c; --cb-c2-dark: #c2410c;
  --cb-shadow: rgba(249, 115, 22, 0.4);
  --cb-text: #7c2d12; --cb-text-soft: #c2410c;
}
.checkin-block[data-color="gold"] {
  --cb-bg: linear-gradient(135deg, #fef9c3, #fef08a);
  --cb-border: rgba(234, 179, 8, 0.22);
  --cb-c1: #eab308; --cb-c2: #ca8a04; --cb-c2-dark: #a16207;
  --cb-shadow: rgba(234, 179, 8, 0.4);
  --cb-text: #713f12; --cb-text-soft: #a16207;
}
.checkin-block[data-color="sunset"] {
  --cb-bg: linear-gradient(135deg, #ffedd5, #fce7f3 55%, #f3e8ff);
  --cb-border: rgba(244, 63, 94, 0.24);
  --cb-c1: #fb923c; --cb-c2: #f43f5e; --cb-c2-dark: #a855f7;
  --cb-shadow: rgba(244, 63, 94, 0.4);
  --cb-text: #9a3412; --cb-text-soft: #be123c;
}
.checkin-block[data-color="lime"] {
  --cb-bg: linear-gradient(135deg, #ecfccb, #d9f99d);
  --cb-border: rgba(132, 204, 22, 0.22);
  --cb-c1: #84cc16; --cb-c2: #65a30d; --cb-c2-dark: #4d7c0f;
  --cb-shadow: rgba(132, 204, 22, 0.4);
  --cb-text: #3f6212; --cb-text-soft: #4d7c0f;
}
.checkin-block[data-color="teal"] {
  --cb-bg: linear-gradient(135deg, #ccfbf1, #99f6e4);
  --cb-border: rgba(20, 184, 166, 0.22);
  --cb-c1: #14b8a6; --cb-c2: #0d9488; --cb-c2-dark: #0f766e;
  --cb-shadow: rgba(20, 184, 166, 0.4);
  --cb-text: #134e4a; --cb-text-soft: #0f766e;
}
.checkin-block[data-color="cyan"] {
  --cb-bg: linear-gradient(135deg, #cffafe, #a5f3fc);
  --cb-border: rgba(6, 182, 212, 0.22);
  --cb-c1: #06b6d4; --cb-c2: #0891b2; --cb-c2-dark: #0e7490;
  --cb-shadow: rgba(6, 182, 212, 0.4);
  --cb-text: #164e63; --cb-text-soft: #0e7490;
}
.checkin-block[data-color="violet"] {
  --cb-bg: linear-gradient(135deg, #ede9fe, #ddd6fe);
  --cb-border: rgba(139, 92, 246, 0.22);
  --cb-c1: #8b5cf6; --cb-c2: #7c3aed; --cb-c2-dark: #6d28d9;
  --cb-shadow: rgba(139, 92, 246, 0.4);
  --cb-text: #4c1d95; --cb-text-soft: #6d28d9;
}
.checkin-block[data-color="fuchsia"] {
  --cb-bg: linear-gradient(135deg, #fae8ff, #f5d0fe);
  --cb-border: rgba(217, 70, 239, 0.22);
  --cb-c1: #d946ef; --cb-c2: #c026d3; --cb-c2-dark: #a21caf;
  --cb-shadow: rgba(217, 70, 239, 0.4);
  --cb-text: #701a75; --cb-text-soft: #a21caf;
}

/* ============ MD EDITOR ============ */
.md-editor {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.md-tabs {
  display: flex;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
.md-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.md-tab:hover { color: var(--text); }
.md-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
  background: var(--surface);
}

.md-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.md-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.12s, color 0.12s;
}
.md-btn:hover { background: var(--primary-soft); color: var(--primary-dark); }
.md-btn b, .md-btn i { font-size: 14px; }
.md-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
}

.md-textarea {
  width: 100%;
  min-height: 200px;
  padding: 14px 16px;
  border: 0;
  outline: none;
  font: inherit;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
}
.md-textarea[hidden] { display: none !important; }

.md-preview {
  padding: 16px;
  background: var(--surface-soft);
}
.md-preview[hidden] { display: none !important; }
.md-preview-shell {
  background: var(--surface);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--line);
}
.md-body {
  text-align: left;
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
}
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }
.md-body h1, .md-body h2, .md-body h3 {
  margin: 14px 0 6px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.md-body h1 { font-size: 20px; }
.md-body h2 { font-size: 17px; }
.md-body h3 { font-size: 15px; }
.md-body p { margin: 8px 0; }
.md-body ul, .md-body ol { padding-left: 22px; margin: 8px 0; }
.md-body li { margin: 3px 0; }
.md-body blockquote {
  margin: 10px 0;
  padding: 6px 14px;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text-soft);
}
.md-body blockquote p { margin: 4px 0; }
.md-body strong { color: var(--primary-dark); font-weight: 800; }
.md-body em { color: var(--text-soft); }
.md-body code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-soft);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
}
.md-body hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 14px 0;
}
.md-body .md-empty {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}
.mp-foot {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ============ BOTTOM ACTIONS ============ */
.bottom-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.btn-primary, .btn-secondary {
  padding: 13px 20px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  transition: background 0.15s, transform 0.05s;
}
.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface-soft);
  color: var(--text-soft);
}
.btn-secondary:hover { background: var(--line); color: var(--text); }

/* ============ TOAST ============ */
.ck-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 0.2s, transform 0.2s;
}
.ck-toast.show { opacity: 0.92; transform: translate(-50%, 0); }
.ck-toast[hidden] { display: none !important; }

/* ============ MOBILE NAV ============ */
.mobile-nav { display: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); padding: 16px; gap: 18px; }
}

@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .sidebar { display: none; }
  .main { padding: 14px 16px 100px; }
  .topbar { padding: 4px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
  .topbar .back { display: inline-flex; }
  .topbar h1 { font-size: 18px; text-align: center; }
  .topbar-brand { display: none; }
  .setup-row { flex-direction: column; align-items: stretch; }
  .setup-input { align-items: flex-start; }

  .mobile-nav {
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 10px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 20;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
  }
  .mobile-nav.nav-hidden {
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
  }
  .mobile-nav a { text-align: center; font-size: 12px; color: var(--text-soft); padding: 8px 4px; }
  .mobile-nav a.active { color: var(--text); font-weight: 600; }
  .mobile-nav .compose-btn {
    width: 46px; height: 46px;
    margin: auto; padding: 0;
    border-radius: 50%;
    background: var(--cta-bg); color: var(--cta-text);
    display: grid; place-items: center; line-height: 1;
  }
}

/* ============ PPA-SETUP ADDITIONS ============ */
/* Price quick chips */
.price-chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.price-chips .pc {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.price-chips .pc:hover { border-color: var(--primary); color: var(--primary-dark); }
.price-chips .pc.active { background: var(--primary); border-color: var(--primary); color: white; }

/* Category multi-select (reuses .pill-group visuals, multi-select behavior) */
.cat-count { font-size: 12px; color: var(--text-soft); margin: 0 0 10px; }
.cat-count b { color: var(--primary-dark); }
.cat-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.6;
}
.cat-note b { color: var(--text); }

/* Adult gate hint */
.adult-gate {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  line-height: 1.6;
}
.adult-gate b { color: #78350f; }

/* Profile About-card preview (mirrors profile-v1 .about-ppa) */
.ppa-preview { margin-top: 6px; }
.ppa-preview .cp-label { display: block; font-size: 11px; font-weight: 700; color: var(--text-soft); margin-bottom: 8px; letter-spacing: 0.04em; }
.pv-card {
  display: block;
  padding: 18px 22px;
  background: linear-gradient(180deg, var(--surface), var(--primary-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.pv-card .ppa-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.pv-card h3 { margin: 0; font-size: 16px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.pv-card h3::before {
  content: "AI";
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}
.pv-card .ppa-price { display: inline-flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.pv-card .ppa-price b { font-size: 20px; font-weight: 800; }
.pv-card .ppa-price small { font-size: 12px; color: var(--text-soft); font-weight: 700; }
.pv-card p { margin: 0 0 14px; font-size: 14px; line-height: 1.65; color: var(--text); }
.pv-card .ppa-cta {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 14px;
}
.ppa-preview.off .pv-card { filter: grayscale(1); opacity: 0.55; }
.pv-off-pill {
  display: none;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}
.ppa-preview.off .pv-off-pill { display: block; }

/* ============ PPA-INBOX ADDITIONS ============ */
/* Stats summary */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.stat-grid .st {
  padding: 12px 10px;
  border-radius: 12px;
  background: var(--surface-soft);
  text-align: center;
}
.stat-grid .st b { display: block; font-size: 18px; letter-spacing: -0.02em; }
.stat-grid .st b.earn { color: var(--primary-dark); }
.stat-grid .st small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-soft); }
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Filter pills */
.q-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.q-filters .pill { cursor: pointer; }

/* Question cards (standalone, outside the list card) */
.q-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.q-card { padding: 16px 18px; margin-bottom: 0; }
.q-head { display: flex; align-items: center; gap: 10px; }
.q-head .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.q-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.q-who b { font-size: 14.5px; }
.q-who small { font-size: 12px; color: var(--text-soft); }
.q-chip {
  font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.q-chip.waiting { background: #fef3c7; color: #b45309; }
.q-chip.review  { background: var(--primary-soft); color: var(--primary-dark); }
.q-chip.paid    { background: #dcfce7; color: #15803d; }
.q-chip.half    { background: #e0f2fe; color: #0369a1; }
.q-chip.refunded { background: #f1f5f9; color: #64748b; }

.q-text { margin: 12px 0 0; font-size: 14.5px; line-height: 1.55; }
.q-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--text-soft); }
.q-meta b { color: var(--text); }

/* Answer block (already answered) */
.q-answer {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  border-left: 3px solid var(--primary);
  font-size: 14px; line-height: 1.55;
}
.q-answer small { display: block; margin-top: 6px; font-size: 12px; color: var(--text-soft); }

/* Score / settlement line */
.q-score {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px; font-weight: 600;
}
.q-settle { margin-top: 10px; font-size: 13px; font-weight: 600; color: #15803d; }
.q-settle.half { color: #0369a1; }
.q-settle.refund { color: #64748b; }

/* Answer entry (links to ppa-answer-v1) */
.q-actions { margin-top: 12px; }
.q-actions .answer-btn {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: center;
  border-radius: 999px;
  font-weight: 700; font-size: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.q-empty {
  padding: 36px;
  text-align: center;
  color: var(--text-soft);
  font-size: 14px;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
}

.q-head .avatar.g1 { background: linear-gradient(135deg, var(--primary), var(--ai)); }
.q-head .avatar.g2 { background: linear-gradient(135deg, var(--ai), var(--info)); }
.q-head .avatar.g3 { background: linear-gradient(135deg, var(--success), var(--ai)); }
.q-head .avatar.g4 { background: linear-gradient(135deg, var(--accent), var(--accent-warm)); }
.q-head .avatar.g5 { background: linear-gradient(135deg, var(--primary), var(--accent)); }
