/* =========================================================================
   PORCHLYTE FORM TOOLS — SHARED DESIGN SYSTEM
   -------------------------------------------------------------------------
   This stylesheet is the cohesive base for every form tool in the suite.
   The shared base below is identical across the suite. Tool-specific rules
   for the Instagram Bio & Pinned Post Writer live in the clearly marked block
   at the bottom and only build on the tokens above; they never change them.

   Palette: white + cream surfaces, dark brown type, rust as an accent only.
   Type:    Chapza (display, falls back to Playfair Display) + Inter (body/UI).
   ========================================================================= */

:root {
  /* Brand palette */
  --cream: #efeae3;      /* page + section backgrounds */
  --white: #ffffff;      /* cards, tool surfaces, form fields */
  --tan: #d7c8ba;        /* secondary panels, hover, dividers, pills */
  --brown: #2b1f1b;      /* body text + headings, dark modules */
  --rust: #80441e;       /* accent only: buttons, active state, underlines */

  --text: var(--brown);
  --text-soft: #6f6157;  /* muted brown for sub text */
  --border: #e4dacd;     /* soft warm border */
  --error: #80441e;

  --font-display: "Chapza", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(43, 31, 27, 0.04), 0 6px 20px rgba(43, 31, 27, 0.05);

  --content-width: 760px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

/* The hidden attribute must always win, even over display rules like flex/grid. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 24px 96px;
}

.screen { display: none; }
.screen.active {
  display: block;
  animation: fadein 0.35s var(--ease);
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== TOOL HEADER (reusable shell — same on every form) ===== */
.tool-header {
  text-align: center;
  margin: 0 0 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.tool-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--brown);
  margin: 0 0 12px;
}
.tool-tagline {
  margin: 0 auto;
  max-width: 540px;
  color: var(--text-soft);
  font-size: 16px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--rust);
  color: #fff;
  border: 1px solid var(--rust);
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  box-shadow: 0 2px 8px rgba(128, 68, 30, 0.18);
}
.btn-primary:hover {
  background: #6c3818;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(128, 68, 30, 0.24);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--brown);
  color: #fff;
  border: 1px solid var(--brown);
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.2s var(--ease);
}
.btn-secondary:hover { background: #1c1512; transform: translateY(-1px); }

/* Quiet Copy button — tan pill */
.btn-copy {
  background: var(--tan);
  color: var(--brown);
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.btn-copy:hover { background: #cbb9a8; }
.btn-copy.is-copied { background: var(--rust); color: #fff; }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ===== FORM ===== */
#form, #loading, #results {
  margin: 0 auto;
}
.form-note {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rust);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 0 0 28px;
  color: var(--text-soft);
  font-size: 14.5px;
}
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.form-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-margin-top: 96px;
}
.form-section-title {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--rust);
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.field-row {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field.span-2 { grid-column: span 2; }
.field > span,
.field > legend {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-soft);
  text-align: left;
  padding-left: 2px;
}
.field > span em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--tan);
  margin-left: 6px;
}
.field input,
.field select,
.field textarea {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  font: inherit;
  color: inherit;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(128, 68, 30, 0.15);
}

.form-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 4px;
}
.form-actions .microcopy { text-align: center; }
.microcopy {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}
.form-error {
  color: var(--error);
  font-size: 14px;
  margin: 8px 0 0;
  font-weight: 500;
  background: #fbf1ea;
  border: 1px solid #e7c9b6;
  border-left: 3px solid var(--rust);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

/* ===== SCREEN HEADERS (used on the results screen) ===== */
.screen-header {
  text-align: left;
  margin: 8px 0 28px;
}
.screen-header.center { text-align: center; }
.screen-header h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 4.5vw, 46px);
  line-height: 1.05;
  color: var(--brown);
  margin: 0 0 12px;
}
.screen-header.center h2.underline { display: inline-block; }
.screen-header.center h2.underline::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  background: var(--rust);
  border-radius: 2px;
  margin: 14px auto 0;
}
.screen-sub {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
}

