:root {
  color-scheme: light;
  --paper: #f2f3ee;
  --paper-strong: #fbfcf8;
  --ink: #171917;
  --muted: #686d66;
  --line: #d9dcd4;
  --line-strong: #bdc2b8;
  --panel: #ffffff;
  --dark: #171a18;
  --dark-soft: #222622;
  --accent: #536dff;
  --accent-soft: #e8ebff;
  --accent-ink: #2d44c7;
  --green: #15946a;
  --green-soft: #ddf6ec;
  --amber: #c77817;
  --amber-soft: #fff0d8;
  --red: #bd4c4c;
  --red-soft: #fde7e7;
  --shadow: 0 22px 70px rgba(27, 35, 26, 0.09);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(83, 109, 255, 0.08), transparent 28rem),
    linear-gradient(180deg, #f7f8f4 0%, var(--paper) 46%, #eceee8 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(83, 109, 255, 0.28);
  outline-offset: 2px;
}

.page-glow {
  position: fixed;
  z-index: -1;
  top: -16rem;
  right: -14rem;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  background: rgba(120, 240, 198, 0.1);
  filter: blur(18px);
  pointer-events: none;
}

.app-shell {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  padding: 16px 2px;
  background: linear-gradient(180deg, rgba(247, 248, 244, 0.97), rgba(247, 248, 244, 0.8));
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper-strong);
  box-shadow: inset 0 0 0 4px var(--paper-strong);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span::before,
.brand-mark span::after {
  position: absolute;
  width: 10px;
  height: 10px;
  content: "";
  border-color: var(--accent);
  border-style: solid;
}

.brand-mark::before {
  top: 6px;
  left: 6px;
  border-width: 2px 0 0 2px;
}

.brand-mark::after {
  top: 6px;
  right: 6px;
  border-width: 2px 2px 0 0;
}

.brand-mark span::before {
  bottom: 6px;
  left: 6px;
  border-width: 0 0 2px 2px;
}

.brand-mark span::after {
  right: 6px;
  bottom: 6px;
  border-width: 0 2px 2px 0;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.76rem;
}

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

.button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

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

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.65);
}

.button-ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #fff;
}

.button-secondary {
  border-color: #c9cffc;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.button-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(83, 109, 255, 0.22);
}

.button-success {
  color: #fff;
  background: var(--green);
}

.button-danger-quiet {
  border-color: #efcaca;
  color: var(--red);
  background: var(--red-soft);
}

.phase-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phase-pill[data-phase="REVIEW"] {
  border-color: #f0d29d;
  color: #965b10;
  background: var(--amber-soft);
}

.phase-pill[data-phase="ACCEPTED"] {
  border-color: #bce8d5;
  color: #0f714f;
  background: var(--green-soft);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 22px;
  align-items: start;
}

.workspace,
.side-rail > section {
  border: 1px solid rgba(207, 211, 203, 0.92);
  box-shadow: var(--shadow);
}

.workspace {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: rgba(251, 252, 248, 0.92);
}

.workspace-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 30px 32px 20px;
}

.workspace-heading h1,
.section-heading h2,
.panel-heading h2,
.brief-copy h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

.workspace-heading h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 0.96;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-on-dark {
  color: rgba(255, 255, 255, 0.54);
}

.scope-version {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.scope-version span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.scope-version strong {
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.brief-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: start;
  margin: 0 22px;
  padding: 21px;
  border: 1px solid #ced4ff;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(130deg, rgba(232, 235, 255, 0.98), rgba(247, 249, 255, 0.95)),
    #fff;
}

.brief-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
}

