/* ── Reset & Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:        #0a0a0f;
  --bg-card:   #12121a;
  --bg-raised: #1c1c2a;
  --bg-input:  #16161f;
  --accent:    #D97706;
  --accent2:   #FBBF24;
  --accent-lt: #FBBF24;
  --green:     #10b981;
  --red:       #ef4444;
  --txt:       #eeeef5;
  --txt-dim:   #8888a8;
  --border:    #252535;
  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  overscroll-behavior-y: none;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px env(safe-area-inset-bottom, 24px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 32px);
}

.section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hidden { display: none !important; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.header {
  position: relative;
  padding: 24px 0 16px;
  text-align: center;
}

/* ── Flying bee ──────────────────────────────────────────────────────────── */
#flying-bee {
  position: absolute;
  left: -70px;
  top: 18px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  animation: beeFly 45s linear 3s infinite;
}

@keyframes beeFly {
  0%    { transform: translateX(0) translateY(0) rotate(-8deg); opacity: 0; }
  1.1%  { opacity: 1; }
  2.2%  { transform: translateX(12vw) translateY(-8px) rotate(-8deg); }
  3.3%  { transform: translateX(25vw) translateY(6px) rotate(-5deg); }
  4.4%  { transform: translateX(40vw) translateY(-10px) rotate(-8deg); }
  5.6%  { transform: translateX(55vw) translateY(5px) rotate(-5deg); }
  6.7%  { transform: translateX(70vw) translateY(-8px) rotate(-8deg); }
  7.8%  { transform: translateX(85vw) translateY(3px) rotate(-5deg); opacity: 1; }
  8.9%  { transform: translateX(calc(100vw + 70px)) translateY(0) rotate(-8deg); opacity: 0; }
  9%    { transform: translateX(0) translateY(0) rotate(-8deg); opacity: 0; }
  100%  { transform: translateX(0) translateY(0) rotate(-8deg); opacity: 0; }
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.logo-icon { font-size: 30px; line-height: 1; }

.logo-text {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #D97706 0%, #FBBF24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 13px;
  color: var(--txt-dim);
  letter-spacing: 0.2px;
  margin-bottom: 14px;
}

/* ── Nav tabs ────────────────────────────────────────────────────────────── */
.nav-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--txt-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s;
  line-height: 1;
}

.tab-btn.active {
  background: var(--bg-raised);
  color: var(--txt);
}

.tab-btn:active { opacity: .75; }

/* ── Upload area ─────────────────────────────────────────────────────────── */
.upload-area {
  position: relative;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s, background .2s;
}

.upload-area:active { background: var(--bg-raised); }

.upload-area.has-image {
  border-style: solid;
  border-color: var(--accent);
  min-height: 0;
  cursor: default;
  align-items: flex-start;
}

.upload-area.drag-over {
  border-color: var(--accent-lt);
  background: rgba(217,119,6,.08);
}

.upload-placeholder {
  text-align: center;
  padding: 36px 24px;
  pointer-events: none;
}

.upload-icon { font-size: 52px; margin-bottom: 14px; }

.upload-text {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
}

.upload-subtext {
  font-size: 13px;
  color: var(--txt-dim);
}

/* ── Photo grid ──────────────────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  width: 100%;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-raised);
}

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

.thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
  line-height: 1;
}

.thumb-remove:active { background: var(--red); }

/* ── Result-section photo strip ──────────────────────────────────────────── */
.result-photo-strip {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.result-photo-strip-thumb {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-raised);
}

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

.result-photo-add-tile {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--txt-dim);
  font-size: 22px;
  line-height: 1;
  transition: border-color .15s, background .15s;
  user-select: none;
}

.result-photo-add-tile:active { background: var(--bg-raised); border-color: var(--accent-lt); }

.thumb-crop {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,.60);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}

.thumb-crop:hover  { background: rgba(0,0,0,.85); }
.thumb-crop:active { background: var(--accent); }

@media (hover: hover) {
  .photo-thumb .thumb-crop { opacity: .85; }
  .photo-thumb:hover .thumb-crop { opacity: 1; }
}

.photo-add-tile {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--txt-dim);
  transition: border-color .2s, background .2s;
  user-select: none;
}

.photo-add-tile:active { background: var(--bg-raised); border-color: var(--accent-lt); }

.photo-add-plus { font-size: 22px; line-height: 1; }
.photo-add-label { font-size: 11px; font-weight: 600; }

/* ── Camera / Gallery buttons ────────────────────────────────────────────── */
.capture-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, opacity .15s, box-shadow .2s;
  -webkit-appearance: none;
}

