:root {
  color-scheme: light;
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #ebe7dd;
  --ink: #191b1f;
  --muted: #686f77;
  --line: #d7d2c6;
  --green: #1f7a5a;
  --blue: #2457a6;
  --red: #b24537;
  --yellow: #c58b18;
  --shadow: 0 14px 34px rgba(25, 27, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  min-height: 100vh;
}

.sidebar,
.activity {
  background: #fbfaf7;
  border-right: 1px solid var(--line);
  padding: 24px;
}

.activity {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.1;
}

.brand p,
.eyebrow,
small {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.role-list {
  display: grid;
  gap: 10px;
}

.role-button {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.role-button:hover,
.role-button.active {
  border-color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.role-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  font-weight: 800;
}

.role-name {
  display: block;
  font-weight: 800;
}

.role-title {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.role-tools {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
}

.panel {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.panel.compact h2,
.activity h2 {
  font-size: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.metric-grid div {
  border-left: 3px solid var(--green);
  padding-left: 10px;
}

.metric-grid span {
  display: block;
  font-size: 28px;
  font-weight: 850;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar,
.section-heading,
.form-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 26px;
}

.topbar h2 {
  max-width: 760px;
  font-size: clamp(28px, 4vw, 50px);
  line-height: 0.98;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.icon-button,
.primary-action,
.run-button,
.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 42px;
}

.icon-button {
  width: 42px;
  font-size: 22px;
}

.primary-action,
.run-button {
  padding: 0 16px;
  font-weight: 800;
}

.primary-action,
.run-button {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.briefing {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 18px;
  align-items: stretch;
}

.task-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 140px;
  margin: 8px 0 14px;
  padding: 14px;
  resize: vertical;
}

select {
  height: 44px;
  padding: 0 12px;
}

.form-row {
  align-items: end;
}

.form-row label {
  flex: 1;
}

.run-button {
  min-width: 130px;
}

.executive-plan {
  margin-top: 24px;
}

.executive-plan:empty {
  display: none;
}

.executive-plan {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 18px;
  box-shadow: var(--shadow);
}

.plan-score {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid rgba(31, 122, 90, 0.32);
  border-radius: 999px;
  background: rgba(31, 122, 90, 0.1);
  color: var(--green);
  padding: 0 12px;
  font-weight: 850;
  white-space: nowrap;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.plan-grid article {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.plan-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.plan-grid strong {
  font-size: 15px;
  line-height: 1.35;
}

.live-status {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.live-status h3 {
  font-size: 24px;
  line-height: 1.1;
}

.stage-list {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
}

.stage-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.stage-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.stage-list li.done {
  color: var(--ink);
}

.stage-list li.done::before {
  border-color: var(--green);
  background: var(--green);
}

.output-area {
  margin-top: 28px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  border-color: var(--blue);
  color: var(--blue);
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.output-card {
  display: grid;
  gap: 14px;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.output-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.output-card h3 {
  font-size: 18px;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.score-row span {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-row strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 17px;
}

.badge {
  align-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.output-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #333940;
}

.deliverable-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.deliverable-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 6px 9px;
  color: #333940;
  font-size: 12px;
  font-weight: 800;
}

.risk-box {
  border-left: 3px solid var(--red);
  background: rgba(178, 69, 55, 0.08);
  padding: 10px 12px;
  color: #55302c;
  font-size: 13px;
  line-height: 1.4;
}

.creative-calendar {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.creative-day {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 12px;
}

.creative-day div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.creative-day span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.creative-day strong {
  color: var(--ink);
}

.creative-day p {
  color: #333940;
  font-size: 13px;
  line-height: 1.35;
}

.output-card footer {
  align-self: end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.activity .section-heading {
  align-items: center;
}

.section-heading.tight {
  margin-bottom: 14px;
}

.activity-log {
  display: grid;
  gap: 10px;
}

.log-item {
  border-left: 3px solid var(--blue);
  background: #fff;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.35;
}

.log-item strong {
  display: block;
  margin-bottom: 3px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 860px) {
  .app-shell,
  .briefing,
  .output-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .activity,
  .workspace {
    padding: 18px;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .topbar,
  .form-row,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 34px;
  }

  .topbar-actions,
  .filter-tabs {
    width: 100%;
  }

  .primary-action,
  .run-button,
  .tab {
    flex: 1;
  }

  .score-row {
    grid-template-columns: 1fr;
  }
}