/* ===== LOADING ===== */
.loader {
  text-align: center;
  padding: 72px 0;
}
.loader h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.5vw, 32px);
  color: var(--brown);
  margin: 0 0 8px;
}

/* ===== RESULTS ===== */
.result-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.result-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--brown);
  color: #fff;
  padding: 12px 22px;
}
.result-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--tan);
}
.result-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: #fff;
}
.result-body { padding: 22px 22px 8px; }
.content-body {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--brown);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.result-card .card-actions { padding: 0 22px 20px; }

.results-again {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.card-error-msg {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
}

.result-card.just-arrived { animation: card-in 0.35s var(--ease); }
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 56px;
  padding: 26px 0 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-disclaimer {
  font-size: 12px;
  color: var(--text-soft);
  margin: 0 auto;
  max-width: 620px;
  opacity: 0.9;
  line-height: 1.55;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== RESPONSIVE (shared) ===== */
@media (max-width: 520px) {
  .app { padding: 28px 18px 80px; }
  .result-bar { padding: 11px 18px; }
  .result-body { padding: 18px 18px 6px; }
  .result-card .card-actions { padding: 0 18px 18px; }
  .field.span-2 { grid-column: auto; }
}

/* =========================================================================
   TOOL-SPECIFIC ADDITIONS (Instagram Bio & Pinned Post Writer only)
   Builds on the shared system above and reuses its tokens. Nothing here
   changes the shared components; it only adds the pieces this tool needs.
   ========================================================================= */

/* ---- Header badge + supporting copy ---- */
.tool-badge-cat {
  display: inline-block;
  background: var(--brown);
  color: var(--tan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}
.tool-subhead {
  margin: 0 auto;
  max-width: 560px;
  color: var(--rust);
  font-size: clamp(16px, 2.4vw, 19px);
  font-weight: 600;
}
.tool-support {
  margin: 12px auto 0;
  max-width: 560px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.6;
}
.tool-support em { font-style: italic; }
.tool-header-cta { margin-top: 22px; }

/* ---- Sticky progress summary ---- */
.progress-rail {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(239, 234, 227, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin: 0 0 28px;
  box-shadow: 0 4px 14px rgba(43, 31, 27, 0.05);
}
.progress-track {
  height: 5px;
  background: var(--tan);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 9px;
}
.progress-fill {
  display: block;
  height: 100%;
  width: 12.5%;
  background: var(--rust);
  border-radius: var(--radius-pill);
  transition: width 0.35s var(--ease);
}
.progress-current {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  padding: 2px 4px;
  text-align: left;
}
.progress-step {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--rust);
  white-space: nowrap;
}
.progress-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--brown);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-chevron { color: var(--text-soft); font-size: 12px; }
.progress-menu {
  list-style: none;
  margin: 8px 0 2px;
  padding: 6px 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}
.progress-menu li {
  font-size: 13px;
  color: var(--text-soft);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
}
.progress-menu li:hover { background: var(--tan); color: var(--brown); }
.progress-menu li .n {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--rust);
  min-width: 18px;
}
.progress-menu li.active { background: var(--rust); color: #fff; }
.progress-menu li.active .n { color: #fff; }
@media (max-width: 520px) {
  .progress-menu { grid-template-columns: 1fr; }
}

/* ---- Pill option groups ---- */
.pill-group {
  border: 0; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 14.5px;
  color: var(--brown);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease);
  user-select: none;
}
.pill:hover { border-color: var(--tan); background: #faf7f2; }
.pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill:has(input:focus-visible) {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(128, 68, 30, 0.15);
}
.pill:has(input:checked) {
  background: var(--rust);
  border-color: var(--rust);
  color: #fff;
  box-shadow: 0 2px 8px rgba(128, 68, 30, 0.2);
}
/* Disabled pills (e.g. once the brand-word limit is reached) read as unavailable. */
.pill.is-disabled { opacity: 0.4; cursor: not-allowed; }
.pill.is-disabled:hover { border-color: var(--border); background: var(--white); }

/* ---- Conditional reveal blocks ---- */
.conditional {
  margin-top: 4px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rust);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadein 0.3s var(--ease);
}
.help-text {
  font-size: 13.5px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.55;
}
.help-text.warn {
  border-left: 3px solid var(--tan);
  padding-left: 12px;
}

textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
textarea.tall { min-height: 150px; }

/* ---- Results toolbar + section titles ---- */
.results-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 0 0 26px; padding-bottom: 22px; border-bottom: 1px solid var(--border);
}
.section-title-row {
  display: flex; align-items: center; gap: 12px; margin: 34px 0 14px;
}
.section-title-row h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(20px, 3vw, 26px); color: var(--brown); margin: 0;
}
.section-title-row .rule { flex: 1; height: 1px; background: var(--border); }