.btn:active:not(:disabled) { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #1a0a00;
  box-shadow: 0 4px 22px rgba(217,119,6,.4);
}

.btn-primary:disabled {
  opacity: .38;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-raised);
  color: var(--txt);
  border: 1px solid var(--border);
}

.btn-secondary:active { background: #22223a; }

.btn-outline {
  background: transparent;
  color: var(--accent-lt);
  border: 1px solid var(--accent);
  padding: 11px 18px;
  font-size: 14px;
  width: auto;
}

/* ── Fields ──────────────────────────────────────────────────────────────── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--txt-dim);
}

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

.field-hint {
  font-size: 11px;
  color: var(--txt-dim);
  opacity: .7;
  margin-top: 2px;
}

/* ── Condition selector ──────────────────────────────────────────────────── */
.condition-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--txt);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 13px 36px 13px 14px;
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%238888a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  transition: border-color .2s;
}

.condition-select:focus { border-color: var(--accent-lt); }

.condition-select option {
  background: var(--bg-card);
  color: var(--txt);
}

/* ── Mic button ──────────────────────────────────────────────────────────── */
.mic-btn {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background .15s, transform .15s, box-shadow .2s;
  flex-shrink: 0;
}

.mic-btn:active { transform: scale(0.88); }

.mic-btn.listening {
  background: var(--red);
  border-color: var(--red);
  animation: micPulse 1.1s ease infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  55%       { box-shadow: 0 0 0 9px rgba(239,68,68,0); }
}

/* ── Starting price input ────────────────────────────────────────────────── */
.price-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}

.price-input-wrap:focus-within {
  border-color: var(--accent-lt);
}

.price-input-wrap.price-filled {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(16,185,129,.18);
}

.price-prefix {
  padding: 0 8px 0 14px;
  font-size: 20px;
  font-weight: 800;
  color: var(--green);
  user-select: none;
}

.price-input {
  background: transparent;
  border: none;
  color: var(--txt);
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  padding: 13px 14px 13px 0;
  flex: 1;
  outline: none;
  min-width: 0;
}

.price-input::placeholder {
  color: var(--txt-dim);
  font-weight: 400;
  font-size: 15px;
}

/* ── Textarea ────────────────────────────────────────────────────────────── */
.textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--txt);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  padding: 13px 14px;
  resize: none;
  transition: border-color .2s;
}

.textarea:focus {
  outline: none;
  border-color: var(--accent-lt);
}

.textarea::placeholder { color: var(--txt-dim); }

/* ── Loading ─────────────────────────────────────────────────────────────── */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 24px;
  text-align: center;
  gap: 14px;
}

.spinner {
  width: 52px;
  height: 52px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-lt);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-title {
  font-size: 19px;
  font-weight: 700;
}

.loading-sub {
  font-size: 14px;
  color: var(--txt-dim);
  line-height: 1.5;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.step {
  font-size: 13px;
  color: var(--txt-dim);
  opacity: 0;
  animation: fadeStep .4s forwards;
}

.step:nth-child(1) { animation-delay: .8s; }
.step:nth-child(2) { animation-delay: 2.2s; }
.step:nth-child(3) { animation-delay: 4s; }

@keyframes fadeStep {
  to { opacity: 1; color: var(--accent-lt); }
}

/* ── Results ─────────────────────────────────────────────────────────────── */
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0 4px;
}

.results-title {
  font-size: 20px;
  font-weight: 700;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  opacity: 0;
  transform: translateY(12px);
  animation: slideUp .35s forwards;
}

.card:nth-child(1) { animation-delay: .04s; }
.card:nth-child(2) { animation-delay: .10s; }
.card:nth-child(3) { animation-delay: .16s; }
.card:nth-child(4) { animation-delay: .22s; }
.card:nth-child(5) { animation-delay: .28s; }
.card:nth-child(6) { animation-delay: .34s; }
.card:nth-child(7) { animation-delay: .40s; }

@keyframes slideUp {
  to { opacity: 1; transform: translateY(0); }
}

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

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

.card-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--accent-lt);
}

/* ── Edit button ─────────────────────────────────────────────────────────── */
.edit-btn {
  background: none;
  border: none;
  color: var(--txt-dim);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  line-height: 1;
}

.edit-btn:hover { background: var(--bg-raised); color: var(--accent-lt); }

.edit-btn.editing {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 8px;
}

.card-value[contenteditable="true"] {
  outline: none;
  border-radius: 8px;
  border: 1px solid var(--accent-lt);
  padding: 8px 10px;
  margin: -8px -10px;
  background: var(--bg-input);
  cursor: text;
}

