:root {
  --bg: #0c0e0d;
  --surface: #141715;
  --surface-2: #1a1e1b;
  --surface-3: #202520;
  --line: #30372f;
  --line-soft: #222722;
  --text: #f2f0e7;
  --muted: #a8ada5;
  --dim: #6f766f;
  --lime: #c9ff62;
  --lime-dark: #27351b;
  --orange: #ff8a4c;
  --blue: #81a9ff;
  --red: #ff6e6e;
  --lane-color-1: #c9ff62;
  --lane-color-2: #ff8a4c;
  --lane-color-3: #81a9ff;
  --lane-color-4: #c594ff;
  --lane-color-5: #56d6bd;
  --lane-color-6: #ffd166;
  --radius: 14px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% 8%, rgba(201, 255, 98, 0.08), transparent 25rem),
    var(--bg);
}

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

button {
  color: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.025;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.18) 4px),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(255, 255, 255, 0.12) 6px);
}

[hidden] {
  display: none !important;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--lime);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow .lucide {
  width: 14px;
  height: 14px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  position: relative;
  width: min(100%, 560px);
  padding: 54px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(24, 28, 25, 0.98), rgba(14, 16, 15, 0.98));
  box-shadow: var(--shadow);
}

.login-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -84px;
  top: -76px;
  border: 32px solid var(--lime);
  border-radius: 50%;
  opacity: 0.75;
}

.login-card h1 {
  max-width: 450px;
  margin: 20px 0 18px;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.login-intro {
  max-width: 430px;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.75;
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-form label:not(.remember-row) {
  display: grid;
  gap: 8px;
}

.login-form label > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  padding: 13px 15px;
  color: var(--text);
  background: #0f1210;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.login-form input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(201, 255, 98, 0.1);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
}

.remember-row input {
  width: 16px;
  accent-color: var(--lime);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
  border: 0;
  border-radius: 10px;
  padding: 14px 18px;
  color: #10130d;
  background: var(--lime);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 150ms ease,
    filter 150ms ease;
}

.primary-button .lucide {
  width: 17px;
  height: 17px;
}

.primary-button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  filter: grayscale(0.5);
  opacity: 0.7;
}

.form-error {
  min-height: 1.3em;
  margin: 0;
  color: var(--red);
  font-size: 0.82rem;
}

.login-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-foot span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.login-foot .lucide {
  width: 14px;
  height: 14px;
  color: var(--lime);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 18px;
  border-right: 1px solid var(--line-soft);
  background: rgba(13, 15, 14, 0.94);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 28px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #10130d;
  background: var(--lime);
}

.brand-mark .lucide {
  width: 21px;
  height: 21px;
  stroke-width: 2.1;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 0.95rem;
}

.brand span {
  margin-top: 3px;
  color: var(--dim);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  border: 0;
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    color 140ms ease,
    background 140ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-item.active {
  color: var(--text);
  background: var(--surface-2);
}

.nav-icon {
  width: 16px;
  height: 16px;
  color: var(--dim);
}

.nav-item.active .nav-icon {
  color: var(--lime);
}

.sidebar-foot {
  margin-top: auto;
  padding: 18px 8px 0;
  border-top: 1px solid var(--line-soft);
}

.relay-state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.relay-icon {
  width: 16px;
  height: 16px;
  color: var(--lime);
}

.relay-state strong,
.relay-state span {
  display: block;
}

.relay-state strong {
  font-size: 0.77rem;
}

.relay-state span {
  margin-top: 3px;
  color: var(--dim);
  font-size: 0.7rem;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 0;
  color: var(--dim);
  background: none;
  font-size: 0.72rem;
  cursor: pointer;
}

.text-button .lucide {
  width: 14px;
  height: 14px;
}

.text-button:hover {
  color: var(--text);
}

.main {
  min-width: 0;
  padding: 0 clamp(24px, 5vw, 72px) 64px;
}

.topbar {
  min-height: 136px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.topbar h1 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 3.5vw, 3.2rem);
  letter-spacing: -0.045em;
}

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

.updated-label {
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.67rem;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--lime);
  border-color: #58644e;
}

.content {
  padding-top: 32px;
}

.loading-state {
  padding-top: 32px;
}

.loading-line,
.loading-grid > div {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}

.loading-line::after,
.loading-grid > div::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  animation: shimmer 1.2s infinite;
}

