/* Social Channel Growth Plan — modern light gradient theme */
:root {
  --bg: #f6f7fc;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --border: #e3e7f0;
  --text: #1b2333;
  --muted: #6b7280;
  --grad-1: #6d28d9;
  --grad-2: #9333ea;
  --grad-3: #ec4899;
  --acc: #6d28d9;
  --acc-2: #8b5cf6;
  --ok: #10b981;
  --shadow: 0 10px 24px rgba(109, 40, 217, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(109, 40, 217, .10), transparent 60%),
    radial-gradient(1000px 500px at 105% 20%, rgba(236, 72, 153, .08), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  display: flex; min-height: 100vh; flex-direction: column;
}
main { width: 100%; max-width: 860px; margin: 0 auto; padding: 28px 16px 48px; flex: 1; }

/* ==== header + aurora gradient ==== */
.app-header {
  position: relative; overflow: hidden; padding: 26px 16px 26px;
  background: linear-gradient(120deg, #6d28d9 0%, #9333ea 45%, #ec4899 100%);
  color: #fff;
}
.aurora {
  position: absolute; inset: 0; pointer-events: none; opacity: .28;
  background:
    radial-gradient(600px 200px at 20% 0%, rgba(255,255,255,.5), transparent 70%),
    radial-gradient(500px 200px at 90% 100%, rgba(255,255,255,.35), transparent 70%);
}
.brand { display: flex; align-items: center; gap: 14px; max-width: 860px; margin: 0 auto; }
.brand img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.brand h1 { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: .2px; }
.brand p { margin: 4px 0 0; font-size: .95rem; opacity: .94; }
.chip {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  color: #fff; background: rgba(255,255,255,.18); white-space: nowrap;
}
.chip.missing .dot { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; }
.chip:not(.missing) .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

/* ==== cards ==== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 22px; box-shadow: var(--shadow);
}
.card.glow { background: linear-gradient(180deg, #ffffff, #f7f8fd); }
.section-label {
  margin: 0 0 14px; font-size: .82rem; font-weight: 800; letter-spacing: .3px;
  text-transform: uppercase; color: var(--acc); display: flex; align-items: center; gap: 8px;
}
.stepnum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--grad-1), var(--grad-3)); color: #fff;
  font-size: .72rem; font-weight: 800;
}

/* ==== handle input ==== */
.handle-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 13px 16px; transition: border-color .15s, box-shadow .15s;
}
.handle-row:focus-within { border-color: var(--acc-2); box-shadow: 0 0 0 4px rgba(139, 92, 246, .18); }
.handle-at { color: var(--acc); font-size: 1.25rem; font-weight: 800; }
.handle-input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 1.05rem; font-weight: 600; color: var(--text);
}
.handle-input::placeholder { color: var(--muted); font-weight: 400; }
.handle-hint { margin: 7px 0 0; font-size: .8rem; color: var(--muted); }
.handle-hint code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .76rem; }

