:root {
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-sunk: #eef0f6;
  --ink: #0e1222;
  --ink-soft: #4a5068;
  --ink-mute: #8a8fa6;
  --line: #e4e6ef;
  --brand: #5b3df5;
  --brand-dark: #4429d6;
  --brand-soft: #eeeaff;
  --accent: #12c99b;
  --accent-soft: #dcf8ef;
  --warn: #f5a524;
  --warn-soft: #fff3dc;
  --danger: #e5484d;
  --danger-soft: #ffe9ea;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(14, 18, 34, .04), 0 8px 24px rgba(14, 18, 34, .06);
  --shadow-lg: 0 24px 64px rgba(14, 18, 34, .18);
  --sidebar: 248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg-soft);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { max-width: 100%; display: block; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--ink-soft); }
.mute { color: var(--ink-mute); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }

.logo { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.logo span { color: var(--brand); }
.boot { height: 100vh; display: grid; place-items: center; }
.boot .logo { font-size: 40px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  cursor: pointer; background: none;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(91, 61, 245, .28); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-ghost { border-color: var(--line); background: #fff; }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink-mute); }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn-soft:hover:not(:disabled) { background: #e2dcff; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #ffd9db; }
.btn-success { background: var(--accent); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border-radius: 10px; border: none; background: none; cursor: pointer; color: var(--ink-soft);
}
.icon-btn:hover { background: var(--bg-sunk); color: var(--ink); }
.icon-btn.on { color: var(--brand); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--ink-mute); }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
textarea.input { resize: vertical; min-height: 96px; line-height: 1.55; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91, 61, 245, .12); }
.input::placeholder { color: var(--ink-mute); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-error {
  display: none; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger); font-weight: 500; margin-bottom: 14px;
}
.form-error.show { display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-weight: 500; font-size: 13px; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--ink-mute); }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.chip svg.lucide { width: 15px; height: 15px; }

