:root {
  --bg: #020617;
  --panel: rgba(15,23,42,.84);
  --soft: rgba(30,41,59,.7);
  --text: #e5f3ff;
  --muted: #94a3b8;
  --blue: #38bdf8;
  --green: #22c55e;
  --violet: #8b5cf6;
  --border: rgba(56,189,248,.2);
}

body[data-theme="day"] {
  --bg: #edf7ff;
  --panel: rgba(255,255,255,.9);
  --soft: rgba(255,255,255,.72);
  --text: #0f172a;
  --muted: #526173;
  --border: rgba(14,116,144,.22);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 70% 0%, rgba(56,189,248,.18), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

.encounter-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.rail {
  padding: 26px;
  border-right: 1px solid var(--border);
  background: rgba(2,6,23,.72);
}

.rail h1 {
  margin: 0;
  color: var(--blue);
}

.rail p {
  color: var(--muted);
  margin-bottom: 30px;
}

.rail button {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.rail button.active,
.rail button:hover {
  background: rgba(56,189,248,.14);
  border-color: var(--border);
}

.workspace {
  padding: 28px;
}

header,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h2 {
  margin: 0;
  font-size: 32px;
}

header p {
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 0 40px rgba(56,189,248,.08);
}

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

.grid.two {
  grid-template-columns: 1fr 1fr;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  box-sizing: border-box;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

button {
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(56,189,248,.2), rgba(139,92,246,.18));
  color: var(--text);
  cursor: pointer;
}

.template-sections {
  display: grid;
  gap: 14px;
}

.note-section {
  display: grid;
  gap: 8px;
}

.note-section label {
  color: var(--blue);
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(56,189,248,.12);
  color: var(--text);
  cursor: pointer;
}

.selected-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: var(--soft);
}

.billing-result {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.3);
}

.submit-panel {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.submit-panel button:last-child {
  background: linear-gradient(135deg, #0284c7, #0f766e);
  color: white;
  font-weight: 800;
}

@media (max-width: 1000px) {
  .encounter-shell,
  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .rail {
    display: none;
  }
}