.brief-label {
  margin: 1px 0 5px;
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brief-copy h2 {
  font-size: 1.22rem;
}

.brief-copy > p:not(.brief-label) {
  max-width: 720px;
  margin: 7px 0 9px;
  color: #444a5e;
  line-height: 1.48;
}

.brief-copy ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brief-copy li {
  padding: 5px 9px;
  border: 1px solid rgba(83, 109, 255, 0.18);
  border-radius: 999px;
  color: #49516b;
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.72rem;
  font-weight: 650;
}

.brief-date {
  display: grid;
  min-width: 104px;
  justify-items: end;
  gap: 3px;
  padding-top: 2px;
}

.brief-date span {
  color: #68708c;
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.brief-date strong {
  font-size: 0.86rem;
}

.board-section {
  padding: 28px 22px 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 6px 18px;
}

.section-heading h2 {
  font-size: 1.36rem;
}

.section-heading p:not(.eyebrow) {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-card {
  position: relative;
  display: grid;
  gap: 13px;
  min-height: 162px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.field-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.field-card.is-scoped {
  border-color: rgba(83, 109, 255, 0.72);
  background: linear-gradient(145deg, #fff, #f8f9ff);
  box-shadow:
    0 0 0 3px rgba(83, 109, 255, 0.09),
    0 15px 35px rgba(63, 81, 181, 0.1);
}

.field-card.is-scoped::before,
.field-card.is-scoped::after {
  position: absolute;
  width: 18px;
  height: 18px;
  content: "";
  pointer-events: none;
}

.field-card.is-scoped::before {
  top: 8px;
  left: 8px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  border-radius: 4px 0 0;
}

.field-card.is-scoped::after {
  right: 8px;
  bottom: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  border-radius: 0 0 4px;
}

.field-card.is-locked {
  opacity: 0.72;
}

.field-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.field-meta {
  display: grid;
  gap: 4px;
}

.field-meta label {
  font-size: 0.86rem;
  font-weight: 800;
}

.field-meta small {
  color: var(--muted);
  font-size: 0.7rem;
}

.scope-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.scope-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #e4e6e0;
  transition: 160ms ease;
}

.toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  content: "";
  transition: transform 160ms ease;
}

.scope-toggle input:checked + .toggle-track {
  border-color: var(--accent);
  background: var(--accent);
}

.scope-toggle input:checked + .toggle-track::after {
  transform: translateX(14px);
}

.scope-toggle input:focus-visible + .toggle-track {
  outline: 3px solid rgba(83, 109, 255, 0.25);
  outline-offset: 2px;
}

.toggle-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-card.is-scoped .toggle-label {
  color: var(--accent-ink);
}

.field-input,
.field-textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.45;
}

.field-input {
  min-height: 42px;
  padding: 6px 1px 8px;
}

.field-textarea {
  min-height: 66px;
  padding: 6px 1px 8px;
  resize: vertical;
}

.field-input:disabled,
.field-textarea:disabled {
  color: #5e625d;
  cursor: not-allowed;
}

.field-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #636861;
  background: #eff1eb;
  font-size: 0.66rem;
  font-weight: 800;
}

.access-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #969c93;
  content: "";
}

.field-card.is-scoped .access-badge {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.field-card.is-scoped .access-badge::before {
  background: var(--accent);
}

.char-count {
  color: #8a8f88;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.decision-zone {
  display: grid;
  gap: 12px;
  padding: 0 22px 24px;
}

.decision-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.decision-card.pending {
  border-color: #efcf99;
  background: linear-gradient(135deg, #fffaf1, #fff);
}

.decision-card.review {
  border-color: #cdd2ff;
  background: linear-gradient(135deg, #f6f7ff, #fff);
}

.decision-card.accepted {
  border-color: #b7e4d1;
  background: linear-gradient(135deg, #effbf6, #fff);
}

.decision-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
}

.decision-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.decision-header h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.decision-header p:not(.decision-kicker) {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.46;
}

.decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.request-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.request-field {
  padding: 5px 9px;
  border-radius: 999px;
  color: #8b5510;
  background: var(--amber-soft);
  font-size: 0.7rem;
  font-weight: 800;
}

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

.diff-item {
  display: grid;
  grid-template-columns: minmax(100px, 0.25fr) 1fr 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.diff-label {
  font-size: 0.75rem;
  font-weight: 850;
}

.diff-before,
.diff-after {
  overflow-wrap: anywhere;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.77rem;
  line-height: 1.4;
}

.diff-before {
  color: #8b4a4a;
  background: var(--red-soft);
  text-decoration: line-through;
}

.diff-after {
  color: #116948;
  background: var(--green-soft);
}

.diff-arrow {
  color: #8c918b;
  text-align: center;
}

.side-rail {
  position: sticky;
  top: 102px;
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 0 1px 4px;
  scrollbar-width: thin;
}

.side-rail > section {
  border-radius: var(--radius-xl);
}

.panel-dark {
  color: #fff;
  background:
    radial-gradient(circle at 100% 0%, rgba(83, 109, 255, 0.28), transparent 19rem),
    var(--dark);
}

.panel-light {
  background: rgba(255, 255, 255, 0.9);
}

.surface-panel,
.access-panel,
.activity-panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading.compact {
  margin-bottom: 15px;
}

.panel-heading h2 {
  font-size: 1.18rem;
  line-height: 1.15;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  margin-top: 1px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.connection-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7e847e;
  box-shadow: 0 0 0 3px rgba(126, 132, 126, 0.13);
  content: "";
}

.connection-status.is-live {
  border-color: rgba(94, 225, 170, 0.22);
  color: #8cefc4;
  background: rgba(94, 225, 170, 0.07);
}

.connection-status.is-live::before {
  background: #5ee1aa;
  box-shadow: 0 0 0 3px rgba(94, 225, 170, 0.13);
}

.connection-status.is-preview {
  color: rgba(255, 255, 255, 0.6);
}

.connection-status.has-error {
  border-color: rgba(255, 155, 120, 0.22);
  color: #ffc1aa;
  background: rgba(255, 155, 120, 0.07);
}

.connection-status.has-error::before {
  background: #ff9b78;
  box-shadow: 0 0 0 3px rgba(255, 155, 120, 0.13);
}

.tool-list {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}

.tool-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  animation: tool-in 200ms ease both;
}

@keyframes tool-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tool-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: #b9c2ff;
  background: rgba(83, 109, 255, 0.18);
  font-size: 0.72rem;
  font-weight: 900;
}

.tool-item[data-mode="write"] .tool-icon {
  color: #7aebbb;
  background: rgba(21, 148, 106, 0.2);
}

.tool-name {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-mode {
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.surface-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.69rem;
  line-height: 1.45;
}

.access-list {
  display: grid;
  gap: 8px;
}

.access-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 36px;
  padding: 0 2px;
  border-bottom: 1px solid #eceee8;
}

.access-row:last-child {
  border-bottom: 0;
}

.access-row span:first-child {
  font-size: 0.78rem;
  font-weight: 700;
}

.access-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #777d75;
  font-size: 0.65rem;
  font-weight: 850;
  text-transform: uppercase;
}

.access-state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a6aaa3;
  content: "";
}