/* This form's primary generate button is black (suite variant). */
#btn-generate {
  background: var(--brown); border-color: var(--brown);
  box-shadow: 0 2px 8px rgba(43, 31, 27, 0.18);
}
#btn-generate:hover { background: #1c1512; box-shadow: 0 5px 14px rgba(43, 31, 27, 0.24); }

/* =========================================================================
   RESULTS — PROFILE SCORE
   ========================================================================= */
.score-card {
  background: var(--brown); color: #fff;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  overflow: hidden; margin-bottom: 22px;
}
.score-top {
  display: flex; align-items: center; gap: 24px;
  padding: 24px; flex-wrap: wrap;
}
.score-ring {
  --pct: 0;
  position: relative;
  width: 108px; height: 108px; flex: 0 0 108px;
  border-radius: 50%;
  background: conic-gradient(var(--rust) calc(var(--pct) * 1%), rgba(255,255,255,0.14) 0);
  display: grid; place-items: center;
}
.score-ring::after {
  content: ""; position: absolute; inset: 9px;
  border-radius: 50%; background: var(--brown);
}
.score-ring .score-value {
  position: relative; z-index: 1; text-align: center; line-height: 1;
}
.score-ring .score-num {
  font-family: var(--font-display); font-weight: 700; font-size: 34px; color: #fff;
}
.score-ring .score-den { font-size: 11px; color: var(--tan); letter-spacing: 0.08em; }
.score-headline { flex: 1; min-width: 220px; }
.score-headline .score-label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 700; color: var(--tan); margin: 0 0 8px;
}
.score-headline .score-summary { margin: 0; font-size: 16px; line-height: 1.55; color: #fff; }
.score-recs {
  border-top: 1px solid rgba(255,255,255,0.14);
  padding: 20px 24px 24px;
}
.score-recs h4 {
  margin: 0 0 12px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; color: var(--tan);
}
.score-recs ol { margin: 0; padding-left: 20px; }
.score-recs li { margin: 0 0 8px; font-size: 15px; line-height: 1.5; color: #f3ede6; }
@media (max-width: 520px) {
  .score-ring { width: 92px; height: 92px; flex-basis: 92px; }
  .score-ring .score-num { font-size: 28px; }
}

/* =========================================================================
   RESULTS — POSITIONING SUMMARY
   ========================================================================= */
.positioning-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  overflow: hidden; margin-bottom: 22px;
}
.positioning-top {
  background: var(--tan); color: var(--brown); padding: 12px 22px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
}
.positioning-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.positioning-row .label {
  display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; color: var(--rust); margin-bottom: 5px;
}
.positioning-row .value { margin: 0; font-size: 15.5px; color: var(--brown); line-height: 1.55; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.keyword-chip {
  background: var(--cream); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 5px 12px;
  font-size: 13px; color: var(--brown);
}

/* =========================================================================
   RESULTS — GENERIC CARD INTERIORS
   ========================================================================= */
.result-card + .result-card { margin-top: 16px; }

/* ---- Progressive loading: shimmer placeholders + writing indicator ---- */
.result-card.is-pending { opacity: 0.85; }
.shimmer { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 16px; }
.shimmer span {
  height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--cream) 25%, #e7ddd0 37%, var(--cream) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.shimmer span:nth-child(1) { width: 100%; }
.shimmer span:nth-child(2) { width: 92%; }
.shimmer span:nth-child(3) { width: 68%; }
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.result-card.just-arrived { animation: card-in 0.35s var(--ease); }

.results-writing {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 20px 0 0; color: var(--text-soft); font-size: 14px;
}
.writing-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--rust);
  animation: writing-pulse 1s ease-in-out infinite;
}
@keyframes writing-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .shimmer span, .writing-dot { animation: none; }
}

