/* ===== Design tokens ===== */
:root {
  --navy: #1f3864;
  --navy-dark: #142544;
  --accent: #2e75b6;
  --accent-light: #dce6f1;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5b6472;
  --border: #e2e6ec;
  --success: #2e7d4f;
  --success-bg: #e6f4ea;
  --warning: #9a6700;
  --warning-bg: #fff4d6;
  --danger: #b3261e;
  --danger-bg: #fdeceb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(20, 37, 68, 0.08), 0 1px 2px rgba(20, 37, 68, 0.06);
  --shadow-md: 0 4px 14px rgba(20, 37, 68, 0.1);
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
h1, h2, h3, h4 { margin: 0 0 8px; color: var(--navy); font-weight: 700; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* ===== App shell ===== */
#app { min-height: 100vh; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  background: var(--navy-dark);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  font-weight: 800;
  font-size: 16px;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}
.sidebar-brand span { color: var(--accent-light); }
.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
  padding: 14px 20px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.82);
  cursor: pointer;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
  background: rgba(46,117,182,0.25);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}
.nav-icon { width: 18px; text-align: center; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 64px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-title { font-weight: 700; font-size: 17px; color: var(--navy); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.content { padding: 28px; max-width: 1200px; width: 100%; margin: 0 auto; }
/* Opt-in override for views that want to use the full browser width instead
   of the default 1200px reading-width column (e.g. the Marketplace product
   grid). Applied/removed per-view in router.js so it never leaks into other
   modules. */
.content.content-wide { max-width: none; }

/* ===== Cards & layout ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-flat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.page-header { margin-bottom: 20px; }
.page-header .eyebrow {
  text-transform: uppercase; letter-spacing: .08em; font-size: 11px;
  color: var(--accent); font-weight: 700; margin-bottom: 4px;
}
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.stat-card { text-align: left; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; color: var(--navy); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); }
.stat-card .stat-delta { font-size: 12px; font-weight: 600; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: opacity .15s, transform .05s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.92; }
.btn-secondary { background: var(--accent-light); color: var(--navy); }
.btn-secondary:hover { opacity: 0.85; }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ===== Forms ===== */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="tel"], input[type="date"],
select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.flex-gap input[type="date"] { width: auto; }
textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 16px; }
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.option-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 14px;
  cursor: pointer; text-align: center; font-weight: 600; font-size: 14px; transition: all .15s;
}
.option-card:hover { border-color: var(--accent); }
.option-card.selected { border-color: var(--accent); background: var(--accent-light); color: var(--navy); }

