/* =========================================================
   Instagram Bio Formatter — tool-specific styles.
   Layered on /tools/_shared/tool.css.

   Two visual layers:
   1. The editor (uses the shared design system; theme-aware)
   2. The .ig-frame preview (locked to Instagram's mobile light view
      regardless of the tool theme — point is to look like Instagram)
   ========================================================= */

/* ---------- Editor ---------- */
.bio-editor { margin-bottom: var(--space-5); }

.bio-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
@media (min-width: 540px) {
  .bio-fields-2up { grid-template-columns: 1fr 1fr; }
  .bio-fields-3up { grid-template-columns: repeat(3, 1fr); }
}

.bio-field { margin-bottom: var(--space-4); }
.bio-field:last-child { margin-bottom: 0; }
.bio-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.bio-field-hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--text-subtle);
  margin-left: 6px;
}
.bio-field-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.bio-field-header label { margin-bottom: 0; }

.bio-field input[type="text"],
.bio-field input[type="number"],
.bio-editor textarea {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-size: 15px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: var(--transition-colors);
}
.bio-editor textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.55;
  padding: var(--space-4);
}
.bio-editor textarea::placeholder {
  color: var(--text-subtle);
  white-space: pre-line;
}
.bio-field input:focus,
.bio-editor textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.bio-section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-subtle);
  margin: var(--space-5) 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--border);
}
.bio-section-eyebrow:first-child { margin-top: 0; }

.bio-count {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.bio-count strong {
  color: var(--text);
  font-weight: 600;
}
.bio-count strong.is-warn { color: var(--warning); }
.bio-count strong.is-over { color: var(--danger); }

.bio-option {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin-top: var(--space-3);
}
.bio-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Preview frame (Instagram mobile mockup) ----------
   Always renders in IG's light-mode look regardless of the tool theme.
   Inside this scope: Instagram font stack, exact hex grays, bright
   link blue, and pixel sizes that match the real IG mobile profile. */

.bio-preview-wrap { margin-bottom: var(--space-5); }
.bio-preview-wrap .section-eyebrow { margin-bottom: var(--space-3); }

.ig-frame {
  --ig-bg:         #ffffff;
  --ig-text:       #0a0a0a;
  --ig-muted:      #737373;
  --ig-border:     #dbdbdb;
  --ig-soft:       #efefef;
  --ig-soft-hov:   #dbdbdb;
  --ig-accent:     #0095f6;
  --ig-accent-hov: #1877f2;
  --ig-link:       #00376b;
  --ig-story-ring: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);

  display: flex;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ig-text);
  -webkit-font-smoothing: antialiased;
}

.ig-profile {
  width: 100%;
  background: var(--ig-bg);
  border: 1px solid var(--ig-border);
  border-radius: 4px;
  overflow: hidden;
}

/* ---------- Top bar (faux IG mobile chrome) ---------- */
.ig-topbar {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid var(--ig-border);
  background: var(--ig-bg);
  font-weight: 600;
  font-size: 16px;
  color: var(--ig-text);
}
.ig-topbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--ig-text);
  flex-shrink: 0;
}
.ig-topbar-handle {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  word-break: break-all;
  font-weight: 600;
}
.ig-topbar-handle-chevron {
  width: 14px;
  height: 14px;
  color: var(--ig-text);
}
.ig-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Header (avatar + stats) ---------- */
.ig-header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px 16px 12px;
}
.ig-avatar-wrap {
  flex-shrink: 0;
  padding: 3px;
  border-radius: 50%;
  background: var(--ig-border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
  display: block;
}
.ig-avatar-wrap[data-story="true"] { background: var(--ig-story-ring); }
.ig-avatar-wrap:hover { transform: scale(1.02); }
.ig-avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 3px solid var(--ig-bg);
  background: #fafafa center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b3b3b3;
  overflow: hidden;
  box-sizing: border-box;
}
.ig-avatar-camera {
  width: 28px;
  height: 28px;
  opacity: 0.9;
}
.ig-avatar.has-image { background-color: transparent; }
.ig-avatar.has-image .ig-avatar-camera { display: none; }

.ig-stats {
  display: flex;
  flex: 1;
  justify-content: space-around;
  text-align: center;
  gap: 8px;
}
.ig-stat__num {
  display: block;
  font-weight: 600;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  color: var(--ig-text);
  line-height: 1.2;
}
.ig-stat__label {
  font-size: 14px;
  color: var(--ig-text);
}

/* ---------- Bio block ---------- */
.ig-bio {
  padding: 0 16px 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ig-text);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.ig-bio__name {
  font-weight: 600;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.ig-bio__pronouns {
  color: var(--ig-muted);
  font-weight: 400;
  font-size: 13px;
}
.ig-bio__category {
  color: var(--ig-muted);
  margin-top: 2px;
}
.ig-bio__category[hidden] { display: none; }
.ig-bio__text {
  margin-top: 4px;
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 1.45em;
}
.ig-token {
  color: var(--ig-link);
  font-weight: 600;
}
.ig-bio__link {
  margin-top: 4px;
  color: var(--ig-link);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  word-break: break-all;
  pointer-events: none;
}
.ig-bio__link[hidden] { display: none; }

/* ---------- Action buttons ---------- */
.ig-actions {
  display: flex;
  gap: 6px;
  padding: 0 16px 16px;
}
.ig-btn {
  flex: 1;
  height: 32px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: default;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1;
}
.ig-btn--primary { background: var(--ig-accent); color: #fff; }
.ig-btn--secondary { background: var(--ig-soft); color: var(--ig-text); }
.ig-btn--icon {
  flex: 0 0 32px;
  background: var(--ig-soft);
  color: var(--ig-text);
}

/* ---------- Story highlights row (decorative) ---------- */
.ig-highlights {
  display: flex;
  gap: 14px;
  padding: 4px 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ig-highlights::-webkit-scrollbar { display: none; }
.ig-highlight {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ig-text);
  width: 64px;
}
.ig-highlight-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ig-soft);
  border: 1px solid var(--ig-border);
}
.ig-highlight-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

/* ---------- Tab strip (decorative) ---------- */
.ig-tabs {
  display: flex;
  border-top: 1px solid var(--ig-border);
}
.ig-tab {
  flex: 1;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ig-muted);
  border-top: 1px solid transparent;
  margin-top: -1px;
}
.ig-tab[data-active="true"] {
  color: var(--ig-text);
  border-top-color: var(--ig-text);
}
.ig-tab svg { width: 22px; height: 22px; }