/* ── Copy button ─────────────────────────────────────────────────────────── */
.copy-btn {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--txt-dim);
  padding: 5px 14px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.copy-btn.copied {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.copy-btn:active { transform: scale(0.95); }

.card-value {
  font-size: 15px;
  line-height: 1.65;
  color: var(--txt);
  white-space: pre-wrap;
  word-break: break-word;
}

.card-value.is-title {
  font-size: 16px;
  font-weight: 600;
}

.card-value.is-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: .3px;
}

.card-value.is-badge::before { content: '🏷️'; }

.card-value.is-price {
  font-size: 32px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -.5px;
}

.title-char-counter {
  margin-top: 5px;
  font-size: 12px;
  color: var(--txt-dim);
  text-align: right;
}
.title-char-counter.over-limit {
  color: var(--red);
  font-weight: 600;
}

.card-sub {
  margin-top: 7px;
  font-size: 13px;
  color: var(--txt-dim);
  line-height: 1.55;
}

/* ── Platform share ──────────────────────────────────────────────────────── */
.platform-share-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.platform-share-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--txt-dim);
}

.platform-share-blurb {
  font-size: 12px;
  color: var(--txt-dim);
  margin: 4px 2px 0;
  line-height: 1.4;
}

.platform-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.platform-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--txt);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .12s;
  text-align: left;
}

.platform-btn:active { transform: scale(0.98); background: var(--bg-raised); }

.platform-btn.copied { border-color: var(--green); }

.platform-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.platform-name { flex: 1; }

.platform-copy-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--txt-dim);
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-raised);
  transition: background .2s, border-color .2s, color .2s;
  flex-shrink: 0;
}

.platform-btn.copied .platform-copy-label {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ── History ─────────────────────────────────────────────────────────────── */
.history-head {
  padding: 2px 0 4px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item:active {
  background: var(--bg-raised);
  border-color: var(--accent);
}

.history-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--txt-dim);
}

.history-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

.history-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-photo-icon {
  font-size: 12px;
  opacity: 0.75;
  line-height: 1;
}

.history-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--txt-dim);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: max(28px, env(safe-area-inset-bottom, 28px));
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--green);
  color: #fff;
  padding: 12px 26px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 999;
  pointer-events: none;
  animation: toastPop .3s cubic-bezier(.22,1,.36,1);
}

#toast.error { background: var(--red); }

@keyframes toastPop {
  from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.9); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ── Responsive tweak for larger phones ─────────────────────────────────── */
@media (min-width: 390px) {
  .logo-text { font-size: 32px; }
}

/* ── Auth pages ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.auth-error {
  background: rgba(239, 68, 68, .14);
  border: 1px solid rgba(239, 68, 68, .4);
  color: #f87171;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input {
  display: block;
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--txt);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  font-family: inherit;
  transition: border-color .18s;
  -webkit-appearance: none;
}

.auth-input:focus { border-color: var(--accent); }

.auth-submit { width: 100%; margin-top: 4px; }

.auth-link {
  text-align: center;
  font-size: 14px;
  color: var(--txt-dim);
}

.auth-link a {
  color: var(--accent-lt);
  text-decoration: none;
  font-weight: 600;
}

.auth-success {
  background: rgba(16, 185, 129, .14);
  border: 1px solid rgba(16, 185, 129, .4);
  color: #6ee7b7;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
}

.pw-wrap {
  position: relative;
}

.pw-wrap .auth-input {
  padding-right: 44px;
}

.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--txt-dim);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
  line-height: 0;
}

.pw-toggle:hover { color: var(--txt); }

/* ── Listing format toggle ────────────────────────────────────────────────── */
.format-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.format-btn {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: none;
  color: var(--txt-dim);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.format-btn + .format-btn {
  border-left: 1.5px solid var(--border);
}

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

/* ── Header user / logout ────────────────────────────────────────────────── */
.header-user {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.header-username {
  font-size: 13px;
  color: var(--txt-dim);
  font-weight: 500;
}

.btn-logout {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt-dim);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: color .18s, border-color .18s;
}

.btn-logout:hover {
  color: var(--txt);
  border-color: var(--txt-dim);
}

/* ── eBay Post Section ───────────────────────────────────────────────────── */
.ebay-post-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.ebay-post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ebay-mode-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--txt-dim);
  padding: 3px 8px;
  border-radius: 10px;
}