.btn {
  border: 0; cursor: pointer; padding: 11px 18px; border-radius: 12px; font-size: .95rem; font-weight: 700;
  color: #fff; background: linear-gradient(120deg, var(--grad-1), var(--grad-3));
  box-shadow: 0 4px 14px rgba(109, 40, 217, .25); white-space: nowrap;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-arrow { font-weight: 800; }

/* ==== channel preview (auto-filled from handle) ==== */
.channel-preview {
  margin-top: 16px; display: flex; gap: 14px; align-items: center;
  border: 1px dashed var(--border); border-radius: 14px; padding: 12px 14px;
  background: linear-gradient(180deg, #fafbff, #f0f3fa);
}
.channel-preview img.avatar {
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--acc-2);
  object-fit: cover; background: var(--surface-2);
}
.channel-preview .cp-info { flex: 1; min-width: 0; }
.channel-preview .cp-name { margin: 0; font-size: 1.05rem; font-weight: 700; }
.channel-preview .cp-meta { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.channel-preview .cp-tag {
  font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #fff;
  background: linear-gradient(120deg, var(--grad-1), var(--grad-2)); white-space: nowrap;
}
.channel-preview.resolving .cp-tag { background: #f59e0b; }
.channel-preview .cp-err { font-size: .8rem; color: #dc2626; font-weight: 600; }

/* ==== advanced ==== */
details.advanced { margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
details.advanced summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--text); }
details.advanced summary em { color: var(--muted); font-weight: 400; }
details.advanced[open] { padding-bottom: 16px; }
.adv-ico { margin-right: 6px; }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field span { font-size: .78rem; font-weight: 600; color: var(--text); }
.field span small { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
  font-size: .9rem; font-family: inherit; color: var(--text); background: var(--surface);
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus { border-color: var(--acc-2); outline: 0; }

.status { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .86rem; min-height: 22px; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(139, 92, 246, .35);
  border-top-color: var(--acc-2); display: none; animation: spin .8s linear infinite;
}
.status.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==== report ==== */
.report { margin-top: 22px; }
.rep-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; position: sticky; top: 8px; z-index: 5;
  background: linear-gradient(180deg, #ffffff, #f6f8fd); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 12px; box-shadow: var(--shadow);
}
.tb {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: .8rem; font-weight: 600;
  padding: 6px 11px; border-radius: 9px; text-decoration: none; transition: border-color .15s;
}
.tb:hover { border-color: var(--acc-2); color: var(--acc); }
.tb.ok { color: var(--ok); border-color: var(--ok); }

.resultArea { margin-top: 12px; }

/* report blocks */
.resultArea > .rep-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px;
}
.rep-ident h2 {
  margin: 0; font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(120deg, var(--grad-1), var(--grad-3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.rep-meta { margin: 4px 0 0; font-size: .78rem; color: var(--muted); }
.rep-meta a { color: var(--acc); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; }
.rep-stage { margin-left: auto; text-align: right; font-size: .8rem; color: var(--muted); }
.rep-stage b { color: var(--acc); }

.block {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; margin: 12px 0;
}
.block-title { margin: 0 0 12px; font-size: 1rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; }
.b-ico { font-size: 1.05rem; }
.b-tag {
  font-size: .66rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; margin-left: 8px;
  color: #fff; background: linear-gradient(120deg, var(--grad-1), var(--grad-2));
}

/* verdict cards */
.verdicts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.verdict {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff, #f5f7fc);
}
.v-head { display: flex; align-items: center; gap: 9px; }
.v-num {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  font-size: .74rem; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--grad-2), var(--grad-3));
}
.v-head h3 { margin: 0 0 4px; font-size: .95rem; font-weight: 700; }
.v-answer { margin: 6px 0 10px; font-size: .92rem; }
.v-row { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.v-key { color: var(--muted); }
.v-val { color: var(--acc); font-weight: 700; }

.confbar {
  height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 4px 0 10px;
}
.confbar span {
  display: block; height: 100%;
  background: linear-gradient(120deg, var(--grad-1), var(--grad-3), #f59e0b);
}
.v-probs { margin-top: 6px; }
.v-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip-mini {
  display: inline-flex; align-items: center; gap: 6px; font-size: .72rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px;
}
.chip-mini i { color: var(--muted); }
.chip-mini b { color: var(--acc); font-weight: 700; }

.ramp-card {
  display: flex; gap: 16px; align-items: center; border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; margin-top: 12px; background: linear-gradient(180deg, #fff, #f5f7fc);
}
.ramp-card h3 { margin: 0 0 4px; font-size: .95rem; }
.ramp-card .v-answer { margin: 4px 0 0; font-size: 1.1rem; font-weight: 700; color: var(--acc); }
.ramp-side { margin-left: auto; min-width: 200px; }

.thesis p { margin: 0; font-size: .95rem; line-height: 1.6; }

.block ul { margin: 8px 0 6px; padding-left: 18px; }
.block ul li { margin: 4px 0; font-size: .92rem; line-height: 1.5; }

/* ==== footer ==== */
footer#cfgStatus {
  padding: 12px 16px; color: var(--muted); font-size: .78rem; text-align: center; margin-top: auto;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .adv-grid { grid-template-columns: 1fr; }
  .verdicts { grid-template-columns: 1fr; }
  .ramp-card { flex-direction: column; align-items: flex-start; }
  .ramp-side { width: 100%; }
  .rep-ident h2 { font-size: 1.25rem; }
}