:root {
  --bg: #f6f5f2;
  --panel: #fff;
  --ink: #1c2320;
  --muted: #67716c;
  --line: #e5e4de;
  --accent: #17635a;
  --soft: #e7f1ee;
  --warn: #fdf6e3;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.65 "Malgun Gothic",
    system-ui,
    sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
button,
input {
  font: inherit;
}
button {
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  padding: 10px 15px;
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #99cfc4;
  outline-offset: 3px;
}
button.secondary {
  background: var(--soft);
  color: var(--accent);
}
a {
  color: var(--accent);
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 19px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.brand b {
  font-size: 20px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.mark {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 9px;
}
.top nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
.tag,
.eyebrow {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.tag {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 30px;
}
.workspace {
  display: grid;
  grid-template-columns: 230px minmax(350px, 1fr) 340px;
  max-width: 1700px;
  margin: auto;
  min-height: calc(100vh - 83px);
}
.rail {
  padding: 23px 16px;
  border-right: 1px solid var(--line);
}
main {
  padding: 26px 28px;
  min-width: 0;
}
.evidence-panel {
  padding: 23px 20px;
  border-left: 1px solid var(--line);
  position: sticky;
  top: 0;
  max-height: calc(100vh - 20px);
  overflow: auto;
}
h1 {
  font-size: 24px;
  line-height: 1.45;
  margin: 8px 0 10px;
  letter-spacing: -0.03em;
}
h2 {
  font-size: 15px;
  margin: 0 0 14px;
}
h3 {
  font-size: 15px;
  margin: 15px 0 8px;
}
h4 {
  font-size: 13px;
  margin: 14px 0 5px;
}
.muted,
small,
.rail-note {
  font-size: 12px;
  color: var(--muted);
}
p {
  margin: 7px 0;
}
.switch {
  display: flex;
  gap: 3px;
  background: #eeefea;
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
}
.switch button {
  flex: 1;
  padding: 7px 4px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
}
.switch button[aria-selected="true"] {
  background: white;
  color: var(--accent);
  box-shadow: 0 1px 3px #0001;
}
.search-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
input[type="search"] {
  display: block;
  width: 100%;
  padding: 9px 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 6px 0 12px;
}
#draft-filter {
  font-size: 12px;
}
.case-button {
  display: block;
  text-align: left;
  width: 100%;
  background: transparent;
  color: var(--ink);
  padding: 11px 9px;
  margin: 5px 0;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
}
.case-button[aria-pressed="true"] {
  background: var(--soft);
  border-color: #bdd9d1;
  color: var(--accent);
}
.case-button small {
  display: block;
  margin-top: 4px;
}
.rail-note {
  padding: 16px 8px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
}
.heading {
  padding-bottom: 14px;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fact {
  border-radius: 8px;
  background: #eceee8;
  padding: 6px 10px;
  font-size: 12px;
}
.toolbar {
  display: flex;
  gap: 8px;
  padding: 17px 0;
}
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  margin: 12px 0;
  padding: 18px;
}
.conclusion {
  border-left: 3px solid var(--accent);
  padding-left: 13px;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 600;
}
.notice,
.boundary {
  background: var(--warn);
  padding: 13px;
  border-radius: 9px;
  font-size: 12px;
}
.boundary {
  margin-top: 20px;
}
.boundary span {
  font-weight: normal;
  color: var(--muted);
}
.alert-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.severity {
  padding: 2px 7px;
  background: var(--warn);
  color: #785621;
  font-size: 10px;
  white-space: nowrap;
  border-radius: 6px;
}
.dose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 13px 0;
}
.dose-grid div {
  padding: 10px;
  background: #f5f7f3;
  border-radius: 8px;
  font-size: 12px;
}
.dose-grid b {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 4px;
}
details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 13px;
}
summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--accent);
}
ul {
  padding-left: 18px;
  font-size: 12px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
th,
td {
  padding: 9px 6px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.score {
  font-size: 23px;
  font-weight: 700;
  color: var(--accent);
}
.evidence-item {
  margin: 10px 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  font-size: 12px;
}
.evidence-item a {
  font-size: 11px;
}
.empty {
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}
.composer {
  margin-top: 28px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
}
.composer label {
  font-size: 12px;
  color: var(--muted);
}
.composer div {
  display: flex;
  gap: 8px;
  align-items: center;
}
.composer input {
  margin: 7px 0;
}
.composer button {
  white-space: nowrap;
}
#status {
  font-size: 12px;
  color: var(--accent);
}
mark {
  background: #f8e6a4;
  color: inherit;
}
pre {
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 11px;
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .evidence-panel {
    grid-column: 2;
    position: static;
    max-height: none;
    border-top: 1px solid var(--line);
  }
  main {
    padding: 24px;
  }
  .rail {
    grid-row: 1/3;
  }
}
@media (max-width: 650px) {
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .top {
    padding: 14px;
  }
  .top nav {
    gap: 10px;
    font-size: 11px;
  }
  .top .tag {
    display: none;
  }
  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 15px;
  }
  .rail-note {
    display: none;
  }
  #case-list {
    display: flex;
    gap: 5px;
    overflow: auto;
    max-height: 140px;
  }
  .case-button {
    min-width: 185px;
  }
  .evidence-panel,
  main {
    padding: 18px;
  }
  .dose-grid {
    grid-template-columns: 1fr;
  }
  .heading h1 {
    font-size: 21px;
  }
  .evidence-panel {
    border-left: 0;
  }
}