.ebay-settings-link {
  font-size: 12px;
  color: var(--accent-lt);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-ebay {
  background: #f5a623;
  color: #111;
  font-weight: 700;
  width: 100%;
  font-size: 16px;
}

.btn-ebay:hover { background: #e09515; }

.btn-ebay:disabled {
  background: #c47d10;
  color: #555;
  opacity: .8;
}

/* ── Price Check ─────────────────────────────────────────────────────────── */
.pc-upgrade-wall {
  text-align: center;
  padding: 32px 20px;
}
.pc-upgrade-icon { font-size: 40px; margin-bottom: 12px; }
.pc-upgrade-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 8px;
}
.pc-upgrade-desc {
  font-size: 13px;
  color: var(--txt-dim);
  margin-bottom: 20px;
  line-height: 1.5;
}
.pc-photo-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s;
  margin-bottom: 12px;
}
.pc-photo-area:hover { border-color: var(--accent); }
.pc-photo-area-icon { font-size: 32px; margin-bottom: 8px; }
.pc-photo-area-text { font-size: 14px; color: var(--txt-dim); }
.pc-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.pc-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.pc-result-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.pc-item-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 4px;
}
.pc-item-desc {
  font-size: 13px;
  color: var(--txt-dim);
  margin-bottom: 16px;
  line-height: 1.4;
}
.pc-price-range {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.pc-price-band {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
}
.pc-price-band--avg {
  background: #052e16;
  border-color: #16a34a;
}
.pc-price-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--txt-dim);
  margin-bottom: 4px;
}
.pc-price-band--avg .pc-price-label { color: #4ade80; }
.pc-price-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--txt);
}
.pc-price-band--avg .pc-price-value { color: #4ade80; }
.pc-comp-note {
  font-size: 12px;
  color: var(--txt-dim);
  margin-bottom: 10px;
}
.pc-market-note {
  font-size: 13px;
  color: var(--txt-dim);
  line-height: 1.5;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.pc-load-wrap {
  text-align: center;
  padding: 48px 0;
}
.pc-load-wrap .spinner { margin: 0 auto 16px; }
.pc-load-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--txt);
  margin-bottom: 4px;
}
.pc-load-sub { font-size: 13px; color: var(--txt-dim); }

.btn-ebay.ebay-posted {
  background: var(--green);
  color: #fff;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 92svh;
  overflow-y: auto;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalSlide .28s cubic-bezier(.22,1,.36,1);
}

.modal-compact { max-height: 70svh; }

@keyframes modalSlide {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--txt);
  font-size: 14px;
  flex-shrink: 0;
  transition: background .15s;
}

.modal-close:hover { background: var(--bg-input); }

.modal-desc {
  font-size: 14px;
  color: var(--txt-dim);
  line-height: 1.55;
}

.modal-desc a {
  color: var(--accent-lt);
  text-decoration: none;
}

.modal-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-input {
  display: block;
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--txt);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  font-family: inherit;
  transition: border-color .18s;
}

.modal-input:focus { border-color: var(--accent); }

.modal-input::placeholder { color: var(--txt-dim); opacity: .7; }

.modal-textarea {
  resize: vertical;
  min-height: 76px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.5;
}

.field-hint-inline {
  font-size: 11px;
  font-weight: 400;
  color: var(--txt-dim);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Toggle switch ───────────────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  user-select: none;
}

.toggle-wrap {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  transition: background .2s, border-color .2s;
}

.toggle-track::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--txt-dim);
  transition: transform .2s, background .2s;
}

.toggle-wrap input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-wrap input:checked + .toggle-track::before {
  transform: translateX(20px);
  background: #fff;
}

.toggle-hint {
  font-size: 12px;
  color: var(--txt-dim);
}

/* ── Success modal body ──────────────────────────────────────────────────── */
.modal-success-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0 4px;
  text-align: center;
}

.success-icon { font-size: 52px; line-height: 1; }

.success-detail {
  font-size: 14px;
  color: var(--txt-dim);
}

.success-note {
  font-size: 12px;
  color: var(--txt-dim);
  font-style: italic;
}

/* ── User menu dropdown ──────────────────────────────────────────────────── */
.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--txt-dim);
  font-weight: 500;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: color .18s, border-color .18s;
}

.user-menu-btn:hover {
  color: var(--txt);
  border-color: var(--txt-dim);
}

.user-menu-caret {
  font-size: 10px;
  opacity: .65;
  margin-left: 2px;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 168px;
  z-index: 100;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: dropdownFade .15s ease;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--txt);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  text-align: left;
  transition: background .15s;
}

.user-dropdown-item:hover { background: var(--bg-raised); }

.user-dropdown-item--logout { color: var(--red); }

