:root {
  --app-bg: #eef2f0;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --surface-green: #f0f8f4;
  --text: #17231e;
  --muted: #617069;
  --faint: #87928d;
  --line: #dfe6e2;
  --line-strong: #cad5cf;
  --green: #07884c;
  --green-dark: #05653a;
  --green-light: #dff3e8;
  --lime: #b9f56e;
  --amber: #a76012;
  --amber-bg: #fff5e8;
  --red: #a43e3e;
  --red-bg: #fff0f0;
  --shadow: 0 8px 26px rgba(27, 52, 40, 0.07);
  --radius: 14px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--app-bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

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

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #77c9a1;
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
blockquote {
  margin: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: white;
  background: var(--green-dark);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 180ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #10251c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand,
.topbar__actions,
.user-chip {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
  color: white;
}

.brand__mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #062d1b;
  background: #3bdb91;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 900;
}

.brand > div,
.user-chip > div {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 0.93rem;
  letter-spacing: -0.01em;
}

.brand small,
.user-chip small {
  color: #a9b9b1;
  font-size: 0.7rem;
}

.demo-badge {
  margin-left: 5px;
  padding: 4px 7px;
  color: #b9facf;
  background: rgba(56, 213, 140, 0.14);
  border: 1px solid rgba(89, 228, 163, 0.28);
  border-radius: 5px;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar__actions {
  gap: 22px;
}

.text-button {
  padding: 7px 4px;
  color: #d4dfda;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed #70837a;
  font-size: 0.77rem;
  transition: color 180ms ease-out, border-color 180ms ease-out;
}

.text-button:hover {
  color: white;
  border-color: white;
}

.user-chip {
  gap: 9px;
  color: white;
}

.user-chip > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #123124;
  background: #dbeae2;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
}

.user-chip strong {
  font-size: 0.76rem;
}

.app-layout {
  display: grid;
  min-height: calc(100vh - 68px);
  grid-template-columns: 264px minmax(0, 1fr);
}

.case-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 16px 18px;
  background: #f8faf9;
  border-right: 1px solid var(--line);
}

.sidebar-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 6px 18px;
}