.access-state.write {
  color: var(--accent-ink);
}

.access-state.write::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.access-state.framed {
  color: var(--accent-ink);
}

.access-state.framed::before {
  box-sizing: border-box;
  border: 2px solid var(--accent);
  background: transparent;
}

.activity-list {
  display: grid;
  gap: 0;
  max-height: 360px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  padding: 9px 0;
}

.activity-item::after {
  position: absolute;
  top: 28px;
  bottom: -7px;
  left: 11px;
  width: 1px;
  background: var(--line);
  content: "";
}

.activity-item:last-child::after {
  display: none;
}

.actor-dot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.actor-dot.agent {
  border-color: #c7cdfb;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.actor-dot.human {
  border-color: #bce4d3;
  color: #0d7450;
  background: var(--green-soft);
}

.activity-copy {
  min-width: 0;
}

.activity-copy p {
  margin: 1px 0 3px;
  color: #4f544f;
  font-size: 0.72rem;
  line-height: 1.4;
}

.activity-copy time {
  color: #969b94;
  font-size: 0.62rem;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 4px 30px;
  color: var(--muted);
  font-size: 0.72rem;
}

.footer p {
  margin: 0;
}

.footer p:first-child {
  color: var(--ink);
  font-weight: 750;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 44px));
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid #cfd4cc;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 45px rgba(28, 35, 27, 0.16);
  font-size: 0.76rem;
  line-height: 1.4;
  animation: toast-in 180ms ease both;
}

.toast.error {
  border-color: #efc3c3;
  color: #8f3838;
  background: #fff8f8;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.debug-panel {
  position: fixed;
  z-index: 90;
  right: 16px;
  bottom: 16px;
  width: min(620px, calc(100vw - 32px));
  max-height: 70vh;
  padding: 16px;
  overflow: auto;
  border: 1px solid #454b45;
  border-radius: 16px;
  color: #e9eee9;
  background: rgba(18, 21, 19, 0.97);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.debug-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.debug-heading span {
  color: #99a099;
  font-size: 0.68rem;
}

.debug-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.debug-actions button {
  padding: 7px 9px;
  border: 1px solid #4d554e;
  border-radius: 8px;
  color: #fff;
  background: #2b302c;
  cursor: pointer;
  font-size: 0.69rem;
}

.debug-panel pre {
  max-height: 260px;
  margin: 12px 0 0;
  padding: 10px;
  overflow: auto;
  border-radius: 9px;
  color: #bdebd3;
  background: #101311;
  font-size: 0.66rem;
  white-space: pre-wrap;
}

@media (max-width: 1050px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }

  .surface-panel {
    grid-row: span 2;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1500px);
  }

  .topbar {
    min-height: 72px;
  }

  .brand-copy small,
  .phase-pill {
    display: none;
  }

  .layout {
    gap: 12px;
  }

  .workspace-heading,
  .board-section {
    padding-right: 16px;
    padding-left: 16px;
  }

  .brief-card {
    grid-template-columns: auto 1fr;
    margin: 0 10px;
  }

  .brief-date {
    grid-column: 2;
    justify-items: start;
  }

  .field-grid,
  .side-rail {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .decision-header,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading,
  .decision-header,
  .footer {
    display: flex;
  }

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

  .decision-actions .button {
    flex: 1;
  }

  .diff-item {
    grid-template-columns: 1fr;
  }

  .diff-arrow {
    transform: rotate(90deg);
  }

  .footer {
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