.user-dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── Plan badge (header) ─────────────────────────────────────────────────── */
.plan-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  text-decoration: none;
}
.plan-badge--pro {
  background: rgba(217,119,6,.15);
  border: 1px solid rgba(217,119,6,.4);
  color: var(--accent2);
}
.plan-badge--free {
  background: rgba(136,136,168,.1);
  border: 1px solid rgba(136,136,168,.25);
  color: var(--txt-dim);
  transition: border-color .2s, color .2s;
}
.plan-badge--free:hover {
  border-color: var(--accent);
  color: var(--txt);
}

/* ── Limit-reached prompt (shown when free user hits cap) ────────────────── */
.limit-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(217,119,6,.1);
  border: 1px solid rgba(217,119,6,.35);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  color: var(--txt-dim);
  margin-top: 10px;
}
.limit-prompt-link {
  color: var(--accent2);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.limit-prompt-link:hover { text-decoration: underline; }

/* ── Upgrade item in user dropdown ───────────────────────────────────────── */
.user-dropdown-item--upgrade {
  color: var(--accent2) !important;
  font-weight: 600;
}

/* ── eBay connected badge (header) ───────────────────────────────────────── */
.ebay-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  background: rgba(16, 185, 129, .12);
  border: 1px solid rgba(16, 185, 129, .38);
  color: var(--green);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── eBay OAuth section (modal) ──────────────────────────────────────────── */
.ebay-oauth-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.oauth-divider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.oauth-divider {
  flex: 1;
  border: none;
  border-top: 1px solid var(--border);
}

.oauth-divider-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--txt-dim);
  white-space: nowrap;
}

.ebay-oauth-connected-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 185, 129, .08);
  border: 1px solid rgba(16, 185, 129, .28);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.ebay-connected-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

.btn-link-danger {
  background: none;
  border: none;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Settings page ───────────────────────────────────────────────────────── */
.settings-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 48px);
}

.settings-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
}

.settings-back {
  font-size: 14px;
  color: var(--accent-lt);
  text-decoration: none;
  font-weight: 600;
}

.settings-back:hover { opacity: .8; }

.settings-nav-title {
  font-size: 16px;
  font-weight: 700;
}

.settings-flash {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.settings-flash--success {
  background: rgba(16, 185, 129, .12);
  border: 1px solid rgba(16, 185, 129, .35);
  color: #34d399;
}

.settings-flash--error {
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .35);
  color: #f87171;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-card--danger { border-color: rgba(239, 68, 68, .3); }

.settings-section-title {
  font-size: 16px;
  font-weight: 700;
}

.settings-section-title--danger { color: var(--red); }

.settings-current-value {
  font-size: 13px;
  color: var(--txt-dim);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.settings-warning {
  background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .32);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #fbbf24;
  line-height: 1.5;
}

.settings-danger-desc {
  font-size: 13px;
  color: var(--txt-dim);
  line-height: 1.55;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input--danger { border-color: rgba(239, 68, 68, .4); }
.auth-input--danger:focus { border-color: var(--red); }

.btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: var(--red);
  color: #fff;
  transition: opacity .15s;
}

/* ── Result section format mirror ──────────────────────────────────────── */
.result-format-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-format-row .format-toggle { flex: 1; }

.result-format-row .condition-select {
  width: auto;
  flex: 0 0 auto;
  font-size: 13px;
  padding: 8px 10px;
}

/* ── Market snapshot card ───────────────────────────────────────────────── */
.market-snapshot-wrap {
  margin-top: 14px;
  width: 100%;
}

.market-snapshot-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  width: 100%;
  box-sizing: border-box;
  color: var(--txt);
}

.ms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ms-title {
  font-size: 13px;
  color: var(--txt-dim);
  font-weight: 400;
}

.ms-view-link {
  font-size: 12px;
  color: var(--txt-dim);
  text-decoration: none;
}
.ms-view-link:hover { text-decoration: underline; color: var(--txt); }

.ms-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ms-tile-label {
  font-size: 11px;
  color: var(--txt-dim);
  margin-bottom: 3px;
}

.ms-tile-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--txt);
}

.ms-tile-value--highlight {
  color: var(--green);
}

.ms-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.ms-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.ms-clock {
  font-size: 13px;
}

.ms-footer-text {
  font-size: 13px;
  color: var(--txt-dim);
}

.ms-use-btn {
  background: rgba(16, 185, 129, .12);
  border: 1px solid rgba(16, 185, 129, .35);
  color: var(--green);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.ms-use-btn:active { background: rgba(16, 185, 129, .25); }

/* ── Demand pill badges ─────────────────────────────────────────────────── */
.demand-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 12px;
}

.demand-pill--bzzzz {
  background: #EAF3DE;
  border: 0.5px solid #97C459;
}

.demand-pill--bzzzz .demand-text {
  font-weight: 500;
  color: #3B6D11;
  font-size: 12px;
}