.sidebar-heading p,
.panel-kicker {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-heading h1 {
  font-size: 1.22rem;
  letter-spacing: -0.025em;
}

.queue-count {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
}

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

.case-item {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 15px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(32, 57, 45, 0.02);
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out, background 180ms ease-out;
}

.case-item:hover {
  border-color: #adc3b7;
  box-shadow: 0 6px 16px rgba(32, 57, 45, 0.07);
}

.case-item.is-active {
  background: #f1faf5;
  border-color: #61b78a;
  box-shadow: inset 3px 0 var(--green);
}

.case-item__top,
.case-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.case-item__code {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.case-item__status {
  color: var(--amber);
  font-size: 0.65rem;
  font-weight: 800;
}

.case-item__status.is-complete {
  color: var(--green);
}

.case-item > strong {
  margin-top: 3px;
  font-size: 0.9rem;
}

.case-item > small {
  color: var(--muted);
  font-size: 0.72rem;
}

.case-item__progress {
  overflow: hidden;
  height: 3px;
  margin-top: 6px;
  background: #e4eae7;
  border-radius: 99px;
}

.case-item__progress i {
  display: block;
  height: 100%;
  background: var(--green);
  transition: width 220ms ease-out;
}

.case-item__footer {
  color: var(--faint);
  font-size: 0.64rem;
}

.case-item__footer b {
  padding: 3px 6px;
  color: var(--muted);
  background: #edf1ef;
  border-radius: 4px;
  font-size: 0.58rem;
  text-transform: uppercase;
}

.sidebar-note {
  display: flex;
  gap: 9px;
  margin-top: auto;
  padding: 14px 8px 2px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.sidebar-note__dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 5px;
  background: var(--green);
  border-radius: 50%;
}

.sidebar-note strong {
  display: block;
  color: var(--text);
}

.case-workspace {
  min-width: 0;
  padding: 22px 24px 28px;
  overflow: auto;
}

.case-header {
  display: flex;
  max-width: 1500px;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin: 0 auto 18px;
}

.case-header__meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.status-pill {
  padding: 3px 7px;
  color: var(--amber);
  background: var(--amber-bg);
  border-radius: 99px;
  font-size: 0.62rem;
  font-weight: 800;
}

.status-pill.is-complete {
  color: var(--green-dark);
  background: var(--green-light);
}

.case-header h2 {
  margin-bottom: 3px;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  letter-spacing: -0.035em;
}

.case-header__main > p {
  color: var(--muted);
  font-size: 0.78rem;
}

.owner-card {
  display: flex;
  flex: 0 0 auto;
  gap: 0;
  padding: 9px 0;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.owner-card > div {
  display: grid;
  gap: 3px;
  min-width: 108px;
  padding: 0 14px;
  border-right: 1px solid var(--line);
}

.owner-card > div:last-child {
  min-width: 75px;
  border-right: 0;
}

.owner-card span {
  color: var(--faint);
  font-size: 0.6rem;
}

.owner-card strong {
  font-size: 0.7rem;
}

.process-steps {
  display: grid;
  max-width: 1500px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 auto 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(27, 52, 40, 0.03);
}

.process-step {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  text-align: left;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  transition: background 180ms ease-out;
}

.process-step:last-child {
  border-right: 0;
}

.process-step:hover:not(:disabled) {
  background: var(--surface-soft);
}

.process-step.is-active {
  background: var(--surface-green);
}

.process-step.is-active::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 3px;
  content: "";
  background: var(--green);
  border-radius: 3px 3px 0 0;
}

.process-step:disabled {
  color: #9ca7a2;
  cursor: not-allowed;
}

.process-step__index {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--muted);
  background: #edf2ef;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 900;
}

.process-step.is-active .process-step__index {
  color: white;
  background: var(--green);
}

.process-step.is-complete .process-step__index {
  color: var(--green-dark);
  background: var(--green-light);
}

.process-step > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.process-step strong {
  font-size: 0.75rem;
}

.process-step small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-grid {
  display: grid;
  max-width: 1500px;
  grid-template-columns: minmax(270px, 0.88fr) minmax(390px, 1.2fr) minmax(250px, 0.72fr);
  align-items: start;
  gap: 16px;
  margin: 0 auto;
}

.artifact-panel,
.copilot-panel,
.memory-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.artifact-panel,
.memory-panel {
  overflow: hidden;
}

.panel-header,
.memory-header,
.copilot-header {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3,
.memory-header h3,
.copilot-header h3 {
  font-size: 0.91rem;
  letter-spacing: -0.015em;
}

.artifact-state,
.memory-count,
.agent-scope {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.61rem;
  font-weight: 800;
}

.artifact-content {
  padding: 18px;
}

.artifact-intro {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.artifact-message {
  margin-bottom: 16px;
  padding: 14px;
  color: #22332b;
  background: #f5f7f6;
  border: 1px solid var(--line);
  border-left: 3px solid #8fa79b;
  border-radius: 8px;
  font-size: 0.76rem;
  line-height: 1.55;
}

.artifact-rows {
  border-top: 1px solid var(--line);
}

.artifact-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(120px, 1.2fr);
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #edf1ef;
}

.artifact-row dt {
  color: var(--muted);
  font-size: 0.68rem;
}

.artifact-row dd {
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
}

.artifact-row.has-gap dd {
  color: var(--red);
}

.artifact-note {
  display: flex;
  gap: 9px;
  margin-top: 16px;
  padding: 11px;
  color: #675330;
  background: var(--amber-bg);
  border-radius: 8px;
  font-size: 0.67rem;
  line-height: 1.45;
}

.artifact-note > span {
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  place-items: center;
  color: white;
  background: #c17b22;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 0.67rem;
  font-weight: 900;
}

.copilot-panel {
  display: flex;
  min-height: 600px;
  flex-direction: column;
  overflow: hidden;
}

.copilot-header {
  justify-content: flex-start;
  background: #fbfcfb;
}

.agent-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  background: var(--green-dark);
  border-radius: 11px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.copilot-header > div {
  min-width: 0;
  margin-right: auto;
}

.agent-presence {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  color: var(--green);
  font-size: 0.6rem;
  font-weight: 800;
}

.agent-presence span {
  width: 6px;
  height: 6px;
  background: #20bd70;
  border-radius: 50%;
}

.conversation {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: #f7f9f8;
}

.message {
  max-width: 94%;
  padding: 14px 15px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px;
  box-shadow: 0 3px 9px rgba(31, 55, 43, 0.04);
}

.message--human {
  align-self: flex-end;
  color: white;
  background: var(--green-dark);
  border-color: var(--green-dark);
  border-radius: 12px 12px 4px 12px;
}

.message--compact {
  padding-block: 12px;
}

.message--system {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--green-dark);
  background: var(--green-light);
  border-color: #bde5ce;
  border-radius: 8px;
  box-shadow: none;
}

.message--system > span {
  padding: 3px 6px;
  color: white;
  background: var(--green);
  border-radius: 4px;
  font-size: 0.56rem;
  font-weight: 900;
  text-transform: uppercase;
}

.message--system p {
  font-size: 0.68rem;
  font-weight: 700;
}

.message__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--faint);
  font-size: 0.6rem;
}

