/* style.css — Scandi/Nordic minimalist UI */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:            #F5F3EE;
  --surface:       #FDFCFA;
  --surface-2:     #ECEAE4;
  --border:        #E2DED6;
  --border-strong: #C4BFB7;
  --text:          #1A1918;
  --text-muted:    #7A7773;
  --text-light:    #B2AEA6;
  --accent:        #4D6E54;
  --accent-light:  #EBF1EC;
  --success:       #4D6E54;
  --error:         #8B3A3A;
  --warning:       #7A6030;
  --font:          'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display:  'Instrument Serif', Georgia, serif;
  --radius:        6px;
  --shadow-sm:     0 1px 2px rgba(26,25,24,0.06), 0 2px 6px rgba(26,25,24,0.04);
  --shadow-card:   0 1px 3px rgba(26,25,24,0.07), 0 4px 14px rgba(26,25,24,0.05);
  --shadow-hover:  0 4px 12px rgba(26,25,24,0.10), 0 12px 32px rgba(26,25,24,0.07);
}

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Processing overlay ── */

.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 243, 238, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}

.processing-overlay.active { display: flex; }

.processing-box {
  text-align: center;
  width: 320px;
}

.proc-stage {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 20px;
}

.proc-bar {
  height: 1px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 12px;
}

.proc-bar-fill {
  height: 100%;
  background: var(--text);
  width: 0%;
  transition: width 0.3s ease;
}

.proc-count {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── Header ── */

.header {
  background: rgba(245, 243, 238, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.01em;
}

.logo-mark {
  font-family: var(--font);
  font-style: normal;
  font-size: 10px;
  color: var(--accent);
  line-height: 1;
}

.nav { display: flex; align-items: center; gap: 2px; }

.nav-btn {
  background: none;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  padding: 6px 14px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.nav-btn:hover { color: var(--text); background: var(--surface-2); }
.nav-btn.active { color: var(--text); background: var(--surface-2); font-weight: 500; }

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 500;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
}
.nav-count:empty { display: none; }

/* ── Main ── */

.main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 52px 40px 80px;
}

.view { display: none; }
.view.active { display: block; }

/* ── View header ── */

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 44px;
  gap: 24px;
}

.view-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.view-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 300;
}

.view-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 6px;
  flex-shrink: 0;
}

/* ── Buttons ── */

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  padding: 9px 24px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 100px;
  letter-spacing: 0.01em;
  transition: opacity 0.15s, transform 0.12s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { opacity: 0.86; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }

.btn-primary.btn-sm { padding: 6px 16px; font-size: 12px; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 24px;
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  border-radius: 100px;
  letter-spacing: 0.01em;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0); }

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

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-muted);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.btn-link:hover { color: var(--text); }
.btn-link.danger:hover { color: var(--error); }

/* ── Upload view ── */

.upload-area {
  border: 1.5px dashed var(--border-strong);
  border-radius: 16px;
  padding: 72px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  margin-bottom: 20px;
  background: var(--surface);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 4px rgba(77,110,84,0.08);
}

.upload-icon {
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 20px;
  line-height: 1;
  opacity: 0.7;
}

.upload-heading {
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
}

.upload-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-error {
  font-size: 13px;
  color: var(--error);
  white-space: pre-wrap;
  line-height: 1.6;
  padding: 14px 16px;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  display: none;
  margin-bottom: 16px;
}
.upload-error.visible { display: block; }

.upload-instructions {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
  max-width: 560px;
}