.loading-line {
  width: 70%;
  height: 140px;
}

.loading-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.loading-grid > div {
  height: 110px;
}

@keyframes shimmer {
  from {
    transform: translateX(-140%);
  }
  to {
    transform: translateX(350%);
  }
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.55fr);
  gap: 24px;
  min-height: 290px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(26px, 4vw, 48px);
  background:
    linear-gradient(120deg, rgba(201, 255, 98, 0.06), transparent 38%),
    var(--surface);
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: -80px;
  bottom: -110px;
  border: 44px solid rgba(201, 255, 98, 0.68);
  border-radius: 50%;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h2 {
  max-width: 760px;
  margin: 17px 0 20px;
  font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero-copy p {
  max-width: 740px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.hero-meta {
  position: relative;
  z-index: 1;
  align-self: end;
  display: grid;
  gap: 14px;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.meta-row span,
.meta-row strong {
  display: block;
}

.meta-row span {
  color: var(--dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.meta-row strong {
  margin-top: 5px;
  font-size: 0.9rem;
}

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

.stat-card {
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
}

.stat-card span {
  color: var(--dim);
  font-size: 0.72rem;
}

.stat-card strong {
  font-size: 2rem;
  letter-spacing: -0.06em;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.5fr);
  gap: 14px;
  margin-top: 14px;
}

.recent-panel {
  margin-top: 14px;
}

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

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 1rem;
}

.panel-label {
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.65rem;
}

.focus-list,
.requirement-list {
  display: grid;
  gap: 10px;
}

.focus-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 13px;
  align-items: start;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.focus-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.focus-number {
  color: var(--lime);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
}

.focus-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.deadline-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-color: #46533b;
  background: var(--lime-dark);
}

.deadline-card .eyebrow {
  color: var(--lime);
}

.deadline-date {
  margin: 26px 0 8px;
  font-size: clamp(2.7rem, 6vw, 4.8rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.deadline-card p {
  margin: 0;
  color: #bac7ae;
  line-height: 1.65;
}

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

.markdown-panel {
  max-width: 980px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 46px);
  background: var(--surface);
}

.markdown {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.78;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
  color: var(--text);
  letter-spacing: -0.025em;
  scroll-margin-top: 24px;
}

.markdown h1 {
  margin: 0 0 26px;
  font-size: 2rem;
}

.markdown h2 {
  margin: 42px 0 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 1.35rem;
}

.markdown h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.markdown h3 {
  margin: 27px 0 10px;
  color: var(--lime);
  font-size: 1rem;
}

.markdown h4 {
  margin: 20px 0 8px;
  font-size: 0.92rem;
}

.markdown p {
  margin: 0 0 15px;
}

.markdown ul,
.markdown ol {
  margin: 0 0 18px;
  padding-left: 1.4rem;
}

.markdown li {
  margin: 6px 0;
}

.markdown strong {
  color: var(--text);
}

.markdown code {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--lime);
  background: #101310;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.86em;
}

.markdown blockquote {
  margin: 18px 0;
  border-left: 3px solid var(--lime);
  padding: 10px 16px;
  color: var(--text);
  background: rgba(201, 255, 98, 0.04);
}

.history-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.history-sidebar {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}

.history-sidebar h2 {
  margin: 8px 9px 12px;
  font-size: 0.86rem;
}

.history-item {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.history-item:hover,
.history-item.active {
  color: var(--text);
  background: var(--surface-3);
}

.history-item span {
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
}

.history-item strong {
  font-size: 0.78rem;
  font-weight: 600;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.search-input,
.select-input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: var(--text);
  background: var(--surface);
}

.search-input {
  flex: 1;
  padding: 0 13px;
}

.select-input {
  padding: 0 30px 0 12px;
}

.search-input:focus,
.select-input:focus {
  border-color: #637454;
}

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

.term-card {
  display: grid;
  grid-template-columns: minmax(120px, 0.34fr) minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: 18px;
  background: var(--surface);
}

.term-name {
  margin: 0 0 7px;
  font-size: 1rem;
}

.term-domain {
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.64rem;
  text-transform: uppercase;
}

.term-definition {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.65;
}

.term-alias {
  margin-top: 9px;
  color: var(--dim);
  font-size: 0.73rem;
  line-height: 1.55;
}

.confirmed-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #475c35;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--lime);
  background: rgba(201, 255, 98, 0.05);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.registration-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.registration-summary > div {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 17px;
  background: var(--surface);
}

.registration-summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dim);
  font-size: 0.72rem;
}

.registration-summary span .lucide {
  width: 15px;
  height: 15px;
}

.registration-summary strong {
  font-size: 1.8rem;
  letter-spacing: -0.05em;
}

.registration-intro {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1fr);
  gap: 30px;
  align-items: end;
  margin-bottom: 14px;
}

