/* ==========================================================================
   SocialFlow AI — design system
   Professional and calm: one main colour (indigo), neutral greys, generous
   spacing, readable type (Inter, bundled). Animations are short and subtle,
   and switched off for people who ask their system for reduced motion.
   ========================================================================== */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e4e7ee;
  --border-strong: #cfd5e1;
  --text: #121a2b;
  --text-2: #3b4458;
  --muted: #6b7489;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef0fe;
  --primary-ring: rgba(79, 70, 229, .18);
  --accent: #7c3aed;
  --success: #10845a;
  --success-soft: #e8f6ef;
  --warning: #b25e09;
  --warning-soft: #fdf3e3;
  --danger: #c0352b;
  --danger-soft: #fdeceb;
  --sidebar: #0f1729;
  --sidebar-2: #16203a;
  --sidebar-text: #c3cad9;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, .18);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  font-feature-settings: "cv11", "ss01";
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15.5px; font-weight: 650; }
p { margin: 0 0 12px; }
b, strong { font-weight: 620; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
[hidden] { display: none !important; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; border-radius: 6px; }

/* ----------------------------------------------------------------- motion */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .45); } 70% { box-shadow: 0 0 0 10px rgba(79, 70, 229, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(14px, -18px); } }
@keyframes progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.content > * { animation: rise .35s var(--ease) both; }
.stagger > * { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }

/* ---------------------------------------------------------------- layout */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%); color: var(--sidebar-text);
  padding: 22px 14px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; z-index: 30; }