.instr-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.instr-list {
  list-style: none;
  counter-reset: instr;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.instr-list li {
  counter-increment: instr;
  display: flex;
  gap: 14px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.instr-list li::before {
  content: counter(instr);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

.instr-list li strong { color: var(--text); font-weight: 500; }
.instr-list li code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
  background: var(--border);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ── Image grid (review) ── */

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 18px;
}

/* ── Image card ── */

.image-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
}
.image-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-image-wrap {
  position: relative;
  background: var(--surface-2, #ECEAE4);
  flex-shrink: 0;
  max-height: 420px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image-wrap img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--border);
}

.carousel-wrap {
  position: relative;
  width: 100%;
}

.carousel-wrap .carousel-slide {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}
.carousel-prev { left: 6px; }
.carousel-next { right: 6px; }
.carousel-btn:hover { background: rgba(0,0,0,0.6); }

.carousel-counter {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  pointer-events: none;
}

.carousel-strip {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  overflow-x: auto;
  background: var(--surface-2, #ECEAE4);
  border-top: 1px solid var(--border);
  scrollbar-width: none;
}
.carousel-strip::-webkit-scrollbar { display: none; }

.strip-item {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  cursor: default;
  border: 2px solid transparent;
  transition: opacity 0.15s;
}
.strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.strip-item:hover .strip-controls { opacity: 1; }
.strip-excluded { opacity: 0.3; }
.strip-excluded:hover { opacity: 0.6; }

.strip-btn {
  position: absolute;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 2px;
  z-index: 2;
}
.strip-toggle { top: 2px; right: 2px; }
.strip-left   { bottom: 2px; left: 2px; }
.strip-right  { bottom: 2px; right: 2px; }
.strip-btn:hover { background: rgba(0,0,0,0.85); }

.strip-num {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
}

.strip-item[draggable] { cursor: grab; }
.strip-item[draggable]:active { cursor: grabbing; }
.strip-item.strip-dragging { opacity: 0.4; }
.strip-item.strip-drag-over { outline: 2px solid var(--text); outline-offset: 2px; }

.card-status-bar { height: 2px; flex-shrink: 0; }

.status-pending  .card-status-bar  { background: var(--border); }
.status-approved .card-status-bar  { background: var(--accent); height: 3px; }
.status-skipped  .card-status-bar  { background: var(--text-light); opacity: 0.4; }
.status-failed   .card-status-bar  { background: var(--error); opacity: 0.6; }

.status-approved { border-color: rgba(77,110,84,0.25); }

.card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-status-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.status-pending  .card-status-label  { color: var(--text-muted); }
.status-approved .card-status-label  { color: var(--success); }
.status-skipped  .card-status-label  { color: var(--text-light); }
.status-failed   .card-status-label  { color: var(--error); }

.style-badge {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 1px;
  flex-shrink: 0;
}

.card-poster {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 400;
}

.card-caption {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.68;
  font-weight: 300;
  font-style: italic;
  flex: 1;
}

.card-hashtags {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  word-break: break-word;
}

.card-error-msg {
  font-size: 12px;
  color: var(--error);
  line-height: 1.5;
  flex: 1;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn-approve, .btn-skip {
  flex: 1;
  padding: 8px 4px;
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s;
}

.btn-approve {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-approve:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-skip {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-light);
}
.btn-skip:hover {
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.card-footer-actions {
  display: flex;
  gap: 14px;
  margin-top: auto;
}

/* ── Schedule view ── */

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.schedule-group {
  margin-bottom: 28px;
}

.schedule-date {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.schedule-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

/* ── Schedule card ── */

.schedule-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}
.schedule-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }

.scard-img {
  position: relative;
  aspect-ratio: 1;
  background: var(--border);
  flex-shrink: 0;
}
.scard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scard-cb-label {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: rgba(255,255,255,0.88);
  border-radius: 5px;
  padding: 4px 5px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.scard-cb-label input {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--accent);
  margin: 0;
}

.scard-time-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.52);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.scard-status-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
}
.status-submitted .scard-status-badge { background: var(--accent-light); color: var(--accent); }
.status-posted    .scard-status-badge { background: #eaf5ea; color: var(--success); }
.status-failed    .scard-status-badge { background: #fdecea; color: var(--error); }
.status-skipped   .scard-status-badge { background: var(--bg-muted, #f0f0ee); color: var(--text-muted); }

.scard-body {
  padding: 11px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.scard-poster {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

.scard-caption {
  font-size: 12.5px;
  line-height: 1.6;
  font-style: italic;
  font-weight: 300;
  color: var(--text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scard-tags {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scard-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  padding-top: 4px;
}

.queue-caption-input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font);
  font-size: 12.5px;
  line-height: 1.6;
  font-weight: 300;
  font-style: italic;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  resize: vertical;
  outline: none;
  min-height: 64px;
  transition: border-color 0.15s;
}
.queue-caption-input:focus { border-color: var(--border-strong); }

.fail-reason {
  font-size: 11.5px;
  color: var(--error);
  flex: 1;
}

/* ── Performance insights panel ── */

.insights-panel {
  margin-bottom: 44px;
}

.insights-empty {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 36px;
}

.insights-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.insights-empty-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 480px;
}

.insights-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.insights-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.insights-meta {
  font-size: 12px;
  color: var(--text-light);
}

.insights-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.insight-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 140px;
  box-shadow: var(--shadow-sm);
}

.insight-stat--best {
  border-color: rgba(77, 110, 84, 0.3);
  background: var(--accent-light);
}

.insight-stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-style: italic;
  color: var(--text);
  line-height: 1;
  flex-shrink: 0;
}

.insight-stat--best .insight-stat-value {
  color: var(--accent);
}

.insight-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  text-transform: capitalize;
}

.insight-stat-sub {
  font-size: 11px;
  color: var(--text-light);
}

.insights-tip {
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--accent-light);
  border-radius: 8px;
  border: 1px solid rgba(77, 110, 84, 0.18);
  line-height: 1.55;
}

.insights-tip strong { color: var(--accent); font-weight: 500; }

/* ── Inspiration tab ── */

.insp-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}

.insp-handle-input {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  margin: 0;
}

.insp-limit-select {
  flex: 0 0 120px;
  width: 120px;
  margin: 0;
}

.insp-saved-accounts {
  margin-bottom: 20px;
}

.insp-saved-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.insp-saved-chip {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.insp-saved-name {
  padding: 5px 10px 5px 12px;
  font-size: 13px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.insp-saved-name:hover { text-decoration: underline; }

.insp-saved-remove {
  padding: 5px 10px 5px 4px;
  font-size: 14px;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.insp-saved-remove:hover { color: var(--danger, #c0392b); }

/* Progress */
.insp-progress {
  margin-bottom: 20px;
}

.insp-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.insp-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.insp-progress-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* Profile header */
.insp-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 20px;
}

.insp-profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.insp-profile-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.insp-profile-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Controls row */
.insp-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.insp-sort-btns,
.insp-filter-btns {
  display: flex;
  gap: 6px;
}

.insp-sort-btn,
.insp-filter-btn {
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.insp-sort-btn.active,
.insp-filter-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.insp-sort-btn:not(.active):hover,
.insp-filter-btn:not(.active):hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Selection bar */
.insp-selection-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--accent-light);
  border: 1px solid rgba(77, 110, 84, 0.2);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.insp-selection-bar .btn-primary { margin-left: auto; }

/* Grid */
.insp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.insp-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.insp-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(77,110,84,0.12);
}

.insp-card--selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(77,110,84,0.25);
}

.insp-card--imported {
  opacity: 0.5;
  cursor: default;
}

.insp-card--imported:hover {
  border-color: var(--border);
  box-shadow: none;
}

.insp-card-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

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

.insp-card-img--empty {
  width: 100%;
  height: 100%;
  background: var(--border);
}

.insp-card-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
}

.insp-card-cb {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.insp-card-rank {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.insp-card-imported-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.insp-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
}

.insp-card-stat {
  font-size: 12px;
  color: var(--text-secondary);
}

.insp-card-date {
  font-size: 11px;
  color: var(--text-light);
  margin-left: auto;
}

/* ── Analytics tab ── */

.analytics-stat-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.analytics-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  box-shadow: var(--shadow-sm);
}

.analytics-kpi-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 26px;
  color: var(--text);
  line-height: 1;
}

.analytics-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

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

.analytics-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.analytics-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.analytics-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.analytics-section {
  margin-bottom: 40px;
}

.analytics-section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.analytics-section-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.55;
}