.registration-intro h2 {
  max-width: 520px;
  margin: 10px 0 0;
  font-size: 1.45rem;
  letter-spacing: -0.035em;
}

.registration-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.registration-message {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 0.84rem;
}

.registration-message.success {
  border-color: #475c35;
  color: var(--lime);
  background: rgba(201, 255, 98, 0.05);
}

.registration-message.error {
  border-color: #613d3d;
  color: #ffd0d0;
  background: #251717;
}

.registration-list {
  display: grid;
  gap: 14px;
}

.registration-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px);
  background: var(--surface);
}

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

.registration-card-head h2 {
  margin: 9px 0 5px;
  font-size: 1.25rem;
}

.registration-card-head p {
  margin: 0;
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
}

.registration-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.registration-status .lucide {
  width: 14px;
  height: 14px;
}

.registration-status.status-pending {
  border-color: #6f6137;
  color: #ffd166;
}

.registration-status.status-changes_requested {
  border-color: #70492f;
  color: var(--orange);
}

.registration-status.status-approved,
.registration-status.status-accepted {
  border-color: #475c35;
  color: var(--lime);
}

.registration-status.status-rejected {
  border-color: #613d3d;
  color: var(--red);
}

.registration-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 18px 0;
  color: var(--dim);
  font-size: 0.72rem;
}

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

.registration-field {
  display: grid;
  align-content: start;
  gap: 7px;
}

.registration-field > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.77rem;
}

.registration-field > span .lucide {
  width: 14px;
  height: 14px;
  color: var(--blue);
}

.registration-field input,
.registration-field textarea,
.registration-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  padding: 11px 12px;
  color: var(--text);
  background: #0f1210;
  resize: vertical;
}

.registration-field input:focus,
.registration-field textarea:focus,
.registration-field select:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(201, 255, 98, 0.08);
}

.registration-field input[readonly] {
  border-style: dashed;
  color: var(--blue);
  cursor: not-allowed;
}

.registration-field input:disabled,
.registration-field textarea:disabled,
.registration-field select:disabled {
  color: var(--dim);
  opacity: 0.78;
}

.registration-field small {
  color: var(--dim);
  font-size: 0.68rem;
  line-height: 1.5;
}

.registration-note-field {
  grid-column: 1 / -1;
}

.registration-request-note {
  margin-top: 16px;
  border-left: 2px solid var(--blue);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.registration-request-note p {
  margin: 5px 0 0;
  line-height: 1.6;
}

.registration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.decision-button,
.suggestion-decision-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 15px;
  background: var(--surface-3);
  cursor: pointer;
}

.decision-button .lucide,
.suggestion-decision-button .lucide {
  width: 15px;
  height: 15px;
}

.decision-button:hover,
.suggestion-decision-button:hover {
  filter: brightness(1.13);
}

.suggestion-decision-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.decision-approve {
  border-color: #5a733e;
  color: #10130d;
  background: var(--lime);
  font-weight: 750;
}

.decision-change {
  border-color: #70492f;
  color: var(--orange);
}

.decision-reject {
  border-color: #613d3d;
  color: var(--red);
}

.registration-final {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.78rem;
}

.registration-final strong {
  color: var(--text);
}

.suggestion-intro strong {
  color: var(--orange);
}

.suggestion-proposal,
.suggestion-rationale {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 16px;
  background: #0f1210;
}

.suggestion-proposal > span,
.suggestion-rationale > strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.suggestion-proposal .lucide {
  width: 15px;
  height: 15px;
}

.suggestion-proposal p,
.suggestion-rationale p {
  margin: 10px 0 0;
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.suggestion-rationale {
  margin-top: 10px;
}

.suggestion-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.suggestion-detail-block {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface-2);
}

.suggestion-detail-block header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.suggestion-detail-block header span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.suggestion-detail-block header .lucide {
  width: 14px;
  height: 14px;
  color: var(--lime);
}

.suggestion-detail-block header strong {
  color: var(--dim);
  font-size: 0.7rem;
}