.message--human .message__meta {
  color: #bad5c8;
}

.message__meta strong {
  color: var(--text);
  font-size: 0.65rem;
}

.message--human .message__meta strong {
  color: white;
}

.message__tag {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 7px;
  color: var(--amber);
  background: var(--amber-bg);
  border-radius: 5px;
  font-size: 0.58rem;
  font-weight: 800;
}

.message__tag.is-applied {
  color: var(--green-dark);
  background: var(--green-light);
}

.message h4 {
  margin-bottom: 6px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.message p {
  font-size: 0.72rem;
  line-height: 1.5;
}

.check-list {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 11px 0 0;
  border-top: 1px solid #edf1ef;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.35;
}

.check-list li > span {
  display: grid;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  font-size: 0.58rem;
  font-weight: 900;
}

.check-list .is-pass > span {
  color: var(--green-dark);
  background: var(--green-light);
}

.check-list .is-miss > span {
  color: var(--red);
  background: var(--red-bg);
}

.interaction-area {
  padding: 15px 18px 18px;
  background: white;
  border-top: 1px solid var(--line);
}

.comment-form label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.7rem;
  font-weight: 800;
}

.comment-form textarea,
.rule-dialog input,
.rule-dialog textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--text);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  resize: vertical;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.comment-form textarea {
  min-height: 86px;
  font-size: 0.7rem;
  line-height: 1.45;
}

.comment-form textarea:focus,
.rule-dialog input:focus,
.rule-dialog textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(7, 136, 76, 0.1);
}

.comment-form textarea[aria-invalid="true"] {
  border-color: var(--red);
}

.comment-form__footer,
.rule-proposal__actions,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.comment-form__footer > span {
  max-width: 54%;
  color: var(--faint);
  font-size: 0.59rem;
  line-height: 1.35;
}

.field-error {
  min-height: 16px;
  margin-top: 6px;
  color: var(--red);
  font-size: 0.62rem;
}

.button {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  transition: background 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out, box-shadow 180ms ease-out;
}

.button--primary {
  color: white;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 4px 10px rgba(7, 136, 76, 0.18);
}

.button--primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.button--secondary {
  color: var(--text);
  background: white;
  border-color: var(--line-strong);
}

.button--secondary:hover {
  background: var(--surface-soft);
  border-color: #9eb2a7;
}

.rule-proposal {
  padding: 14px;
  background: #f1f8f4;
  border: 1px solid #bde2cc;
  border-radius: 10px;
}

.rule-proposal__heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.rule-proposal__icon {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  color: white;
  background: var(--green-dark);
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 900;
}

.rule-proposal__heading > div {
  display: grid;
  flex: 1;
  gap: 2px;
}