.demand-pill--nobuzz {
  background: #FAEEDA;
  border: 0.5px solid #FAC775;
}

.demand-pill--nobuzz .demand-text {
  font-weight: 500;
  color: #854F0B;
  font-size: 12px;
}

/* Bzzzz bees — orbit animations */
.demand-bee {
  position: absolute;
  font-size: 11px;
  pointer-events: none;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

.bee-1 {
  top: -9px;
  left: 8px;
  animation-name: bee-orbit-1;
  animation-duration: 1.9s;
  animation-delay: 0s;
}

.bee-2 {
  top: -7px;
  right: 6px;
  animation-name: bee-orbit-2;
  animation-duration: 2.3s;
  animation-delay: -0.7s;
}

.bee-3 {
  bottom: -9px;
  left: 50%;
  margin-left: -6px;
  animation-name: bee-orbit-3;
  animation-duration: 2.1s;
  animation-delay: -1.3s;
}

@keyframes bee-orbit-1 {
  0%   { transform: translate(0,   0)   rotate(0deg);   }
  25%  { transform: translate(7px, -6px) rotate(25deg);  }
  50%  { transform: translate(3px, -11px) rotate(-18deg); }
  75%  { transform: translate(-5px, -5px) rotate(14deg); }
  100% { transform: translate(0,   0)   rotate(0deg);   }
}

@keyframes bee-orbit-2 {
  0%   { transform: translate(0,    0)    rotate(0deg);   }
  33%  { transform: translate(6px, -9px)  rotate(-22deg); }
  66%  { transform: translate(-4px, -6px) rotate(18deg);  }
  100% { transform: translate(0,    0)    rotate(0deg);   }
}

@keyframes bee-orbit-3 {
  0%   { transform: translate(0,    0)   rotate(0deg);   }
  30%  { transform: translate(-7px, 6px)  rotate(20deg);  }
  60%  { transform: translate(5px,  9px)  rotate(-16deg); }
  100% { transform: translate(0,    0)   rotate(0deg);   }
}

/* No Buzz sleeping bee */
.demand-bee-sleeping {
  font-size: 18px;
  display: inline-block;
  margin-left: 4px;
  animation: bee-bob 2.4s ease-in-out infinite;
}

@keyframes bee-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(3px); }
}

/* No Buzz snoring z's */
.demand-zzz {
  position: absolute;
  color: #854F0B;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  animation: zzz-float 2.4s ease-in-out infinite;
}

.zzz-1 { font-size: 11px; right: 6px;  top: -2px;  animation-delay: 0s;    }
.zzz-2 { font-size: 13px; right: 1px;  top: -13px; animation-delay: -0.8s; }
.zzz-3 { font-size: 15px; right: -8px; top: -24px; animation-delay: -1.6s; }

@keyframes zzz-float {
  0%   { opacity: 0;   transform: translateY(0);    }
  20%  { opacity: 0.9; transform: translateY(-4px);  }
  80%  { opacity: 0.4; transform: translateY(-12px); }
  100% { opacity: 0;   transform: translateY(-18px); }
}

/* ── Regenerate / correction section ────────────────────────────────────── */
.correction-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.correction-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt-dim);
}

.correction-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--txt);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
  line-height: 1.5;
}

.correction-textarea:focus { border-color: var(--accent); }

/* ── App footer / Report button ──────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 28px 0 8px;
}

.report-btn {
  background: none;
  border: none;
  color: var(--txt-dim);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color .15s;
  letter-spacing: .01em;
}

.report-btn:hover { color: var(--txt); }

.footer-privacy-link {
  display: block;
  margin-top: 10px;
  color: var(--txt-dim);
  font-size: 12px;
  text-decoration: none;
  transition: color .15s;
}
.footer-privacy-link:hover { color: var(--txt); }

.settings-footer {
  text-align: center;
  padding: 24px 0 8px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

.footer-links .footer-privacy-link { margin-top: 0; }

.footer-disclaimer {
  font-size: 11px;
  color: var(--txt-dim);
  text-align: center;
  margin-top: 10px;
  opacity: 0.6;
  line-height: 1.5;
}

.ai-review-note {
  font-size: 11px;
  color: var(--txt-dim);
  text-align: center;
  margin-top: 8px;
  opacity: 0.7;
}

/* ── FAQ page ────────────────────────────────────────────────────────────── */
.faq-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 48px);
}

.faq-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 24px;
}

.faq-back {
  color: var(--txt-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color .15s;
}
.faq-back:hover { color: var(--txt); }

.faq-nav-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--txt);
}

