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

:root {
  --bg:        #111214;
  --bg2:       #171717;
  --surface:   #1a1a1a;
  --surface2:  #222222;
  --surface3:  #2a2a2a;
  --border:    #1e2025;
  --text:      #e8e8e8;
  --text2:     #9a9fa6;
  --text3:     #7a7f87;
  --accent:    #3cae32;
  --accent2:   #2d8f26;
  --green:     #34d399;
  --green-bg:  rgba(52,211,153,0.1);
  --orange:    #fb923c;
  --orange-bg: rgba(251,146,60,0.1);
  --red:       #f87171;
  --red-bg:    rgba(248,113,113,0.1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  --radius:    12px;
  --radius-sm:  8px;
  --radius-xs:  6px;
}

html { font-size: 14px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─── */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,17,23,0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex; align-items: center; gap: 12px;
}
.hdr-logo {
  width: 32px; height: 32px;
  background: rgba(60,174,50,0.15);
  border: 1px solid rgba(60,174,50,0.3);
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0;
}
.hdr-logo i { width: 16px; height: 16px; }
.hdr-title  { font-size: 16px; font-weight: 700; }
.hdr-sub    { font-size: 11px; color: var(--text3); }
.hdr-badge  {
  margin-left: auto;
  background: var(--green-bg); color: var(--green);
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}

/* ─── Layout ─── */
.content {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 56px;
  width: 100%;
}

/* ─── Hero ─── */
.hero { text-align: center; margin-bottom: 28px; }
.hero-icon {
  width: 64px; height: 64px;
  background: rgba(60,174,50,0.1);
  border: 1px solid rgba(60,174,50,0.25);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; color: var(--accent);
}
.hero-icon i { width: 28px; height: 28px; }
.hero h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.hero p  { font-size: 13.5px; color: var(--text2); max-width: 500px; margin: 0 auto; line-height: 1.6; }

/* ─── Card ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.card-title i { width: 16px; height: 16px; color: var(--accent); }

/* ─── Drop Zone ─── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg);
  user-select: none;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(60,174,50,0.04);
}
.dz-icon {
  width: 48px; height: 48px;
  background: rgba(60,174,50,0.1);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; color: var(--accent);
}
.dz-icon i  { width: 22px; height: 22px; }
.dz-title   { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.dz-sub     { font-size: 12px; color: var(--text3); }
.dz-formats { display: inline-flex; gap: 6px; margin-top: 12px; }
.dz-tag {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 2px 8px;
  font-size: 11px; font-weight: 600; color: var(--text3); font-family: var(--mono);
}

/* ─── File Info Bar ─── */
.file-info-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 10px 14px;
  margin-bottom: 16px;
}
.fi-icon i  { width: 18px; height: 18px; color: var(--accent); }
.fi-name    { font-size: 13px; font-weight: 500; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-size    { font-size: 11px; color: var(--text3); flex-shrink: 0; }
.fi-close   {
  background: none; border: none; cursor: pointer; color: var(--text3);
  padding: 2px; border-radius: var(--radius-xs);
  display: flex; align-items: center; transition: color 0.15s;
}
.fi-close:hover { color: var(--red); }
.fi-close i { width: 14px; height: 14px; }

/* ─── Loader ─── */
.loader-section {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 24px; color: var(--text2); font-size: 13px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Section Label ─── */
.section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text3); margin: 20px 0 10px;
}

/* ─── Stats Grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.stat-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 12px 14px;
}
.stat-label {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text3); margin-bottom: 5px;
}
.stat-value {
  font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--accent);
}
.stat-value.warn { color: var(--orange); }
.stat-value.bad  { color: var(--red); }

/* ─── Platform List ─── */
.platform-list { display: flex; flex-direction: column; gap: 8px; }
.platform-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 10px 14px;
}
.pl-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pl-icon i  { width: 14px; height: 14px; }
.pl-name    { font-size: 13px; font-weight: 600; flex: 1; }
.pl-target  { font-size: 11.5px; color: var(--text3); font-family: var(--mono); margin-right: 6px; flex-shrink: 0; }
.pl-delta   { font-size: 11px; color: var(--text3); font-family: var(--mono); margin-right: 10px; flex-shrink: 0; }

.badge {
  font-size: 10.5px; font-weight: 700; padding: 3px 9px;
  border-radius: 20px; letter-spacing: 0.04em; white-space: nowrap; flex-shrink: 0;
}
.badge-pass { background: var(--green-bg);  color: var(--green);  }
.badge-warn { background: var(--orange-bg); color: var(--orange); }
.badge-fail { background: var(--red-bg);    color: var(--red);    }

/* ─── Target Options ─── */
.target-options { display: flex; flex-wrap: wrap; gap: 8px; }
.target-btn {
  padding: 8px 16px; border-radius: var(--radius-xs);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text2);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: var(--font); display: inline-flex; align-items: center; gap: 8px;
}
.target-btn:hover { border-color: var(--accent); color: var(--text); }
.target-btn.active {
  background: rgba(60,174,50,0.1); border-color: var(--accent); color: var(--accent);
}
.custom-num {
  width: 52px; padding: 2px 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-size: 12px;
  font-family: var(--mono); text-align: center; outline: none;
}
.custom-num:focus { border-color: var(--accent); }
.custom-num::-webkit-outer-spin-button,
.custom-num::-webkit-inner-spin-button { -webkit-appearance: none; }
.custom-num { -moz-appearance: textfield; }

/* ─── Process Section ─── */
.process-section { margin-top: 20px; }
.btn {
  padding: 10px 20px; border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  transition: background 0.15s, opacity 0.15s;
  font-family: var(--font); display: inline-flex; align-items: center; gap: 8px;
}
.btn i { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover:not(:disabled) { background: var(--accent2); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface3); }