.rule-proposal__heading small {
  color: var(--green-dark);
  font-size: 0.57rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rule-proposal__heading strong {
  font-size: 0.73rem;
}

.rule-key {
  display: inline-flex;
  padding: 4px 6px;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 0.58rem;
  font-weight: 800;
}

.rule-proposal > p {
  margin-top: 10px;
  color: #385148;
  font-size: 0.67rem;
  line-height: 1.48;
}

.rule-proposal__actions {
  justify-content: flex-end;
  padding-top: 11px;
  border-top: 1px solid #cee7d8;
}

.confirm-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.confirm-action > div {
  display: grid;
  gap: 3px;
}

.confirm-action span {
  color: var(--green-dark);
  font-size: 0.65rem;
  font-weight: 800;
}

.confirm-action p {
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.35;
}

.confirm-action .button {
  flex: 0 0 auto;
}

.completed-stage-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--green-light);
  border-radius: 8px;
}

.completed-stage-note span {
  color: var(--green-dark);
  font-size: 0.66rem;
  font-weight: 900;
}

.completed-stage-note p {
  color: var(--muted);
  font-size: 0.63rem;
}

.completion-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  background: var(--green-light);
  border: 1px solid #b9dfc9;
  border-radius: 10px;
}

.completion-card__mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 50%;
  font-weight: 900;
}

.completion-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.72rem;
}

.completion-card p {
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.35;
}

.memory-panel {
  min-height: 455px;
}

.memory-content {
  padding: 15px;
}

.memory-empty {
  display: grid;
  justify-items: center;
  padding: 30px 14px;
  text-align: center;
}

.memory-empty > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  margin-bottom: 12px;
  color: #7c8d85;
  background: #edf2ef;
  border: 1px dashed #aebcb5;
  border-radius: 11px;
  font-size: 0.78rem;
  font-weight: 900;
}

.memory-empty strong {
  margin-bottom: 6px;
  font-size: 0.74rem;
}

.memory-empty p {
  max-width: 190px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.45;
}

.memory-rule {
  padding: 13px;
  background: #f3faf6;
  border: 1px solid #c4e4d2;
  border-radius: 10px;
}

.memory-rule.is-candidate {
  background: var(--amber-bg);
  border-color: #efd6b3;
}

.memory-rule__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.memory-rule__status {
  color: var(--green-dark);
  font-size: 0.57rem;
  font-weight: 800;
}

.memory-rule.is-candidate .memory-rule__status {
  color: var(--amber);
}

.memory-rule h4 {
  margin-bottom: 6px;
  font-size: 0.73rem;
  line-height: 1.35;
}

.memory-rule > p {
  color: #496057;
  font-size: 0.64rem;
  line-height: 1.48;
}

.memory-rule__source {
  margin-top: 11px;
  padding-top: 9px;
  color: var(--muted);
  border-top: 1px solid #d7e9df;
  font-size: 0.58rem;
  line-height: 1.4;
}

.memory-rule__source span {
  display: block;
  margin-bottom: 2px;
  color: var(--faint);
  text-transform: uppercase;
}

.activity-block {
  padding: 2px 17px 17px;
}

.activity-block__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0 11px;
  border-top: 1px solid var(--line);
}

.activity-block__heading strong {
  font-size: 0.68rem;
}

.activity-block__heading span {
  color: var(--faint);
  font-size: 0.57rem;
}

.activity-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  position: relative;
  display: flex;
  gap: 9px;
  min-height: 43px;
}

.activity-list li::before {
  position: absolute;
  top: 13px;
  bottom: -2px;
  left: 4px;
  width: 1px;
  content: "";
  background: var(--line);
}

.activity-list li:last-child::before {
  display: none;
}

.activity-list li > span {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 3px;
  background: #c7d1cc;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #c7d1cc;
}