.suggestion-detail-block ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.suggestion-detail-block li,
.suggestion-detail-block > p {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.suggestion-detail-block li p,
.suggestion-detail-block > p {
  margin: 0;
}

.suggestion-detail-block pre {
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.suggestion-review-history {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

.suggestion-review-history summary {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
}

.suggestion-review-history summary .lucide {
  width: 14px;
  height: 14px;
}

.suggestion-review-history ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.suggestion-review-history li {
  padding: 9px 11px;
  color: var(--muted);
  background: var(--surface-2);
}

.suggestion-review-history li > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.72rem;
}

.suggestion-review-history li p {
  margin: 7px 0;
  line-height: 1.5;
}

.suggestion-review-history li small {
  color: var(--dim);
}

.suggestion-review-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.suggestion-review-form .registration-actions {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}

.suggestion-final strong {
  max-width: 780px;
}

.council-status-stack {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.review-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #3f5868;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--blue);
  background: rgba(142, 211, 255, 0.04);
  font-size: 0.64rem;
  white-space: nowrap;
}

.review-state-badge .lucide {
  width: 13px;
  height: 13px;
}

.review-state-badge.review-awaiting_human {
  border-color: #70492f;
  color: var(--orange);
}

.review-state-badge.review-ready_for_decision {
  border-color: #6f6137;
  color: #ffd166;
}

.review-state-badge.review-closed {
  border-color: var(--line);
  color: var(--dim);
}

.agent-review-panel {
  margin-top: 14px;
  border: 1px solid #3f5868;
  border-radius: 12px;
  padding: 16px;
  background: rgba(142, 211, 255, 0.035);
}

.agent-review-panel > header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--blue);
  font-size: 0.76rem;
}

.agent-review-panel > header span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.agent-review-panel > header .lucide {
  width: 15px;
  height: 15px;
}

.agent-review-panel > header strong {
  color: var(--text);
  font-size: 0.7rem;
}

.agent-review-panel > p,
.agent-review-panel details p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.agent-review-panel details {
  margin-top: 12px;
  color: var(--dim);
  font-size: 0.75rem;
}

.agent-review-panel details summary {
  cursor: pointer;
}

.agent-review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.agent-review-grid .suggestion-detail-block {
  background: rgba(12, 15, 13, 0.62);
}

.council-thread {
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 15px;
  background: #0f1210;
}

.council-thread > header {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.75rem;
}

.council-thread > header .lucide {
  width: 15px;
  height: 15px;
  color: var(--lime);
}

.council-thread > header span {
  margin-left: auto;
  color: var(--dim);
  font-size: 0.68rem;
}

.council-thread ol {
  display: grid;
  gap: 9px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.thread-message {
  max-width: 88%;
  border: 1px solid var(--line-soft);
  border-radius: 10px 10px 10px 3px;
  padding: 11px 13px;
  background: var(--surface-2);
}

.thread-message.thread-human {
  justify-self: end;
  border-color: #4c5d34;
  border-radius: 10px 10px 3px 10px;
  background: rgba(201, 255, 98, 0.045);
}

.thread-message.thread-agent {
  border-color: #3f5868;
  background: rgba(142, 211, 255, 0.04);
}

.thread-author {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--dim);
  font-size: 0.67rem;
}

.thread-author span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.thread-author .lucide {
  width: 13px;
  height: 13px;
}

.thread-message p {
  margin: 8px 0;
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.thread-message small {
  color: var(--dim);
  font-size: 0.62rem;
}

.council-reply-form,
.mail-follow-up {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.suggestion-message-button,
.mail-follow-up-button,
.mail-send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border: 1px solid #526f39;
  border-radius: 9px;
  padding: 10px 15px;
  color: #10130d;
  background: var(--lime);
  font-weight: 750;
  cursor: pointer;
}

.suggestion-message-button .lucide,
.mail-follow-up-button .lucide,
.mail-send-button .lucide {
  width: 15px;
  height: 15px;
}

.suggestion-message-button:disabled,
.mail-follow-up-button:disabled,
.mail-send-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.mailbox-compose {
  margin-bottom: 14px;
}

.mailbox-compose > header {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 20px;
}

.mailbox-compose h2,
.council-section-head h2 {
  margin: 9px 0 0;
  font-size: 1.25rem;
}

.mailbox-compose > header p,
.council-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.mailbox-compose-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.7fr 1fr;
  gap: 12px;
}