.logo { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 17px; padding: 2px 10px 22px; color: #fff; letter-spacing: -.01em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(79, 70, 229, .45); flex: none; }
.logo small { display: block; font-size: 11px; font-weight: 500; color: #8f9ab3; letter-spacing: .02em; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f7a94; padding: 14px 12px 6px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: var(--sidebar-text); font-weight: 520; transition: background .18s, color .18s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(124, 116, 255, .16); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #8b85ff; }
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav .count { margin-left: auto; background: #ef4444; color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 1px 8px; min-width: 22px; text-align: center; }
.sidebar .spacer { flex: 1; }
.user-box { border-top: 1px solid rgba(255, 255, 255, .08); padding: 14px 6px 2px; display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.user-box .who { min-width: 0; flex: 1; }
.user-box .who b { display: block; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-box .who span { color: #8f9ab3; font-size: 12.5px; }
.user-box .btn.ghost { color: #aab3c7; }
.user-box .btn.ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; }
.user-box .avatar { background: var(--grad); color: #fff; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 0; position: sticky; top: 0; z-index: 20;
  background: rgba(244, 246, 250, .82); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .menu-btn { display: none; }
.topbar .crumb { font-weight: 600; color: var(--text-2); }
.topbar .grow { flex: 1; }
.topbar-inner { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 36px; }
.content { padding: 8px 36px 56px; max-width: 1320px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------- components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.grid > .card, .grid > * + .card, .vlist > .card, .stepper > .card, .stagger > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head p { margin: 4px 0 0; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.inline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hover-lift { transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #d4d9f3; }

.stat { display: flex; gap: 14px; align-items: flex-start; }
.stat .s-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat .s-ico svg { width: 22px; height: 22px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 550; display: block; }
.stat .value { font-size: 30px; font-weight: 720; letter-spacing: -.02em; line-height: 1.15; display: block; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12.5px; color: var(--muted); }
.tone-indigo { background: var(--primary-soft); color: var(--primary); }
.tone-green { background: var(--success-soft); color: var(--success); }
.tone-orange { background: var(--warning-soft); color: var(--warning); }
.tone-red { background: var(--danger-soft); color: var(--danger); }
.tone-violet { background: #f3edfe; color: var(--accent); }

.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); padding: 10px 17px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 14.5px;
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .08s, color .15s; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: #b9c1d2; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, .28); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(79, 70, 229, .35); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; box-shadow: 0 4px 14px rgba(16, 132, 90, .25); }
.btn.success:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); border-color: #efc9c5; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(16, 24, 40, .05); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 15.5px; }
.btn.block { width: 100%; }
.btn svg { width: 17px; height: 17px; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%; border: 2.2px solid currentColor;
  border-color: rgba(255, 255, 255, .9) rgba(255, 255, 255, .9) rgba(255, 255, 255, .25) rgba(255, 255, 255, .25); animation: spin .7s linear infinite; }
.btn:not(.primary):not(.success):not(.danger-solid).loading::after { border-color: var(--primary) var(--primary) var(--border) var(--border); }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--text-2); transition: background .15s, box-shadow .15s; box-shadow: var(--shadow-sm); }
.icon-btn:hover { background: var(--surface-2); box-shadow: var(--shadow); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: #ef4444;
  color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.icon-btn.ringing svg { animation: ring 1s var(--ease); transform-origin: 50% 10%; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label { font-weight: 600; font-size: 14px; color: var(--text-2); }
.field .hint { color: var(--muted); font-size: 13px; }
.input { width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; padding: 11px 13px; font: inherit; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: #9aa2b4; }
.input:hover { border-color: #b9c1d2; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
select.input { cursor: pointer; appearance: none; padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7489' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 13px center; }
textarea.input { resize: vertical; min-height: 46px; line-height: 1.5; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; animation: pop .2s var(--ease); }
.form-ok { background: var(--success-soft); color: var(--success); border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; animation: pop .2s var(--ease); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: #f1f3f7; color: var(--text-2); border: 1px solid var(--border); }
.badge.blue { background: var(--primary-soft); color: var(--primary-dark); border-color: #dcdffb; }
.badge.green { background: var(--success-soft); color: var(--success); border-color: #c9eadb; }
.badge.orange { background: var(--warning-soft); color: var(--warning); border-color: #f4dcb5; }
.badge.red { background: var(--danger-soft); color: var(--danger); border-color: #f4c9c4; }
.badge .bdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.live .bdot { animation: pulse 1.8s infinite; }

.alert { display: flex; gap: 14px; align-items: center; border-radius: var(--radius); padding: 15px 18px; margin-bottom: 18px; border: 1px solid; animation: rise .35s var(--ease) both; }
.alert .grow { flex: 1; }
.alert.info { background: var(--primary-soft); border-color: #dcdffb; }
.alert.warning { background: var(--warning-soft); border-color: #f4dcb5; }
.alert.danger { background: var(--danger-soft); border-color: #f4c9c4; }
.alert.success { background: var(--success-soft); border-color: #c9eadb; }
.alert .ico { font-size: 22px; line-height: 1; }

.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; }
.row .grow span { color: var(--muted); font-size: 13.5px; }
a.row { color: inherit; border-radius: 10px; transition: background .15s; margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
a.row:hover { background: var(--surface-2); text-decoration: none; }
.brand-dot { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.brand-dot.logo { background: #fff; border: 1px solid var(--border); overflow: hidden; padding: 4px; }
.brand-dot.logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.empty { text-align: center; color: var(--muted); padding: 26px 12px; }
.empty .big { font-size: 30px; margin-bottom: 8px; }
.empty-art { width: 120px; height: auto; margin: 0 auto 12px; display: block; }
.empty h3 { color: var(--text); margin-bottom: 4px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 0 12px 10px; }
.table td { padding: 14px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.actions { text-align: right; white-space: nowrap; }
.who-cell { display: flex; align-items: center; gap: 11px; }
.who-cell span { display: block; color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; padding: 11px 15px; color: var(--muted); font-weight: 600; white-space: nowrap; transition: color .15s; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary-dark); }
.tabs a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; border-radius: 3px 3px 0 0; background: var(--grad); animation: fade .25s; }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, #eceff5 0px, #f6f7fb 140px, #eceff5 280px); background-size: 800px 100%; animation: shimmer 1.3s linear infinite; }
.sk-page .sk-title { height: 30px; width: 260px; margin-bottom: 10px; }
.sk-page .sk-sub { height: 16px; width: 380px; margin-bottom: 28px; }
.sk-page .sk-card { height: 120px; border-radius: var(--radius); }
.sk-page .sk-big { height: 280px; border-radius: var(--radius); margin-top: 18px; }

.help-tip { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #e7eaf2; color: var(--muted); font-size: 11.5px; font-weight: 700;
  cursor: help; position: relative; vertical-align: 1px; margin-left: 4px; }
.help-tip:hover::after, .help-tip:focus::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 260px;
  background: var(--sidebar); color: #fff; font-weight: 450; font-size: 12.5px; line-height: 1.45; padding: 8px 11px; border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 50; animation: fade .15s; white-space: normal; text-align: left; }

/* ------------------------------------------------------------ auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 10% 10%, #2b2a7a 0%, transparent 60%), linear-gradient(160deg, #111a35 0%, #1e1b4b 55%, #3b1f73 100%);
  color: #dfe3f3; padding: 48px 56px; display: flex; flex-direction: column; }
.auth-side .logo { padding: 0 0 48px; font-size: 20px; }
.auth-side h2 { color: #fff; font-size: 34px; line-height: 1.15; font-weight: 750; max-width: 460px; letter-spacing: -.025em; }
.auth-side p.lead { margin: 16px 0 34px; max-width: 440px; color: #b9c0d9; font-size: 16px; }
.auth-points { display: flex; flex-direction: column; gap: 16px; max-width: 440px; }
.auth-points div { display: flex; gap: 14px; align-items: flex-start; animation: rise .5s var(--ease) both; }
.auth-points div:nth-child(2) { animation-delay: .08s; } .auth-points div:nth-child(3) { animation-delay: .16s; } .auth-points div:nth-child(4) { animation-delay: .24s; }
.auth-points span.pi { width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); display: grid; place-items: center; flex: none; font-size: 18px; }
.auth-points b { color: #fff; display: block; }
.auth-points small { color: #aab2cc; font-size: 13.5px; }
.auth-side .blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .55; animation: float 12s ease-in-out infinite; }
.auth-side .b1 { width: 320px; height: 320px; background: #6d5df6; right: -90px; bottom: 60px; }
.auth-side .b2 { width: 220px; height: 220px; background: #c04fd8; right: 140px; bottom: -80px; animation-delay: -4s; opacity: .35; }
.auth-side .foot { margin-top: auto; font-size: 12.5px; color: #8790ad; position: relative; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth-card { width: 100%; max-width: 410px; animation: rise .45s var(--ease) both; }
.auth-card .logo { display: none; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; }
.auth-foot { text-align: center; margin-top: 20px; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 86px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--primary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 9px; border-radius: 6px; }
.pw-wrap button:hover { background: var(--primary-soft); }

/* --------------------------------------------------------- notifications */
.drawer-bg { position: fixed; inset: 0; background: rgba(15, 23, 41, .32); backdrop-filter: blur(2px); z-index: 40; animation: fade .18s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface); z-index: 41; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide-in .26s var(--ease); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.drawer-body { overflow-y: auto; padding: 6px 22px 22px; }
.notif { padding: 15px 0; border-top: 1px solid var(--border); display: flex; gap: 13px; animation: rise .3s var(--ease) both; }
.notif:first-child { border-top: 0; }
.notif .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 16px; background: var(--surface-2); }
.notif.error .ico { background: var(--danger-soft); }
.notif.success .ico { background: var(--success-soft); }
.notif.warning .ico { background: var(--warning-soft); }
.notif .txt { flex: 1; min-width: 0; }
.notif .txt b { display: block; }
.notif.unread .txt b::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-left: 8px; vertical-align: middle; }
.notif .meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.notif details { margin-top: 8px; font-size: 13px; }
.notif details summary { cursor: pointer; color: var(--muted); }
.notif details pre { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px; margin: 6px 0 0; font-size: 12px; }

/* ----------------------------------------------------------- modal/toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 41, .45); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .18s; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 500px; box-shadow: var(--shadow-lg); animation: pop .24s var(--ease); max-height: 90vh; overflow-y: auto; }
.modal.wide { max-width: 640px; }
.modal-head { padding: 22px 24px 0; }
.modal-body { padding: 14px 24px 4px; color: var(--text-2); }
.modal-foot { padding: 16px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

#toasts { position: fixed; top: 18px; right: 18px; z-index: 60; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { position: relative; overflow: hidden; display: flex; gap: 11px; align-items: flex-start; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  padding: 13px 16px 15px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 520; animation: slide-in .3s var(--ease); max-width: min(420px, calc(100vw - 36px)); pointer-events: auto; }
.toast .t-ico { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--success-soft); color: var(--success); font-size: 13px; font-weight: 800; }
.toast.error .t-ico { background: var(--danger-soft); color: var(--danger); }
.toast::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--success); transform-origin: left; animation: progress var(--d, 3.2s) linear forwards; opacity: .6; }
.toast.error::after { background: var(--danger); }
.toast.hide { opacity: 0; transform: translateX(16px); transition: .25s; }

.success-burst { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; pointer-events: none; animation: fade .2s; }
.success-burst .sb-card { background: var(--surface); border-radius: 20px; padding: 30px 38px; box-shadow: var(--shadow-lg); text-align: center; animation: pop .35s var(--ease); max-width: 360px; }
.success-burst svg { width: 74px; height: 74px; }
.success-burst circle { stroke: var(--success); stroke-width: 3; fill: var(--success-soft); }
.success-burst path { stroke: var(--success); stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s .15s var(--ease) forwards; }
.success-burst b { display: block; font-size: 18px; margin-top: 12px; }
.success-burst span { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------- dashboard */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.hello .date { color: var(--muted); font-weight: 550; text-transform: capitalize; font-size: 13.5px; margin-bottom: 4px; }
.onboard { background: linear-gradient(135deg, #ffffff 0%, #f6f5ff 100%); border-color: #e2e0fb; margin-bottom: 18px; }
.onboard .progress { height: 8px; border-radius: 99px; background: #e6e5f7; overflow: hidden; margin: 8px 0 16px; }
.onboard .progress span { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .8s var(--ease); }
.steps-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ob-step { display: flex; gap: 11px; align-items: flex-start; padding: 13px; border-radius: 12px; background: #fff; border: 1px solid var(--border); color: inherit; transition: border-color .15s, transform .15s; }
a.ob-step:hover { border-color: #c9c6f6; transform: translateY(-2px); text-decoration: none; }
.ob-step .num { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.ob-step.done .num { background: var(--success); border-color: var(--success); color: #fff; }
.ob-step.done b { color: var(--muted); text-decoration: line-through; text-decoration-color: #b8bfcd; }
.ob-step b { display: block; font-size: 14px; }
.ob-step span { color: var(--muted); font-size: 12.5px; }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick button, .quick a { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  font: inherit; color: var(--text); cursor: pointer; text-align: left; transition: border-color .15s, background .15s, transform .15s; }
.quick button:hover, .quick a:hover { border-color: #c9c6f6; background: #fff; transform: translateY(-2px); text-decoration: none; }
.quick .q-ico { font-size: 20px; }
.quick b { font-size: 14px; }
.quick span { font-size: 12.5px; color: var(--muted); }
.timeline-day { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 6px; }
.timeline-day:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- brands */
.brand-card { display: flex; flex-direction: column; gap: 14px; color: var(--text); }
.brand-card:hover { text-decoration: none; }
.bc-head { display: flex; gap: 12px; align-items: center; }
.bc-head h3 { margin-bottom: 2px; }
.bc-head .grow { min-width: 0; }
.bc-head .grow span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-lines { display: flex; flex-direction: column; gap: 7px; }
.bc-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 13px; margin-top: auto; }
.avatars { display: flex; }
.avatars .avatar { margin-left: -7px; border: 2px solid #fff; }
.avatars .avatar:first-child { margin-left: 0; }
.warn-text { color: var(--warning); font-weight: 600; }
.owners-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.owners-card .grow { flex: 1; min-width: 220px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px 4px 5px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; font-weight: 520; animation: pop .2s var(--ease); }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 17px; line-height: 1; padding: 0 5px; border-radius: 50%; }
.chip button:hover { color: var(--danger); }
.chip.add { cursor: pointer; padding: 6px 14px; color: var(--primary-dark); background: var(--primary-soft); border-color: #dcdffb; font: inherit; font-weight: 600; font-size: 14px; }
.chip.add:hover { background: #e3e6fd; }
.form-section { margin-bottom: 18px; }
.form-section h2 { margin-bottom: 4px; }
.form-section > .muted.small { margin-bottom: 18px; }
.form-section > h2 + .field, .form-section > h2 + .grid { margin-top: 16px; }
.form-section .field:last-child { margin-bottom: 0; }
.form-section .grid { gap: 16px; margin-bottom: 16px; }
.form-section .grid .field { margin-bottom: 0; }
.form-section .grid:last-child { margin-bottom: 0; }
.list-editor { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.le-row { display: flex; gap: 6px; width: 100%; animation: rise .2s var(--ease); }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 7px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.tag-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.tag-input .chip { padding-left: 11px; }
.tag-input input { flex: 1; min-width: 160px; border: 0; outline: none; font: inherit; padding: 4px 6px; }
.colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.color-field { display: flex; align-items: center; gap: 11px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; background: #fff; }
.color-field > div { flex: 1; min-width: 0; }
.color-field b { display: block; font-size: 14px; }
.color-field input[type=color] { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; flex: none; }
.color-field input[data-empty] { opacity: .35; }
.logo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 150px; height: 80px; border: 1px dashed var(--border-strong); border-radius: 10px; display: grid; place-items: center; padding: 8px; overflow: hidden;
  background: repeating-conic-gradient(#f1f3f6 0 25%, #fff 0 50%) 50% / 16px 16px; }
.logo-preview img { max-width: 132px; max-height: 62px; width: auto; height: auto; object-fit: contain; }
.danger-zone { border-color: #f1d6d3; }
.danger-zone .row span { display: block; }
.savebar { position: sticky; bottom: 16px; display: flex; align-items: center; gap: 10px; background: var(--sidebar); color: #fff; padding: 10px 12px 10px 20px;
  border-radius: 14px; box-shadow: var(--shadow-lg); animation: rise .25s var(--ease); z-index: 6; }
.savebar span { flex: 1; font-weight: 520; }
.savebar .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }

/* -------------------------------------------------------------- planning */
.plan-card { margin-bottom: 18px; }
.plan-head { display: flex; gap: 14px; align-items: flex-start; }
.plan-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; font-size: 21px; flex: none; }
.plan-head .grow { flex: 1; min-width: 0; }
.plan-status { font-size: 16.5px; font-weight: 640; margin: 4px 0 0; }
.plan-next { margin: 2px 0 0; color: var(--muted); }
.plan-q { font-weight: 640; margin: 22px 0 10px; color: var(--text-2); }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 15px 17px; border: 1.5px solid var(--border); border-radius: 12px;
  background: #fff; cursor: pointer; font: inherit; color: var(--text); transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; }
.choice:hover { border-color: #c4c8f4; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.choice.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 4px var(--primary-ring); transform: none; }
.choice .c-ico { font-size: 21px; margin-bottom: 5px; }
.choice b { font-size: 15px; }
.choice span:last-child { color: var(--muted); font-size: 13.5px; }
.panel { margin-top: 16px; padding: 20px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); animation: rise .25s var(--ease); }
.panel .field { margin-bottom: 14px; }
.grid.tight { gap: 0 14px; }
.preview { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px; animation: fade .2s; }
.preview.err { color: var(--danger); background: var(--danger-soft); border-color: #f4c9c4; }
.pv-summary { font-weight: 640; margin: 0 0 8px; }
.pv-dates { margin: 0 0 8px; padding-left: 20px; }
.pv-note { margin: 6px 0 0; }
.panel-foot { margin-top: 16px; display: flex; justify-content: flex-end; }
.pause-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; border-top: 1px solid var(--border); margin-top: 20px; padding-top: 15px; flex-wrap: wrap; }
.cycle + .cycle { margin-top: 20px; }
.cycle-date { font-weight: 640; color: var(--muted); font-size: 13.5px; margin-bottom: 8px; }
.report { border: 1px solid var(--border); border-radius: 11px; margin-bottom: 8px; background: #fff; transition: box-shadow .15s; }
.report:hover { box-shadow: var(--shadow); }
.report summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; cursor: pointer; list-style: none; }
.report summary::-webkit-details-marker { display: none; }
.report summary::after { content: "▾"; color: var(--muted); margin-left: 6px; transition: transform .2s; }
.report[open] summary::after { transform: rotate(180deg); }
.report summary b { flex: 1; }
.report-body { padding: 13px 15px 15px; border-top: 1px solid var(--border); animation: fade .2s; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; background: var(--surface-2); border-radius: 10px; padding: 13px; }
.sources { padding-left: 18px; margin: 4px 0 0; }

/* ----------------------------------------------------------- validation */
.vlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.vcard { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: inherit; }
.vcard:hover { text-decoration: none; }
.vcard .v-img { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #eef0fe, #f6f0ff); display: grid; place-items: center; overflow: hidden; position: relative; }
.vcard .v-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.vcard:hover .v-img img { transform: scale(1.04); }
.vcard .v-img .badge { position: absolute; top: 12px; left: 12px; background: rgba(255, 255, 255, .92); }
.vcard .v-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.vcard .v-body p { color: var(--text-2); font-size: 14px; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.vcard .v-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.countdown { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--warning); }
.countdown.urgent { color: var(--danger); }
.v-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .9fr); gap: 22px; align-items: start; }
.v-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 18px; }
.net-tabs { display: inline-flex; background: #eceef4; border-radius: 10px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.net-tabs button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 8px; cursor: pointer; color: var(--muted); transition: background .15s, color .15s, box-shadow .15s; }
.net-tabs button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.social { max-width: 520px; margin: 0 auto; background: #fff; border: 1px solid #dfe2e8; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); animation: fade .25s; }
.social-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.social-head .brand-dot { width: 40px; height: 40px; border-radius: 50%; }
.social-head b { display: block; font-size: 14.5px; }
.social-head span { font-size: 12.5px; color: #65676b; }
.social-text { padding: 0 14px 12px; font-size: 14.5px; white-space: pre-wrap; word-wrap: break-word; color: #050505; line-height: 1.45; }
.social-text .tag { color: #1a5bd6; }
.social-media { position: relative; background: #f0f2f5; }
.social-media img { width: 100%; display: block; }
.social-media .noimg { aspect-ratio: 4 / 5; display: grid; place-items: center; color: var(--muted); font-size: 14px; text-align: center; padding: 20px; }
.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); box-shadow: var(--shadow-md); cursor: pointer; font-size: 18px; display: grid; place-items: center; }
.carousel-nav.prev { left: 10px; } .carousel-nav.next { right: 10px; }
.carousel-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.carousel-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .55); transition: background .2s, transform .2s; }
.carousel-dots i.on { background: #fff; transform: scale(1.2); }
.social-actions { display: flex; justify-content: space-around; padding: 8px 10px; border-top: 1px solid #e4e6eb; color: #65676b; font-size: 13.5px; font-weight: 600; }
.ig .social-head .brand-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #d62976; }
.ig .social-actions { justify-content: flex-start; gap: 16px; font-size: 20px; padding: 10px 14px 4px; border: 0; }
.ig .social-text { padding-top: 6px; }
.decide-card .deadline { display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 12px; background: var(--warning-soft); margin-bottom: 16px; }
.decide-card .deadline.urgent { background: var(--danger-soft); }
.decide-card .deadline .d-ico { font-size: 22px; }
.decide-card .deadline b { display: block; }
.decide-card .deadline span { font-size: 13px; color: var(--text-2); }
.decide-actions { display: flex; flex-direction: column; gap: 10px; }
.facts-list { display: flex; flex-direction: column; gap: 8px; font-size: 14px; margin-bottom: 16px; }
.facts-list div { display: flex; justify-content: space-between; gap: 12px; }
.facts-list span { color: var(--muted); }
.facts-list b { text-align: right; }
.issue { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-bottom: 8px; }
.issue.red { background: var(--danger-soft); color: #8c231b; }
.issue.orange { background: var(--warning-soft); color: #7a4307; }
.editor .counter { font-size: 12.5px; color: var(--muted); text-align: right; margin-top: 4px; }
.editor .counter.over { color: var(--danger); font-weight: 650; }
.history { display: flex; flex-direction: column; gap: 12px; position: relative; padding-left: 16px; }
.history::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.history div { position: relative; font-size: 13.5px; }
.history div::before { content: ""; position: absolute; left: -16px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.history span { display: block; color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- journal */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filter { border: 1px solid var(--border); background: #fff; border-radius: 99px; padding: 7px 14px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .15s; }
.filter:hover { border-color: var(--border-strong); }
.filter.active { background: var(--sidebar); border-color: var(--sidebar); color: #fff; }
.jitem { display: flex; gap: 13px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); animation: rise .3s var(--ease) both; }
.jitem:first-of-type, .timeline-day + .jitem { border-top: 0; }
.jitem .j-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 15px; }
.jitem .grow { flex: 1; min-width: 0; }
.jitem time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ------------------------------------------------------------ connections */
.stepper { display: flex; flex-direction: column; gap: 18px; }
.step-card { display: grid; grid-template-columns: 44px 1fr; gap: 16px; }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(79, 70, 229, .3); }
.step-card.done .step-num { background: var(--success); box-shadow: none; }
.page-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.page-row:first-child { border-top: 0; }
.page-row .grow { flex: 1; min-width: 200px; }
.page-row select { max-width: 240px; }
.guide-steps { counter-reset: g; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.guide-steps li { counter-increment: g; display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.guide-steps li::before { content: counter(g); width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
code { background: #f1f3f8; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; }

/* ------------------------------------------------------------------ help */
.how { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.how div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 16px; position: relative; box-shadow: var(--shadow); }
.how div:not(:last-child)::after { content: "→"; position: absolute; right: -12px; top: 50%; transform: translateY(-50%); color: #a5abc0; font-weight: 700; z-index: 1; }
.how .h-ico { font-size: 26px; margin-bottom: 8px; display: block; }
.how b { display: block; margin-bottom: 4px; }
.how span { color: var(--muted); font-size: 13px; }
.faq details { border: 1px solid var(--border); border-radius: 12px; background: #fff; margin-bottom: 10px; transition: box-shadow .15s; }
.faq details:hover { box-shadow: var(--shadow); }
.faq summary { padding: 15px 18px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 20px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 18px 16px; color: var(--text-2); animation: fade .2s; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .v-layout { grid-template-columns: 1fr; }
  .v-side { position: static; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how div::after { display: none; }
}
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-card .logo { display: flex; justify-content: center; color: var(--text); padding-bottom: 24px; } }
@media (max-width: 780px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .topbar { padding: 12px 0; }
  .topbar-inner { padding: 0 16px; }
  .topbar .menu-btn { display: grid; }
  .content { padding: 4px 16px 44px; }
  .g-2, .g-3, .colors, .choices, .quick, .steps-list, .how { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .card { padding: 18px; }
  #toasts { left: 16px; right: 16px; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ===================================================== additions (v5) */
/* switch (on / off) */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 25px; border-radius: 99px; background: #d5d9e3; position: relative; flex: none; transition: background .2s var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .25); transition: transform .22s var(--ease); }
.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track::after { transform: translateX(19px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--primary-ring); }
.switch input:disabled + .track { opacity: .5; }
.switch b { font-weight: 600; }

/* settings rows inside a card */
.set-row { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.set-row:first-of-type { border-top: 0; padding-top: 4px; }
.set-row .grow { flex: 1; min-width: 0; }
.set-row .grow b { display: block; }
.set-row .grow p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.net-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 750; color: #fff; flex: none; font-size: 15px; }
.net-ico.fb { background: #1877f2; }
.net-ico.ig { background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af); }

/* Full AI card */
.fullai { position: relative; overflow: hidden; }
.fullai.on { border-color: #c7c3f7; background: linear-gradient(135deg, #ffffff 0%, #f6f5ff 100%); }
.fullai-check { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.fullai-check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--primary); flex: none; cursor: pointer; }
.fullai-check b { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.fullai-rules { margin: 14px 0 0 36px; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 14px; color: var(--text-2); }
.fullai-rules li { display: flex; gap: 9px; align-items: flex-start; }
.fullai-rules li::before { content: "✓"; color: var(--success); font-weight: 800; }
.fullai-rules li.no::before { content: "✕"; color: var(--danger); }
.ai-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; background: var(--grad); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }

/* emergency stop */
.stop-banner { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 36px; }
.stop-banner > div { display: flex; align-items: center; gap: 14px; background: var(--danger); color: #fff; border-radius: var(--radius); padding: 12px 18px; margin: 4px 0 14px; box-shadow: 0 6px 18px rgba(192, 53, 43, .25); animation: rise .35s var(--ease) both; }
.stop-banner .grow { flex: 1; }
.stop-banner a.btn { background: #fff; color: var(--danger); border-color: #fff; }
.stop-hero { text-align: center; padding: 34px 24px; }
.stop-hero .stop-btn { width: 150px; height: 150px; border-radius: 50%; border: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: 17px; color: #fff; letter-spacing: .03em;
  background: radial-gradient(circle at 35% 30%, #ef5a4f, #b4271d 70%); box-shadow: 0 10px 30px rgba(192, 53, 43, .35), inset 0 -6px 0 rgba(0, 0, 0, .15); transition: transform .15s var(--ease), box-shadow .15s; margin: 8px auto 18px; display: grid; place-items: center; }
.stop-hero .stop-btn:hover { transform: scale(1.04); box-shadow: 0 14px 36px rgba(192, 53, 43, .45), inset 0 -6px 0 rgba(0, 0, 0, .15); }
.stop-hero .stop-btn:active { transform: scale(.98); }
.stop-hero.stopped .stop-btn { background: radial-gradient(circle at 35% 30%, #34c38f, #0d7a52 70%); box-shadow: 0 10px 30px rgba(16, 132, 90, .35), inset 0 -6px 0 rgba(0, 0, 0, .15); }
.stop-hero p { max-width: 560px; margin: 0 auto; color: var(--text-2); }
.keeps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.keeps div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 13px; font-size: 13.5px; }
.keeps b { display: block; margin-bottom: 2px; }

/* quality score */
.score-box { display: flex; gap: 16px; align-items: center; }
.score-ring { --v: 0; --c: var(--success); width: 74px; height: 74px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), #e8ebf2 0); animation: pop .4s var(--ease) both; }
.score-ring span { width: 58px; height: 58px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 750; font-size: 19px; font-variant-numeric: tabular-nums; }
.score-ring span small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; margin-top: -4px; }
.score-ring.mid { --c: var(--warning); }
.score-ring.low { --c: var(--danger); }
.score-ring.none { --c: #c9cfdb; }
.bars { display: grid; gap: 9px; margin-top: 14px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) 110px 44px; gap: 10px; align-items: center; font-size: 13px; }
.bar .lbl { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .trk { height: 8px; border-radius: 99px; background: #eceef4; overflow: hidden; }
.bar .trk i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transform-origin: left; animation: grow .7s var(--ease) both; }
.bar .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.flag { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--warning-soft); border: 1px solid #f4dcb5; font-size: 13.5px; margin-top: 8px; }
.flag.high { background: var(--danger-soft); border-color: #f4c9c4; }
.flag b { display: block; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--warning); }
.flag.high b { color: var(--danger); }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-head h2 { min-width: 170px; text-align: center; text-transform: capitalize; margin: 0; }
.cal-head .grow { flex: 1; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); gap: 1px; }
.calendar .dow { background: var(--surface-2); padding: 9px 10px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.calendar .day { background: #fff; min-height: 116px; padding: 7px 7px 9px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.calendar .day.out { background: #fafbfd; }
.calendar .day.out .dn { color: #b3bacb; }
.calendar .day.weekend { background: #fbfbfe; }
.calendar .dn { font-size: 12.5px; font-weight: 650; color: var(--text-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.calendar .day.today .dn { background: var(--grad); color: #fff; }
.ev { display: flex; gap: 6px; align-items: center; padding: 4px 7px; border-radius: 7px; font-size: 12px; line-height: 1.25; color: var(--text); background: var(--surface-2); border-left: 3px solid var(--c, var(--primary));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .12s, box-shadow .12s; animation: pop .25s var(--ease) both; }
a.ev:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.ev .t { font-weight: 650; font-variant-numeric: tabular-nums; flex: none; }
.ev .n { overflow: hidden; text-overflow: ellipsis; }
.ev.published { background: var(--success-soft); }
.ev.failed, .ev.expired { background: var(--danger-soft); }
.ev.to_validate { background: var(--primary-soft); }
.ev.watch { border-left-style: dashed; background: #fff; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--c); display: inline-block; }

/* results */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; }
.kpi span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.kpi b { font-size: 22px; font-weight: 720; font-variant-numeric: tabular-nums; }
.top-post { display: flex; gap: 13px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.top-post:first-child { border-top: 0; padding-top: 0; }
.top-post .thumb { width: 54px; height: 66px; border-radius: 8px; background: var(--surface-2) center / cover no-repeat; flex: none; border: 1px solid var(--border); }
.top-post .grow { flex: 1; min-width: 0; }
.top-post .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-post .grow span { color: var(--muted); font-size: 13px; }
.medal { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 13px; background: var(--primary-soft); color: var(--primary-dark); flex: none; }
.advice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; background: var(--primary-soft); border-radius: 10px; font-size: 14px; margin-top: 8px; }

/* photo library */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface-2) center / cover no-repeat; border: 1px solid var(--border); animation: pop .3s var(--ease) both; }
.media-item .m-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 7px; background: linear-gradient(transparent, rgba(15, 23, 41, .75)); color: #fff; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.media-item .m-foot span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-item button { border: 0; background: rgba(255, 255, 255, .92); color: var(--danger); border-radius: 7px; padding: 3px 8px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; cursor: pointer; display: block; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.dropzone b { color: var(--text); display: block; font-size: 15px; margin-bottom: 2px; }

/* day picker (veille on several days) */
.day-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-picks label { cursor: pointer; }
.day-picks input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-picks span { display: inline-block; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: #fff; font-weight: 600; font-size: 13.5px; text-transform: capitalize; transition: all .15s; }
.day-picks input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.day-picks input:focus-visible + span { box-shadow: 0 0 0 4px var(--primary-ring); }
.idea-btn { margin-top: 12px; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 780px) {
  .stop-banner { padding: 0 16px; }
  .keeps { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar .day { min-height: 74px; padding: 4px; }
  .ev .n { display: none; }
  .calendar .dow { padding: 6px 4px; font-size: 10.5px; }
  .bar { grid-template-columns: minmax(0, 1fr) 70px 38px; }
}
