:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #f7f7f4;
  --ink: #171918;
  --muted: #73766f;
  --line: #dedfd9;
  --line-strong: #c9cbc3;
  --accent: #f2bd39;
  --accent-soft: #fff4cf;
  --green: #188863;
  --green-soft: #e9f6ef;
  --blue: #2869c7;
  --blue-soft: #eaf2fd;
  --red: #c5463f;
  --red-soft: #fff0ee;
  --purple: #7453b9;
  --purple-soft: #f2edfb;
  --nav: #121514;
  --nav-2: #1c201f;
  --nav-text: #f4f5f2;
  --radius: 7px;
  --shadow: 0 12px 30px rgb(16 20 18 / 10%);
  color: var(--ink);
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
}

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, .brand-copy strong, .nav-button, .subnav-button {
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #f4f5f2;
}

.auth-card {
  width: min(100%, 410px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgb(16 20 18 / 8%);
}

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-brand strong { display: block; font-size: 20px; }
.auth-brand span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.auth-form { display: grid; gap: 15px; }
.auth-form label { display: grid; gap: 7px; color: #555a55; font-size: 11px; font-weight: 750; }
.auth-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  outline: none;
}
.auth-form input:focus { border-color: #8f7330; box-shadow: 0 0 0 3px rgb(242 189 57 / 16%); }
.auth-submit { width: 100%; min-height: 42px; margin-top: 3px; }
.auth-error { margin: 0; color: var(--red); font-size: 12px; line-height: 1.45; }
.auth-note { margin: 18px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

.prototype-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
  padding: 7px 22px;
  border-bottom: 1px solid #b88d25;
  background: #f7c648;
  color: #2b2412;
  font-size: 12px;
  font-weight: 700;
}

.prototype-banner a { color: inherit; text-decoration: none; }

.app-shell { min-height: calc(100vh - 34px); }

.global-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.primary-row {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(560px, 1fr) auto;
  align-items: center;
  min-height: 66px;
  padding: 0 24px;
  gap: 24px;
}

.brand-project {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: var(--accent);
  color: #17140b;
}

.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 14px; line-height: 1.15; }
.brand-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.project-picker {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  gap: 9px;
}

.project-picker:hover { border-color: var(--line-strong); }
.project-picker i { width: 17px; height: 17px; color: var(--muted); }
.project-picker-copy { min-width: 0; text-align: left; }
.project-picker-copy small { display: block; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.project-picker-copy strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.project-picker .chevron { margin-left: auto; }

.primary-nav {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  gap: 5px;
}

.nav-button, .subnav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #50544f;
  font-weight: 600;
  white-space: nowrap;
}

.nav-button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 6px;
  gap: 8px;
  font-size: 12px;
}