.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.option {
  padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff;
  cursor: pointer; text-align: left; transition: all .15s; display: flex; flex-direction: column; gap: 8px;
}
.option:hover { border-color: var(--ink-mute); }
.option.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(91, 61, 245, .12); }
.option .t { font-weight: 600; }
.option .d { font-size: 12px; color: var(--ink-soft); }
.option svg.lucide { color: var(--brand); width: 20px; height: 20px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 44px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 80% at 0% 0%, #7a5cff 0%, transparent 55%),
              radial-gradient(90% 70% at 100% 100%, #12c99b 0%, transparent 50%),
              linear-gradient(160deg, #3a22c9, #1a1150 70%);
}
.auth-art .logo { color: #fff; }
.auth-art .logo span { color: #b8a9ff; }
.auth-art h2 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; letter-spacing: -0.035em; max-width: 480px; line-height: 1.08; }
.auth-art p { color: rgba(255, 255, 255, .78); font-size: 16px; max-width: 420px; margin-top: 16px; }
.auth-points { display: grid; gap: 12px; margin-top: 32px; }
.auth-points div { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.auth-points svg.lucide { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: rgba(255, 255, 255, .14); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card > p { color: var(--ink-soft); margin-bottom: 28px; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--ink-soft); }
.auth-switch a { color: var(--brand); font-weight: 600; }

/* ---------- onboarding ---------- */
.onb { min-height: 100vh; background: var(--bg-soft); }
.onb-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; background: #fff; border-bottom: 1px solid var(--line);
}
.onb-progress { display: flex; gap: 8px; align-items: center; }
.onb-progress .step { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-mute); font-size: 13px; }
.onb-progress .num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-sunk); font-size: 12px;
}
.onb-progress .step.on { color: var(--ink); }
.onb-progress .step.on .num { background: var(--brand); color: #fff; }
.onb-progress .step.done .num { background: var(--accent); color: #fff; }
.onb-progress .bar { width: 28px; height: 2px; background: var(--line); }
.onb-body { max-width: 720px; margin: 0 auto; padding: 48px 24px 120px; }
.onb-body .eyebrow { color: var(--brand); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.onb-body h1 { font-size: 32px; margin: 8px 0 8px; }
.onb-body > p { color: var(--ink-soft); font-size: 16px; margin-bottom: 32px; }
.onb-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.onb-actions {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line);
  padding: 14px 32px; display: flex; justify-content: space-between; align-items: center; z-index: 5;
}
.onb-actions .right { display: flex; gap: 10px; }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.swatch { position: relative; width: 64px; text-align: center; }
.swatch input[type=color] {
  width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 14px; padding: 0; cursor: pointer; background: none;
}
.swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input[type=color]::-webkit-color-swatch { border: none; border-radius: 13px; }
.swatch .hex { font-size: 11px; color: var(--ink-mute); margin-top: 4px; font-family: ui-monospace, monospace; }
.swatch .rm {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); color: #fff; border: 2px solid #fff; display: grid; place-items: center; cursor: pointer;
}
.swatch .rm svg.lucide { width: 11px; height: 11px; }
.swatch-add {
  width: 64px; height: 64px; border: 1.5px dashed var(--line); border-radius: 14px; display: grid; place-items: center;
  cursor: pointer; background: none; color: var(--ink-mute); margin-bottom: 20px;
}
.swatch-add:hover { border-color: var(--brand); color: var(--brand); }
.logo-drop {
  display: flex; gap: 16px; align-items: center; padding: 16px; border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm); cursor: pointer;
}
.logo-drop:hover { border-color: var(--brand); }
.logo-drop .thumb {
  width: 72px; height: 72px; border-radius: 12px; background: var(--bg-soft); display: grid; place-items: center; overflow: hidden;
}
.logo-drop .thumb img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.sidebar .logo { padding: 4px 10px 20px; }
.sidebar .new-btn { margin: 0 4px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  font-weight: 500; color: var(--ink-soft); transition: background .12s;
}
.nav a:hover { background: var(--bg-soft); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--ink-mute); font-weight: 500; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.help-card { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 14px; }
.help-card h4 { font-size: 13px; margin-bottom: 4px; }
.help-card p { font-size: 12px; color: var(--ink-soft); }
.me {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; border: none; background: none; text-align: left; width: 100%;
}
.me:hover { background: var(--bg-soft); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.team { background: var(--ink); }
.me .who { min-width: 0; }
.me .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { display: block; font-size: 12px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10; height: 64px; padding: 0 32px;
  display: flex; align-items: center; gap: 16px;
  background: rgba(246, 247, 251, .85); backdrop-filter: blur(12px); border-bottom: 1px solid transparent;
}
.topbar .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 420px; }
.search svg.lucide { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); width: 16px; }
.search input { padding-left: 38px; min-height: 38px; background: #fff; border-radius: 999px; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; max-height: 360px; overflow: auto; z-index: 20;
}
.search-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.search-results a:hover { background: var(--bg-soft); }
.search-results .type { font-size: 11px; color: var(--ink-mute); margin-left: auto; text-transform: uppercase; letter-spacing: .05em; }
.topbar .spacer { flex: 1; }
.content { padding: 8px 32px 64px; max-width: 1240px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 16px 0 24px; flex-wrap: wrap; }
.page-head p { color: var(--ink-soft); margin-top: 4px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--ink-mute); font-size: 13px; margin-top: 16px; }
.crumbs a:hover { color: var(--ink); }
.crumbs svg.lucide { width: 14px; height: 14px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head a { color: var(--brand); font-weight: 600; font-size: 13px; }

.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.stat .ico svg.lucide { width: 22px; height: 22px; }
.stat b { font-size: 24px; font-weight: 800; display: block; line-height: 1.1; letter-spacing: -0.02em; }
.stat span { color: var(--ink-soft); font-size: 13px; }
.tint-brand { background: var(--brand-soft); color: var(--brand); }
.tint-accent { background: var(--accent-soft); color: #0a9b77; }
.tint-warn { background: var(--warn-soft); color: #b77300; }
.tint-ink { background: var(--bg-sunk); color: var(--ink); }

.dash { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.dash > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; min-width: 0; }

.hero {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 28px; color: #fff; margin-bottom: 24px;
  background: radial-gradient(80% 120% at 100% 0%, rgba(18, 201, 155, .55), transparent 60%), linear-gradient(120deg, #5b3df5, #3a22c9);
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.hero h1 { font-size: 26px; }
.hero p { color: rgba(255, 255, 255, .82); margin-top: 6px; max-width: 520px; }
.hero .btn-ghost { background: #fff; border-color: #fff; color: var(--brand-dark); }
.hero .btn-outline { border: 1px solid rgba(255, 255, 255, .45); color: #fff; }
.hero .btn-outline:hover { background: rgba(255, 255, 255, .12); }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.checklist { padding: 6px 0; }
.check-item { display: flex; gap: 12px; align-items: center; padding: 10px 22px; }
.check-item .tick {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex-shrink: 0;
}
.check-item.done .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.check-item.done .tick svg.lucide { width: 13px; height: 13px; stroke-width: 3; }
.check-item.done span { color: var(--ink-mute); text-decoration: line-through; }
.check-item a { margin-left: auto; color: var(--brand); font-weight: 600; font-size: 13px; }
.meter { height: 6px; background: var(--bg-sunk); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 99px; transition: width .4s; }

.feed { padding: 8px 0; }
.feed-item { display: flex; gap: 12px; padding: 10px 22px; }
.feed-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex-shrink: 0; }
.feed-item p { font-size: 13px; }
.feed-item time { font-size: 12px; color: var(--ink-mute); }

.empty { text-align: center; padding: 48px 24px; color: var(--ink-soft); }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand-soft); color: var(--brand); }
.empty .ico svg.lucide { width: 26px; height: 26px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 360px; margin: 0 auto 18px; }

/* ---------- projects ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button, .tabs a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: none; background: none; cursor: pointer; font-weight: 600; color: var(--ink-mute);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs .on { color: var(--ink); border-bottom-color: var(--brand); }
.tabs .n { font-size: 11px; background: var(--bg-sunk); padding: 1px 7px; border-radius: 99px; color: var(--ink-soft); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filters .grow { flex: 1; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.project-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.project-cover {
  aspect-ratio: 16 / 8; position: relative; display: grid; place-items: center; color: rgba(255, 255, 255, .9);
}
.project-cover svg.lucide { width: 34px; height: 34px; }
.project-cover .badge { position: absolute; top: 12px; left: 12px; }
.project-cover .len { position: absolute; bottom: 10px; right: 12px; font-size: 12px; font-weight: 600; background: rgba(0, 0, 0, .35); padding: 2px 8px; border-radius: 6px; }
.project-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-body h3 { font-size: 16px; }
.project-meta { display: flex; gap: 14px; color: var(--ink-mute); font-size: 12.5px; margin-top: auto; }
.project-meta span { display: inline-flex; gap: 5px; align-items: center; }
.project-meta svg.lucide { width: 14px; height: 14px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: var(--bg-sunk); color: var(--ink-soft); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.s-draft { background: var(--bg-sunk); color: var(--ink-soft); }
.badge.s-submitted { background: #e6f0ff; color: #2962d9; }
.badge.s-scripting { background: var(--brand-soft); color: var(--brand-dark); }
.badge.s-production { background: var(--brand-soft); color: var(--brand-dark); }
.badge.s-review { background: var(--warn-soft); color: #b77300; }
.badge.s-delivered { background: var(--accent-soft); color: #0a8a6a; }
.badge.plain::before { display: none; }

.stages { display: flex; gap: 4px; }
.stages i { flex: 1; height: 4px; border-radius: 99px; background: var(--bg-sunk); }
.stages i.done { background: var(--brand); }
.stages i.now { background: linear-gradient(90deg, var(--brand), var(--accent)); }

.tracker { display: grid; grid-template-columns: repeat(6, 1fr); padding: 22px; gap: 4px; }
.tracker .st { position: relative; text-align: center; }
.tracker .st::before {
  content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--line); z-index: 0;
}
.tracker .st:first-child::before { display: none; }
.tracker .st.done::before, .tracker .st.now::before { background: var(--brand); }
.tracker .pt {
  position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 8px;
  display: grid; place-items: center; background: #fff; border: 2px solid var(--line); color: var(--ink-mute);
}
.tracker .pt svg.lucide { width: 15px; height: 15px; }
.tracker .done .pt { background: var(--brand); border-color: var(--brand); color: #fff; }
.tracker .now .pt { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 5px rgba(91, 61, 245, .14); }
.tracker .st b { display: block; font-size: 12.5px; }
.tracker .st span { font-size: 11.5px; color: var(--ink-mute); }

.callout {
  display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-radius: var(--radius);
  margin-bottom: 20px; flex-wrap: wrap;
}
.callout .txt { flex: 1; min-width: 220px; }
.callout b { display: block; }
.callout.brand { background: var(--brand-soft); color: var(--brand-dark); }
.callout.warn { background: var(--warn-soft); color: #8a5800; }
.callout.ok { background: var(--accent-soft); color: #08745a; }
.callout .actions { display: flex; gap: 8px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.kv { display: grid; gap: 14px; }
.kv div span { display: block; font-size: 12px; color: var(--ink-mute); font-weight: 500; margin-bottom: 2px; }
.kv div b { font-weight: 600; }

/* ---------- ideas ---------- */
.composer { padding: 16px 18px; margin-bottom: 22px; }
.composer .input.title { border: none; box-shadow: none; padding: 4px 0; font-size: 16px; font-weight: 600; min-height: 0; }
.composer textarea.input { border: none; box-shadow: none; padding: 4px 0; min-height: 48px; resize: none; }
.composer .bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.composer .bar .grow { flex: 1; }
.composer select.input { min-height: 32px; padding: 4px 10px; width: auto; border-radius: 99px; font-size: 13px; }
.composer .input.link { min-height: 32px; padding: 4px 12px; border-radius: 99px; font-size: 13px; width: 200px; }

.idea-grid { columns: 3 280px; column-gap: 16px; }
.idea { break-inside: avoid; margin-bottom: 16px; padding: 16px 18px; position: relative; border-top: 3px solid var(--c, var(--brand)); }
.idea .top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.idea .cat { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c, var(--brand)); display: inline-flex; gap: 6px; align-items: center; }
.idea .cat svg.lucide { width: 14px; height: 14px; }
.idea .tools { margin-left: auto; display: flex; gap: 0; opacity: 0; transition: opacity .15s; }
.idea:hover .tools, .idea .tools .on { opacity: 1; }
.idea .tools .icon-btn { width: 28px; height: 28px; }
.idea .tools svg.lucide { width: 15px; height: 15px; }
.idea h3 { margin-bottom: 6px; }
.idea p { color: var(--ink-soft); white-space: pre-wrap; word-break: break-word; }
.idea .link { display: inline-flex; gap: 6px; align-items: center; color: var(--brand); font-weight: 500; font-size: 13px; margin-top: 10px; word-break: break-all; }
.idea .link svg.lucide { width: 14px; height: 14px; }
.idea .foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--ink-mute); }
.idea.pinned { box-shadow: 0 0 0 1.5px var(--c, var(--brand)), var(--shadow); }
.idea .pin-flag { position: absolute; top: -10px; right: 14px; background: var(--c, var(--brand)); color: #fff; border-radius: 6px; padding: 2px 6px; font-size: 11px; font-weight: 700; display: flex; gap: 4px; align-items: center; }
.idea .pin-flag svg.lucide { width: 11px; height: 11px; }

/* ---------- assets ---------- */
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius); background: #fff; padding: 28px;
  display: flex; align-items: center; gap: 18px; cursor: pointer; margin-bottom: 22px; transition: all .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .ico { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.dropzone.over .ico { background: #fff; }
.dropzone .ico svg.lucide { width: 24px; height: 24px; }
.dropzone b { font-size: 15px; display: block; }
.dropzone .grow { flex: 1; }
.uploads { display: grid; gap: 8px; margin-bottom: 18px; }
.upload-row { display: flex; gap: 12px; align-items: center; padding: 10px 14px; }
.upload-row .meter { flex: 1; max-width: 240px; }
.upload-row .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.asset { overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.asset:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.asset .thumb { aspect-ratio: 4 / 3; background: var(--bg-soft); display: grid; place-items: center; position: relative; overflow: hidden; }
.asset .thumb img, .asset .thumb video { width: 100%; height: 100%; object-fit: cover; }
.asset .thumb .ft { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; }
.asset .thumb .ft svg.lucide { width: 24px; height: 24px; }
.asset .thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(transparent 50%, rgba(0, 0, 0, .35)); }
.asset .thumb .play svg.lucide { width: 34px; height: 34px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .4)); }
.asset .info { padding: 12px 14px; }
.asset .info b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset .info span { font-size: 12px; color: var(--ink-mute); }

.preview { background: #0e1222; border-radius: var(--radius-sm); display: grid; place-items: center; min-height: 220px; max-height: 60vh; overflow: hidden; }
.preview img, .preview video { max-height: 60vh; width: auto; }
.preview audio { width: 90%; }
.preview.file { background: var(--bg-soft); }

/* ---------- messages ---------- */
.thread { display: flex; flex-direction: column; gap: 14px; padding: 22px; max-height: 520px; overflow-y: auto; }
.msg { display: flex; gap: 10px; max-width: 80%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble { background: var(--bg-soft); padding: 10px 14px; border-radius: 14px 14px 14px 4px; white-space: pre-wrap; word-break: break-word; }
.msg.mine .bubble { background: var(--brand); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg .meta { font-size: 11.5px; color: var(--ink-mute); margin-top: 4px; }
.msg.mine .meta { text-align: right; }
.reply { display: flex; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); align-items: flex-end; }
.reply textarea.input { min-height: 44px; height: 44px; resize: none; }

/* ---------- brand kit ---------- */
.brand-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.palette { display: flex; border-radius: var(--radius-sm); overflow: hidden; height: 88px; }
.palette div { flex: 1; display: flex; align-items: flex-end; padding: 8px; font-size: 11px; font-family: ui-monospace, monospace; }

/* ---------- modal & toast ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(14, 18, 34, .45); z-index: 100; display: grid; place-items: center; padding: 20px;
  animation: fade .15s ease;
}
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 20px;
  box-shadow: var(--shadow-lg); animation: pop .18s ease;
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 0; }
.modal-body { padding: 18px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; }
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

#toasts { position: fixed; bottom: 24px; right: 24px; display: grid; gap: 10px; z-index: 200; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; gap: 10px; align-items: center; font-weight: 500; animation: pop .2s ease; max-width: 360px;
}
.toast.error { background: var(--danger); }
.toast svg.lucide { color: var(--accent); }
.toast.error svg.lucide { color: #fff; }

.menu {
  position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 200px; z-index: 50;
}
.menu button, .menu a {
  display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border: none; background: none; cursor: pointer;
  border-radius: 8px; text-align: left; font-weight: 500;
}
.menu button:hover, .menu a:hover { background: var(--bg-soft); }
.menu .danger { color: var(--danger); }

/* ---------- AI brand setup ---------- */
.ai-hint { display: flex; gap: 10px; align-items: flex-start; margin-top: 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; }
.ai-hint svg.lucide { width: 16px; height: 16px; margin-top: 2px; }
.ai-card {
  display: flex; gap: 18px; align-items: center; padding: 18px 20px; margin-bottom: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, #f4f1ff, #e9fbf5); border-color: #ddd5ff;
}
.ai-card-text { display: flex; gap: 12px; align-items: flex-start; flex: 1; min-width: 240px; }
.ai-card-text > svg.lucide { width: 22px; height: 22px; color: var(--brand); margin-top: 2px; }
.ai-card-text b { display: block; }
.ai-card-text span { color: var(--ink-soft); font-size: 13px; }
.ai-card-form { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.ai-card-form .input { flex: 1; min-width: 0; }
.ai-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.ai-banner b { display: block; }
.ai-banner span:not(.spinner) { font-size: 13px; }
.ai-banner > svg.lucide { margin-top: 2px; }
.ai-banner.running { background: var(--brand-soft); color: var(--brand-dark); }
.ai-banner.done { background: var(--accent-soft); color: #08745a; }
.ai-banner.error { background: var(--warn-soft); color: #8a5800; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(91, 61, 245, .25); border-top-color: var(--brand);
  animation: spin .8s linear infinite; flex-shrink: 0; margin-top: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- admin panel ---------- */
.admin-tag { margin-left: 6px; font-size: 10.5px; letter-spacing: .04em; background: var(--ink); color: #fff; }
.shell.staff .sidebar .logo { display: flex; align-items: center; }
.tint-danger { background: var(--danger-soft); color: var(--danger); }
.grid-stats.six { grid-template-columns: repeat(6, 1fr); }
a.stat { transition: transform .15s, box-shadow .15s; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .05em;
  padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-soft);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafbfe; }
.table tr.click { cursor: pointer; }
.table td a:not(.btn) { color: var(--ink); }
.table td a:not(.btn):hover { color: var(--brand); }
.cell-title { display: block; font-weight: 600; }
.cell-sel { min-height: 34px; padding: 5px 10px; font-size: 13px; width: auto; min-width: 140px; border-radius: 8px; }
.cell-sel.pr-urgent { color: var(--danger); font-weight: 600; }
.cell-sel.pr-high { color: #b77300; font-weight: 600; }
.reasons { display: flex; gap: 6px; flex-wrap: wrap; }
.badge.r-warn { background: var(--warn-soft); color: #9a6100; }
.badge.r-danger { background: var(--danger-soft); color: var(--danger); }
.badge.r-brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge.pr-low { background: var(--bg-sunk); color: var(--ink-mute); }
.badge.pr-high { background: var(--warn-soft); color: #9a6100; }
.badge.pr-urgent { background: var(--danger-soft); color: var(--danger); }
.badge.pr-low::before, .badge.pr-high::before, .badge.pr-urgent::before { display: none; }
.overdue { color: var(--danger); font-weight: 600; }
.waiting-txt { color: var(--brand); font-weight: 600; }

.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person > span:last-child:not(.avatar) { display: flex; flex-direction: column; min-width: 0; }
.person.big { gap: 16px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; border-radius: 16px; }
.avatar.logo { background: #fff; border: 1px solid var(--line); }
.avatar.logo img { object-fit: contain; padding: 3px; }
.avatar.lg.logo img { padding: 8px; }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 28px; gap: 12px; align-items: center; font-size: 13px; }
.bar-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row b { text-align: right; }
a.bar-row:hover > span { color: var(--brand); }
.bar-track { height: 8px; background: var(--bg-sunk); border-radius: 99px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; background: var(--brand); min-width: 2px; }
.bar-track i.s-draft { background: var(--ink-mute); }
.bar-track i.s-submitted { background: #2962d9; }
.bar-track i.s-review { background: var(--warn); }
.bar-track i.s-delivered { background: var(--accent); }

.manager-card { padding: 18px 22px 16px; margin-bottom: 20px; border-color: #d9d2ff; background: linear-gradient(180deg, #faf9ff, #fff); }
.mc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mc-head > span:first-child { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--brand-dark); }
.mc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mc-client { display: flex; align-items: center; gap: 8px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-client:hover { border-color: var(--brand); color: var(--brand); }

.board { display: grid; grid-template-columns: repeat(6, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kcol { background: var(--bg-sunk); border-radius: var(--radius); padding: 10px; min-height: 200px; transition: background .15s, box-shadow .15s; }
.kcol.over { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.kcol-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; }
.kcol-body { display: grid; gap: 10px; }
.kcol-empty { text-align: center; color: var(--ink-mute); font-size: 12.5px; padding: 18px 0; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); }
.kcard {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: #fff; border: 1px solid var(--line);
  border-left: 3px solid transparent; border-radius: 12px; box-shadow: 0 1px 2px rgba(14, 18, 34, .05); cursor: grab;
}
.kcard:hover { box-shadow: var(--shadow); }
.kcard.dragging { opacity: .45; }
.kcard.pr-edge-high { border-left-color: var(--warn); }
.kcard.pr-edge-urgent { border-left-color: var(--danger); }
.kcard-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.kcard-top .mute { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard b { font-size: 14px; line-height: 1.3; }
.kcard-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-soft); }
.kcard-meta span { display: inline-flex; gap: 4px; align-items: center; }
.kcard-meta svg.lucide { width: 13px; height: 13px; }
.kcard-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.waiting { color: var(--brand); display: inline-flex; }

.check { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }
.input.f-sel, .input.cell-sel { width: auto; }
.f-sel { min-height: 38px; }
.asset .thumb img.contain { object-fit: contain; padding: 18px; }
.brand-logo { height: 120px; border-radius: var(--radius-sm); background: var(--bg-soft); display: grid; place-items: center; padding: 18px; margin-bottom: 16px; }
.brand-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.kv b.pre { white-space: pre-wrap; font-weight: 500; }

/* ---------- responsive ---------- */
@media (min-width: 1101px) and (max-width: 1400px) {
  .grid-stats.six { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .dash, .split { grid-template-columns: minmax(0, 1fr); }
  .grid-stats, .grid-stats.six { grid-template-columns: repeat(2, 1fr); }
  .mc-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 280px; padding: 28px 24px; }
  .auth-points { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar); z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { padding: 0 16px; }
  .topbar .menu-btn { display: inline-grid; }
  #quick-idea .lbl { display: none; }
  .search-results { min-width: min(320px, calc(100vw - 32px)); }
  .content { padding: 8px 16px 48px; }
  .brand-grid { grid-template-columns: 1fr; }
  .tracker { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
  .tracker .st:nth-child(4)::before { display: none; }
  .onb-top { padding: 14px 16px; }
  .onb-progress .label-txt, .onb-progress .bar { display: none; }
  .onb-actions { padding: 12px 16px; }
}
@media (max-width: 560px) {
  .row, .row-3 { grid-template-columns: 1fr; gap: 0; }
  .grid-stats, .grid-stats.six { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mc-grid { grid-template-columns: 1fr; gap: 0; }
  .ai-card-form { min-width: 0; width: 100%; }
  .bar-row { grid-template-columns: 100px 1fr 24px; }
  .stat { padding: 14px; }
  .dropzone { flex-direction: column; text-align: center; }
  .msg { max-width: 92%; }
  #toasts { left: 16px; right: 16px; }
}

/* ---------- payments & final video ---------- */
.badge.pay-paid { background: var(--accent-soft); color: #0a8a6a; }
.badge.pay-due { background: var(--warn-soft); color: #9a6100; }
.badge.pay-none { background: var(--bg-sunk); color: var(--ink-mute); }
.badge.pay-paid::before, .badge.pay-due::before { display: none; }

.final-card { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 16px 20px; margin: -6px 0 20px; border-color: #ffe2a8; background: linear-gradient(180deg, #fffaf0, #fff); }
.final-card.unlocked { border-color: #b8eedd; background: linear-gradient(180deg, #f2fcf8, #fff); }
.final-card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--warn-soft); color: #9a6100; flex: none; }
.final-card.unlocked .ico { background: var(--accent-soft); color: #0a8a6a; }
.final-card .txt { flex: 1; min-width: 220px; display: grid; gap: 3px; }
.final-card .txt b { display: flex; gap: 8px; align-items: center; }

.mc-pay { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; margin: 2px 0 12px; }
.mc-pay .field { margin: 0; }
.price-in { display: flex; gap: 8px; }
.price-in .input { width: 150px; }
.mc-pay-sum { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-bottom: 8px; }
.pay-list { display: grid; gap: 6px; margin: 0 0 12px; }
.pay-list div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.pay-list svg.lucide { width: 16px; height: 16px; color: #0a8a6a; }

.final-check { margin: -6px 0 16px; display: flex; }
.asset.final { border-color: #ffd98a; }
.asset .final-tag { position: absolute; left: 8px; top: 8px; display: inline-flex; gap: 4px; align-items: center; padding: 3px 8px; border-radius: 99px; background: #fff; color: #9a6100; font-size: 11px; font-weight: 700; box-shadow: var(--shadow); }
.asset .final-tag svg.lucide { width: 12px; height: 12px; }
.locked-thumb { display: grid; gap: 6px; place-items: center; color: var(--ink-mute); font-size: 12px; font-weight: 600; }
.locked-thumb svg.lucide { width: 28px; height: 28px; }
.preview .empty.locked { color: var(--ink); display: grid; gap: 6px; place-items: center; text-align: center; padding: 30px; }
.preview .empty.locked svg.lucide { width: 34px; height: 34px; color: var(--warn); }
.preview .empty.locked .small { color: var(--ink-soft); }
.kv > div > .badge { width: fit-content; margin-top: 4px; }