.piece-field { padding: 16px 0; border-top: 1px solid var(--border); }
.piece-field:first-child { border-top: none; padding-top: 4px; }
.piece-field-label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; color: var(--rust); margin: 0 0 8px;
}
.piece-strong { margin: 0; font-size: 16.5px; font-weight: 600; color: var(--brown); line-height: 1.4; }
.piece-italic { margin: 0; font-size: 14.5px; color: var(--text-soft); font-style: italic; }
.piece-cta {
  margin: 0; padding: 12px 16px; background: var(--cream);
  border-radius: var(--radius-md); border-left: 3px solid var(--rust);
  font-size: 15px; color: var(--brown);
}
.piece-meta-line { margin: 0; font-size: 14px; color: var(--text-soft); line-height: 1.55; }
.hashtags { margin: 4px 0 0; font-size: 14px; color: var(--rust); word-spacing: 4px; }

/* ---- Bio options ---- */
.bio-option { padding: 18px 0; border-top: 1px solid var(--border); }
.bio-option:first-child { border-top: none; padding-top: 4px; }
.bio-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.bio-style-tag {
  display: inline-block; background: var(--tan); color: var(--brown);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 12px; border-radius: var(--radius-pill);
}
.bio-count {
  margin-left: auto; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 600; color: var(--text-soft);
}
.bio-count.over { color: var(--rust); }
.bio-text {
  margin: 0 0 10px; padding: 16px 18px;
  background: var(--cream); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15.5px; line-height: 1.55; color: var(--brown);
  white-space: pre-wrap; word-wrap: break-word;
}
.bio-note { margin: 0 0 10px; font-size: 13.5px; color: var(--text-soft); line-height: 1.5; }

/* ---- Name field + username lists ---- */
.name-row { padding: 14px 0; border-top: 1px solid var(--border); }
.name-row:first-child { border-top: none; padding-top: 2px; }
.name-value {
  margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--brown);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.name-copy {
  background: none; border: 0; cursor: pointer; font-family: inherit;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--rust); padding: 2px 4px;
}
.name-copy.is-copied { color: var(--brown); }
.name-why { margin: 0; font-size: 13.5px; color: var(--text-soft); line-height: 1.5; }

/* ---- Pinned post cards ---- */
.pinned-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  overflow: hidden; margin-bottom: 16px;
}
.pinned-top {
  display: flex; align-items: center; gap: 12px;
  background: var(--brown); color: #fff; padding: 12px 22px;
}
.pinned-num { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--tan); }
.pinned-title { font-size: 15px; font-weight: 600; color: #fff; }
.pinned-pin { margin-left: auto; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tan); }
.pinned-body { padding: 20px 22px 8px; }

/* ---- Highlights ---- */
.highlight-list {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  padding: 4px 0 8px;
}
.highlight-item {
  background: var(--cream); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center;
}
.highlight-cover {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--rust);
  display: grid; place-items: center;
}
.highlight-cover svg { width: 26px; height: 26px; stroke: var(--rust); fill: none; stroke-width: 1.8; }
.highlight-name { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--brown); }
.highlight-desc { font-size: 12.5px; color: var(--text-soft); line-height: 1.45; }
.highlight-icon-note { font-size: 11px; color: var(--rust); font-style: italic; }