/* Bar chart rows */
.analytics-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.analytics-bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  width: 52px;
  flex-shrink: 0;
  text-align: right;
}

.analytics-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.analytics-bar-track--sm {
  height: 6px;
}

.analytics-bar-fill {
  height: 100%;
  background: var(--text-muted);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.analytics-bar-fill--best {
  background: var(--accent);
}

.analytics-bar-value {
  font-size: 12px;
  color: var(--text-muted);
  width: 32px;
  flex-shrink: 0;
  text-align: right;
}

/* Hashtag table */
.analytics-hashtag-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 0;
  margin-bottom: 10px;
}

.analytics-hashtag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
}

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

.analytics-hashtag-rank {
  font-size: 11px;
  color: var(--text-light);
  width: 18px;
  flex-shrink: 0;
  text-align: right;
}

.analytics-hashtag-tag {
  font-size: 13px;
  color: var(--accent);
  width: 160px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-hashtag-posts {
  font-size: 11px;
  color: var(--text-light);
  flex-shrink: 0;
  width: 50px;
  text-align: right;
}

.analytics-hashtag-note {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

/* Top posts grid */
.analytics-top-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.analytics-top-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.analytics-post-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.analytics-post-img--empty {
  background: var(--border);
}

.analytics-post-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.analytics-post-caption {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 12px 12px;
  line-height: 1.45;
}

.analytics-empty-msg {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}

/* ── History view ── */

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

.history-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.history-item:first-child { border-top: 1px solid var(--border); }

.history-num {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding-top: 2px;
}

.history-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-poster {
  font-size: 11.5px;
  color: var(--text-muted);
}

.history-caption {
  font-size: 13.5px;
  line-height: 1.7;
  font-weight: 300;
  font-style: italic;
  color: var(--text);
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-light);
}

/* ── Settings ── */

.settings-form { max-width: 620px; }

.settings-section { margin-bottom: 48px; }

.settings-section-title {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 22px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}

.form-field { margin-bottom: 20px; }
.form-field:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--border-strong); }
.form-input::placeholder { color: var(--text-light); }