.mailbox-subject-field,
.mailbox-content-field,
.mailbox-compose-actions {
  grid-column: 1 / -1;
}

.mailbox-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.mailbox-compose-actions > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 700px;
  color: var(--dim);
  font-size: 0.7rem;
  line-height: 1.5;
}

.mailbox-compose-actions > span .lucide {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--blue);
}

.council-section-head {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  margin: 24px 0 12px;
}

.council-proposal-head {
  margin-top: 34px;
}

.mailbox-card .council-thread {
  margin-top: 0;
}

.mail-status-queued {
  border-color: #6f6137;
  color: #ffd166;
}

.mail-status-claimed,
.mail-status-in_progress {
  border-color: #3f5868;
  color: var(--blue);
}

.mail-status-needs_input {
  border-color: #70492f;
  color: var(--orange);
}

.mail-status-completed {
  border-color: #475c35;
  color: var(--lime);
}

.mail-status-failed {
  border-color: #613d3d;
  color: var(--red);
}

.compact-empty {
  min-height: 210px;
}

.file-explorer {
  display: grid;
  grid-template-columns: minmax(270px, 0.34fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.file-browser-panel,
.file-preview-panel {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.file-browser-panel {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-browser-head,
.file-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
  padding: 18px;
}

.file-browser-head h2 {
  margin: 8px 0 0;
  font-size: 1rem;
}

.readonly-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #4a5e38;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--lime);
  background: rgba(201, 255, 98, 0.04);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.58rem;
  white-space: nowrap;
}

.readonly-badge .lucide {
  width: 12px;
  height: 12px;
}

.file-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 14px;
}

.file-breadcrumbs button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 2px;
  color: var(--blue);
  background: transparent;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  cursor: pointer;
  white-space: nowrap;
}

.file-breadcrumbs button .lucide,
.file-breadcrumb-separator {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.file-breadcrumbs button:hover {
  color: var(--text);
}

.file-breadcrumb-separator {
  color: var(--dim);
}

.file-entry-list {
  min-height: 260px;
  overflow: auto;
  padding: 8px;
}

.file-entry {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.file-entry:hover,
.file-entry.active {
  color: var(--text);
  background: var(--surface-3);
}

.file-entry.is-directory .file-type {
  color: var(--lime);
}

.file-type {
  display: grid;
  place-items: center;
  color: var(--blue);
}

.file-type .lucide {
  width: 17px;
  height: 17px;
}

.file-entry-name {
  min-width: 0;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-entry-meta {
  color: var(--dim);
  font-size: 0.62rem;
}

.file-list-message {
  padding: 28px 12px;
  color: var(--dim);
  font-size: 0.78rem;
  text-align: center;
}

.file-list-message.error {
  color: var(--red);
}

.file-preview-panel {
  min-height: 580px;
}

.file-preview-head {
  align-items: center;
}

.file-preview-head span,
.file-preview-head strong {
  display: block;
}

.file-preview-head span {
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

.file-preview-head strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
}

.file-preview-head small {
  color: var(--dim);
  white-space: nowrap;
}

.file-preview-body {
  min-width: 0;
  padding: clamp(18px, 3vw, 34px);
}

.file-preview-empty {
  min-height: 450px;
  display: grid;
  place-content: center;
  text-align: center;
}

.file-preview-empty span {
  color: var(--lime);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
}

.file-preview-empty h2 {
  margin: 12px 0 8px;
}

.file-preview-empty p {
  max-width: 440px;
  margin: 0;
  color: var(--dim);
  line-height: 1.65;
}

.file-markdown {
  max-width: 920px;
}

.file-code-preview {
  max-width: 100%;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 18px;
  color: #d9e6cf;
  background: #0e100f;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.event-list {
  display: grid;
}

.lane-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: -5px 0 14px;
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.65rem;
}

.lane-direction {
  color: var(--lime);
  white-space: nowrap;
}

.event-lane-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--line) transparent;
}

.event-lane-board {
  position: relative;
}

.lane-grid {
  display: grid;
}

.lane-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 74px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.lane-total-head,
.lane-node-head {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px 14px;
}

.lane-total-head {
  position: sticky;
  left: 0;
  z-index: 8;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.lane-total-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--lime);
  background: var(--surface-2);
  font-family: Georgia, serif;
  font-size: 1rem;
}

