:root {
  color-scheme: light;
  --ink: #202326;
  --muted: #677078;
  --line: #d9dedc;
  --surface: #f7f7f3;
  --paper: #ffffff;
  --teal: #2f6f73;
  --rust: #9a4f4c;
  --gold: #b3832d;
  --green: #4f7f52;
  --focus: #1e5aa8;
  --shadow: 0 18px 45px rgba(31, 39, 43, 0.11);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(47, 111, 115, 0.1), transparent 280px),
    var(--surface);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #fff;
  background: var(--teal);
  cursor: pointer;
}

button:hover {
  filter: brightness(0.95);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(30, 90, 168, 0.24);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

button.secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 52px) 18px;
  border-bottom: 1px solid rgba(32, 35, 38, 0.08);
}

.topbar h1,
.panel-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.8rem, 3vw, 3.2rem);
  line-height: 1.02;
}

.topbar-actions,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.1fr);
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 52px) 42px;
}

.prompt-panel,
.council-panel,
.output-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.prompt-panel,
.council-panel {
  padding: 18px;
}

.output-panel {
  grid-column: 1 / -1;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--rust);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

textarea {
  resize: vertical;
  min-height: 120px;
  margin-top: 16px;
  padding: 14px;
  line-height: 1.5;
}

input {
  min-height: 38px;
  padding: 8px 10px;
}

input[type="color"] {
  padding: 3px;
}

#councilMap {
  width: 100%;
  height: auto;
  margin: 18px 0;
  border: 1px solid #d6dbd8;
  border-radius: 8px;
  background: #eff2ee;
}

.agents-list {
  display: grid;
  gap: 12px;
}

.agent-editor {
  display: grid;
  grid-template-columns: 8px repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.agent-strip {
  align-self: stretch;
  border-radius: 5px;
  background: var(--teal);
}

.agent-editor label {
  display: grid;
  gap: 5px;
}

.agent-editor label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.agent-editor .wide {
  grid-column: 2 / 6;
}

.agent-editor textarea {
  min-height: 92px;
  margin: 0;
}

.remove-agent {
  align-self: center;
}

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  background: #e7ebe7;
}

.tab {
  min-width: 120px;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
}

.tab.active {
  color: var(--ink);
  background: #fff;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.meeting-output {
  padding: 24px;
  background: #fff;
}

.meeting-output h2 {
  margin: 0 0 6px;
  font-size: 1.55rem;
}

.meeting-output h3 {
  margin: 24px 0 10px;
  color: var(--teal);
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.meeting-output p {
  max-width: 80rem;
  line-height: 1.6;
}

.meeting-output ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.meta {
  color: var(--muted);
}

.dialogue-list {
  display: grid;
  gap: 12px;
}

.dialogue-item {
  padding: 14px 16px;
  border-left: 5px solid var(--teal);
  border-radius: 6px;
  background: #f9faf7;
}

.dialogue-item strong {
  display: block;
  margin-bottom: 4px;
}

.hidden {
  display: none;
}

@media (max-width: 960px) {
  .topbar,
  .workspace,
  .panel-heading,
  .agent-editor {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-heading {
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions button,
  .panel-heading button {
    width: 100%;
  }

  .agent-strip {
    display: none;
  }

  .agent-editor .wide {
    grid-column: auto;
  }
}