.nav-button i, .subnav-button i { width: 15px; height: 15px; }
.nav-button:hover { background: var(--surface-2); color: var(--ink); }
.nav-button.active { background: #eff1ed; color: var(--ink); }

.user-tools { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.icon-button, .avatar-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
}
.icon-button { width: 38px; height: 38px; border-radius: 6px; }
.icon-button i { width: 17px; height: 17px; }
.avatar-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #242725;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.account-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; display: grid; width: 230px;
  padding: 12px; border: 1px solid #343735; border-radius: 7px; background: var(--nav); box-shadow: var(--shadow); color: #fff;
}
.account-menu strong { font-size: 13px; }
.account-menu > span { margin-top: 4px; color: #9fa39e; font-size: 10px; overflow-wrap: anywhere; }
.account-menu button { display: flex; align-items: center; width: 100%; margin-top: 12px; padding: 9px; border: 1px solid #363a37; border-radius: 5px; background: var(--nav-2); color: #fff; gap: 8px; text-align: left; }
.account-menu button:hover { background: #2b2e2c; }
.account-menu button i { width: 15px; height: 15px; }
.account-preview { display: grid; margin-top: 12px; padding-top: 10px; border-top: 1px solid #343735; }
.account-preview small { color: #9fa39e; font-size: 9px; }
.account-preview button { margin-top: 6px; }
.account-preview > span { margin-top: 6px; color: #9fa39e; font-size: 10px; }

.secondary-row {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border-top: 1px solid var(--line);
  background: #fbfcfa;
  gap: 5px;
}

.picker-menu {
  position: absolute;
  top: 59px;
  left: 24px;
  z-index: 40;
  width: 340px;
  max-height: min(560px, calc(100vh - 100px));
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #343735;
  border-radius: 7px;
  background: var(--nav);
  box-shadow: var(--shadow);
  color: #fff;
}
.picker-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 9px; }
.picker-menu-head strong { font-size: 11px; }
.picker-menu-head button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: transparent; color: #aaa; }
.picker-menu-head i { width: 15px; height: 15px; }
.picker-all, .picker-project, .picker-add {
  width: 100%;
  border: 0;
  border-radius: 5px;
  color: inherit;
  text-align: left;
}
.picker-all, .picker-add { display: flex; align-items: center; min-height: 37px; padding: 0 10px; gap: 8px; font-size: 11px; font-weight: 750; }
.picker-all { margin-bottom: 5px; background: var(--nav-2); }
.picker-project { display: grid; grid-template-columns: auto 1fr; align-items: center; min-height: 53px; padding: 8px 10px; background: transparent; gap: 10px; }
.picker-project:hover { background: var(--nav-2); }
.picker-project strong { display: block; font-size: 12px; }
.picker-project small { display: block; margin-top: 3px; color: #979b96; font-size: 9px; }
.picker-add { justify-content: center; margin-top: 6px; background: #f4f5f2; color: var(--ink); text-align: center; }
.picker-all i, .picker-add i { width: 15px; height: 15px; }

.secondary-label {
  margin-right: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.second-project-picker {
  display: flex;
  align-items: center;
  flex: 0 0 220px;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  gap: 9px;
  text-align: left;
}
.second-project-picker:hover { border-color: var(--line-strong); }
.second-project-picker .project-dot { flex: 0 0 7px; }
.second-project-picker > i { width: 15px; height: 15px; margin-left: auto; color: var(--muted); }
.second-project-copy { min-width: 0; }
.second-project-copy small { display: block; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.second-project-copy strong { display: block; overflow: hidden; margin-top: 1px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.secondary-divider { align-self: center; width: 1px; height: 24px; margin: 0 7px; background: var(--line); }

.project-tabs { display: flex; align-items: center; min-width: 0; gap: 4px; }
.project-tab {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.project-tab:hover { background: var(--surface); color: var(--ink); }
.project-tab.active { border-color: var(--line); background: var(--surface); color: var(--ink); }
.project-tab.more { display: grid; place-items: center; width: 34px; padding: 0; }
.project-tab.more i { width: 16px; height: 16px; }

.subnav-button {
  position: relative;
  min-height: 47px;
  padding: 0 14px;
  gap: 7px;
  font-size: 12px;
}

.subnav-button::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: transparent;
  content: "";
}
.subnav-button:hover, .subnav-button.active { color: var(--ink); }
.subnav-button.active::after { background: var(--accent); }

.workspace { padding: 22px 24px 44px; }
.workspace-inner { width: min(1500px, 100%); margin: 0 auto; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.page-heading h1 { margin: 0; font-size: 25px; line-height: 1.15; }
.page-heading p { max-width: 680px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.heading-actions { display: flex; gap: 8px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  gap: 8px;
  font-size: 12px;
  font-weight: 750;
}
.button i { width: 16px; height: 16px; }
.button:hover { border-color: var(--line-strong); }
.button.primary { border-color: var(--nav); background: var(--nav); color: #fff; }
.button.accent { border-color: #d4a328; background: var(--accent); color: #211b0d; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 18px;
}
.metric {
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 14px 17px;
  border-right: 1px solid var(--line);
  gap: 11px;
}
.metric:last-child { border-right: 0; }
.metric i { width: 20px; height: 20px; color: var(--muted); }
.metric strong { display: block; font-size: 20px; }
.metric span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.section-band {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  gap: 14px;
}
.section-head h2 { margin: 0; font-size: 15px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }

.projects-table { width: 100%; border-collapse: collapse; }
.projects-table th {
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  text-align: left;
  text-transform: uppercase;
}
.projects-table td { padding: 13px 15px; border-bottom: 1px solid #ecece8; font-size: 12px; }
.projects-table tr:last-child td { border-bottom: 0; }
.projects-table tbody tr { cursor: pointer; }
.projects-table tbody tr:hover { background: #fbfbf8; }
.project-name-cell { display: flex; align-items: center; gap: 10px; }
.project-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.project-name-cell strong { display: block; font-size: 13px; }
.project-name-cell span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 7px;
  border-radius: 999px;
  background: #efefeb;
  color: #5e615c;
  font-size: 9px;
  font-weight: 800;
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.yellow { background: var(--accent-soft); color: #8b6411; }

.planner-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.planning-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 555px;
  gap: 10px;
  padding: 12px;
}
.plan-column { min-width: 0; padding: 10px; border-radius: 6px; background: var(--surface-2); }
.column-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; font-size: 12px; font-weight: 800; }
.count { display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; background: #e8e9e3; font-size: 10px; }
.plan-stack { display: grid; gap: 9px; }
.plan-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgb(20 22 20 / 3%);
}
.plan-card.leadsender { border-left-color: var(--purple); }
.plan-card.sebastian { border-left-color: var(--accent); }
.plan-card h3 { margin: 0; font-size: 13px; line-height: 1.35; }
.plan-card p { margin: 7px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.plan-meta { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.owner { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.owner-mark { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: #252825; color: #fff; font-size: 8px; }
.date { color: var(--muted); font-size: 9px; font-weight: 700; }

.side-stack { display: grid; align-content: start; gap: 16px; }
.side-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.side-panel .section-head { min-height: 52px; }
.agenda-list, .idea-list { display: grid; }
.agenda-item, .idea-item { padding: 12px 14px; border-bottom: 1px solid #ecece8; }
.agenda-item:last-child, .idea-item:last-child { border-bottom: 0; }
.agenda-item strong, .idea-item strong { display: block; font-size: 11px; }
.agenda-item span, .idea-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }

.finance-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 16px; }
.money-summary { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.money-cell { padding: 18px; border-right: 1px solid var(--line); }
.money-cell:last-child { border-right: 0; }
.money-cell span { display: block; color: var(--muted); font-size: 10px; }
.money-cell strong { display: block; margin-top: 5px; font-size: 22px; }
.money-cell em { display: block; margin-top: 4px; color: var(--green); font-size: 10px; font-style: normal; }
.simple-list { display: grid; }
.simple-row { display: grid; grid-template-columns: minmax(180px, 1fr) 140px 120px 90px; align-items: center; min-height: 58px; padding: 0 15px; border-bottom: 1px solid #ecece8; gap: 10px; font-size: 11px; }
.simple-row:last-child { border-bottom: 0; }
.simple-row strong { font-size: 12px; }
.simple-row span { color: var(--muted); }
.invoice-state { justify-self: start; }
.lead-pipeline { display: grid; padding: 12px; gap: 9px; }
.lead-row { padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.lead-row strong { display: block; font-size: 12px; }
.lead-row p { margin: 5px 0 9px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.lead-row footer { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; }

.users-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.user-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: 18px; border-bottom: 1px solid var(--line); gap: 13px; }
.user-card:last-child { border-bottom: 0; }
.large-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--nav); color: #fff; font-size: 12px; font-weight: 800; }
.user-card strong { display: block; font-size: 13px; }
.user-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.user-create-panel { margin-bottom: 16px; }
.user-create-form { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr .8fr auto; align-items: end; gap: 10px; }
.user-create-form label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.user-create-form input, .user-create-form select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.access-grid { display: grid; grid-template-columns: 1fr 90px 90px; align-items: center; min-height: 52px; padding: 0 14px; border-bottom: 1px solid #ecece8; gap: 8px; font-size: 11px; }
.access-grid:last-child { border-bottom: 0; }

.project-workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; }
.project-summary { padding: 17px; border-bottom: 1px solid var(--line); }
.project-summary h2 { margin: 0; font-size: 17px; }
.project-summary p { max-width: 780px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.task-board { display: grid; grid-template-columns: repeat(3, 1fr); min-height: 400px; padding: 12px; gap: 9px; }
.task-column { padding: 10px; border-radius: 6px; background: var(--surface-2); }
.task-card { padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.task-card + .task-card { margin-top: 8px; }
.task-card strong { font-size: 11px; }
.task-card p { display: -webkit-box; overflow: hidden; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.task-detail { padding: 15px; }
.field { display: grid; gap: 5px; margin-bottom: 11px; }
.field label { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); padding: 9px 10px; font-size: 11px; }
.field textarea { min-height: 94px; resize: vertical; }

.empty-view { display: grid; place-items: center; min-height: 430px; padding: 40px; text-align: center; }
.empty-view i { width: 34px; height: 34px; color: var(--muted); }
.empty-view h2 { margin: 13px 0 0; font-size: 17px; }
.empty-view p { max-width: 430px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.variant-note { display: none; }

/* Wariant 2: klasyczne dwie belki jak w referencji. */
body.variant-2 .primary-row { grid-template-columns: auto minmax(560px, 1fr) 300px; }
body.variant-2 .brand-project .project-picker { display: none; }
body.variant-2 .primary-nav { justify-content: flex-start; }
body.variant-2 .secondary-row { padding-left: max(24px, calc((100vw - 1400px) / 2)); }
body.variant-2 .project-picker.top-right { display: flex; }
body.variant-2 .picker-menu { right: 24px; left: auto; }

/* Wariant 3: kompaktowy pasek roboczy. */
body.variant-3 { --bg: #f7f7f5; --surface-2: #f2f3ef; }
body.variant-3 .primary-row { min-height: 56px; grid-template-columns: 320px minmax(500px, 1fr) auto; }
body.variant-3 .brand-copy span { display: none; }
body.variant-3 .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
body.variant-3 .secondary-row { min-height: 40px; }
body.variant-3 .subnav-button { min-height: 39px; }
body.variant-3 .workspace { padding-top: 16px; }
body.variant-3 .page-heading { margin-bottom: 14px; }
body.variant-3 .metric { min-height: 64px; }

/* Wariant 4: plan jako centrum dowodzenia. */
body.variant-4 { --accent: #8fb8a5; --accent-soft: #eaf3ef; --blue: #327b68; --blue-soft: #e8f3ef; }
body.variant-4 .global-header { background: #fdfdfb; }
body.variant-4 .primary-row { grid-template-columns: 360px minmax(520px, 1fr) auto; }
body.variant-4 .nav-button.active { background: #e7efeb; color: #1f4b3e; }
body.variant-4 .subnav-button.active::after { background: #327b68; }
body.variant-4 .planning-board { grid-template-columns: 1.1fr 1fr .9fr; }
body.variant-4 .plan-column:first-child { background: #edf4f0; }

/* Wariant 5: ciemna nawigacja zachowująca charakter obecnego OS. */
body.variant-5 .global-header { border-bottom: 0; background: var(--nav); color: var(--nav-text); }
body.variant-5 .brand-copy span, body.variant-5 .project-picker-copy small { color: #9fa39e; }
body.variant-5 .project-picker { border-color: #363a37; background: var(--nav-2); }
body.variant-5 .project-picker i { color: #adb0ac; }
body.variant-5 .nav-button { color: #b9bcb8; }
body.variant-5 .nav-button:hover { background: var(--nav-2); color: #fff; }
body.variant-5 .nav-button.active { background: #f4f5f2; color: var(--ink); }
body.variant-5 .icon-button { border-color: #363a37; background: var(--nav-2); color: #fff; }
body.variant-5 .avatar-button { border-color: #6a6d68; background: var(--accent); color: #161309; }
body.variant-5 .secondary-row { border-color: #313431; background: #191c1b; }
body.variant-5 .secondary-label { color: #8f938e; }
body.variant-5 .subnav-button { color: #aeb1ad; }
body.variant-5 .subnav-button.active { color: #fff; }

/* Wariant 6: selektor projektu otwiera drugą belkę. */
body.variant-6 .primary-row { grid-template-columns: 250px minmax(560px, 1fr) auto; }
body.variant-6 .primary-nav { justify-content: flex-end; }
body.variant-6 .secondary-row { background: #f8f9f6; }
body.variant-6 .picker-menu { top: 113px; }

/* Wariant 7: nazwa projektu jest nagłówkiem drugiego menu. */
body.variant-7 .primary-row { grid-template-columns: 250px minmax(560px, 1fr) auto; }
body.variant-7 .primary-nav { justify-content: flex-end; }
body.variant-7 .second-project-picker { flex-basis: 250px; height: 47px; padding-left: 4px; border-color: transparent; background: transparent; }
body.variant-7 .second-project-picker:hover { border-color: var(--line); background: var(--surface); }
body.variant-7 .second-project-copy small { font-size: 8px; }
body.variant-7 .second-project-copy strong { font-size: 15px; }
body.variant-7 .picker-menu { top: 113px; }

/* Wariant 8: trzy ostatnie projekty jako zakładki. */
body.variant-8 .primary-row { grid-template-columns: 250px minmax(560px, 1fr) auto; }
body.variant-8 .primary-nav { justify-content: flex-end; }
body.variant-8 .secondary-row { background: #f4f5f1; }
body.variant-8 .picker-menu { top: 113px; }

/* Wariant 9: najbardziej kompaktowe dwa menu. */
body.variant-9 .primary-row { min-height: 56px; grid-template-columns: 230px minmax(520px, 1fr) auto; }
body.variant-9 .brand-copy span { display: none; }
body.variant-9 .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
body.variant-9 .secondary-row { min-height: 42px; }
body.variant-9 .second-project-picker { flex-basis: 190px; height: 32px; }
body.variant-9 .subnav-button { min-height: 41px; padding: 0 11px; }
body.variant-9 .picker-menu { top: 98px; }
body.variant-9 .workspace { padding-top: 16px; }

/* Wariant 10: menu projektu po lewej, selektor po prawej. */
body.variant-10 .primary-row { grid-template-columns: 250px minmax(560px, 1fr) auto; }
body.variant-10 .primary-nav { justify-content: flex-end; }
body.variant-10 .secondary-row .subnav-button { order: 1; }
body.variant-10 .secondary-divider { order: 2; margin-left: auto; }
body.variant-10 .second-project-picker { order: 3; flex-basis: 230px; }
body.variant-10 .picker-menu { top: 113px; right: 24px; left: auto; }

/* Warianty 6-10: obie nawigacje sa centrowane wzgledem calego okna. */
body:is(.variant-6, .variant-7, .variant-8, .variant-9, .variant-10) .primary-row {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

body:is(.variant-6, .variant-7, .variant-8, .variant-9, .variant-10) .primary-nav {
  justify-content: center;
}

body:is(.variant-6, .variant-7, .variant-8, .variant-9, .variant-10) .secondary-row {
  justify-content: center;
}

body.variant-10 .secondary-divider { margin-left: 7px; }

body:is(.variant-6, .variant-7, .variant-8, .variant-9, .variant-10) .picker-menu {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}

/* TASK-OS: finalny, interaktywny kierunek wybrany w wariancie 7. */
body.final-demo .app-shell { min-height: 100vh; }
body.final-demo .global-header { box-shadow: 0 1px 0 rgb(20 24 22 / 3%); }
body.final-demo .primary-row { min-height: 64px; }
body.final-demo .secondary-row { min-height: 50px; background: #fafbf8; }
body.final-demo .brand-mark { background: #f5c84b; }
body.final-demo .workspace { padding-top: 22px; }
body.final-demo .workspace-inner { max-width: 1540px; }
body.final-demo .secondary-row { position: relative; }
body.final-demo .secondary-row .second-project-picker {
  position: static;
  flex: 0 0 auto;
  width: max-content;
  min-width: 210px;
  max-width: 360px;
  margin-right: 8px;
  padding: 0 12px;
}
body.final-demo .secondary-row .second-project-copy { max-width: 300px; }
body.final-demo .secondary-row .secondary-divider { display: none; }
body.final-demo .picker-menu { top: 112px; right: auto; left: max(24px, calc((100vw - 1540px) / 2)); transform: none; }

body.final-demo .subnav-button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 5px;
  color: #686c67;
  font-size: 11px;
  font-weight: 600;
}
body.final-demo .subnav-button:hover { background: #f0f2ee; color: var(--ink); }
body.final-demo .subnav-button.active { background: #ecefea; color: var(--ink); box-shadow: inset 0 -2px 0 #d4a62a; }

.area-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.area-toolbar > div:first-child { min-width: 0; }
.area-toolbar > div:first-child > strong { display: block; margin-top: 8px; font-size: 16px; }
.area-toolbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.compact-toolbar { padding-block: 12px; }
.area-select { display: grid; flex: 0 0 min(390px, 40vw); gap: 5px; }
.area-select span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.area-select select { width: 100%; min-height: 40px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-weight: 700; }

.final-workspace-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, .72fr); align-items: start; }
.detail-panel { min-width: 0; }
.demo-board { min-height: 560px; }
.demo-board .task-column { min-width: 0; }
.task-stack { display: grid; align-content: start; gap: 9px; margin-top: 10px; }
.demo-task-card {
  width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); text-align: left; transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.demo-task-card:hover { border-color: #aaaDA5; transform: translateY(-1px); }
.demo-task-card.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.demo-task-card.completed { background: #f4f5f2; color: #60635e; }
.demo-task-card.dragging { opacity: .35; transform: scale(.98); }
.demo-task-card.prompt-now { border-color: #d29d20; background: #fff8df; box-shadow: 0 0 0 1px #d29d20; }
.demo-task-card.prompt-context { border-color: #7453b9; background: #f4efff; box-shadow: 0 0 0 1px #7453b9; }
.task-column.drag-over { background: #fff8df; box-shadow: inset 0 0 0 2px #d7ae4e; }
.task-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.task-card-top strong { min-width: 0; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.demo-task-card p { display: -webkit-box; overflow: hidden; margin: 24px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.demo-task-card small { color: var(--muted); font-size: 10px; }
.demo-task-card small.warning { color: #a76500; font-weight: 800; }
.task-status { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 21px; padding: 0 7px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.status-todo { background: #fff3cf; color: #765400; }
.status-test { background: var(--blue-soft); color: #1f5ba8; }
.status-done { background: var(--green-soft); color: #116849; }
.column-empty { padding: 28px 10px; color: #a0a39d; font-size: 11px; text-align: center; }
.board-toolbar { display: flex; justify-content: flex-end; margin: -5px 0 10px; }
.prompt-controls { display: flex; align-items: center; gap: 8px; }
.prompt-controls > span { margin-right: 4px; color: var(--muted); font-size: 10px; }
.compact-empty { min-height: 360px; }

.detail-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.detail-title h2 { margin: 4px 0 0; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.danger-soft { border-color: #f0cbc7; background: var(--red-soft); color: var(--red); }
.detail-fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.task-detail .field { display: grid; gap: 6px; margin-bottom: 12px; }
.task-detail .field label { color: #5e625c; font-size: 10px; font-weight: 800; }
.task-detail input, .task-detail select, .task-detail textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.task-detail input, .task-detail select { min-height: 38px; padding: 0 10px; }
.task-detail textarea { min-height: 94px; padding: 10px; resize: vertical; line-height: 1.45; }
.test-input { display: grid; grid-template-columns: 1fr 38px; gap: 7px; }
.detail-tests { display: grid; gap: 6px; margin-top: -3px; }
.detail-tests > p { margin: 4px 0; color: var(--muted); font-size: 11px; }
.detail-test { display: flex; align-items: center; width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); gap: 8px; text-align: left; }
.detail-test span { font-size: 11px; line-height: 1.35; }
.detail-test i { width: 12px; height: 12px; color: var(--muted); }
.detail-test.checked { background: #f5f6f3; color: var(--muted); text-decoration: line-through; }
.detail-test.checked i { color: var(--green); }
.detail-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.empty-detail { padding: 40px 12px; color: var(--muted); text-align: center; }

.tasks-demo-layout { display: grid; grid-template-columns: 250px minmax(380px, 1fr) minmax(300px, 390px); align-items: start; gap: 16px; }
.area-list, .wide-task-list { display: grid; gap: 7px; }
.area-row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-align: left; }
.area-row.active { border-color: var(--ink); background: #f5f6f3; box-shadow: inset 3px 0 0 var(--accent); }
.area-row span { min-width: 0; }
.area-row strong, .area-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-row strong { font-size: 12px; }
.area-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.area-row em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 800; }
.wide-task-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; gap: 10px; text-align: left; }
.wide-task-row:hover { border-color: var(--line-strong); }
.wide-task-row.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.task-index { color: #a16f00; font-size: 11px; font-weight: 800; text-align: center; }
.wide-task-copy { min-width: 0; }
.wide-task-copy strong, .wide-task-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wide-task-copy strong { font-size: 12px; }
.wide-task-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }

.tests-demo-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); align-items: start; gap: 14px; }
.tests-summary { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.tests-summary strong { font-size: 13px; }
.tests-summary span { color: var(--muted); font-size: 11px; }
.test-demo-card { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.test-demo-card.completed { opacity: .66; }
.test-card-heading { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; }
.test-card-heading span, .test-card-heading strong, .test-card-heading small { display: block; min-width: 0; }
.test-card-heading strong { font-size: 13px; }
.test-card-heading small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.test-card-heading em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 800; }
.test-items { display: grid; gap: 7px; padding: 10px; }
.test-toggle { display: flex; align-items: flex-start; justify-content: space-between; width: 100%; min-height: 38px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; gap: 10px; text-align: left; }
.test-toggle span { line-height: 1.35; overflow-wrap: anywhere; }
.test-toggle i { flex: 0 0 16px; width: 16px; height: 16px; color: var(--muted); }
.test-toggle:hover span { text-decoration: line-through; }
.test-toggle.checked { background: #f5f6f3; color: var(--muted); text-decoration: line-through; }
.test-toggle.checked i { color: var(--green); }

.ai-demo-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; }
.ai-mode-list { display: grid; align-content: start; gap: 7px; }
.ai-mode { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-align: left; }
.ai-mode.active { border-color: var(--ink); background: #f5f6f3; box-shadow: inset 3px 0 0 var(--accent); }
.ai-config { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: end; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.ai-config h2, .prompt-head h2 { margin: 4px 0; }
.ai-config p { margin: 0; color: var(--muted); }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0 10px; }
.ai-preview { padding: 22px; }
.ai-preview pre { overflow: auto; min-height: 310px; margin: 0; padding: 17px; border: 1px solid var(--line); border-radius: 6px; background: #fafbf8; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

.context-demo-grid { display: grid; grid-template-columns: .9fr 1.3fr; gap: 16px; }
.secret-create-form { display: grid; grid-template-columns: 1fr 1fr 1.2fr 1.2fr 1fr auto; align-items: end; gap: 9px; margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.secret-create-form label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.secret-create-form input { width: 100%; min-height: 37px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.secret-row code { display: block; margin-top: 5px; color: #444843; font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.context-list { display: grid; gap: 8px; }
.context-row, .context-row > div { display: flex; align-items: center; }
.context-row { justify-content: space-between; padding: 10px; border: 1px solid var(--line); border-radius: 6px; gap: 10px; }
.context-row > div { min-width: 0; gap: 10px; }
.context-row > div > i { flex: 0 0 18px; width: 18px; }
.context-row strong, .context-row small { display: block; }
.context-row small { margin-top: 3px; color: var(--muted); }
.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.notes-grid article, .ideas-demo-grid article { padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.notes-grid p { min-height: 60px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.notes-grid small, .ideas-demo-grid small { color: var(--muted); font-size: 10px; }

.ideas-demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ideas-demo-grid h2 { margin: 18px 0 7px; font-size: 16px; }
.ideas-demo-grid p { min-height: 68px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.calendar-strip { display: grid; grid-template-columns: 92px minmax(0, 1fr) 130px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); gap: 16px; }
.calendar-strip:last-child { border-bottom: 0; }
.calendar-strip div { display: flex; align-items: baseline; gap: 7px; }
.calendar-strip div span { font-size: 22px; font-weight: 800; }
.calendar-strip small, .calendar-strip em { color: var(--muted); font-size: 11px; font-style: normal; }
.access-table { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); align-items: center; }
.access-table > * { min-height: 42px; padding: 12px; border-bottom: 1px solid var(--line); }
.access-table i { width: 16px; height: 16px; color: var(--green); }
.activity-list { display: grid; gap: 0; }
.activity-list > div { display: flex; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); gap: 11px; }
.activity-list p { margin: 0; }
.activity-list small { display: block; margin-top: 3px; color: var(--muted); }
.table-empty { padding: 42px; color: var(--muted); text-align: center; }

.heading-actions { align-items: center; }
.heading-area-select .area-select { display: block; width: min(430px, 38vw); }
.heading-area-select .area-select > span { display: none; }
.idea-card-top, .idea-card-top > span { display: flex; align-items: center; }
.idea-card-top { justify-content: space-between; gap: 10px; }
.idea-card-top > span { gap: 5px; }
.idea-card-top .icon-button { width: 25px; height: 25px; border-color: #e5e6e1; color: #656963; }
.idea-card-top .icon-button i { width: 11px; height: 11px; }

.schedule-panel { padding: 16px; }
.schedule-scale { display: grid; grid-template-columns: 1fr 1fr 1fr; margin: 0 58px 12px 124px; color: var(--muted); font-size: 9px; font-weight: 800; }
.schedule-scale span:nth-child(2) { text-align: center; }
.schedule-scale span:last-child { text-align: right; }
.schedule-list { position: relative; display: grid; gap: 8px; }
.schedule-list::before { position: absolute; top: 0; bottom: 0; left: 106px; width: 1px; background: var(--line); content: ""; }
.schedule-row { position: relative; display: grid; grid-template-columns: 28px 68px 12px minmax(0, 1fr) 130px 38px; align-items: center; min-height: 76px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; gap: 10px; }
.schedule-row.active { border-color: #c9a13f; box-shadow: inset 3px 0 0 var(--accent); }
.schedule-row.later { opacity: .72; }
.schedule-row time { color: var(--muted); font-size: 10px; font-weight: 800; }
.schedule-line { position: relative; z-index: 1; display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px #c99520; color: #332606; }
.schedule-line:hover { transform: scale(1.12); }
.schedule-line i { width: 10px; height: 10px; stroke-width: 3; }
.schedule-row.completed { order: 2; border-color: var(--line); background: #f4f5f2; box-shadow: none; opacity: .68; }
.schedule-row.completed > div strong, .schedule-row.completed > div p { text-decoration: line-through; }
.schedule-row.completed .schedule-line { background: var(--green); box-shadow: 0 0 0 1px var(--green); color: #fff; }
.schedule-row small, .schedule-row strong, .schedule-row p { display: block; }
.schedule-row small { color: var(--muted); font-size: 9px; font-weight: 800; }
.schedule-row strong { margin-top: 3px; font-size: 13px; }
.schedule-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.schedule-owner { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.drag-handle { display: grid; place-items: center; width: 28px; height: 36px; border: 0; background: transparent; color: #9a9d97; }
.drag-handle i { width: 15px; }

.payments-panel { overflow: hidden; }
.payments-head, .payment-row { display: grid; grid-template-columns: minmax(240px, 1.4fr) 160px 170px 110px 125px 38px; align-items: center; gap: 14px; }
.payments-head { min-height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #f7f8f5; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.payment-row { min-height: 68px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.payment-row:last-child { border-bottom: 0; }
.payment-row:hover { background: #fbfcfa; }
.payment-row > div strong, .payment-row > div small { display: block; }
.payment-row > div small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.payment-row > span { color: #555953; font-size: 11px; }
.payment-row > strong { font-size: 13px; }
.payment-row .icon-button { width: 34px; height: 34px; }

.knowledge-state { display: grid; min-height: 360px; place-items: center; align-content: center; text-align: center; }
.knowledge-state > i { width: 28px; height: 28px; color: var(--muted); }
.knowledge-state h2 { margin: 12px 0 0; }
.knowledge-state p { color: var(--muted); }
.knowledge-state.error > i { color: var(--red); }
.knowledge-notice { display: flex; align-items: center; margin-bottom: 14px; padding: 10px 13px; border: 1px solid #b9decf; border-radius: 6px; background: var(--green-soft); color: #116849; gap: 8px; font-size: 11px; font-weight: 750; }
.knowledge-notice i { width: 15px; height: 15px; }
.knowledge-overview { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(430px, .9fr); margin-bottom: 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.knowledge-score { display: flex; align-items: center; min-height: 128px; padding: 20px; gap: 18px; }
.knowledge-score h2 { margin: 4px 0; font-size: 17px; }
.knowledge-score p { max-width: 640px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.score-ring { --score: 0; position: relative; display: grid; flex: 0 0 72px; width: 72px; height: 72px; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--score) * 1%), #ebece7 0); }
.score-ring::after { position: absolute; inset: 7px; border-radius: 50%; background: #fff; content: ""; }
.score-ring strong { position: relative; z-index: 1; font-size: 16px; }
.knowledge-status-summary { display: grid; grid-template-columns: 1fr 1fr; border-left: 1px solid var(--line); }
.knowledge-status-summary > div { display: grid; grid-template-columns: 10px 28px 1fr; align-items: center; min-height: 64px; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 7px; }
.knowledge-status-summary > div:nth-child(odd) { border-right: 1px solid var(--line); }
.knowledge-status-summary > div:nth-last-child(-n+2) { border-bottom: 0; }
.knowledge-status-summary strong { font-size: 15px; }
.knowledge-status-summary small { color: var(--muted); font-size: 9px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a2a49d; }
.status-dot.confirmed { background: var(--green); }
.status-dot.draft { background: #c08b13; }
.status-dot.decision { background: var(--purple); }
.status-dot.missing { background: #9a9d97; }

.knowledge-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.knowledge-card { display: flex; min-width: 0; min-height: 206px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: #fff; flex-direction: column; text-align: left; transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease; }
.knowledge-card:hover { border-color: #aeb1aa; box-shadow: 0 7px 18px rgb(20 24 22 / 5%); transform: translateY(-1px); }
.knowledge-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.knowledge-icon { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #f8f9f6; color: #525650; }
.knowledge-icon i { width: 15px; height: 15px; }
.knowledge-card h2 { margin: 18px 0 5px; font-size: 15px; }
.knowledge-card > p { min-height: 34px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.knowledge-card-meta { display: flex; justify-content: space-between; margin-top: auto; padding-top: 16px; color: var(--muted); font-size: 9px; }
.knowledge-card-meta strong { color: var(--ink); }
.knowledge-progress { height: 3px; margin-top: 7px; overflow: hidden; border-radius: 2px; background: #ecede9; }
.knowledge-progress span { display: block; height: 100%; background: var(--accent); }
.knowledge-card > small { margin-top: 8px; color: #969992; font-size: 8px; }
.knowledge-status { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 999px; background: #f0f1ee; color: #686c66; gap: 5px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.knowledge-status > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.knowledge-status.confirmed { background: var(--green-soft); color: #116849; }
.knowledge-status.draft { background: #fff5d8; color: #856109; }
.knowledge-status.decision { background: var(--purple-soft); color: #60419f; }
.knowledge-history { margin-top: 16px; }
.knowledge-history-list { border-top: 1px solid var(--line); }
.knowledge-history-list > div { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; min-height: 54px; padding: 9px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.knowledge-history-list > div:last-child { border-bottom: 0; }
.knowledge-history-list strong, .knowledge-history-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-history-list strong { font-size: 11px; }
.knowledge-history-list small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.knowledge-history-list em { color: var(--muted); font-size: 9px; font-style: normal; }
.export-version { display: grid; width: 34px; height: 28px; place-items: center; border-radius: 5px; background: #f0f1ed; font-size: 9px; font-weight: 800; }

.knowledge-category-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.back-link { display: inline-flex; align-items: center; padding: 6px 0; border: 0; background: transparent; color: var(--muted); gap: 7px; font-size: 10px; font-weight: 750; }
.back-link:hover { color: var(--ink); }
.back-link i { width: 14px; height: 14px; }
.knowledge-list-panel { min-height: 420px; }
.knowledge-list-tools { display: grid; grid-template-columns: minmax(260px, 1fr) 220px; gap: 10px; margin-bottom: 14px; }
.knowledge-search { display: flex; align-items: center; min-height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; gap: 8px; }
.knowledge-search i { flex: 0 0 15px; width: 15px; color: var(--muted); }
.knowledge-search input { width: 100%; border: 0; outline: 0; font-size: 11px; }
.knowledge-filter { display: grid; grid-template-columns: auto 1fr; align-items: center; min-height: 39px; padding-left: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; gap: 8px; }
.knowledge-filter span { color: var(--muted); font-size: 9px; font-weight: 800; }
.knowledge-filter select { width: 100%; height: 37px; border: 0; background: transparent; font-size: 10px; outline: 0; }
.knowledge-entry-list { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.knowledge-entry-list > button { display: grid; grid-template-columns: minmax(0, 1fr) 130px 90px 16px; align-items: center; width: 100%; min-height: 68px; padding: 11px 13px; border: 0; border-bottom: 1px solid var(--line); background: #fff; gap: 14px; text-align: left; }
.knowledge-entry-list > button:last-child { border-bottom: 0; }
.knowledge-entry-list > button:hover { background: #fafbf8; }
.entry-main { min-width: 0; }
.entry-main strong, .entry-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-main strong { font-size: 12px; }
.entry-main small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.entry-date { color: var(--muted); font-size: 9px; text-align: right; }
.knowledge-entry-list > button > i { width: 14px; height: 14px; color: #9a9d97; }
.knowledge-empty { display: grid; min-height: 330px; place-items: center; align-content: center; text-align: center; }
.knowledge-empty > i { width: 28px; height: 28px; color: #979a94; }
.knowledge-empty h2 { margin: 13px 0 5px; font-size: 15px; }
.knowledge-empty p { max-width: 430px; margin: 0 0 16px; color: var(--muted); font-size: 11px; }

.knowledge-overlay { position: fixed; inset: 0; z-index: 100; display: grid; justify-items: end; background: rgb(17 20 19 / 30%); }
.knowledge-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; }
.knowledge-editor { position: relative; z-index: 1; width: min(760px, calc(100vw - 40px)); height: 100%; overflow-y: auto; padding: 20px; border-left: 1px solid var(--line); background: #fff; box-shadow: -14px 0 38px rgb(16 20 18 / 12%); }
.knowledge-editor-head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--line); gap: 18px; }
.knowledge-editor-head h2 { margin: 5px 0 4px; font-size: 20px; }
.knowledge-editor-head p { margin: 0; color: var(--muted); font-size: 10px; }
.knowledge-editor-core { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(150px, .65fr) 170px; gap: 10px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.knowledge-editor-core label, .knowledge-field { display: grid; gap: 6px; color: #5e625c; font-size: 9px; font-weight: 800; }
.knowledge-editor-core input, .knowledge-editor-core select, .knowledge-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; outline: 0; }
.knowledge-editor-core input, .knowledge-editor-core select { min-height: 39px; padding: 0 10px; }
.knowledge-form-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px 0 86px; }
.knowledge-field.important { grid-column: 1 / -1; }
.knowledge-field textarea { min-height: 92px; padding: 10px; resize: vertical; font-size: 11px; font-weight: 500; line-height: 1.5; }
.knowledge-field.important textarea { min-height: 112px; }
.knowledge-editor-footer { position: sticky; bottom: -20px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; min-height: 70px; margin: 0 -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); background: rgb(255 255 255 / 96%); gap: 12px; }
.knowledge-editor-footer > span { color: var(--muted); font-size: 9px; text-align: center; }
.export-overlay { justify-items: center; align-items: center; }
.export-preview { width: min(760px, calc(100vw - 40px)); height: auto; max-height: min(760px, calc(100vh - 48px)); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.export-warnings, .export-ready { display: grid; margin: 16px 0; padding: 12px; border: 1px solid #ead49d; border-radius: 6px; background: #fff8e6; gap: 5px; color: #6e5517; font-size: 10px; }
.export-warnings strong, .export-ready { align-items: center; grid-template-columns: auto 1fr; }
.export-warnings i, .export-ready i { width: 15px; height: 15px; }
.export-warnings span { padding-left: 23px; }
.export-ready { display: flex; border-color: #b9decf; background: var(--green-soft); color: #116849; }
.export-files { display: grid; grid-template-columns: 1fr 1fr; max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.export-files span { display: flex; align-items: center; min-width: 0; padding: 9px 10px; border-bottom: 1px solid var(--line); gap: 8px; font: 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.export-files span:nth-child(odd) { border-right: 1px solid var(--line); }
.export-files i { flex: 0 0 13px; width: 13px; height: 13px; color: var(--muted); }

@media (max-width: 1120px) {
  .primary-row, body.variant-2 .primary-row, body.variant-3 .primary-row, body.variant-4 .primary-row, body.variant-6 .primary-row, body.variant-7 .primary-row, body.variant-8 .primary-row, body.variant-9 .primary-row, body.variant-10 .primary-row {
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 12px;
  }
  .primary-nav { order: 3; grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  .primary-nav::-webkit-scrollbar { display: none; }
  .user-tools { grid-column: 2; grid-row: 1; }
  body.variant-2 .project-picker.top-right { display: none; }
  .primary-row { padding-top: 9px; }
  .planner-layout, .finance-grid, .project-workspace-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; }
  .final-workspace-grid, .tasks-demo-layout { grid-template-columns: 1fr; }
  .tasks-demo-layout .area-panel { order: 1; }
  .tasks-demo-layout .task-list-panel { order: 2; }
  .tasks-demo-layout .detail-panel { order: 3; }
  .area-list { grid-template-columns: repeat(3, 1fr); }
  .tests-demo-grid { grid-template-columns: repeat(2, 1fr); }
  body.final-demo .secondary-row { justify-content: flex-start; padding-right: 12px; }
  body.final-demo .secondary-row .second-project-picker { position: static; flex: 0 0 auto; min-width: 180px; }
  body.final-demo .picker-menu { right: 12px; }
  .payments-panel { overflow-x: auto; }
  .payments-head, .payment-row { min-width: 940px; }
  .knowledge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .knowledge-overview { grid-template-columns: 1fr; }
  .knowledge-status-summary { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 760px) {
  .prototype-banner { align-items: flex-start; flex-direction: column; }
  .primary-row, body.variant-2 .primary-row, body.variant-3 .primary-row, body.variant-4 .primary-row, body.variant-6 .primary-row, body.variant-7 .primary-row, body.variant-8 .primary-row, body.variant-9 .primary-row, body.variant-10 .primary-row { grid-template-columns: 1fr auto; padding: 9px 12px 0; }
  .brand-copy { display: none; }
  .project-picker { min-width: 0; }
  .primary-nav { gap: 2px; }
  .nav-button { padding: 0 10px; }
  .nav-button span { display: none; }
  .secondary-row { overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
  body:is(.variant-6, .variant-7, .variant-8, .variant-9, .variant-10) .secondary-row { justify-content: flex-start; }
  .secondary-row::-webkit-scrollbar { display: none; }
  .secondary-label { display: none; }
  .second-project-picker { flex-basis: 180px; }
  .project-tabs { overflow-x: auto; }
  .workspace { padding: 16px 12px 36px; }
  .picker-menu { top: 60px; right: 12px; left: 12px; width: auto; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .planning-board, .task-board { grid-template-columns: 82vw 82vw 82vw; overflow-x: auto; }
  .side-stack, .users-layout, .user-create-form { grid-template-columns: 1fr; }
  .money-summary { grid-template-columns: 1fr; }
  .money-cell { border-right: 0; border-bottom: 1px solid var(--line); }
  .money-cell:last-child { border-bottom: 0; }
  .simple-row { grid-template-columns: 1fr auto; }
  .simple-row > :nth-child(3), .simple-row > :nth-child(4) { display: none; }
  .area-toolbar { align-items: stretch; flex-direction: column; }
  .area-select { flex-basis: auto; width: 100%; }
  .demo-board { grid-template-columns: 82vw 82vw 82vw; min-height: 480px; overflow-x: auto; }
  .detail-fields-row, .ai-config, .context-demo-grid, .secret-create-form { grid-template-columns: 1fr; }
  .area-list, .tests-demo-grid, .notes-grid, .ideas-demo-grid { grid-template-columns: 1fr; }
  .ai-demo-layout { grid-template-columns: 1fr; }
  .ai-mode-list { grid-template-columns: repeat(5, max-content); overflow-x: auto; }
  .wide-task-row { grid-template-columns: 20px minmax(0, 1fr); }
  .wide-task-row .task-status { grid-column: 2; justify-self: start; }
  .calendar-strip { grid-template-columns: 74px minmax(0, 1fr); }
  .calendar-strip > em { grid-column: 2; }
  .access-table { min-width: 600px; }
  .section-band:has(.access-table) { overflow-x: auto; }
  .heading-actions { align-items: stretch; flex-wrap: wrap; width: 100%; }
  .heading-area-select { width: 100%; }
  .heading-area-select .area-select { width: 100%; }
  .tests-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .schedule-scale { display: none; }
  .schedule-list::before { left: 75px; }
  .schedule-row { grid-template-columns: 24px 55px 10px minmax(0, 1fr) 34px; }
  .schedule-owner { display: none; }
  .schedule-row > .icon-button { grid-column: 5; }
  .knowledge-grid { grid-template-columns: 1fr; }
  .knowledge-list-tools, .knowledge-editor-core, .knowledge-form-sections { grid-template-columns: 1fr; }
  .knowledge-field.important { grid-column: auto; }
  .knowledge-entry-list > button { grid-template-columns: minmax(0, 1fr) auto 14px; }
  .entry-date { display: none; }
  .knowledge-editor { width: 100%; }
  .knowledge-editor-footer { grid-template-columns: 1fr; }
  .knowledge-editor-footer > span { display: none; }
  .export-files { grid-template-columns: 1fr; }
  .export-files span:nth-child(odd) { border-right: 0; }
}