.form-textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  line-height: 1.68;
  transition: border-color 0.15s;
}
.form-textarea:focus { border-color: var(--border-strong); }

.form-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 7px;
  line-height: 1.55;
}
.form-hint a { color: var(--text-muted); }

.connect-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.connect-status {
  font-size: 12.5px;
  color: var(--text-light);
}
.connect-status.connected { color: var(--success); }

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

.pillars-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 30px;
}

.pillar-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 12.5px;
  color: var(--text);
}

.pillar-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 15px;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}
.pillar-remove:hover { color: var(--text); }

.pillar-input-row { display: flex; gap: 9px; }
.pillar-input { flex: 1; }

/* ── Weekly slot picker ── */
.weekly-slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.weekly-slot-row .form-input { margin: 0; }

/* ── Schedule mode toggle ── */
.sched-mode-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.sched-mode-btn {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.sched-mode-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.sched-mode-btn:not(.active):hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Regen feedback form ── */
.regen-feedback-wrap { margin-top: 8px; }
.regen-feedback-input {
  width: 100%;
  font-family: var(--font);
  font-size: 12px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  margin-bottom: 6px;
}
.regen-feedback-input:focus { outline: none; border-color: var(--accent); }
.regen-feedback-actions { display: flex; gap: 10px; align-items: center; }
.card-regen-loading { font-size: 12px; color: var(--text-muted); font-style: italic; }

.settings-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
}

.save-status { font-size: 13px; color: var(--success); }

/* ── Review caption editing ── */