.activity-list li.is-current > span {
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.activity-list li > div {
  display: grid;
  align-content: start;
  gap: 2px;
}

.activity-list strong {
  font-size: 0.61rem;
  font-weight: 700;
  line-height: 1.35;
}

.activity-list small {
  color: var(--faint);
  font-size: 0.55rem;
}

.rule-dialog {
  width: min(540px, calc(100vw - 32px));
  padding: 0;
  background: white;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(11, 35, 24, 0.28);
}

.rule-dialog::backdrop {
  background: rgba(12, 32, 23, 0.52);
  backdrop-filter: blur(2px);
}

.rule-dialog form {
  display: grid;
  gap: 7px;
  padding: 22px;
}

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dialog-heading h2 {
  font-size: 1.15rem;
}

.dialog-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1.15rem;
}

.rule-dialog label {
  margin-top: 6px;
  font-size: 0.68rem;
  font-weight: 800;
}

.rule-dialog input,
.rule-dialog textarea {
  font-size: 0.72rem;
  line-height: 1.45;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 12px 16px;
  color: white;
  background: #143c2b;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  box-shadow: 0 14px 40px rgba(8, 33, 21, 0.25);
  font-size: 0.69rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1260px) {
  .app-layout {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .case-workspace {
    padding-inline: 18px;
  }

  .work-grid {
    grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.1fr);
  }

  .memory-panel {
    display: grid;
    min-height: 0;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .memory-header {
    grid-column: 1 / -1;
  }

  .activity-block {
    padding-top: 13px;
    border-left: 1px solid var(--line);
  }

  .activity-block__heading {
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 960px) {
  .topbar {
    padding-inline: 18px;
  }

  .user-chip > div,
  .owner-card {
    display: none;
  }

  .app-layout {
    display: block;
  }

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

  .sidebar-heading {
    align-items: center;
    padding-bottom: 10px;
  }

  .sidebar-heading p,
  .sidebar-note {
    display: none;
  }

  .sidebar-heading h1 {
    font-size: 1rem;
  }

  .case-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-bottom: 16px;
  }

  .case-item {
    padding: 12px;
  }

  .process-step {
    padding-inline: 11px;
  }

  .process-step small {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: 60px;
    padding-inline: 12px;
  }

  .brand__mark {
    width: 32px;
    height: 32px;
  }

  .brand small,
  .demo-badge,
  .user-chip,
  .text-button {
    display: none;
  }

  .app-layout {
    min-height: calc(100vh - 60px);
  }

  .case-sidebar {
    padding-inline: 12px;
  }

  .case-list {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .case-item {
    flex: 0 0 82vw;
    scroll-snap-align: start;
  }

  .case-workspace {
    padding: 16px 12px 24px;
    overflow: visible;
  }

  .case-header {
    margin-bottom: 14px;
  }

  .case-header h2 {
    font-size: 1.35rem;
  }

  .case-header__main > p {
    max-width: 330px;
    font-size: 0.7rem;
    line-height: 1.4;
  }

  .process-steps {
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(132px, 1fr));
    scroll-snap-type: x proximity;
  }

  .process-step {
    scroll-snap-align: start;
  }

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

  .copilot-panel {
    min-height: 0;
  }

  .memory-panel {
    display: block;
    grid-column: auto;
  }

  .activity-block {
    border-left: 0;
  }

  .activity-block__heading {
    padding-top: 13px;
    border-top: 1px solid var(--line);
  }

  .comment-form__footer,
  .confirm-action,
  .completion-card {
    align-items: stretch;
    flex-direction: column;
  }

  .comment-form__footer > span {
    max-width: none;
  }

  .comment-form__footer .button,
  .confirm-action .button {
    width: 100%;
  }

  .completion-card {
    display: flex;
  }

  .completion-card__mark {
    flex: 0 0 auto;
  }

  .rule-proposal__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

@media (max-width: 410px) {
  .panel-header,
  .memory-header,
  .copilot-header {
    padding-inline: 14px;
  }

  .artifact-content,
  .conversation,
  .interaction-area {
    padding-inline: 14px;
  }

  .agent-scope {
    display: none;
  }

  .artifact-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .message {
    max-width: 100%;
  }
}

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