/* ===== Badges / tags ===== */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--accent-light); color: var(--navy); }
.badge-grey { background: #eef0f3; color: var(--text-muted); }

/* ===== Notices (compliance flags etc.) ===== */
.notice { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin-bottom: 16px; border-left: 4px solid; }
.notice-warning { background: var(--warning-bg); border-color: var(--warning); color: #6b4d00; }
.notice-info { background: var(--accent-light); border-color: var(--accent); color: var(--navy); }
.notice-danger { background: var(--danger-bg); border-color: var(--danger); color: #7a1a14; }

/* ===== Progress ===== */
.progress-track { background: #eef0f3; border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.progress-fill.warn { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }

/* ===== Mini trend bars (7-day health history) ===== */
.minibars { display: flex; align-items: flex-end; gap: 8px; height: 90px; margin-top: 16px; }
.minibars .mbar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 5px; }
.minibars .mbar-track { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.minibars .mbar-fill { width: 100%; border-radius: 4px 4px 2px 2px; background: var(--accent); min-height: 3px; transition: height .3s; }
.minibars .mbar-fill.warn { background: var(--warning); }
.minibars .mbar-fill.today { background: var(--navy); }
.minibars .mbar-value { font-size: 10px; font-weight: 700; color: var(--navy); }
.minibars .mbar-label { font-size: 10px; color: var(--text-muted); }
.minibars .mbar-track.stacked { flex-direction: column-reverse; align-items: stretch; }
.minibars .mbar-seg { width: 100%; min-height: 3px; }
.minibars .mbar-seg.healthy { background: var(--success); }
.minibars .mbar-seg.junk { background: var(--danger); }
.minibars .mbar-seg.moderate { background: var(--accent); }
.minibars .mbar-seg.unknown { background: #c7cbd1; }
.minibars .mbar-track.stacked .mbar-seg:last-child { border-radius: 4px 4px 2px 2px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 9px 16px; font-size: 14px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== Table ===== */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px 10px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

/* ===== Lists ===== */
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.simple-list li:last-child { border-bottom: none; }
.simple-list li[draggable="true"] { cursor: grab; }
.simple-list li.dragging { opacity: 0.4; }
.simple-list li.drag-over { background: var(--accent-light); border-radius: var(--radius-sm); }
.drag-handle { display: inline-block; margin-right: 8px; color: var(--text-muted); cursor: grab; }
.simple-list li.task-virtual { background: var(--accent-light); border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; }
.simple-list li.task-virtual .drag-handle { cursor: default; }

/* ===== Chat ===== */
.chat-window { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px; margin-bottom: 14px; }
.chat-bubble { max-width: 75%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.chat-bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.ai { align-self: flex-start; background: var(--accent-light); color: var(--navy); border-bottom-left-radius: 4px; }
.chat-bubble.ai.demo { background: #eef0f3; color: var(--text-muted); font-style: italic; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row textarea { flex: 1; min-height: 44px; }

/* ===== Cards used for marketplace / listing items ===== */
/* Denser, self-wrapping grid for the product catalog: keeps cards at a
   sensible minimum width but adds as many columns as fit the available
   width, so it scales up on wide screens instead of staying pinned at 3. */
.product-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.product-card { display: flex; flex-direction: column; gap: 0; padding: 16px; transition: box-shadow .15s, transform .15s; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-thumb {
  position: relative; height: 130px; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--accent-light), #fff);
  display: flex; align-items: center; justify-content: center; font-size: 38px; color: var(--accent);
  margin-bottom: 12px;
}
.product-creator-badge {
  position: absolute; top: 8px; right: 8px; background: var(--navy); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.product-card-body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-title {
  font-size: 15px; font-weight: 700; color: var(--navy); margin: 0; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card-footer { margin-top: auto; }
.price { font-weight: 800; color: var(--navy); font-size: 16px; }

/* ===== Onboarding ===== */
.onboard-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  padding: 24px;
}
.onboard-card {
  background: #fff; border-radius: 16px; padding: 36px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow-md);
}
.onboard-steps { display: flex; gap: 6px; margin-bottom: 22px; }
.onboard-step-dot { flex: 1; height: 4px; border-radius: 999px; background: var(--border); }
.onboard-step-dot.done { background: var(--accent); }
.brand-logo { font-weight: 800; font-size: 20px; color: var(--navy); margin-bottom: 6px; text-align: center; }
.brand-logo span { color: var(--accent); }

/* ===== Resume builder ===== */
.resume-preview-wrap { overflow-x: auto; background: #eef0f3; padding: 20px; border-radius: var(--radius-sm); }
.resume-preview { background: #fff; padding: 36px; max-width: 680px; margin: 0 auto; box-shadow: var(--shadow); min-height: 200px; border-radius: 2px; }
.resume-section { margin-top: 18px; }
.resume-section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-bottom: 10px; }
.resume-entry { margin-bottom: 12px; }
.resume-entry-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.resume-dates { color: var(--text-muted); font-size: 12.5px; white-space: nowrap; }
.resume-entry ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; }
.resume-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.resume-skill-tag { background: var(--resume-accent-light, var(--accent-light)); color: var(--resume-accent, var(--navy)); padding: 3px 10px; border-radius: 999px; font-size: 12.5px; }
.resume-title { font-size: 14.5px; font-weight: 600; margin: 2px 0 6px; }
.resume-dot { opacity: .6; }

/* Fields made directly editable in the live preview (see resumebuilder.js
   renderResumeHTML opts.editable) — a dashed outline on hover/focus is the
   only visual cue; nothing else about the layout changes. */
.resume-preview [contenteditable="true"] { border-radius: 2px; }
.resume-preview [contenteditable="true"]:hover { outline: 1px dashed var(--accent); cursor: text; }
.resume-preview [contenteditable="true"]:focus { outline: 2px solid var(--accent); background: rgba(46, 117, 182, 0.06); }

/* Classic: centered serif header, traditional */
.resume-tpl-classic .resume-header { text-align: center; border-bottom: 2px solid var(--resume-accent, var(--navy)); padding-bottom: 12px; }
.resume-tpl-classic .resume-name { font-family: Georgia, 'Times New Roman', serif; font-size: 26px; color: var(--resume-accent, var(--navy)); margin: 0 0 2px; }
.resume-tpl-classic .resume-title { color: var(--text-muted); font-weight: 600; }
.resume-tpl-classic .resume-contact { font-size: 12.5px; color: var(--text-muted); }
.resume-tpl-classic .resume-section h2 { color: var(--resume-accent, var(--navy)); }

/* Modern: solid navy header band, bold sans-serif */
.resume-tpl-modern .resume-header { background: var(--resume-accent, var(--navy)); color: #fff; margin: -36px -36px 18px; padding: 28px 36px; border-radius: 2px 2px 0 0; }
.resume-tpl-modern .resume-name { font-size: 28px; font-weight: 800; margin: 0 0 4px; color: #fff; }
.resume-tpl-modern .resume-title { color: #fff; opacity: .85; }
.resume-tpl-modern .resume-contact { font-size: 12.5px; color: var(--resume-accent-light, var(--accent-light)); }
.resume-tpl-modern .resume-section h2 { color: var(--resume-accent, var(--accent)); }

/* Minimal: left-aligned, light, plenty of whitespace */
.resume-tpl-minimal .resume-header { text-align: left; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.resume-tpl-minimal .resume-name { font-size: 24px; font-weight: 600; color: #1a1a1a; margin: 0 0 2px; }
.resume-tpl-minimal .resume-title { color: var(--text-muted); font-weight: 500; }
.resume-tpl-minimal .resume-contact { font-size: 12px; color: var(--text-muted); }
.resume-tpl-minimal .resume-section h2 { font-weight: 600; letter-spacing: .03em; border-bottom: none; color: #1a1a1a; }

/* Bold: heavy full-bleed header band, accent rail down each entry */
.resume-tpl-bold .resume-header { background: var(--resume-accent, var(--navy)); color: #fff; margin: -36px -36px 18px; padding: 32px 36px; border-left: 10px solid var(--resume-accent-light, var(--accent-light)); }
.resume-tpl-bold .resume-name { font-size: 30px; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 4px; color: #fff; }
.resume-tpl-bold .resume-title { color: #fff; opacity: .9; font-weight: 600; }
.resume-tpl-bold .resume-contact { font-size: 12.5px; color: var(--resume-accent-light, var(--accent-light)); }
.resume-tpl-bold .resume-section h2 { color: #fff; background: var(--resume-accent, var(--navy)); padding: 4px 10px; border-bottom: none; display: inline-block; }
.resume-tpl-bold .resume-entry { border-left: 3px solid var(--resume-accent, var(--navy)); padding-left: 12px; }

/* Elegant: serif, centered, small-caps headers, thin accent rule */
.resume-tpl-elegant .resume-header { text-align: center; padding-bottom: 14px; border-bottom: 1px solid var(--resume-accent, var(--navy)); }
.resume-tpl-elegant .resume-name { font-family: Georgia, 'Times New Roman', serif; font-size: 27px; font-weight: 400; letter-spacing: .04em; color: #1a1a1a; margin: 0 0 4px; }
.resume-tpl-elegant .resume-title { font-family: Georgia, serif; font-style: italic; color: var(--resume-accent, var(--navy)); font-weight: 400; }
.resume-tpl-elegant .resume-contact { font-size: 12px; color: var(--text-muted); letter-spacing: .03em; }
.resume-tpl-elegant .resume-section h2 { font-family: Georgia, serif; font-variant: small-caps; font-weight: 400; letter-spacing: .08em; color: var(--resume-accent, var(--navy)); border-bottom: 1px solid var(--resume-accent-light, var(--accent-light)); }

/* Compact: dense single column, smaller type, fits more on one page */
.resume-tpl-compact .resume-doc { font-size: 13px; }
.resume-tpl-compact .resume-header { border-bottom: 1px solid var(--resume-accent, var(--accent)); padding-bottom: 8px; }
.resume-tpl-compact .resume-name { font-size: 21px; font-weight: 700; color: #1a1a1a; margin: 0 0 1px; }
.resume-tpl-compact .resume-title { color: var(--resume-accent, var(--accent)); font-weight: 600; font-size: 12.5px; }
.resume-tpl-compact .resume-contact { font-size: 11.5px; color: var(--text-muted); }
.resume-tpl-compact .resume-section { margin-top: 10px; }
.resume-tpl-compact .resume-section h2 { font-size: 11px; color: var(--resume-accent, var(--accent)); border-bottom: 1px solid var(--resume-accent-light, var(--accent-light)); padding-bottom: 2px; margin-bottom: 6px; }
.resume-tpl-compact .resume-entry { margin-bottom: 8px; }

.resume-color-swatch { width: 18px; height: 18px; border-radius: 50%; display: inline-block; vertical-align: middle; border: 1px solid var(--border); }

/* ===== ATS Compatibility Check ===== */
#ats-jd-text { min-height: 100px; }
.ats-score-row { display: flex; align-items: center; gap: 14px; }
.ats-score-badge {
  flex: none; width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; background: var(--accent-light); color: var(--navy);
}
.ats-score-badge span { font-size: 11px; font-weight: 600; opacity: .7; margin-left: 1px; }
.ats-score-badge.ats-score-good { background: var(--success-bg); color: var(--success); }
.ats-score-badge.ats-score-ok { background: var(--warning-bg); color: var(--warning); }
.ats-score-badge.ats-score-low { background: var(--danger-bg); color: var(--danger); }
.ats-checklist { display: flex; flex-direction: column; gap: 8px; }
.ats-check-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg); }
.ats-check-icon { flex: none; font-size: 14px; line-height: 1.5; }
.ats-check-item.ats-check-fail { background: var(--danger-bg); }
.ats-check-item.ats-check-warn { background: var(--warning-bg); }
.ats-keyword-pill {
  display: inline-block; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; margin: 0 4px 4px 0;
}
.ats-keyword-pill.ats-keyword-matched { background: var(--success-bg); color: var(--success); }
.ats-keyword-pill.ats-keyword-missing { background: var(--danger-bg); color: var(--danger); }

/* ===== Misc ===== */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { display: flex; gap: 10px; align-items: center; }
.center-text { text-align: center; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.spinner {
  width: 18px; height: 18px; border: 2.5px solid var(--accent-light); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.module-icon-tile {
  width: 44px; height: 44px; border-radius: 10px; background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.section-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ===== AI Social Studio ===== */
/* Stories + composer combined into one card, single professional surface
   instead of two stacked boxes each shouting its own large heading. */
.social-create-card { padding: 18px 20px; }
.social-create-section { padding: 2px 0; }
.social-section-label {
  text-transform: uppercase; letter-spacing: .07em; font-size: 11.5px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 8px;
}
.social-create-divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.social-create-actions { justify-content: flex-end; }

.social-dropzone {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 22px 16px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-muted); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.social-dropzone:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.social-dropzone-icon { display: flex; color: inherit; }
.social-dropzone-icon svg { width: 18px; height: 18px; }

.stories-bar { display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 12px; }
.story-circle { flex: 0 0 auto; width: 66px; text-align: center; cursor: pointer; }
.story-ring {
  width: 60px; height: 60px; border-radius: 50%; padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--navy));
  display: flex; align-items: center; justify-content: center; margin: 0 auto 5px;
  overflow: hidden;
}
.story-ring img, .story-ring video {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--card); display: block;
}
.story-circle.add .story-ring { background: var(--accent-light); color: var(--accent); font-size: 24px; font-weight: 700; }
.story-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 66px; }

.social-type-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-pill {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--border); color: var(--text-muted); background: #fff;
}
.tab-pill.active { border-color: var(--accent); background: var(--accent-light); color: var(--navy); }
.social-preview { max-width: 260px; border-radius: var(--radius-sm); overflow: hidden; margin-top: 10px; background: #eef0f3; }
.social-preview img, .social-preview video { width: 100%; display: block; max-height: 300px; object-fit: contain; }
.composer-thumb-picker { margin-top: 10px; max-width: 260px; }
.composer-thumb-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.composer-thumb-preview { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

.social-feed { width: 100%; }

/* Instagram-style profile tabs (Posts / Reels) above the grid — kept narrow
   and centered so two tabs don't stretch into oversized empty buttons on a
   wide screen, even though the grid below them uses the full width. */
.social-feed-tabs { display: flex; max-width: 420px; margin: 0 auto 2px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.social-feed-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 0; background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 13px; font-weight: 600; border-top: 2px solid transparent; margin-top: -1px;
}
.social-feed-tab svg { width: 18px; height: 18px; }
.social-feed-tab.active { color: var(--navy); border-top-color: var(--navy); }

/* Square photo/reel grid, Instagram-profile style — sized tiles that wrap
   to fill whatever width is available instead of a fixed 3-up column, so
   the grid uses the same full width as the cards above it. */
.social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.grid-item { position: relative; aspect-ratio: 1 / 1; background: #000; overflow: hidden; cursor: pointer; }
.grid-item img, .grid-item video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.grid-item-badge { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); display: flex; pointer-events: none; }
.grid-item-badge svg { width: 14px; height: 14px; }

.post-card { padding: 0; overflow: hidden; }
.post-card-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 0; }
.post-card-media { width: 100%; background: #000; display: flex; align-items: center; justify-content: center; max-height: 520px; overflow: hidden; position: relative; }
.post-card-media img, .post-card-media video { width: 100%; max-height: 520px; object-fit: contain; display: block; }
.post-card.reel .post-card-media { aspect-ratio: 9 / 16; max-height: 600px; cursor: pointer; }
.post-card.reel .post-card-media video { height: 100%; object-fit: cover; pointer-events: none; }
.post-card-body { padding: 12px 16px 16px; }
.post-hashtag-inline { color: var(--accent); font-weight: 600; }
.post-actions { display: flex; gap: 16px; margin-top: 10px; }
.post-action-btn { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; padding: 4px 0; }
.post-action-btn.liked { color: #e0245e; font-weight: 700; }
.post-comments { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.post-comment { font-size: 13px; margin-bottom: 6px; }
.post-comment strong { color: var(--navy); }
.post-comment-input { display: flex; gap: 8px; margin-top: 6px; }
.post-comment-input input { flex: 1; }
.reel-badge { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; pointer-events: none; }
.reel-play-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 40px; opacity: .85; pointer-events: none; text-shadow: 0 1px 6px rgba(0,0,0,.5);
}

/* Full-screen overlays: Status viewer + Reels viewer */
.social-overlay {
  position: fixed; inset: 0; background: rgba(10, 14, 22, .94); z-index: 200;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.social-overlay-close {
  position: absolute; top: 16px; right: 20px; color: #fff; font-size: 28px; cursor: pointer;
  background: none; border: none; line-height: 1; z-index: 2;
}
.social-overlay-media { position: relative; max-width: min(420px, 92vw); max-height: 78vh; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.social-overlay-media img, .social-overlay-media video { width: 100%; height: 100%; object-fit: contain; display: block; max-height: 78vh; }
.social-overlay-mute {
  position: absolute; bottom: 12px; right: 12px; z-index: 2;
  background: var(--accent); border: 2px solid #fff; color: #fff; width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.social-overlay-mute svg { width: 16px; height: 16px; }
.social-overlay-thumb-btn {
  position: absolute; bottom: 12px; left: 12px; z-index: 2;
  background: var(--accent); border: 2px solid #fff; color: #fff;
  border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.social-overlay-thumb-btn svg { width: 14px; height: 14px; flex: 0 0 auto; }
.social-overlay-caption { color: #fff; max-width: min(420px, 92vw); margin-top: 14px; font-size: 14px; text-align: center; }
.social-overlay-meta { color: rgba(255,255,255,.6); font-size: 12px; margin-top: 6px; }
.social-overlay-nav { position: absolute; left: 0; right: 0; top: 50%; display: flex; justify-content: space-between; padding: 0 18px; transform: translateY(-50%); pointer-events: none; }
.social-overlay-nav button { background: rgba(255,255,255,.18); border: none; color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 18px; cursor: pointer; pointer-events: all; }
.social-overlay-nav button:disabled { opacity: .25; cursor: default; }

/* Post overlay (Posts tab detail view): like/comment/delete actions and the
   comment list, recolored for the dark overlay backdrop — the base
   .post-actions/.post-comments rules above assume a light card background. */
.social-overlay-post-body { max-width: min(420px, 92vw); width: 100%; margin-top: 12px; }
.social-overlay-post-body .post-actions { justify-content: center; }
.social-overlay-post-body .post-action-btn { color: rgba(255,255,255,.85); }
.social-overlay-post-body .post-action-btn.liked { color: #ff4d6d; }
.social-overlay-post-body .post-comments { border-top-color: rgba(255,255,255,.2); max-height: 160px; overflow-y: auto; }
.social-overlay-post-body .post-comment { color: rgba(255,255,255,.85); }
.social-overlay-post-body .post-comment strong { color: #fff; }

/* ===================================================================
   AI Social Studio — multi-user social network (auth, profiles,
   follow/feed, discover, requests, messages)
   =================================================================== */
.savatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
}
.savatar-lg { width: 52px; height: 52px; font-size: 17px; }
.savatar-xl { width: 72px; height: 72px; font-size: 24px; }

/* Auth card */
.ss-auth-card { max-width: 440px; margin: 0 auto; }
.ss-auth-tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.ss-auth-tab {
  flex: 1; padding: 10px; border: 1px solid var(--border); background: var(--bg);
  border-radius: var(--radius-sm); font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.ss-auth-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ss-auth-card code { background: var(--accent-light); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* Identity header */
.ss-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; flex-wrap: wrap;
}
.ss-id { display: flex; align-items: center; gap: 12px; }
.ss-id-name { font-weight: 700; color: var(--navy); font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ss-handle { color: var(--text-muted); font-weight: 500; font-size: 13px; }
.ss-id-counts { display: flex; gap: 16px; color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.ss-id-counts strong { color: var(--navy); }
.ss-private-badge, .ss-public-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em;
}
.ss-private-badge { background: var(--warning-bg); color: var(--warning); }
.ss-public-badge { background: var(--success-bg); color: var(--success); }

/* Tab bar */
.ss-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.ss-tab {
  position: relative; padding: 10px 16px; background: transparent; border: none;
  border-bottom: 2px solid transparent; font-weight: 600; color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
}
.ss-tab:hover { color: var(--navy); }
.ss-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ss-tab-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; vertical-align: middle;
}

.ss-panel { padding: 0; overflow: hidden; }
.ss-panel .empty-state { padding: 32px 16px; }

/* People rows (discover, requests, conversations) */
.ss-person {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); width: 100%;
  background: transparent; text-align: left;
}
.ss-person:last-child { border-bottom: none; }
.ss-person-main, .ss-conv { display: flex; align-items: center; gap: 12px; background: transparent; border: none; cursor: pointer; flex: 1; min-width: 0; text-align: left; padding: 0; }
button.ss-conv { padding: 12px 16px; border-bottom: 1px solid var(--border); }
button.ss-conv:last-child { border-bottom: none; }
.feed-card-names { display: flex; flex-direction: column; min-width: 0; }
.feed-card-names strong { color: var(--navy); }
.feed-card-names .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-search { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ss-search input { width: 100%; }

/* Following feed cards */
.feed-list { display: flex; flex-direction: column; gap: 16px; }
.feed-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.feed-card-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; }
.feed-card-user { display: flex; align-items: center; gap: 10px; background: transparent; border: none; cursor: pointer; padding: 0; }
.feed-card-media { background: #000; display: flex; justify-content: center; max-height: 560px; }
.feed-card-media img, .feed-card-media video { width: 100%; max-height: 560px; object-fit: contain; background: #000; }
.feed-card-caption { padding: 10px 14px 0; }
.feed-card .post-actions { padding: 8px 14px 12px; }

/* Privacy toggle / profile */
.ss-profile { padding: 16px; }
.ss-profile-top { display: flex; gap: 16px; align-items: center; }
.ss-bio { margin: 8px 0 0; color: var(--text); }
.ss-privacy-row { display: flex; align-items: center; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.ss-switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy); cursor: pointer; }
.ss-edit { margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.ss-edit summary { cursor: pointer; font-weight: 600; color: var(--accent); }

/* Messages thread */
.ss-thread-panel { display: flex; flex-direction: column; height: 70vh; }
.ss-thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ss-thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.dm-bubble { max-width: 75%; padding: 8px 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 2px; }
.dm-bubble span:first-child { word-wrap: break-word; }
.dm-time { font-size: 10px; opacity: 0.7; align-self: flex-end; }
.dm-mine { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.dm-theirs { align-self: flex-start; background: var(--card); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.ss-thread-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.ss-thread-input input { flex: 1; }

/* Overlay owner line */
.social-overlay-owner { display: flex; align-items: center; gap: 8px; color: #fff; padding: 8px 4px 0; }
.social-overlay-owner .savatar { width: 32px; height: 32px; font-size: 12px; }

/* Share sheet modal */
.ss-modal-backdrop { position: fixed; inset: 0; background: rgba(20,37,68,0.45); display: flex; align-items: center; justify-content: center; z-index: 1200; padding: 16px; }
.ss-modal { background: var(--card); border-radius: var(--radius); width: 100%; max-width: 420px; max-height: 70vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.ss-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 16px; color: var(--navy); }
.ss-modal .ss-person-main { cursor: default; }

/* Shared-post preview inside a DM bubble */
.dm-post-preview { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; padding: 6px; cursor: pointer; max-width: 220px; }
.dm-theirs .dm-post-preview { background: var(--bg); border-color: var(--border); }
.dm-post-preview img, .dm-post-vid { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: 0 0 auto; }
.dm-post-vid { display: flex; align-items: center; justify-content: center; background: #000; color: #fff; }
.dm-post-cap { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Global account login screen (app-wide front door) */
.auth-switch { display: flex; gap: 8px; margin: 4px 0 8px; }
.auth-switch-btn { flex: 1; padding: 10px; border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-sm); font-weight: 600; color: var(--text-muted); cursor: pointer; }
.auth-switch-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.onboard-card code { background: var(--accent-light); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ===== Instagram-style Feed layout (Feed tab) ===== */
.ig-layout { display: flex; gap: 40px; align-items: flex-start; justify-content: center; }
.ig-feed { flex: 1 1 auto; max-width: 480px; min-width: 0; }
.ig-sidebar { flex: 0 0 300px; width: 300px; position: sticky; top: 16px; }
@media (max-width: 1080px) { .ig-sidebar { display: none; } .ig-feed { margin: 0 auto; } }

.savatar-sm { width: 32px; height: 32px; font-size: 12px; }

/* Suggestions sidebar */
.ig-me { display: flex; align-items: center; gap: 12px; padding: 4px 4px 16px; }
.ig-sugg-head { display: flex; align-items: center; justify-content: space-between; padding: 4px; margin-bottom: 4px; }
.ig-sugg-head > span { color: var(--text-muted); font-weight: 600; font-size: 14px; }
.ig-seeall { background: none; border: none; color: var(--navy); font-weight: 600; font-size: 12px; cursor: pointer; }
.ig-sugg-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 4px; }
.ig-sugg-row .ig-card-user { min-width: 0; }
.ig-follow-link { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ig-follow-link:hover { color: var(--navy); }

/* IG post card */
.ig-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow); }
.ig-card-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; }
.ig-card-user { display: flex; align-items: center; gap: 10px; background: none; border: none; cursor: pointer; padding: 0; min-width: 0; }
.ig-card-uname { font-weight: 600; color: var(--navy); font-size: 14px; }
.ig-card-dot { color: var(--text-muted); }
.ig-icon-btn { background: none; border: none; cursor: pointer; font-size: 15px; color: var(--text-muted); }
.ig-card-media { background: var(--card); width: 100%; aspect-ratio: 4 / 5; max-height: 600px; overflow: hidden; }
.ig-card-media img, .ig-card-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-card-actions { display: flex; gap: 14px; padding: 8px 12px 4px; }
.ig-action { background: none; border: none; cursor: pointer; font-size: 22px; line-height: 1; color: var(--navy); padding: 0; }
.ig-action.liked { color: #e0245e; }
.ig-action:hover { opacity: 0.6; }
.ig-likes { padding: 2px 12px; font-weight: 600; font-size: 14px; color: var(--navy); }
.ig-caption { padding: 2px 12px; font-size: 14px; color: var(--text); }
.ig-caption strong { color: var(--navy); margin-right: 4px; }
.ig-view-comments { background: none; border: none; color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 4px 12px; display: block; }
.ig-card .post-comments { padding: 4px 12px 12px; }

/* ===== Reactions + rich comments ===== */
.ig-react-bar { display: inline-flex; gap: 4px; padding: 6px 10px; margin: 2px 12px 0; background: var(--card); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-md); }
.ig-react-emoji { background: none; border: none; cursor: pointer; font-size: 22px; line-height: 1; padding: 2px; border-radius: 50%; transition: transform 0.1s; }
.ig-react-emoji:hover { transform: scale(1.3); }
.ig-react-emoji.active { background: var(--accent-light); }

.ig-comments { padding: 6px 12px 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.ig-nocomments { padding: 6px 0; }
.ig-comment { display: flex; gap: 8px; padding: 6px 0; }
.ig-comment.ig-reply { padding-left: 4px; }
.ig-replies { margin-top: 6px; padding-left: 14px; border-left: 2px solid var(--border); }
.ig-comment-body { flex: 1; min-width: 0; }
.ig-comment-text { font-size: 14px; color: var(--text); }
.ig-comment-text strong { color: var(--navy); margin-right: 4px; }
.ig-comment-meta { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
.ig-comment-meta > span { color: var(--text-muted); font-size: 12px; }
.ig-comment-link { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 12px; font-weight: 600; padding: 0; }
.ig-comment-link.liked { color: #e0245e; }
.ig-comment-link:hover { color: var(--navy); }
.ig-comment-sticker { font-size: 40px; line-height: 1.1; }
.ig-comment-img { max-width: 160px; max-height: 160px; border-radius: 8px; margin-top: 4px; display: block; }
.ig-comment-reel { max-width: 200px; max-height: 260px; border-radius: 8px; margin-top: 4px; display: block; background: #000; }

/* Comment composer */
.ig-composer { margin-top: 6px; }
.ig-composer-row { display: flex; align-items: center; gap: 4px; }
.ig-cinput { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; font-size: 14px; }
.ig-cbtn { background: none; border: none; cursor: pointer; font-size: 17px; padding: 4px; border-radius: 6px; }
.ig-cbtn:hover { background: var(--bg); }
.ig-emoji-bar, .ig-sticker-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; margin-top: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ig-emoji { background: none; border: none; cursor: pointer; font-size: 18px; padding: 2px 4px; border-radius: 6px; }
.ig-emoji:hover { background: var(--accent-light); }
.ig-sticker { background: none; border: none; cursor: pointer; font-size: 28px; padding: 2px 4px; border-radius: 8px; }
.ig-sticker:hover { background: var(--accent-light); transform: scale(1.15); }

/* Clickable follower/following counts */
.ss-count-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 13px; padding: 0; }
.ss-count-btn strong { color: var(--navy); }
.ss-count-btn:hover { color: var(--navy); }
.ss-count-btn:hover strong { text-decoration: underline; }

/* ===== Global people search (above the profile header) ===== */
.ss-global-search { position: relative; z-index: 60; margin-bottom: 14px; }
.ss-global-search input {
  width: 100%; padding: 11px 38px 11px 38px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--card); font-size: 14px; box-shadow: var(--shadow);
}
.ss-global-search input:focus { outline: none; border-color: var(--accent); }
.ss-gsearch-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: 0.6; pointer-events: none; }
.ss-gsearch-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 15px; }
.ss-search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md);
  max-height: 380px; overflow-y: auto; z-index: 61;
}
.ss-search-dropdown .ss-person { padding: 10px 14px; }
.ss-search-backdrop { position: fixed; inset: 0; z-index: 40; }

/* ===== Floating chat popup (bottom-right) ===== */
.chat-pop {
  position: fixed; right: 20px; bottom: 20px; width: 350px; height: 480px; max-height: calc(100vh - 100px);
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; overflow: hidden; z-index: 1300;
}
.chat-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--navy); }
.chat-pop-head .savatar { border: 2px solid rgba(255,255,255,0.5); }
.chat-pop-user { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; min-width: 0; }
.chat-pop-user strong { color: #fff; font-size: 14px; }
.chat-pop-user .muted { color: rgba(255,255,255,0.7); }
.chat-pop-actions { display: flex; gap: 2px; }
.chat-pop-btn { background: none; border: none; cursor: pointer; color: #fff; font-size: 16px; padding: 5px 6px; border-radius: 6px; display: inline-flex; align-items: center; }
.chat-pop-btn:hover { background: rgba(255,255,255,0.15); }
.chat-pop-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.chat-pop-input { display: flex; align-items: center; gap: 2px; padding: 8px; border-top: 1px solid var(--border); }
.chat-pop-input #dm-input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; font-size: 14px; }
.chat-pop .ig-emoji-bar, .chat-pop .ig-sticker-bar { margin: 0; border-radius: 0; border-left: none; border-right: none; }
.dm-img { max-width: 200px; max-height: 220px; border-radius: 10px; display: block; }
.dm-sticker { font-size: 46px; line-height: 1; }

/* ===== Call screen ===== */
.call-overlay {
  position: fixed; inset: 0; background: #0b1424; z-index: 1400;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; color: #fff;
}
.call-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.call-video { width: min(70vw, 720px); max-height: 64vh; border-radius: 16px; background: #000; transform: scaleX(-1); object-fit: cover; }
.call-audio-av .savatar { width: 120px; height: 120px; font-size: 40px; }
.call-info { text-align: center; }
.call-name { font-size: 22px; font-weight: 700; }
.call-status { color: rgba(255,255,255,0.75); margin-top: 4px; }
.call-demo-note { color: rgba(255,255,255,0.45); font-size: 12px; margin-top: 6px; }
.call-filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.call-filter { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); color: #fff; border-radius: 999px; padding: 7px 16px; cursor: pointer; font-weight: 600; font-size: 13px; }
.call-filter.active { background: var(--accent); border-color: var(--accent); }
.call-controls { margin-top: 4px; }
.call-end { background: #e0245e; color: #fff; border: none; border-radius: 999px; padding: 12px 28px; font-weight: 700; cursor: pointer; font-size: 15px; }
.call-end:hover { background: #c01e50; }

/* ===== Audio recording bar ===== */
.rec-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; width: 100%; font-weight: 600; color: var(--danger); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: recpulse 1s infinite; }
@keyframes recpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Comment audio player */
.ig-comment-audio { display: block; margin-top: 4px; height: 34px; max-width: 240px; }

/* ===== DM attachments ===== */
.dm-audio { display: block; height: 36px; max-width: 220px; }
.dm-video { max-width: 220px; max-height: 240px; border-radius: 10px; display: block; background: #000; }
.dm-file { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--navy); font-weight: 600; font-size: 13px; text-decoration: none; }
.dm-mine .dm-file { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.3); }

/* DM attach menu */
.dm-attach-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; border-top: 1px solid var(--border); background: var(--bg); }
.dm-attach-menu button { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 9px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--navy); }
.dm-attach-menu button:hover { border-color: var(--accent); }

/* View-once */
.ig-cbtn.vo-on { background: var(--accent); color: #fff; border-radius: 50%; }
.dm-vo { display: inline-block; font-weight: 600; }
.dm-vo-tap { background: none; border: 1px dashed currentColor; border-radius: 999px; padding: 6px 12px; cursor: pointer; color: inherit; font: inherit; }
.dm-mine .dm-vo-tap { color: #fff; }
.dm-vo-opened { opacity: 0.6; }
.vo-modal { max-width: 480px; }
.vo-body { padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vo-body img, .vo-body video { max-width: 100%; max-height: 60vh; border-radius: 10px; }
.vo-sticker { font-size: 80px; }
.vo-text { font-size: 18px; color: var(--text); text-align: center; }
.vo-note { padding: 0 16px 14px; text-align: center; }

/* ===== Pages ===== */
.ss-pages-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ss-page-badge { font-size: 10px; font-weight: 700; background: var(--accent); color: #fff; padding: 2px 7px; border-radius: 999px; vertical-align: middle; letter-spacing: 0.04em; }
.ss-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 8px 0 6px; }
.page-contact { padding: 12px 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 12px 0; }
.page-contact-row { display: flex; gap: 12px; padding: 4px 0; font-size: 14px; }
.page-contact-key { min-width: 110px; color: var(--text-muted); text-transform: capitalize; font-weight: 600; }
.page-manage { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin: 8px 0; }
.composer-as { margin: 8px 0; font-size: 13px; color: var(--text-muted); }
.composer-as select { margin-left: 6px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 600; color: var(--navy); }
.pc-contact-row { display: flex; gap: 6px; margin-bottom: 6px; }
.pc-contact-row input { flex: 1; min-width: 0; }
.page-addrole { display: flex; gap: 6px; flex-wrap: wrap; }
.page-addrole input { flex: 1; min-width: 120px; }

/* ===== Account switcher ===== */
.ss-header { position: relative; }
.ss-switcher { position: absolute; right: 16px; top: 60px; z-index: 70; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); min-width: 260px; overflow: hidden; }
.ss-switch-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer; text-align: left; }
.ss-switch-item:last-child { border-bottom: none; }
.ss-switch-item:hover { background: var(--bg); }
.ss-switch-item.active { background: var(--accent-light); }
.ss-switch-item .feed-card-names { flex: 1; min-width: 0; }
.ss-switch-check { color: var(--accent); font-weight: 700; }

/* Profile photo avatars */
.savatar.savatar-img { overflow: hidden; padding: 0; background: var(--border); }
.savatar.savatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-controls { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }

/* ===== Profile photo cropper ===== */
.crop-modal { max-width: 360px; }
.crop-wrap { display: flex; justify-content: center; padding: 16px; }
.crop-stage { position: relative; overflow: hidden; border-radius: 50%; background: #000; cursor: grab; touch-action: none; box-shadow: 0 0 0 3px var(--accent-light); }
.crop-stage:active { cursor: grabbing; }
.crop-stage #crop-img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; }
.crop-controls { display: flex; align-items: center; gap: 10px; padding: 0 16px 6px; }
.crop-controls input[type="range"] { flex: 1; }

/* ===================================================================
   AI Marketplace — vendor marketplace with escrow
   =================================================================== */
.shop-tabs { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.shop-cart-btn { margin-left: auto; background: var(--accent-light); color: var(--navy); border: none; border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.shop-flash { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 1500; box-shadow: var(--shadow-md); }
.shop-content { min-height: 200px; }
.shop-searchbar input { width: 100%; padding: 11px 16px; border: 1px solid var(--border); border-radius: 999px; margin-bottom: 12px; }
.shop-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.shop-chip { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-muted); }
.shop-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.shop-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: box-shadow 0.15s; }
.shop-card:hover { box-shadow: var(--shadow-md); }
.shop-img { aspect-ratio: 1; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.shop-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-img-ph { font-size: 48px; color: var(--text-muted); }
.shop-img-sm { width: 64px; height: 64px; aspect-ratio: auto; border-radius: var(--radius-sm); flex: 0 0 auto; }
.shop-card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.shop-card-title { font-weight: 600; color: var(--navy); font-size: 14px; line-height: 1.3; }
.shop-price { font-weight: 800; color: var(--navy); }
.shop-price-lg { font-size: 24px; margin: 8px 0; }
.shop-mrp { text-decoration: line-through; color: var(--text-muted); font-weight: 400; font-size: 13px; }
.shop-off { color: var(--success); font-weight: 700; font-size: 13px; }
.shop-vendor { font-size: 12px; color: var(--text-muted); }
.shop-card-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 8px; }
.shop-card-actions .btn { flex: 1; }

.shop-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 12px; }
@media (max-width: 800px) { .shop-detail { grid-template-columns: 1fr; } }
.shop-detail-media img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.shop-detail-ph { aspect-ratio: 1; border-radius: var(--radius); font-size: 72px; }
.shop-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.shop-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.shop-desc { color: var(--text); line-height: 1.6; }
.shop-qty { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.qty-btn { width: 30px; height: 30px; border: 1px solid var(--border); background: var(--card); border-radius: 6px; cursor: pointer; font-size: 16px; font-weight: 700; }
.shop-remove { background: none; border: none; color: var(--danger); cursor: pointer; margin-left: 12px; font-size: 13px; }
.shop-escrow-note, .shop-pay-note { background: var(--accent-light); border-radius: var(--radius-sm); padding: 12px; font-size: 13px; color: var(--navy); margin-top: 14px; }

.shop-checkout, .shop-cart-card, .shop-sell { max-width: 620px; }
.shop-co-row, .shop-cart-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.shop-cart-mid { flex: 1; min-width: 0; }
.shop-co-total { font-weight: 700; color: var(--navy); }
.shop-cart-total { display: flex; justify-content: space-between; padding: 12px 0; font-size: 18px; color: var(--navy); }
.shop-cart-total strong { font-size: 22px; }
.shop-sell-row { display: flex; gap: 12px; }
.shop-sell-row .field { flex: 1; }

.addr-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.addr-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.addr-row.selected { border-color: var(--accent); background: var(--accent-light); }
.addr-row input[type="radio"] { margin-top: 4px; }
.addr-row-body { flex: 1; min-width: 0; }
.addr-row-actions { display: flex; gap: 2px; flex-shrink: 0; }

.shop-order { margin-bottom: 14px; }
.shop-order-head { display: flex; align-items: center; gap: 12px; }
.shop-order-mid { flex: 1; min-width: 0; }
.shop-order-status { font-size: 12px; font-weight: 700; color: var(--accent); text-align: right; max-width: 160px; }
.shop-order-status.disputed { color: var(--warning); }
.shop-timeline { display: flex; align-items: center; gap: 4px; margin: 12px 0 4px; flex-wrap: wrap; }
.shop-step { font-size: 11px; text-transform: capitalize; color: var(--text-muted); padding: 2px 8px; border-radius: 999px; background: var(--bg); }
.shop-step.done { background: var(--success-bg); color: var(--success); font-weight: 600; }
.shop-step.disputed { background: var(--warning-bg); color: var(--warning); }
.shop-step-sep { flex: 0 0 8px; height: 2px; background: var(--border); }
.shop-order-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.shop-paid { color: var(--success); font-weight: 700; }

/* Career — portfolio builder preview */
.pf-preview { border: 1px solid #e2e8f0; border-radius: 12px; padding: 22px; background: #fff; }
.pf-head h1 { margin: 0 0 2px; font-size: 26px; }
.pf-headline { color: #475569; margin: 0 0 6px; font-size: 15px; }
.pf-links { color: #64748b; font-size: 13px; margin: 0; }
.pf-skills { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.pf-proj { margin: 12px 0; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.pf-proj:last-child { border-bottom: none; }
.pf-proj-top { margin-bottom: 3px; }

/* Auth — Google / phone OTP options */
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: #94a3b8; font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }
.btn-google { background: #fff; border: 1px solid #d7dde6; color: #1e293b; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-google:hover { background: #f8fafc; }
.btn-google .g-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); color: #fff; font-weight: 700; font-size: 11px; }
.auth-back { text-align: left; }
.link-btn { background: none; border: none; color: #1d4ed8; cursor: pointer; font-size: 13px; padding: 0; }

/* Wellness — Calm tools, learn, wrapping tabs */
.tabs-wrap { flex-wrap: wrap; row-gap: 4px; }
.breath-stage { display: flex; justify-content: center; align-items: center; padding: 24px 0; }
.breath-circle { width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #bfdbfe, #60a5fa); display: flex; align-items: center; justify-content: center; color: #1e3a8a; font-weight: 600; text-align: center; padding: 12px; transition: transform 4s ease-in-out, background 1s; box-shadow: 0 8px 30px rgba(96,165,250,.35); }
.breath-circle.b-in { transform: scale(1.35); transition-duration: 4s; }
.breath-circle.b-out { transform: scale(0.85); transition-duration: 8s; }
.breath-circle.b-hold { transform: scale(1.35); }
.ground-list { margin: 8px 0 0; padding-left: 22px; }
.ground-list li { margin: 6px 0; }
.learn-item { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; margin-top: 8px; }
.learn-item summary { cursor: pointer; font-weight: 600; }
.learn-item p { margin: 8px 0 0; color: #475569; }
.ml-8 { margin-left: 8px; }

/* Wellness — guided grounding + PMR */
.ground-block { margin-top: 12px; }
.ground-head { font-size: 14px; margin-bottom: 6px; }
.ground-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #2563eb; color: #fff; font-weight: 700; font-size: 12px; }
.ground-input { width: 100%; padding: 7px 10px; border: 1px solid #d7dde6; border-radius: 8px; font-size: 13px; margin-top: 4px; box-sizing: border-box; transition: border-color .2s, background .2s; }
.ground-input.filled { border-color: #34a853; background: #f0fdf4; }
.ground-bar { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.ground-bar-fill { height: 100%; background: linear-gradient(90deg, #60a5fa, #34a853); transition: width .3s; }
.pmr-stage { text-align: center; padding: 18px 0; }
.pmr-phase { font-size: 26px; font-weight: 700; color: #64748b; }
.pmr-phase.p-tense { color: #d97706; }
.pmr-phase.p-release { color: #2563eb; }
.pmr-count { font-size: 40px; font-weight: 800; line-height: 1; margin-top: 4px; color: #1e293b; }

/* Wellness — grounding mode toggle + audio Q&A */
.ground-mode { display: inline-flex; gap: 4px; background: #eef2f7; padding: 4px; border-radius: 10px; }
.ground-mode-btn { border: none; background: transparent; padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; color: #475569; }
.ground-mode-btn.active { background: #fff; color: #1d4ed8; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ground-q { font-size: 18px; line-height: 1.5; color: #1e293b; padding: 8px 0; min-height: 54px; }

/* Wellness — SOS button, values stars, sleep, worry */
.sos-btn { position: fixed; right: 24px; bottom: 24px; z-index: 40; background: #dc2626; color: #fff; border: none; border-radius: 999px; padding: 12px 18px; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 8px 24px rgba(220,38,38,.4); }
.sos-btn:hover { background: #b91c1c; }
.sos-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.sos-modal { background: #fff; border-radius: 16px; padding: 22px; max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; }
.sos-actions { margin-top: 8px; }
.val-stars { cursor: pointer; }
.val-star { color: #cbd5e1; font-size: 20px; cursor: pointer; }
.val-star.on { color: #f59e0b; }
.val-action { width: 100%; padding: 7px 10px; border: 1px solid #d7dde6; border-radius: 8px; font-size: 13px; box-sizing: border-box; }
.sleep-check { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid #f1f5f9; }
.worry-plan { padding: 7px 10px; border: 1px solid #d7dde6; border-radius: 8px; font-size: 13px; }

/* Wellness — therapist inline booking form */
.book-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.book-form input[type="date"], .book-form input[type="time"], .book-form select { width: 100%; padding: 7px 10px; border: 1px solid #d7dde6; border-radius: 8px; font-size: 13px; box-sizing: border-box; }

/* Top-bar avatar as a button + profile/settings modal */
.avatar { cursor: pointer; border: none; font: inherit; }
.avatar:hover { filter: brightness(1.08); box-shadow: 0 0 0 3px rgba(47,109,240,.25); }
.profile-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.profile-modal { background: #fff; border-radius: 16px; padding: 22px; max-width: 460px; width: 100%; max-height: 92vh; overflow-y: auto; }
.profile-head { display: flex; align-items: center; gap: 12px; }
.profile-av { width: 46px; height: 46px; border-radius: 50%; background: #2f6df0; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.btn-danger { background: #dc2626; color: #fff; border: none; }
.btn-danger:hover { background: #b91c1c; }

/* Wellness — focus timer + concentration trainer */
.focus-stage { text-align: center; padding: 18px 0 8px; }
.focus-clock { font-size: 52px; font-weight: 800; line-height: 1; color: #1e293b; font-variant-numeric: tabular-nums; }

/* Wellness — Your Week dashboard */
.week-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.week-score { text-align: center; }
.week-score-num { font-size: 46px; font-weight: 800; line-height: 1; }
.week-streaks { display: flex; gap: 10px; flex-wrap: wrap; }
.streak-chip { background: #f1f5f9; border-radius: 10px; padding: 8px 14px; text-align: center; }
.streak-chip strong { display: block; font-size: 18px; }

/* Marketplace — ratings, sort, wishlist */
.shop-sortbar { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }
.shop-sortbar select { padding: 6px 10px; border: 1px solid #d7dde6; border-radius: 8px; font-size: 13px; }
.shop-stars { color: #f59e0b; letter-spacing: 1px; }
.shop-rating { margin: 2px 0 4px; font-size: 13px; }
.shop-card { position: relative; }
.shop-wish { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(255,255,255,.92); border: none; border-radius: 50%; width: 30px; height: 30px; font-size: 16px; color: #dc2626; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.shop-wish.on { color: #dc2626; }
.shop-review-write { padding: 12px; margin-bottom: 12px; }
.shop-review-write textarea { width: 100%; margin-top: 6px; border: 1px solid #d7dde6; border-radius: 8px; padding: 8px; font-size: 13px; box-sizing: border-box; }
.shop-starpick { font-size: 24px; margin: 4px 0; }
.star-btn { background: none; border: none; cursor: pointer; color: #f59e0b; font-size: 24px; padding: 0 2px; }
.shop-review { border-top: 1px solid #f1f5f9; padding: 10px 0; }

/* Marketplace — product gallery thumbnails */
.shop-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.shop-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; opacity: .75; transition: opacity .15s, border-color .15s; }
.shop-thumb:hover { opacity: 1; }
.shop-thumb.active { border-color: #2563eb; opacity: 1; }

/* Marketplace — seller listing photo-count badge */
.shop-imgcount { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }

/* Marketplace — manage listing image grid */
.shop-manage-imgs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.shop-manage-img { position: relative; }
.shop-manage-img img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; }
.shop-img-del { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: #dc2626; color: #fff; border: 2px solid #fff; cursor: pointer; font-size: 11px; line-height: 1; }
.shop-img-add { width: 84px; height: 84px; border: 1.5px dashed #cbd5e1; border-radius: 8px; background: #f8fafc; color: #64748b; cursor: pointer; font-size: 12px; }
.shop-img-add:hover { border-color: #2563eb; color: #2563eb; }

/* ============================================================
   Mobile responsiveness
   ------------------------------------------------------------
   The sidebar is a fixed 248px column on desktop. On narrow
   screens it becomes an off-canvas drawer opened by a hamburger
   button in the topbar (see #nav-toggle / #sidebar-backdrop in
   app.js). Everything below also compacts spacing, stacks
   multi-column layouts, and lets wide content scroll instead of
   overflowing the viewport.
   ============================================================ */

/* Hamburger toggle + backdrop are hidden on desktop, shown on mobile. */
.nav-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 768px) {
  /* --- App shell: sidebar becomes an off-canvas drawer --- */
  .app-shell { display: block; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 82vw;
    max-width: 300px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 24px rgba(0,0,0,0.25);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 37, 68, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 50;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

  /* Prevent background scroll while the drawer is open. */
  body.sidebar-open { overflow: hidden; }

  /* --- Topbar: hamburger on the left, compact spacing --- */
  .topbar {
    padding: 0 14px;
    gap: 8px;
    height: 56px;
  }
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 8px;
    margin-left: -4px;
    background: transparent;
    border: none;
    cursor: pointer;
    flex: 0 0 auto;
  }
  .nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--navy);
    border-radius: 2px;
  }
  .topbar-title { font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { gap: 8px; flex: 0 0 auto; }
  /* Reset-demo is non-essential on small screens; keep logout + avatar. */
  #reset-demo-btn { display: none; }
  .topbar-right .btn-sm { padding: 6px 10px; font-size: 12px; }

  /* --- Content: tighter padding, no fixed reading width --- */
  .content { padding: 16px 14px; max-width: none; }

  h1 { font-size: 23px; }
  h2 { font-size: 18px; }

  .card { padding: 16px; margin-bottom: 16px; }
  .card-flat { padding: 14px; }

  /* --- Stack every multi-column layout --- */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr; }
  .shop-detail { grid-template-columns: 1fr; }

  /* --- Wide content scrolls instead of breaking the layout --- */
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .resume-preview-wrap { -webkit-overflow-scrolling: touch; }

  /* --- Chat + composer feel native on small screens --- */
  .chat-bubble { max-width: 85%; }

  /* --- Modals/cards fill more of the viewport, less inner padding --- */
  .onboard-card { padding: 24px; }
  .profile-modal { padding: 18px; }

  /* --- Instagram-style social feed --- */
  .ig-sidebar { display: none; }
  .ig-feed { margin: 0 auto; }
  .social-feed-tabs { max-width: 100%; }

  /* Buttons in a row wrap rather than overflow. */
  .flex-gap { flex-wrap: wrap; }
}

/* Extra squeeze for very small phones. */
@media (max-width: 400px) {
  .content { padding: 14px 10px; }
  .topbar-right .btn-sm { padding: 6px 8px; }
  h1 { font-size: 21px; }
}

/* ============================================================
   App-like experience: icon+title tabs, bottom app bar,
   tablet icon-rail sidebar, native touch polish
   ============================================================ */

/* ----- Icon + title inside every tab (added by tabicons.js) ----- */
.tab, .ss-tab, .tab-pill { display: inline-flex; align-items: center; gap: 7px; }
.tab-ic { font-size: 15px; line-height: 1; flex: 0 0 auto; }
.tab-tx { line-height: 1.2; }
.ss-tab .ss-tab-badge { margin-left: 2px; }

/* ----- Bottom app bar (phones only) ----- */
.bottom-nav { display: none; }

/* ----- Tablet (769–1024px): compact icon-rail sidebar ----- */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: 84px; padding: 16px 0; }
  .sidebar-brand { font-size: 0; padding: 0 0 14px; text-align: center; }
  .sidebar-brand::before { content: 'AI'; font-size: 18px; font-weight: 800; color: #fff; }
  .sidebar-brand span { display: none; }
  .nav-section-label { text-align: center; padding: 12px 4px 4px; font-size: 9px; letter-spacing: 0.05em; }
  .nav-item {
    flex-direction: column; gap: 4px; padding: 10px 4px; font-size: 10px;
    text-align: center; border-left-width: 3px;
  }
  .nav-icon { width: auto; font-size: 19px; }
  .content { padding: 22px 20px; }
  .topbar { padding: 0 20px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .ig-sidebar { display: none; }
  .ig-feed { margin: 0 auto; }
}

/* ----- Phones (≤768px): full app treatment ----- */
@media (max-width: 768px) {
  /* Tab bars scroll horizontally like native segmented controls. */
  .tabs, .ss-tabs, .shop-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    scroll-snap-type: x proximity;
    padding-bottom: 0;
  }
  .tabs::-webkit-scrollbar, .ss-tabs::-webkit-scrollbar, .shop-tabs::-webkit-scrollbar { display: none; }
  .tabs.tabs-wrap { flex-wrap: nowrap; } /* wellness: scroll, don't stack 17 rows */

  /* Icon stacked above the title — native app tab look. */
  .tab, .ss-tab {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 0 0 auto;
    min-width: 74px;
    max-width: 112px;
    padding: 9px 10px 8px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    scroll-snap-align: center;
    border-radius: 10px 10px 0 0;
  }
  .tab .tab-ic, .ss-tab .tab-ic { font-size: 20px; }
  .tab .tab-tx, .ss-tab .tab-tx {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  .tab.active, .ss-tab.active { background: var(--accent-light); }
  .ss-tab .ss-tab-badge { position: absolute; top: 4px; right: 8px; margin: 0; }
  .ss-tab { position: relative; }

  /* Composer type pills: icon inline, larger touch target. */
  .tab-pill { padding: 8px 14px; }

  /* Marketplace cart button stays reachable at the end of the scroll row. */
  .shop-cart-btn { flex: 0 0 auto; align-self: center; }

  /* ----- Bottom app bar (scrolls horizontally like the top tabs) ----- */
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 45;
    background: var(--card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(20, 37, 68, 0.08);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    gap: 2px;
  }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .bnav-item {
    flex: 0 0 auto;
    width: 76px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
    min-height: 52px;
    background: none; border: none; cursor: pointer;
    color: var(--text-muted);
    border-radius: 10px;
    scroll-snap-align: center;
    -webkit-tap-highlight-color: transparent;
  }
  .bnav-ic { font-size: 21px; line-height: 1; }
  .bnav-tx { font-size: 10.5px; font-weight: 600; line-height: 1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bnav-item.active { color: var(--accent); }
  .bnav-item.active .bnav-ic { transform: translateY(-1px); }
  .bnav-item:active { background: var(--accent-light); }

  /* Content and floating elements clear the bottom bar. */
  .content { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .sos-btn { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); right: 14px; }
  .shop-flash { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .chat-pop {
    right: 0; left: 0; width: 100%;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    border-radius: 14px 14px 0 0; height: 65vh;
  }
  .bottom-nav { padding-left: calc(6px + env(safe-area-inset-left, 0px)); padding-right: calc(6px + env(safe-area-inset-right, 0px)); }

  /* ----- Native touch polish ----- */
  /* 16px inputs stop iOS auto-zoom on focus. */
  input[type="text"], input[type="email"], input[type="number"], input[type="password"],
  input[type="tel"], input[type="date"], select, textarea { font-size: 16px; padding: 11px 12px; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 34px; }
  .nav-item { padding: 13px 20px; font-size: 15px; }
  .topbar { backdrop-filter: saturate(1.2) blur(8px); background: rgba(255,255,255,0.92); }
  body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }

  /* Full-screen overlays respect notches. */
  .social-overlay, .call-overlay, .profile-overlay, .sos-overlay {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Cards read as app surfaces: slightly tighter, softer. */
  .page-header { margin-bottom: 14px; }
  .page-header p.muted { display: none; } /* long crumb lines are desktop-only */
}