.faq-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--txt);
  margin-bottom: 28px;
  letter-spacing: -.3px;
}

.faq-group {
  margin-bottom: 32px;
}

.faq-category {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-lt);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
  padding-left: 2px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  margin-bottom: 6px;
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  background: none;
  border: none;
  color: var(--txt);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
  line-height: 1.4;
}
.faq-question:hover { background: var(--bg-raised); }

.faq-chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-right: 2px solid var(--txt-dim);
  border-bottom: 2px solid var(--txt-dim);
  transform: rotate(45deg) translateY(-3px);
  transition: transform .22s ease, border-color .15s;
  margin-right: 2px;
}

.faq-question[aria-expanded="true"] .faq-chevron {
  transform: rotate(225deg) translateY(-3px);
  border-color: var(--accent-lt);
}

.faq-answer {
  transition: height .25s ease;
  box-sizing: border-box;
}

.faq-answer p,
.faq-answer li {
  padding: 0 16px 16px;
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--txt-dim);
}

.faq-answer a {
  color: var(--accent-lt);
  text-decoration: none;
}
.faq-answer a:hover { text-decoration: underline; }

/* ── Item Specifics card ─────────────────────────────────────────────────── */
.specifics-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.specifics-row {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.4;
}

.specifics-row:last-child { border-bottom: none; }

.specifics-key {
  flex: 0 0 42%;
  color: var(--txt-dim);
  font-weight: 500;
}

.specifics-val {
  flex: 1;
  color: var(--txt);
  word-break: break-word;
}

.specifics-val-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.specifics-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--txt);
  font-size: 13px;
  padding: 4px 7px;
  outline: none;
  transition: border-color 0.15s;
}
.specifics-input:focus {
  border-color: var(--green);
}
.specifics-input.specifics-input-error {
  border-color: var(--red);
}

.specifics-char-counter {
  font-size: 11px;
  color: var(--txt-dim);
  text-align: right;
  line-height: 1;
}
.specifics-char-counter.over-limit {
  color: var(--red);
  font-weight: 600;
}


.btn-danger:hover { opacity: .88; }

/* ── Crop toggle ─────────────────────────────────────────────────────────── */
.crop-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  width: fit-content;
}

.crop-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.crop-toggle-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  margin: 0;
  cursor: pointer;
  -webkit-appearance: none;
}

.crop-toggle-thumb {
  position: absolute;
  inset: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: background .2s, border-color .2s;
}

.crop-toggle-thumb::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--txt-dim);
  transition: left .2s, background .2s;
}

.crop-toggle-input:checked + .crop-toggle-thumb {
  background: rgba(217,119,6,.18);
  border-color: var(--accent);
}

.crop-toggle-input:checked + .crop-toggle-thumb::after {
  left: 21px;
  background: var(--accent);
}

.crop-toggle-label {
  font-size: 13px;
  color: var(--txt-dim);
  transition: color .2s;
}

.crop-toggle-row:has(.crop-toggle-input:checked) .crop-toggle-label {
  color: var(--accent);
}

/* ── Crop Modal ──────────────────────────────────────────────────────────── */
.crop-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  max-height: 94vh;
  max-height: 94svh;
  overflow: hidden;
  animation: modalSlide .28s cubic-bezier(.22,1,.36,1);
}

.crop-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.crop-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--txt);
}

.crop-modal-counter {
  font-size: 13px;
  color: var(--txt-dim);
}

.crop-container {
  flex: 1;
  min-height: 0;
  height: 52vh;
  height: 52svh;
  background: #000;
  overflow: hidden;
  position: relative;
}

.crop-container img {
  display: block;
  max-width: 100%;
}

.crop-ratio-row {
  display: flex;
  gap: 8px;
  padding: 11px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.crop-ratio-btn {
  flex: 1;
  padding: 10px 6px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--txt-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
}

.crop-ratio-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(217,119,6,.12);
}

.crop-actions {
  display: flex;
  gap: 10px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.crop-actions .btn {
  flex: 1;
  min-height: 52px;
  font-size: 16px;
  padding: 14px 12px;
}

/* Larger Cropper.js drag handles on touch screens */
@media (pointer: coarse) {
  .cropper-point {
    width: 14px !important;
    height: 14px !important;
    opacity: 0.9 !important;
  }
  .cropper-point.point-n,
  .cropper-point.point-s { left: calc(50% - 7px) !important; }
  .cropper-point.point-e,
  .cropper-point.point-w { top: calc(50% - 7px) !important; }
}

/* ── Schedule toggle ──────────────────────────────────────────────────────── */
.schedule-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pro-badge-inline {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: .5px;
  vertical-align: middle;
  margin-left: 6px;
}

.schedule-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
  padding: 0;
}

