:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f7fb;
  color: #152033;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 32px;
  background: #ffffff;
  border-bottom: 1px solid #dfe5ef;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 { margin: 0; font-size: 24px; }
.topbar p { margin: 4px 0 0; color: #667085; }

main { padding: 24px; }

.card {
  background: #ffffff;
  border: 1px solid #dfe5ef;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.narrow {
  max-width: 420px;
  margin: 60px auto;
}

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

.sidebar {
  position: sticky;
  top: 105px;
  max-height: calc(100vh - 130px);
  overflow: auto;
}

.editor { min-width: 0; }

label {
  display: block;
  font-weight: 700;
  margin: 14px 0 6px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #ffffff;
}

textarea {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  resize: vertical;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 700;
}

button:hover { filter: brightness(0.95); }
button.secondary { background: #475569; }
button.success { background: #15803d; }
button.warning { background: #b45309; }
button.danger { background: #b91c1c; }

.hidden { display: none !important; }

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

.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid {
  display: grid;
  gap: 14px;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }

.case-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.case-item {
  border: 1px solid #dfe5ef;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  background: #f8fafc;
}

.case-item:hover { background: #eef4ff; }
.case-item.active { outline: 2px solid #1d4ed8; background: #eef4ff; }
.case-item h4 { margin: 0 0 6px; }
.case-item p { margin: 0; color: #667085; font-size: 13px; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  margin-top: 8px;
}

.muted { color: #667085; }
.msg { min-height: 22px; color: #b45309; }
.section-title { margin-top: 20px; }

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .grid.two { grid-template-columns: 1fr; }
  .span2 { grid-column: span 1; }
}