.lane-total-mark .lucide {
  width: 16px;
  height: 16px;
}

.lane-node-head {
  position: relative;
  border-left: 1px solid var(--line-soft);
}

.lane-node-head::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--lane-color);
  opacity: 0.72;
}

.lane-total-head strong,
.lane-total-head small,
.lane-node-head strong,
.lane-node-head small {
  display: block;
}

.lane-total-head strong,
.lane-node-head strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-total-head small,
.lane-node-head small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-node-shape,
.lane-origin,
.lane-card-anchor {
  display: inline-block;
  flex: 0 0 auto;
  border: 2px solid var(--surface);
  background: var(--lane-color);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--lane-color), transparent 45%);
}

.lane-node-shape {
  width: 15px;
  height: 15px;
}

.shape-circle {
  border-radius: 50%;
}

.shape-square {
  border-radius: 2px;
}

.shape-diamond {
  border-radius: 2px;
  transform: rotate(45deg) scale(0.82);
}

.shape-pill {
  width: 19px;
  border-radius: 999px;
}

.lane-row {
  position: relative;
  min-height: 142px;
  border-bottom: 1px solid var(--line-soft);
}

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

.lane-total-cell {
  position: sticky;
  left: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 26px 22px 1fr;
  align-items: start;
  gap: 5px;
  border-right: 1px solid var(--line);
  padding: 24px 12px;
  background: var(--surface);
}

.lane-order {
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.63rem;
}

.lane-origin {
  position: relative;
  z-index: 3;
  width: 11px;
  height: 11px;
  margin-top: 1px;
}

.lane-total-cell time {
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.59rem;
  line-height: 1.45;
}

.lane-connector {
  position: absolute;
  z-index: 1;
  top: 29px;
  left: 45px;
  width: calc(163px + (var(--target-lane) * var(--lane-width)));
  height: 1px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--lane-color), transparent 20%),
    color-mix(in srgb, var(--lane-color), transparent 58%)
  );
}

.lane-cell {
  position: relative;
  min-width: 0;
  border-left: 1px solid var(--line-soft);
  padding: 16px 16px 18px 34px;
}

.lane-cell::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 18px;
  width: 1px;
  background: var(--line-soft);
}

.lane-cell.has-event::before {
  background: color-mix(in srgb, var(--lane-color), transparent 58%);
}

.lane-event-card {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 108px;
  border: 1px solid color-mix(in srgb, var(--lane-color), transparent 68%);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--text);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--lane-color), transparent 92%), transparent 62%),
    #101310;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    transform 140ms ease,
    background 140ms ease;
}

.lane-event-card:hover,
.lane-event-card:focus-visible {
  border-color: color-mix(in srgb, var(--lane-color), transparent 28%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--lane-color), transparent 86%), transparent 68%),
    #121612;
  transform: translateY(-1px);
}

.lane-event-card:focus-visible {
  outline: 2px solid var(--lane-color);
  outline-offset: 2px;
}

.lane-card-anchor {
  position: absolute;
  top: 9px;
  left: -22px;
  width: 11px;
  height: 11px;
}

.lane-event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lane-event-meta time {
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.58rem;
}

.lane-event-card h3 {
  display: -webkit-box;
  margin: 11px 0 8px;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.lane-event-links {
  display: grid;
  gap: 4px;
  color: var(--dim);
  font-size: 0.62rem;
}

.lane-event-links span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-event-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  border-top: 1px solid var(--line-soft);
  padding-top: 9px;
  color: var(--lane-color);
  font-size: 0.66rem;
}

.lane-event-open .lucide {
  width: 13px;
  height: 13px;
}

.event-card {
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.event-rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.event-rail::after {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.event-card:last-child .event-rail::after {
  display: none;
}

.event-rail i {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 2px #4d5e3e;
}

.event-body {
  min-width: 0;
  padding: 0 0 26px;
}

.event-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.64rem;
}

.event-body h3 {
  margin: 10px 0 7px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.55;
}

.event-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--dim);
  font-size: 0.7rem;
}

.event-body details {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #101310;
}

.event-body summary {
  padding: 9px 11px;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
}

