/* Fledge Forge styles. Each page sets body.role-* which picks the accent color. */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #17181c;
  --ink-2: #3d3f46;
  --muted: #6c6e76;
  --line: #e5e2d9;
  --line-strong: #d3cfc3;
  --warn: #b5470b;
  --warn-bg: #fdeee4;
  --ok: #157a4a;
  --ok-bg: #e2f4ea;

  --admin: #4b45c9;
  --admin-bg: #ecebfb;
  --senior: #0b8466;
  --senior-bg: #e1f3ec;
  --marketer: #cf4a22;
  --marketer-bg: #fcebe4;
  --intern: #9a6700;
  --intern-bg: #fbf0d8;
  --ideas: #2f5bd3;
  --ideas-bg: #e7edfb;

  --accent: var(--ink);
  --accent-bg: #ecebe6;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.05), 0 6px 20px rgba(20, 20, 30, 0.05);
  --display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111215;
    --surface: #1a1b20;
    --surface-2: #16171b;
    --ink: #f1efe9;
    --ink-2: #c9c7c0;
    --muted: #9a9890;
    --line: #2c2d33;
    --line-strong: #3a3b42;
    --warn: #f59a62;
    --warn-bg: #3a2318;
    --ok: #5fd39a;
    --ok-bg: #173126;

    --admin: #9d98ff;
    --admin-bg: #24234a;
    --senior: #4fd1a8;
    --senior-bg: #14322a;
    --marketer: #ff8b66;
    --marketer-bg: #3a2019;
    --intern: #f2b844;
    --intern-bg: #352a12;
    --ideas: #86a6ff;
    --ideas-bg: #1d2645;

    --accent-bg: #26272d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

body.role-admin { --accent: var(--admin); --accent-bg: var(--admin-bg); }
body.role-senior { --accent: var(--senior); --accent-bg: var(--senior-bg); }
body.role-marketer { --accent: var(--marketer); --accent-bg: var(--marketer-bg); }
body.role-intern { --accent: var(--intern); --accent-bg: var(--intern-bg); }
body.role-ideas { --accent: var(--ideas); --accent-bg: var(--ideas-bg); }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--body);
  overflow-x: hidden;
}

a { color: inherit; }

h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 4vw, 38px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }

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

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }

.logo {
  display: inline-flex; align-items: center; gap: 1px;
  font: 700 22px/1 var(--display); text-decoration: none; letter-spacing: -0.02em;
  flex-shrink: 0;
}
.logo-o {
  width: 19px; height: 19px; border-radius: 50%; margin-left: 1px; margin-top: 1px;
  background: conic-gradient(var(--admin) 0 25%, var(--senior) 0 50%, var(--marketer) 0 75%, var(--intern) 0);
  -webkit-mask: radial-gradient(circle, transparent 44%, #000 46%);
  mask: radial-gradient(circle, transparent 44%, #000 46%);
}

.nav {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  margin-left: auto; min-width: 0;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.nav a:hover { background: var(--accent-bg); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Generic building blocks ---------- */

main { padding: 36px 0 56px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p { color: var(--muted); font-size: 13px; }

.stack { display: grid; gap: 20px; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 880px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2.wide-left { grid-template-columns: 1.5fr 1fr; }
  .grid-2.top-align { align-items: start; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 640px) and (max-width: 879px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.muted { color: var(--muted); }
.small { font-size: 13px; }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.page-head h1 { margin-top: 6px; }
.page-head .sub { color: var(--muted); margin-top: 6px; max-width: 60ch; }

.picker { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }

select, input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], textarea {
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 8px 10px; min-width: 0; max-width: 100%;
}
textarea { width: 100%; resize: vertical; line-height: 1.45; }
select:focus, input:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 14px/1 var(--body); padding: 10px 16px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--ink); color: var(--bg);
}
.btn:hover { opacity: 0.9; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--accent-bg); }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

@media (prefers-color-scheme: dark) {
  .btn.accent { color: #111215; }
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-bg); color: var(--ink-2); white-space: nowrap;
}
.pill.stage-Idea { background: var(--admin-bg); color: var(--admin); }
.pill.stage-Build { background: var(--intern-bg); color: var(--intern); }
.pill.stage-Beta { background: var(--marketer-bg); color: var(--marketer); }
.pill.stage-Launched { background: var(--senior-bg); color: var(--senior); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }

.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  font: 700 12px/1 var(--body); letter-spacing: 0.02em;
  background: var(--accent-bg); color: var(--accent);
}
.avatar.lg { width: 48px; height: 48px; font-size: 15px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.admin { background: var(--admin-bg); color: var(--admin); }
.avatar.senior { background: var(--senior-bg); color: var(--senior); }
.avatar.marketer { background: var(--marketer-bg); color: var(--marketer); }
.avatar.intern { background: var(--intern-bg); color: var(--intern); }
.avatar.empty { background: transparent; border: 1.5px dashed var(--line-strong); color: var(--muted); }

.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .who { min-width: 0; }
.person .name { font-weight: 600; }
.person .role { font-size: 12.5px; color: var(--muted); }

.bar { height: 8px; background: var(--accent-bg); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.bar.senior { background: var(--senior-bg); } .bar.senior > span { background: var(--senior); }
.bar.marketer { background: var(--marketer-bg); } .bar.marketer > span { background: var(--marketer); }
.bar.over > span { background: var(--warn); }

.empty-state {
  border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 22px;
  text-align: center; color: var(--muted); font-size: 14px;
}

/* KPI tiles */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
@media (min-width: 880px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font: 700 28px/1.1 var(--display); margin-top: 6px; }
.kpi .note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* Stage tracker */
.stages { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0; margin: 0; }
.stages li {
  position: relative; padding-top: 14px; font-size: 12px; color: var(--muted); font-weight: 500;
}
.stages li::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 999px;
  background: var(--line);
}
.stages li.done::before, .stages li.current::before { background: var(--accent); }
.stages li.current { color: var(--ink); font-weight: 700; }

/* Checklists */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.checklist label { display: flex; align-items: center; gap: 10px; cursor: pointer; width: 100%; }
.checklist input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; margin: 0; }
.checklist .done-text { color: var(--muted); text-decoration: line-through; }

/* Lists */
.list { list-style: none; padding: 0; margin: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 2px; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.list .meta { font-size: 13px; color: var(--muted); }
.list .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .list > li { flex-wrap: wrap; }
  .list .actions { width: 100%; justify-content: flex-start; }
}

/* Tables */
.table-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; padding: 0 12px 10px 0; white-space: nowrap;
}
td { padding: 12px 12px 12px 0; border-top: 1px solid var(--line); vertical-align: middle; }
td select { width: 100%; min-width: 170px; }

/* Forms */
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form .row { display: flex; gap: 8px; flex-wrap: wrap; }
.form .row > * { flex: 1 1 160px; }

.form .row > .btn { flex: 0 0 auto; }

/* Weekly chats */
.chat-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.chat-card { display: grid; gap: 14px; align-content: start; }
.chat-card .card-head { margin-bottom: 0; }
h3.mini { font: 600 13px/1.3 var(--body); color: var(--ink-2); margin-bottom: 6px; letter-spacing: 0; }
.topics { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.topics li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 8px; background: var(--accent-bg); font-size: 14px;
}
.topics .linklike { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.note-box { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 12px; }
.note-box p { font-size: 14px; margin-top: 4px; }
.guide h2 { margin-bottom: 12px; }
.guide ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.kpi .value-sm { font-size: 20px; line-height: 1.2; margin-top: 10px; }
.cell-status { margin-top: 6px; }

.plan { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.pill.today { background: var(--accent); color: #fff; }

/* Week calendar (senior programmer) */
.cal-layout { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) { .cal-layout.has-detail { grid-template-columns: minmax(0, 1fr) 320px; } }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; gap: 6px; }
.cal { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-head, .cal-body { display: grid; grid-template-columns: 48px repeat(5, minmax(0, 1fr)); }
.cal-head { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-dayname { padding: 8px 10px; font-size: 13px; color: var(--muted); border-left: 1px solid var(--line); }
.cal-dayname b { color: var(--ink); font: 700 16px var(--display); margin-left: 2px; }
.cal-dayname.today, .cal-dayname.today b { color: var(--accent); }
.cal-times { position: relative; }
.cal-times span { position: absolute; right: 8px; margin-top: 3px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.cal-col {
  position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour));
}
.cal-col.today { background-color: color-mix(in srgb, var(--accent-bg) 50%, transparent); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--warn); z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }

.meeting {
  position: absolute; display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0;
  text-align: left; padding: 4px 8px; border-radius: 8px; cursor: pointer; overflow: hidden; z-index: 1;
  border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  background: var(--surface); color: var(--ink); font: 12px/1.3 var(--body);
}
.meeting .m-line, .meeting .m-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meeting .m-line { font-weight: 600; }
.meeting .m-sub { color: var(--muted); font-size: 11.5px; }
.meeting:hover { border-color: var(--accent); }
.meeting.st-logged { background: var(--accent-bg); border-color: transparent; border-left-color: var(--accent); }
.meeting.st-today { background: var(--accent); border-color: var(--accent); color: #fff; }
.meeting.st-today .m-sub { color: rgba(255, 255, 255, 0.85); }
.meeting.st-upcoming { border-style: dashed; border-left-style: solid; }
/* Missed chats are grey and striped rather than coloured, so they stand apart from either mentor's accent. */
.meeting.st-missed {
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--line) 6px 8px);
  border-color: var(--line-strong); border-left-color: var(--muted); color: var(--ink-2);
}
.meeting.selected { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 3; }

.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.cal-hint { margin-left: auto; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.key.logged { background: var(--accent-bg); border: 1px solid var(--accent); }
.key.today { background: var(--accent); }
.key.upcoming { border: 1px dashed var(--line-strong); }
.key.missed { background: repeating-linear-gradient(135deg, var(--surface-2) 0 2px, var(--muted) 2px 3px); border: 1px solid var(--muted); }

.agenda { display: none; }
@media (max-width: 759px) {
  .cal { display: none; }
  .agenda { display: grid; }
}
.agenda-day { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.agenda-day:first-child { border-top: 0; padding-top: 0; }
.agenda-date { font-size: 12px; color: var(--muted); }
.agenda-date b { display: block; font: 700 18px/1.1 var(--display); color: var(--ink); }
.agenda-day.today .agenda-date, .agenda-day.today .agenda-date b { color: var(--accent); }
.agenda-items { display: grid; gap: 6px; }
.agenda .meeting { position: static; width: 100%; padding: 8px 10px; font-size: 13px; }

.meeting-detail { display: grid; gap: 14px; scroll-margin-top: 76px; }
.meeting-detail:focus { outline: none; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.close-btn {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2); font-size: 20px; line-height: 1;
}
.close-btn:hover { background: var(--accent-bg); color: var(--ink); }
@media (min-width: 1000px) { .meeting-detail { position: sticky; top: 76px; } }

@media (prefers-color-scheme: dark) {
  .pill.today, .meeting.st-today { color: #111215; }
  .meeting.st-today .m-sub { color: rgba(17, 18, 21, 0.75); }
}

/* Activity */
.feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.feed li { display: flex; gap: 10px; font-size: 14px; }
.feed .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; margin-left: auto; padding-left: 8px; }

/* Board (marketer introductions) */
.board { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.column { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.column h3 { font-size: 14px; display: flex; justify-content: space-between; margin-bottom: 10px; }
.column h3 .count { color: var(--muted); font-weight: 500; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 10px; display: grid; gap: 6px;
}
.tile:last-child { margin-bottom: 0; }
.tile .title { font-weight: 600; font-size: 14px; }
.tile .meta { font-size: 12.5px; color: var(--muted); }

/* Project cards (senior / marketer / landing) */
.project { display: grid; gap: 14px; align-content: start; }
.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-name { font: 700 19px/1.2 var(--display); }
.project-pitch { color: var(--ink-2); font-size: 14px; }
.project-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.metric .v { font: 700 20px/1.1 var(--display); }
.metric .l { font-size: 12px; color: var(--muted); }

/* Pipeline */
.pipeline { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pipe { border-radius: 12px; padding: 12px; min-width: 0; }
.pipe .n { font: 700 26px/1 var(--display); }
.pipe .s { font-size: 13px; font-weight: 600; margin: 4px 0 8px; }
.pipe .names { font-size: 12.5px; display: grid; gap: 2px; }
.pipe.stage-Idea { background: var(--admin-bg); color: var(--admin); }
.pipe.stage-Build { background: var(--intern-bg); color: var(--intern); }
.pipe.stage-Beta { background: var(--marketer-bg); color: var(--marketer); }
.pipe.stage-Launched { background: var(--senior-bg); color: var(--senior); }
.pipe .names span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100vw - 32px); z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--warn); color: #fff; }
@media (prefers-color-scheme: dark) { .toast.error { color: #111215; } }

/* Messages in place of a page (loading, or a page someone can't see) */
.loading { padding: 40px 0; text-align: center; }
.notice { max-width: 560px; margin: 24px auto; display: grid; gap: 10px; }
.notice h1 { font-size: 26px; }
.viewing-note { margin-top: 10px; max-width: 60ch; }

/* Sign-in pages */
.auth { max-width: 420px; margin: 24px auto; display: grid; gap: 14px; }
.auth h1 { font-size: 28px; }
.auth .form input { width: 100%; }
.auth .form input[readonly] { color: var(--muted); background: var(--surface-2); }
.auth .btn { justify-self: start; }
.form-error { color: var(--warn); font-size: 14px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 13px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; cursor: pointer; }

/* ---------- Landing page ---------- */

.hero { padding: 48px 0 32px; display: grid; gap: 40px; align-items: center; }
@media (min-width: 940px) { .hero { grid-template-columns: 1.05fr 1fr; padding: 72px 0 48px; } }
.hero h1 { font-size: clamp(36px, 5vw, 54px); letter-spacing: -0.03em; line-height: 1.02; }
.hero h1 em { font-style: normal; color: var(--senior); }
.hero h1 em + em { color: var(--marketer); }
.hero .lede { font-size: 18px; color: var(--ink-2); margin-top: 18px; max-width: 52ch; }
.hero .ctas { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }

.diagram { padding: 18px; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }
.d-bar { fill: var(--admin-bg); stroke: var(--admin); }
.d-node { fill: var(--surface); stroke-width: 1.5; }
.d-senior { stroke: var(--senior); }
.d-intern { stroke: var(--intern); }
.d-marketer { stroke: var(--marketer); }
.d-line-senior { stroke: var(--senior); stroke-width: 2; fill: none; }
.d-line-marketer { stroke: var(--marketer); stroke-width: 2; fill: none; }
.d-line-admin { stroke: var(--admin); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; opacity: 0.6; }
.d-t1 { fill: var(--ink); font: 700 14px var(--body); }
.d-t2 { font: 600 11.5px var(--body); }
.d-admin { fill: var(--admin); font: 700 13px var(--body); }
.d-c-senior { fill: var(--senior); } .d-c-intern { fill: var(--intern); } .d-c-marketer { fill: var(--marketer); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats div { background: var(--surface); padding: 18px 20px; }
.stats b { display: block; font: 700 30px/1 var(--display); }
.stats span { font-size: 13px; color: var(--muted); }

.section { padding: 56px 0 8px; }
.section-head { max-width: 640px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); margin-top: 8px; }
.section-head p { color: var(--muted); margin-top: 8px; }

.steps { counter-reset: step; }
.step { position: relative; padding-top: 52px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 18px; left: 20px;
  font: 700 14px/1 var(--display); width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--bg);
}
.step h3 { margin-bottom: 6px; }
.step p { color: var(--ink-2); font-size: 14px; }

.role-cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .role-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .role-cards { grid-template-columns: repeat(4, 1fr); } }
.role-card { display: flex; flex-direction: column; gap: 12px; border-top: 4px solid var(--accent); }
.role-card.admin { --accent: var(--admin); --accent-bg: var(--admin-bg); }
.role-card.senior { --accent: var(--senior); --accent-bg: var(--senior-bg); }
.role-card.marketer { --accent: var(--marketer); --accent-bg: var(--marketer-bg); }
.role-card.intern { --accent: var(--intern); --accent-bg: var(--intern-bg); }
.role-card .tag { font-size: 13px; font-weight: 600; color: var(--accent); }
.role-card ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.role-card .btn { margin-top: auto; align-self: flex-start; }

.cohort { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cohort { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .cohort { grid-template-columns: repeat(3, 1fr); } }
.cohort .card { display: grid; gap: 10px; align-content: start; }
.cohort a.card { text-decoration: none; transition: transform 0.15s, border-color 0.15s; }
.cohort a.card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.mentor-row { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

.cta-band {
  margin-top: 56px; padding: 36px 28px; border-radius: 20px; text-align: center;
  background: var(--ink); color: var(--bg);
}
.cta-band h2 { font-size: clamp(22px, 3vw, 30px); }
.cta-band p { opacity: 0.75; margin-top: 8px; }
.cta-band .ctas { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.cta-band .btn { background: var(--bg); color: var(--ink); }

/* ---------- Idea bank ---------- */

.idea-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .idea-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .idea-grid { grid-template-columns: repeat(3, 1fr); } }
.card.idea { display: grid; gap: 10px; align-content: start; }
.card.idea.claimed { background: var(--surface-2); box-shadow: none; }
.card.idea.claimed .project-name { color: var(--ink-2); }
.idea-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px;
}
.claim-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.claim-bar h2 { margin-bottom: 4px; }
.idea-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: 600 13px/1 var(--body); padding: 8px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
}
.chip span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] span { color: inherit; opacity: 0.7; }
.idea-cat { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.idea-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.idea-tags .tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.idea-tags .tag[class*="level-"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.idea-tags .tag.level-easy { color: var(--ok); }
.idea-tags .tag.level-mid { color: var(--intern); }
.idea-tags .tag.level-hard { color: var(--warn); }
.idea-details { border-top: 1px solid var(--line); padding-top: 8px; font-size: 14px; }
.idea-details summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--accent); width: fit-content; }
.idea-details dl { margin: 10px 0 0; display: grid; gap: 10px; }
.idea-details dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.idea-details dd { margin: 2px 0 0; color: var(--ink-2); }
.idea-details dd ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.idea-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.idea-filters input { width: 220px; max-width: 100%; }
.idea-form fieldset { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; min-width: 0; }
.idea-form legend { font: 700 15px/1.3 var(--display); padding: 0; margin-bottom: 8px; }
.idea-form .optional, .invite-form .optional { font-weight: 400; color: var(--muted); font-size: 12px; }
.idea-form .form-end { align-items: flex-end; border-top: 1px solid var(--line); padding-top: 14px; }
.idea-form .form-end > div { flex: 0 0 auto; }

/* ---------- Legal ---------- */

.pill.legal-todo { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.legal-doing { background: var(--intern-bg); color: var(--intern); }
.pill.legal-done { background: var(--ok-bg); color: var(--ok); }
.legal-select { font-size: 13px; font-weight: 600; padding: 6px 8px; flex-shrink: 0; min-width: 120px; }
.legal-select.legal-doing { color: var(--intern); border-color: var(--intern); }
.legal-select.legal-done { color: var(--ok); border-color: var(--ok); }
/* Two fixed columns (who handles it, then status) so every row lines up. */
.legal-controls { display: grid; grid-template-columns: 240px 120px; gap: 10px; align-items: end; flex-shrink: 0; }
.legal-controls select { width: 100%; }
.legal-controls .pill { justify-self: start; margin-bottom: 8px; }
/* On narrower screens the controls drop below each item's name so the text keeps its width. */
@media (max-width: 760px) {
  .legal-list > li { flex-wrap: wrap; }
  .legal-controls { width: 100%; grid-template-columns: minmax(0, 1fr) 120px; }
}
.legal-done { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.legal-done summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); width: fit-content; }
.legal-done .list { opacity: 0.8; }

/* Weekly chat times editor (a pairing can meet up to once a day) */
.slot-editor { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.slot-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 999px;
  background: var(--accent-bg); color: var(--ink); font-size: 13px; font-weight: 600;
}
.slot-chip button {
  width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2);
  cursor: pointer; font-size: 15px; line-height: 1;
}
.slot-chip button:hover { background: var(--surface); }
.slot-editor select { font-size: 13px; padding: 6px 8px; }
.meeting-detail .project-foot { align-items: flex-end; }

/* Admin: one folding section per product for assigning legal items */
.legal-product { border-top: 1px solid var(--line); padding: 10px 0; }
.legal-product:first-of-type { border-top: 0; }
.legal-product summary {
  display: flex; align-items: center; gap: 16px; cursor: pointer; list-style: none; flex-wrap: wrap;
}
.legal-product summary::-webkit-details-marker { display: none; }
.legal-product summary::before { content: "▸"; color: var(--muted); width: 10px; }
.legal-product[open] summary::before { content: "▾"; }
.legal-product summary .title { font-weight: 600; }
.legal-product summary .pill { margin-left: 8px; }
.legal-progress { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.legal-progress .bar { flex: 1; }
.legal-product .legal-list { margin: 8px 0 0 26px; }
/* Phases folded inside one of these sections keep their own heading style. */
.legal-product .phase summary::before { content: none; }@media (max-width: 560px) { .legal-product .legal-list { margin-left: 0; } .legal-progress { min-width: 0; width: 100%; } }

/* "Add a meeting time" form under the calendar toolbar */
.add-time { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.add-time .row { align-items: flex-end; }
.add-time-actions { display: flex; gap: 8px; flex: 0 0 auto !important; }
.cal-nav { flex-wrap: wrap; }

/* Phased checklists (intern, overseer and marketer) */
.phase { border-top: 1px solid var(--line); padding: 8px 0; }
.phase:first-of-type { border-top: 0; }
.phase summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.phase summary::-webkit-details-marker { display: none; }
.phase-name { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.phase-name::before { content: "▸"; color: var(--muted); font-weight: 400; }
.phase[open] .phase-name::before { content: "▾"; }
.phase .pill { font-size: 11px; padding: 2px 8px; }
.checklist.detailed li { align-items: flex-start; padding: 7px 0; }
.checklist.detailed label { align-items: flex-start; }
.checklist.detailed input[type="checkbox"] { margin-top: 2px; }
.checklist .hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.phases { margin: 6px 0 0 26px; }
@media (max-width: 560px) { .phases { margin-left: 0; } }

/* Idea bank: where a returned project is up to */
.idea-stage { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.idea-handover { display: grid; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

/* Admin: confirming an intern has left */
.leave-row td { background: var(--warn-bg); border-top: 0; }
.leave-form { padding: 4px 0; }
.leave-form p { font-size: 14px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Admin: inviting people */
#invite { scroll-margin-top: 84px; } /* clear of the sticky top bar when opened as admin.html#invite */
.invite-form .row[hidden] { display: none; }
.invite-form .row-actions { margin-top: 2px; }
.invite-list { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 4px; }
.invite-list > li:first-child { padding-top: 12px; }

/* Admin: editing ideas in the idea bank */
.idea-admin-list > li { display: block; }
.idea-row { display: flex; align-items: center; gap: 12px; }
.idea-row .title .pill { margin-left: 6px; vertical-align: 1px; }
.idea-admin-list > li.editing { background: var(--surface-2); margin: 0 -20px; padding: 14px 20px; }
.edit-idea { margin-top: 14px; }
.edit-link { margin-left: auto; color: var(--muted); }
.idea-foot .mentor-row { flex: 1; }

/* Deleting ideas */
.btn.danger { color: var(--warn); }
.btn.danger:hover:not(:disabled) { background: var(--warn-bg); }
.btn.danger-solid { background: var(--warn); color: #fff; }
.delete-confirm { margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); display: grid; gap: 8px; font-size: 14px; }

/* Editing checklists */
.ck-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ck-item { display: block !important; }
.ck-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.ck-row > label { flex: 1; min-width: 0; }
.ck-actions { display: inline-flex; gap: 10px; font-size: 12.5px; flex-shrink: 0; padding-top: 2px; }
.ck-actions .linklike { color: var(--accent); text-decoration: none; font-weight: 600; }
.ck-actions .linklike:hover { text-decoration: underline; }
.ck-subs { margin: 4px 0 2px 27px; display: grid; gap: 0; }
.ck-subs li { padding: 3px 0; font-size: 13.5px; }
.ck-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; width: 100%; }
.ck-form input[type="text"] { flex: 1 1 180px; font-size: 13.5px; padding: 6px 8px; }
.ck-form.stacked { display: grid; gap: 6px; }
.ck-form.add-item { margin: 4px 0 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ck-editing { display: block !important; }

/* Reordering checklist items */
.ck-move { display: inline-flex; gap: 2px; }
.icon-move {
  width: 24px; height: 22px; border-radius: 6px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--ink-2); cursor: pointer; font-size: 12px; line-height: 1; padding: 0;
}
.icon-move:hover:not(:disabled) { background: var(--accent-bg); color: var(--ink); }
.icon-move:disabled { opacity: 0.3; cursor: default; }

/* Drag and drop reordering */
.drag-handle {
  cursor: grab; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 4px; margin-left: -4px;
  border-radius: 6px; touch-action: none; user-select: none; flex-shrink: 0;
}
.drag-handle:hover { color: var(--ink); background: var(--accent-bg); }
li.dragging { opacity: 0.85; background: var(--accent-bg); border-radius: 8px; box-shadow: var(--shadow); }
li.dragging .drag-handle { cursor: grabbing; }
/* The phase an item is being dragged into */
.phase.drop-target { background: var(--accent-bg); border-radius: 8px; box-shadow: 0 0 0 6px var(--accent-bg); }
.ck-subs li.ck-row { display: flex; align-items: flex-start; gap: 8px; }

/* Video call links */
.meet-link { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.meet-join { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.meet-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.meet-link input[type="url"] {
  flex: 1 1 200px; font: inherit; font-size: 13.5px; padding: 6px 8px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; min-width: 0;
}
.join-btn { text-decoration: none; }