.card-caption-input {
  width: 100%;
  font-family: var(--font);
  font-size: 12.5px;
  line-height: 1.68;
  font-weight: 300;
  font-style: italic;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  resize: vertical;
  outline: none;
  min-height: 72px;
  transition: border-color 0.15s;
}
.card-caption-input:focus { border-color: var(--border-strong); }

.card-hashtag-input {
  font-size: 11px;
  min-height: 48px;
  margin-top: 6px;
}

/* ── Archived bulk actions ── */

.archived-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.archived-bulk-actions {
  gap: 16px;
  align-items: center;
}

/* ── Skipped posts section ── */

.skipped-section {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.skipped-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0;
  margin-bottom: 20px;
  transition: color 0.15s;
}
.skipped-toggle:hover { color: var(--text); }

.skipped-chevron { font-size: 13px; }

.skipped-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ── Empty state ── */

.empty-state {
  text-align: center;
  padding: 80px 40px;
  color: var(--text-light);
  font-size: 13.5px;
  font-weight: 300;
  display: none;
}
.empty-state.visible { display: block; }

/* ── Toast ── */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: var(--bg);
  padding: 11px 22px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(26,25,24,0.18);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Library tabs ── */

.lib-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.lib-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: -1px;
  white-space: nowrap;
}
.lib-tab:hover { color: var(--text); }
.lib-tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }

.lib-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
}
.lib-tab-count:empty { display: none; }
.lib-tab.active .lib-tab-count { background: var(--accent); color: #fff; }

/* ── Card image overlay checkbox ── */

.card-image-wrap { position: relative; }

.card-cb-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  background: rgba(255,255,255,0.88);
  border-radius: 5px;
  padding: 4px 5px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.15s;
}
.card-cb-overlay input {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--accent);
  margin: 0;
}
.card-selectable { cursor: pointer; }

/* ── Media type badges ── */

.media-type-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  z-index: 2;
}
.media-type-reel     { background: rgba(80,60,140,0.82); color: #fff; }
.media-type-carousel { background: rgba(30,100,160,0.82); color: #fff; }
.media-type-photo    { background: rgba(0,0,0,0.42); color: #fff; }

/* ── Library selection toolbar ── */

.lib-selection-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.lib-selected-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-right: 4px;
}

/* ── Card selection ── */

.card-selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-actions--select {
  margin-top: 4px;
}

.card-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  user-select: none;
}
.card-checkbox-label:hover { color: var(--text); }

.card-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}
.card-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.card-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.card-checkbox-text {
  font-size: 12px;
  color: inherit;
}

/* ── Schedule sections ── */

.schedule-section {
  margin-bottom: 56px;
}

.schedule-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.schedule-section-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.schedule-section-sub {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 300;
  line-height: 1.5;
}

.schedule-section-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  padding-top: 2px;
}

/* ── Submitted status ── */

.status-submitted .queue-status-label { color: var(--accent); }

.submitted-note {
  font-size: 11.5px;
  color: var(--text-light);
  font-style: italic;
}

/* ── Date/time editing ── */

.time-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.datetime-input {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s;
}
.datetime-input:focus { border-color: var(--border-strong); }

/* ── Posted metrics ── */

.post-metrics {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ── Queue selection ── */

.schedule-card.queue-item-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.schedule-card.scard-selectable { cursor: pointer; }
.schedule-card.drag-selecting { outline: 2px solid var(--accent); outline-offset: 2px; }
.sched-tabs { margin-bottom: 24px; }

.queue-selection-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* ── Rubber-band drag selection ── */

.drag-selection-rect {
  position: fixed;
  border: 1.5px solid var(--accent);
  background: rgba(77, 110, 84, 0.07);
  pointer-events: none;
  z-index: 200;
  border-radius: 4px;
}

.image-card.drag-selecting {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#library-grid.drag-active,
#library-grid.drag-active * {
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* ── Responsive ── */

@media (max-width: 700px) {
  .header-inner { padding: 0 20px; }
  .main { padding: 36px 20px 60px; }
  .nav-btn { padding: 8px 10px; font-size: 12px; }
  .image-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .schedule-card-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