@media (min-width: 1101px) {
  .rail {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: calc(100vh - 83px);
    overflow: auto;
  }
}

[hidden] {
  display: none !important;
}
textarea {
  width: 100%;
  resize: vertical;
  font:
    12px/1.6 Consolas,
    monospace;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfa;
  color: var(--ink);
}
textarea:focus-visible {
  outline: 3px solid #99cfc4;
  outline-offset: 3px;
}
.intake-tab {
  width: 100%;
  text-align: left;
  margin-bottom: 10px;
  font-size: 12px;
}
.intake-tab[aria-selected="true"] {
  box-shadow: 0 0 0 3px #b9d8d0;
}
.toolbar {
  flex-wrap: wrap;
}

.clinical-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
input:not([type="checkbox"]),
select {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 8px;
  margin: 5px 0;
  font: inherit;
}
textarea {
  font:
    13px/1.7 "Malgun Gothic",
    system-ui,
    sans-serif;
}
#patient-json {
  font:
    11px/1.6 Consolas,
    monospace;
}
.clinical-row {
  background: #f7f8f5;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  margin: 12px 0;
}
.clinical-row button {
  padding: 5px 12px;
  font-size: 11px;
}
.integration-details {
  margin-top: 20px;
}
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: #eaf0ed;
}
.login-card {
  width: min(420px, 90vw);
  padding: 36px;
  background: white;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 35px #183b2420;
}
.login-card h1 {
  font-size: 30px;
}
.login-card form {
  margin-top: 24px;
}
.login-card form > button {
  width: 100%;
  margin-top: 16px;
}
.mark {
  display: grid;
  place-items: center;
  color: white;
  font-size: 25px;
  font-weight: 500;
}
.workspace {
  grid-template-columns: 235px minmax(380px, 1fr) 345px;
}
#intake-editor > summary {
  font-size: 15px;
  font-weight: 600;
}
#policy-note {
  font-size: 11px;
}
.card h3 {
  line-height: 1.6;
}
#status {
  padding: 7px 0;
}
.clinical-fields input {
  min-width: 0;
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .clinical-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .clinical-fields {
    grid-template-columns: 1fr;
  }
  .workspace {
    display: flex;
  }
}

.signup-link {
  display: block;
  margin-top: 18px;
  text-align: center;
  padding: 10px;
  border: 1px solid var(--line, #dbe5e1);
  border-radius: 8px;
  color: var(--accent, #176c61);
}
.usage-info {
  position: relative;
  font-size: 13px;
}
.usage-info summary {
  cursor: pointer;
  color: #176c61;
  list-style: none;
  padding: 10px;
  background: #e8f3ef;
  border-radius: 8px;
}
.usage-info p {
  position: absolute;
  right: 0;
  z-index: 20;
  width: min(340px, 80vw);
  padding: 18px;
  background: white;
  box-shadow: 0 4px 18px #0002;
  border-radius: 8px;
  line-height: 1.6;
}
.top nav {
  flex-wrap: wrap;
}