/* ---- Audit ---- */
.audit-block { padding: 16px 0; border-top: 1px solid var(--border); }
.audit-block:first-child { border-top: none; padding-top: 4px; }
.audit-block h4 {
  margin: 0 0 10px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 600; color: var(--rust); display: flex; align-items: center; gap: 8px;
}
.audit-block h4 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rust); }
.audit-block.working h4 .dot { background: #4f7a3a; }
.audit-block.working h4 { color: #4f7a3a; }
.audit-list { margin: 0; padding-left: 20px; }
.audit-list li { margin: 0 0 7px; font-size: 15px; color: var(--brown); line-height: 1.5; }

/* ---- Profile tips ---- */
.tips-list { margin: 4px 0 8px; padding-left: 20px; }
.tips-list li { margin: 0 0 8px; font-size: 15px; color: var(--brown); line-height: 1.5; }

/* ---- Checklist ---- */
.checklist { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 8px; }
.check-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.check-item:last-child { border-bottom: none; }
.check-mark {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; margin-top: 1px;
  font-size: 12px; font-weight: 700; color: #fff;
}
.check-item.done .check-mark { background: #4f7a3a; }
.check-item.partial .check-mark { background: var(--tan); color: var(--brown); }
.check-item.todo .check-mark { background: var(--white); border: 2px solid var(--border); color: transparent; }
.check-main { flex: 1; }
.check-name { margin: 0; font-size: 15px; font-weight: 600; color: var(--brown); }
.check-item.todo .check-name { color: var(--text-soft); }
.check-note { margin: 3px 0 0; font-size: 13px; color: var(--text-soft); line-height: 1.45; }
.check-status {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-pill); align-self: flex-start; margin-top: 2px;
}
.check-item.done .check-status { background: #e3ecdb; color: #4f7a3a; }
.check-item.partial .check-status { background: var(--tan); color: var(--brown); }
.check-item.todo .check-status { background: var(--cream); color: var(--text-soft); }

/* =========================================================================
   LOADER SCENE — INSTAGRAM PROFILE ON A PHONE
   The profile assembles on a loop: photo, then bio, highlights, pinned posts.
   ========================================================================= */
.ig-loader { display: flex; justify-content: center; margin: 0 auto 32px; }
.ig-svg { width: 190px; height: auto; overflow: visible; }

.ig-phone { fill: var(--brown); }
.ig-screen { fill: var(--white); }
.ig-notch { stroke: #6b5c52; stroke-width: 3; stroke-linecap: round; }
.ig-skeleton { fill: #eee5da; }

.ig-avatar-ring { fill: none; stroke: var(--rust); stroke-width: 2; }
.ig-avatar-fill { fill: var(--tan); }
.ig-avatar-head { fill: var(--brown); }
.ig-avatar-body { fill: var(--brown); }
.ig-stat-dot { fill: var(--brown); }
.ig-stat-line { stroke: var(--tan); stroke-width: 3; stroke-linecap: round; }
.ig-bio-line { stroke: var(--brown); stroke-width: 3; stroke-linecap: round; }
.ig-bio-link { stroke: var(--rust); stroke-width: 3; stroke-linecap: round; }
.ig-hl circle { fill: var(--white); stroke: var(--rust); stroke-width: 2; }
.ig-hl line { stroke: var(--tan); stroke-width: 2.5; stroke-linecap: round; }
.ig-post rect { fill: var(--tan); }
.ig-post-2 rect { fill: #cbb9a8; }
.ig-post-3 rect { fill: #e0d3c4; }
.ig-pin { fill: var(--rust); }

/* The whole scene runs on one 6s loop. Each group fades/pops in on cue, holds,
   then the scene resets. Skeletons show first and are replaced by real content. */
.ig-avatar-skel { animation: ig-skel 6s ease-in-out infinite; }
.ig-avatar { transform-box: fill-box; transform-origin: 66px 86px; animation: ig-pop-avatar 6s ease-in-out infinite; opacity: 0; }
@keyframes ig-skel {
  0%, 10% { opacity: 1; }
  16%, 100% { opacity: 0; }
}
@keyframes ig-pop-avatar {
  0%, 12% { opacity: 0; transform: scale(0.6); }
  20% { opacity: 1; transform: scale(1.08); }
  26%, 92% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.6); }
}

.ig-stats { opacity: 0; animation: ig-fade 6s ease-in-out infinite; animation-delay: 0s; }
@keyframes ig-fade {
  0%, 20% { opacity: 0; }
  30%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

.ig-bio-skel { animation: ig-skel-bio 6s ease-in-out infinite; }
@keyframes ig-skel-bio {
  0%, 26% { opacity: 1; }
  32%, 100% { opacity: 0; }
}
.ig-bio-line, .ig-bio-link { opacity: 0; }
.ig-bio-1 { animation: ig-line 6s ease-in-out infinite; animation-delay: -5.0s; }
.ig-bio-2 { animation: ig-line 6s ease-in-out infinite; animation-delay: -4.85s; }
.ig-bio-3 { animation: ig-line 6s ease-in-out infinite; animation-delay: -4.7s; }
.ig-bio-4 { animation: ig-line 6s ease-in-out infinite; animation-delay: -4.55s; }
/* ig-line uses a long negative delay so the four lines appear in quick sequence
   around the 32-40% mark, then all hold until the reset. */
@keyframes ig-line {
  0%, 8% { opacity: 0; transform: translateX(-4px); }
  14%, 92% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; }
}

.ig-hl { opacity: 0; transform-box: fill-box; transform-origin: center; }
.ig-hl-1 { animation: ig-pop 6s ease-in-out infinite; animation-delay: -4.2s; }
.ig-hl-2 { animation: ig-pop 6s ease-in-out infinite; animation-delay: -4.05s; }
.ig-hl-3 { animation: ig-pop 6s ease-in-out infinite; animation-delay: -3.9s; }
.ig-hl-4 { animation: ig-pop 6s ease-in-out infinite; animation-delay: -3.75s; }
@keyframes ig-pop {
  0%, 6% { opacity: 0; transform: scale(0.4); }
  12% { opacity: 1; transform: scale(1.12); }
  18%, 92% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.4); }
}

.ig-post { opacity: 0; transform-box: fill-box; transform-origin: center top; }
.ig-post-1 { animation: ig-drop 6s ease-in-out infinite; animation-delay: -3.4s; }
.ig-post-2 { animation: ig-drop 6s ease-in-out infinite; animation-delay: -3.25s; }
.ig-post-3 { animation: ig-drop 6s ease-in-out infinite; animation-delay: -3.1s; }
@keyframes ig-drop {
  0%, 6% { opacity: 0; transform: translateY(-8px) scale(0.9); }
  14% { opacity: 1; transform: translateY(0) scale(1); }
  20%, 92% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.9); }
}

@media (prefers-reduced-motion: reduce) {
  .ig-avatar-skel, .ig-bio-skel { opacity: 0 !important; }
  .ig-avatar, .ig-stats, .ig-bio-line, .ig-bio-link, .ig-hl, .ig-post {
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
}

/* =========================================================================
   PRINT / SAVE AS PDF
   ========================================================================= */
@media print {
  .tool-header-cta, .progress-rail, .results-toolbar, .results-again,
  #form, #loading, .card-actions, .name-copy,
  .site-footer .footer-disclaimer { display: none !important; }
  body { background: #fff; }
  .app { padding: 0; max-width: 100%; }
  .result-card, .score-card, .positioning-card, .pinned-card {
    box-shadow: none; break-inside: avoid; page-break-inside: avoid;
  }
  .result-bar, .pinned-top, .positioning-top, .score-card {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .screen { display: block !important; }
  #form, #loading { display: none !important; }
}