/* ─── Progress ─── */
.progress-wrap  { margin-top: 14px; }
.progress-bar   { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.progress-fill  { height: 100%; background: var(--accent); border-radius: 3px; width: 0; transition: width 0.1s linear; }
.progress-label { font-size: 11.5px; color: var(--text3); }

/* ─── Done Banner ─── */
.done-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--green-bg); border: 1px solid rgba(52,211,153,0.2);
  border-radius: var(--radius-xs); padding: 12px 16px; margin-top: 14px;
}
.done-banner i { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; }
.done-text { font-size: 13px; color: var(--green); font-weight: 500; flex: 1; }

/* ─── Error Banner ─── */
.error-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--red-bg); border: 1px solid rgba(248,113,113,0.2);
  border-radius: var(--radius-xs); padding: 10px 14px;
  margin-bottom: 12px; font-size: 12.5px; color: var(--red);
}
.error-banner i { width: 16px; height: 16px; flex-shrink: 0; }

/* ─── Reference Table ─── */
.ref-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ref-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ref-table th {
  text-align: left; padding: 9px 12px;
  background: var(--surface2); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.ref-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text2); }
.ref-table tr:last-child td { border-bottom: none; }
.ref-table tr:hover td { background: rgba(255,255,255,0.02); color: var(--text); }
.ref-table .mono { font-family: var(--mono); color: var(--accent); }
.ref-table .bold { font-weight: 600; color: var(--text); }

/* ─── Tip / Warn ─── */
.tip {
  border-left: 3px solid var(--accent);
  padding: 10px 14px; background: rgba(60,174,50,0.06);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  margin-top: 14px; font-size: 12px; color: var(--text2); line-height: 1.6;
}
.warn-note {
  border-left: 3px solid var(--orange);
  padding: 10px 14px; background: var(--orange-bg);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  margin-top: 14px; font-size: 12px; color: var(--text2); line-height: 1.6;
}

/* ─── Footer ─── */
.app-footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 20px 24px; text-align: center; }
.footer-text { font-size: 11.5px; color: var(--text3); line-height: 1.7; }
.footer-text a { color: var(--accent); text-decoration: none; }
.footer-text a:hover { text-decoration: underline; }

/* ─── Output option buttons ─── */
.opt-group { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-btn {
  padding: 6px 14px; border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text2);
  transition: all 0.15s; font-family: var(--mono);
}
.opt-btn:hover { border-color: var(--accent); color: var(--text); }
.opt-btn.active {
  background: rgba(60,174,50,0.1); border-color: var(--accent); color: var(--accent);
}
.out-settings-row {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start;
}
.out-settings-row > div { flex-shrink: 0; }

/* ─── Metadata form ─── */
.form-label {
  display: block; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text3); margin-bottom: 5px;
}
.form-input {
  width: 100%; padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text);
  font-size: 12.5px; font-family: var(--font); outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text3); }
textarea.form-input { resize: vertical; min-height: 60px; line-height: 1.5; }
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.meta-full { grid-column: 1 / -1; }
.section-label-inline {
  font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--text3); font-size: 10px;
}

[hidden] { display: none !important; }

/* ─── Art upload ─── */
.art-row {
  display: flex; gap: 16px; align-items: flex-start;
}
.art-thumb {
  width: 110px; height: 110px; flex-shrink: 0;
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--bg); cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.art-thumb:hover { border-color: var(--accent); background: rgba(60,174,50,0.04); }
.art-thumb.has-art { border-style: solid; border-color: var(--border); }
.art-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-ph {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--text3); font-size: 10.5px; text-align: center; padding: 8px;
  pointer-events: none;
}
.art-ph i { width: 22px; height: 22px; }
.art-details { flex: 1; min-width: 0; }
.art-desc { font-size: 11.5px; color: var(--text3); line-height: 1.55; margin: 4px 0 10px; }
.art-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.art-status {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; font-size: 11.5px; color: var(--green);
}
.art-status i { width: 14px; height: 14px; flex-shrink: 0; }
.art-status span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── BUZZSPROUT REFERRAL — remove this block if you host your own copy ── */
.referral-banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 16px;
}
.referral-icon {
  width: 36px; height: 36px;
  background: rgba(60,174,50,0.1);
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0;
}
.referral-icon i { width: 18px; height: 18px; }
.referral-body { flex: 1; min-width: 0; }
.referral-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.referral-sub   { font-size: 12px; color: var(--text2); line-height: 1.5; }
.referral-link {
  padding: 7px 14px;
  background: var(--accent); color: var(--bg);
  border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 600;
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s;
}
.referral-link:hover { background: var(--accent2); text-decoration: none; }
@media (max-width: 480px) {
  .referral-banner { flex-wrap: wrap; }
  .referral-link   { width: 100%; text-align: center; }
}
/* ── END BUZZSPROUT REFERRAL ── */

/* ─── Credits ─── */
.credits {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.credits-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text3); opacity: 0.6;
}
.credits-list { display: flex; flex-wrap: wrap; gap: 6px; }
.credit-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 500; color: var(--text3);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.credit-chip:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.credit-chip svg { width: 11px; height: 11px; stroke: currentColor; fill: none; opacity: 0.6; flex-shrink: 0; }

@media (max-width: 540px) {
  .meta-grid { grid-template-columns: 1fr; }
  .meta-full { grid-column: 1; }
  .art-row   { flex-direction: column; }
  .art-thumb { width: 100%; height: 160px; }
}
@media (max-width: 480px) {
  .app-header { padding: 10px 16px; }
  .content    { padding: 20px 14px 40px; }
  .hero h1    { font-size: 20px; }
  .pl-delta   { display: none; }
}