.event-body pre {
  max-height: 420px;
  margin: 0;
  overflow: auto;
  border-top: 1px solid var(--line-soft);
  padding: 13px;
  color: #bdc4ba;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-detail-dialog {
  width: min(920px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  color: var(--text);
  background: #0e110f;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72);
}

.event-detail-dialog::backdrop {
  background: rgba(2, 4, 3, 0.76);
  backdrop-filter: blur(5px);
}

.event-dialog-shell {
  max-height: calc(100dvh - 34px);
  display: flex;
  flex-direction: column;
}

.event-dialog-bar {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 18px;
  background: rgba(15, 18, 16, 0.96);
}

.event-dialog-bar span,
.event-dialog-bar strong {
  display: block;
}

.event-dialog-bar span {
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.56rem;
  letter-spacing: 0.12em;
}

.event-dialog-bar strong {
  margin-top: 4px;
  font-size: 0.76rem;
}

.event-dialog-bar form {
  margin: 0;
}

.event-dialog-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0;
  color: var(--muted);
  background: var(--surface-2);
  cursor: pointer;
}

.event-dialog-close:hover,
.event-dialog-close:focus-visible {
  border-color: var(--lime);
  color: var(--text);
}

.event-dialog-close .lucide {
  width: 17px;
  height: 17px;
}

.event-dialog-content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(18px, 4vw, 34px);
}

.event-detail-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--lane-color), transparent 64%);
  border-radius: 14px;
  padding: clamp(20px, 4vw, 32px);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--lane-color), transparent 89%), transparent 58%),
    var(--surface);
}

.event-detail-hero::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--lane-color);
}

.event-detail-type {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.6rem;
}

.event-detail-hero h2 {
  max-width: 760px;
  margin: 20px 0 18px;
  font-size: clamp(1.35rem, 4vw, 2.15rem);
  line-height: 1.24;
  letter-spacing: -0.035em;
}

.event-detail-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.74rem;
}

.event-detail-identity span,
.event-source-record span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.event-detail-identity .lucide,
.event-source-record .lucide {
  width: 14px;
  height: 14px;
  color: var(--lane-color, var(--lime));
}

.event-detail-hero > code {
  display: block;
  margin-top: 18px;
  overflow-wrap: anywhere;
  color: var(--dim);
  font-size: 0.65rem;
}

.event-association-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0;
}

.event-association-grid > div {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 13px;
  background: var(--surface);
}

.event-association-grid span,
.event-association-grid strong {
  display: block;
}

.event-association-grid span {
  color: var(--dim);
  font-size: 0.62rem;
}

.event-association-grid strong {
  margin-top: 7px;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.69rem;
}

.event-association-grid .is-empty strong {
  color: var(--dim);
  font-weight: 500;
}

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

.event-detail-section,
.event-source-record {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
}

.event-detail-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 13px 15px;
}

.event-detail-section > header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-detail-section h3 {
  margin: 0;
  font-size: 0.83rem;
}

.event-detail-section header .lucide {
  width: 15px;
  height: 15px;
  color: var(--lime);
}

.event-detail-section header > span {
  min-width: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.58rem;
  text-align: center;
}

.event-detail-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: event-item;
}

.event-detail-list > li {
  position: relative;
  padding: 14px 15px 14px 43px;
  counter-increment: event-item;
}

.event-detail-list > li + li {
  border-top: 1px solid var(--line-soft);
}

.event-detail-list > li::before {
  content: counter(event-item, decimal-leading-zero);
  position: absolute;
  top: 16px;
  left: 15px;
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.58rem;
}

.event-detail-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.65;
}

.event-fact-statement {
  color: var(--text) !important;
}

.event-fact-evidence {
  margin-top: 8px !important;
  color: var(--dim) !important;
  font-size: 0.69rem !important;
}

.event-fact-evidence strong {
  margin-right: 7px;
  color: var(--blue);
}

.event-item-fields,
.event-detail-fields {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.event-item-fields > div,
.event-detail-fields > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(90px, 0.28fr) minmax(0, 1fr);
  gap: 12px;
}

.event-item-fields dt,
.event-detail-fields dt {
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
}

.event-item-fields dd,
.event-detail-fields dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.73rem;
}

.event-item-fields pre,
.event-detail-fields pre {
  margin: 0;
  overflow: auto;
  color: #bdc4ba;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.66rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.event-section-empty {
  margin: 0;
  padding: 18px 15px;
  color: var(--dim);
  font-size: 0.73rem;
}

.event-specific-section {
  margin-top: 12px;
}

.event-detail-fields {
  margin: 0;
  padding: 15px;
}