.schedule-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
}

.schedule-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--txt-dim);
  border-radius: 50%;
  transition: transform .2s, background .2s;
}

.schedule-toggle[aria-pressed="true"]::after {
  transform: translateX(20px);
  background: #fff;
}


.schedule-upgrade-prompt {
  font-size: 13px;
  color: var(--txt-dim);
  background: rgba(217,119,6,.1);
  border: 1px solid rgba(217,119,6,.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.schedule-upgrade-link {
  color: var(--accent-lt);
  text-decoration: none;
  font-weight: 600;
}

.schedule-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.schedule-display-text {
  font-size: 14px;
  color: var(--txt);
  font-weight: 600;
}

.schedule-edit-btn {
  background: none;
  border: none;
  color: var(--accent-lt);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

/* ── Schedule inline picker ───────────────────────────────────────────────── */
.schedule-picker {
  margin-top: 10px;
  animation: schedSlideDown .18s ease;
}

@keyframes schedSlideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.schedule-picker-row {
  display: flex;
  gap: 8px;
}

.sched-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--txt);
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
}

.sched-input:focus {
  outline: none;
  border-color: var(--accent-lt);
}

.schedule-hint {
  font-size: 12px;
  color: var(--txt-dim);
  margin: 6px 0 0;
}

/* ── Schedule modal ───────────────────────────────────────────────────────── */
.sched-modal { gap: 14px; }

/* Calendar */
.sched-calendar {
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.sched-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sched-cal-month-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--txt);
}

.sched-cal-nav-btn {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--txt);
  font-size: 20px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
  line-height: 1;
}

.sched-cal-nav-btn:hover:not(:disabled) { background: var(--border); }
.sched-cal-nav-btn:disabled { opacity: .3; cursor: default; }

.sched-cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.sched-cal-dow {
  text-align: center;
  font-size: 11px;
  color: var(--txt-dim);
  font-weight: 600;
  padding: 4px 0;
}

.sched-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.sched-cal-day {
  aspect-ratio: 1;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--txt);
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  touch-action: manipulation;
}

.sched-cal-day:hover:not(:disabled):not(.selected) { background: var(--bg-input); }
.sched-cal-day:disabled { opacity: .22; cursor: default; }
.sched-cal-day.today { outline: 1.5px solid var(--accent-lt); outline-offset: -1px; }
.sched-cal-day.selected,
.sched-cal-day.selected:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  outline: none;
}

/* Time wheels */
.sched-time-picker {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.sched-wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.sched-wheel-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--txt-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sched-wheel-sep {
  font-size: 28px;
  font-weight: 700;
  color: var(--txt-dim);
  align-self: center;
  margin-top: 18px;
  flex-shrink: 0;
}

.sched-wheel {
  position: relative;
  height: 132px; /* 3 × 44px items */
  width: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
}

.sched-wheel::-webkit-scrollbar { display: none; }

.sched-wheel-selector {
  position: absolute;
  left: 0;
  right: 0;
  top: 44px;
  height: 44px;
  border-top: 1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
  z-index: 2;
  pointer-events: none;
}

.sched-wheel-pad {
  height: 44px;
  scroll-snap-align: none;
}

.sched-wheel-item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: var(--txt-dim);
  scroll-snap-align: center;
  user-select: none;
  -webkit-user-select: none;
  transition: color .1s;
}

.sched-wheel-item.is-selected { color: var(--txt); }

/* Gradient fade top/bottom */
.sched-wheel::before,
.sched-wheel::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 44px;
  z-index: 1;
  pointer-events: none;
}
.sched-wheel::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg-raised) 30%, transparent);
}
.sched-wheel::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg-raised) 30%, transparent);
}

/* Time select inputs */
.sched-tp-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.sched-tp-select {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--txt);
  font-size: 20px;
  font-weight: 600;
  font-family: inherit;
  padding: 10px 4px;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color .15s;
}

.sched-tp-select:focus { border-color: var(--accent-lt); }

/* AM/PM toggle column */
.sched-ampm-wrap { flex: 0 0 auto; min-width: 60px; }

.sched-ampm {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.sched-ampm-btn {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--txt-dim);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 4px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  text-align: center;
  font-family: inherit;
  width: 100%;
  touch-action: manipulation;
}

.sched-ampm-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Preview & error */
.sched-preview {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--txt);
  min-height: 22px;
  padding: 2px 0;
}

.sched-error {
  background: rgba(239,68,68,.1);
  border: 1.5px solid var(--red);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px;
  padding: 10px 14px;
  text-align: center;
}