.event-detail-fields > div + div {
  border-top: 1px solid var(--line-soft);
  padding-top: 9px;
}

.event-source-record {
  margin-top: 12px;
  padding: 15px;
}

.event-source-record > div {
  display: grid;
  gap: 8px;
}

.event-source-record span {
  color: var(--muted);
  font-size: 0.72rem;
}

.event-source-record code {
  overflow-wrap: anywhere;
  color: var(--blue);
  font-size: 0.67rem;
}

.event-source-record details {
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.event-source-record summary {
  padding-top: 13px;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
}

.event-source-record pre {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 13px;
  color: #bdc4ba;
  background: #0c0f0d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.66rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.event-null {
  color: var(--dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
}

.experiment-list {
  display: grid;
  gap: 9px;
}

.node-card,
.task-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
}

.node-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.node-head h2 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.node-head p,
.node-meta p {
  margin: 0;
  color: var(--dim);
  font-size: 0.74rem;
}

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

.node-meta div {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.node-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--dim);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.node-meta strong {
  font-size: 0.8rem;
  font-weight: 600;
}

.empty-state {
  display: grid;
  min-height: 320px;
  place-content: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
}

.empty-state span {
  color: var(--lime);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.67rem;
  letter-spacing: 0.12em;
}

.empty-state h2 {
  margin: 12px 0 8px;
}

.empty-state p {
  max-width: 440px;
  margin: 0;
  color: var(--dim);
  line-height: 1.6;
}

.error-panel {
  border: 1px solid #613d3d;
  border-radius: var(--radius);
  padding: 24px;
  color: #ffd0d0;
  background: #251717;
}

@media (max-width: 1000px) {
  .app-shell {
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky;
    z-index: 10;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    height: auto;
    display: block;
    overflow: hidden;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .brand {
    padding: 0 0 12px;
  }

  .nav-list {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    grid-template-columns: auto 1fr;
    gap: 7px;
  }

  .sidebar-foot {
    display: none;
  }

  .hero-panel,
  .section-grid,
  .history-layout,
  .registration-intro,
  .mailbox-compose > header,
  .council-section-head,
  .file-explorer {
    grid-template-columns: 1fr;
  }

  .mailbox-compose-grid,
  .agent-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-sidebar {
    position: static;
    max-height: none;
    display: flex;
    gap: 5px;
    overflow-x: auto;
  }

  .file-browser-panel {
    position: static;
    max-height: none;
  }

  .history-sidebar h2 {
    display: none;
  }

  .history-item {
    min-width: 145px;
  }
}

@media (max-width: 720px) {
  .login-card {
    padding: 34px 24px;
  }

  .login-foot {
    display: grid;
  }

  .main {
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    padding: 0 16px 44px;
    overflow-x: hidden;
  }

  .topbar {
    min-height: 112px;
  }

  .updated-label {
    display: none;
  }

  .hero-panel {
    padding: 25px;
  }

  .hero-copy h2 {
    font-size: 2.35rem;
  }

  .hero-meta {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 18px 0 0;
  }

  .stat-grid,
  .activity-grid,
  .registration-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .registration-form-grid {
    grid-template-columns: 1fr;
  }

  .suggestion-detail-grid {
    grid-template-columns: 1fr;
  }

  .mailbox-compose-grid,
  .agent-review-grid,
  .council-reply-form,
  .mail-follow-up {
    grid-template-columns: 1fr;
  }

  .mailbox-compose-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .mail-send-button,
  .mail-follow-up-button,
  .suggestion-message-button {
    width: 100%;
  }

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

  .registration-card-head,
  .registration-final {
    display: grid;
  }

  .registration-card {
    min-width: 0;
    overflow: hidden;
  }

  .registration-card-head p,
  .registration-meta span {
    overflow-wrap: anywhere;
  }

  .term-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .confirmed-badge {
    width: max-content;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .event-detail-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 13px;
  }

  .event-dialog-shell {
    max-height: calc(100dvh - 18px);
  }

  .event-association-grid,
  .event-schema-sections {
    grid-template-columns: 1fr;
  }

  .event-item-fields > div,
  .event-detail-fields > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .event-lane-scroll .lane-total-head,
  .event-lane-scroll .lane-total-cell {
    position: relative;
    left: auto;
  }
}

@media (max-width: 430px) {
  .stat-grid,
  .activity-grid,
  .registration-summary {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 1.7rem;
  }
}
