:root {
  --ink: #233e38;
  --muted: #78857d;
  --line: #dfe5df;
  --green: #34695b;
  --pale: #eef3ed;
  --cream: #f8f8f3;
  --gold: #a58c59;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font:
    14px/1.6 -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    sans-serif;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  padding: 9px 15px;
  white-space: nowrap;
}
button:hover {
  border-color: var(--green);
  background: #f2f6f1;
}
button.on,
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fcfdfb;
  color: var(--ink);
  min-width: 0;
}
textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
}
input:focus,
textarea:focus,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid #81a999;
  outline-offset: 2px;
}
input[type="checkbox"] {
  accent-color: var(--green);
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 22px;
}
h1 small,
h2 small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
h2 {
  font-size: 21px;
  font-weight: 600;
}
h3 {
  font-size: 14px;
  font-weight: 600;
}
p {
  margin: 8px 0;
}
.muted {
  font-size: 12px;
  color: var(--muted);
}
header {
  height: 82px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font:
    23px Georgia,
    serif;
  flex: 1;
}
.brand small {
  font: 9px sans-serif;
  letter-spacing: 2px;
  max-width: 100px;
}
.logo {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid #abc0ad;
  border-radius: 50%;
  font: 25px Georgia;
  color: var(--green);
}
.seg {
  display: flex;
  background: #e9eee7;
  padding: 4px;
  border-radius: 10px;
  gap: 3px;
}
.seg button {
  background: transparent;
  border: 0;
  min-height: 38px;
  padding: 6px 14px;
}
.seg button.on {
  background: white;
  color: var(--green);
  box-shadow: 0 2px 5px #233e3810;
}
.demo {
  font-size: 11px;
  color: var(--gold);
}
.layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  max-width: 1600px;
  margin: auto;
  padding: 28px 30px 110px;
  gap: 30px;
}
aside {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100dvh - 100px);
  overflow: auto;
  padding-right: 2px;
}
aside .seg button {
  padding: 5px 8px;
  font-size: 12px;
}
aside h3 {
  margin: 7px 0;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #899789;
  margin-bottom: 6px;
}
.avatar {
  width: 46px;
  height: 46px;
  background: #dce7dc;
  color: var(--green);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 21px;
  margin-bottom: 12px;
}
.visit-chip,
.pill {
  font-size: 11px;
  border: 1px solid #dce5d9;
  background: #f0f4ed;
  border-radius: 6px;
  padding: 4px 8px;
  display: inline-block;
}
.caution {
  background: #f7f0e2;
  border: 1px solid #eaddc4;
  border-radius: 11px;
  padding: 13px;
  margin: 18px 0;
  color: #8b6c39;
  font-size: 12px;
}
.caution button {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  color: #8b6c39;
}
.caution p {
  margin: 3px 0;
}
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.title-row h2 {
  font:
    29px/1.4 "Songti SC",
    Georgia,
    serif;
}
.saved {
  font-size: 11px;
  color: var(--green);
}
nav {
  display: flex;
  position: sticky;
  top: 0;
  background: #f8f8f3f5;
  backdrop-filter: blur(12px);
  z-index: 5;
  border-bottom: 1px solid #bbcbbb;
  padding: 10px 0;
  gap: 8px;
}
nav button {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  padding: 8px 13px;
  border-bottom: 2px solid transparent;
}
nav button.on {
  color: var(--green);
  background: none;
  border-color: var(--green);
}
section {
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 22px;
  margin: 18px 0;
  scroll-margin-top: 85px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.section-title button:last-child,
.section-title .pill:last-child {
  margin-left: auto;
}
.section-title > span.muted {
  margin-left: auto;
}
.num {
  font: italic 18px Georgia;
  color: var(--gold);
}
details {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
summary {
  cursor: pointer;
  min-height: 40px;
  padding: 8px 0;
  font-weight: 500;
}
summary .muted {
  margin-left: 10px;
  font-weight: 400;
}
.fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 12px 0;
}
.field {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.field input,
.field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-weight: 400;
}
.verify {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--pale);
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
}
.checks,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.checks label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}
.row input:not([type="checkbox"]) {
  flex: 1;
  width: 100px;
}
.row .chips {
  margin-left: auto;
}
.chips button {
  font-size: 12px;
  min-height: 38px;
  padding: 6px 12px;
}
.exam-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.exam-card {
  background: #fafcf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  white-space: normal;
  display: block;
  min-height: 235px;
}
.exam-card h3 {
  display: flex;
  justify-content: space-between;
}
.exam-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.mini-six {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 10px;
}
.mini-six > div {
  border: 1px solid #d8e3d6;
  border-radius: 5px;
  padding: 5px;
  font-size: 10px;
  min-height: 39px;
  background: white;
}
.mini-six strong {
  display: block;
  font-size: 11px;
}
.tongue-shape {
  height: 130px;
  width: 100px;
  border: 2px solid #d8b9b2;
  background: #f3e6e0;
  border-radius: 38% 38% 48% 48%;
  margin: 15px auto;
  position: relative;
}
.tongue-shape:after {
  content: "";
  height: 68%;
  position: absolute;
  left: 50%;
  top: 8%;
  border-left: 1px solid #d8b9b2;
}
.belly-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 16px auto;
  max-width: 150px;
}
.belly-mini span {
  height: 35px;
  background: #f1eee3;
  border: 1px solid #dedbcb;
  border-radius: 7px;
  text-align: center;
  font-size: 10px;
  display: grid;
  place-items: center;
}
.table-head,
.pattern-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 15px;
}
.table-head {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.pattern-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.pattern-row input,
.pattern-row textarea {
  width: 100%;
  font-size: 12px;
}
.pattern-row label {
  font-size: 11px;
}
.pattern-row textarea {
  min-height: 55px;
}
.pattern-row button {
  padding: 4px 8px;
  min-height: 32px;
  font-size: 11px;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 14px 0;
}
.review-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.treatment-summary {
  padding: 16px;
  border: 1px dashed #bacdbd;
  border-radius: 9px;
  color: var(--muted);
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding: 20px 0;
}
.meeting {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 12px 30px;
  display: flex;
  gap: 20px;
  align-items: center;
  box-shadow: 0 -5px 30px #233e3806;
}
.meeting > div {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
}
.meeting span {
  font-size: 11px;
}
.status-dot {
  width: 7px;
  height: 7px;
  background: #b3bdb4;
  border-radius: 50%;
}
.meeting button {
  font-size: 12px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 24px;
  color: var(--ink);
  width: min(760px, 94vw);
  max-height: 94dvh;
  overflow: auto;
  box-shadow: 0 25px 100px #1b332a30;
}
dialog::backdrop {
  background: #18382c66;
  backdrop-filter: blur(3px);
}
dialog.wide {
  width: min(1240px, 97vw);
  height: min(850px, 95dvh);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
  margin-bottom: 16px;
}
.exam-workspace {
  display: grid;
  grid-template-columns: 85px 1fr 310px;
  gap: 18px;
  height: calc(100% - 90px);
}
.six-picks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pulse-board {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 10px;
  align-items: start;
}
.pulse-col {
  display: grid;
  gap: 8px;
}
.pulse-cell {
  min-height: 130px;
  border: 1px solid #bfcfbe;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  padding: 9px;
  background: #f9fcf6;
}
.pulse-cell.on {
  outline: 2px solid var(--green);
  background: #edf5e9;
}
.pulse-cell h3 {
  font-size: 13px;
}
.pulse-cell p {
  font-size: 12px;
  position: relative;
  z-index: 1;
}
.pulse-cell svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.symbol-bar {
  display: grid;
  gap: 8px;
  padding-top: 70px;
}
.symbol-bar button {
  padding: 6px;
  font-size: 21px;
  line-height: 1.2;
}
.symbol-bar small {
  font-size: 9px;
  display: block;
}
.pulse-tools {
  background: #f5f7f1;
  padding: 13px;
  border-radius: 12px;
}
.feel-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.feel-grid button {
  min-height: 42px;
  padding: 5px;
  font-size: 13px;
}
.intensity {
  grid-column: 1/-1;
  display: flex;
  gap: 5px;
  align-items: center;
  background: #e0ecdc;
  border-radius: 7px;
  padding: 5px;
}
.intensity button {
  flex: 1;
}
.pulse-tools .chips button {
  flex: 1;
  padding: 6px;
}
.pulse-tools h3 {
  margin: 10px 0 6px;
}
.pulse-tools details {
  font-size: 11px;
}
.pulse-tools input {
  width: 100%;
  margin: 3px 0;
}
.exam-note {
  margin-top: 12px;
}
.touch-board {
  height: 400px;
  position: relative;
  touch-action: none;
  background: #fafbf7;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.touch-board .tongue-shape {
  height: 85%;
  width: 50%;
  margin: 15px auto;
}
.touch-board svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.tongue-work,
.belly-work {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}
.regions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  max-width: 450px;
  margin: 15px auto;
}
.regions button {
  height: 100px;
  white-space: normal;
  background: #f4f0e5;
}
.regions button.on {
  background: var(--green);
}
.rx-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 295px;
  gap: 28px;
}
.rx-review {
  background: var(--pale);
  border-radius: 12px;
  padding: 18px;
  align-self: start;
  position: sticky;
  top: 0;
}
.rx-review button {
  display: block;
  width: 100%;
  margin-top: 12px;
}
.rx-review label {
  font-size: 12px;
}
.herb-row {
  display: grid;
  grid-template-columns: 1fr 110px 55px 65px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.herb-row input {
  width: 100%;
}
.rx-layout textarea {
  min-height: 95px;
}
.formula-card {
  background: #edf4e8;
  border: 1px solid #b7c9ad;
  padding: 15px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#floating-note,
#history-panel {
  position: fixed;
  right: 25px;
  bottom: 85px;
  width: 330px;
  z-index: 15;
  border: 1px solid #dacfaf;
  border-radius: 12px;
  padding: 15px;
  background: #fffdf2;
  box-shadow: 0 10px 40px #233e3820;
}
#floating-note textarea {
  height: 190px;
  background: transparent;
}
#history-panel {
  left: 20px;
  right: auto;
  background: #f5f8ef;
  width: 270px;
}
#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  border-radius: 9px;
  padding: 12px 20px;
  display: none;
  z-index: 50;
}
#patient-preview {
  padding: 25px;
  background: #fbfcf8;
  border-radius: 12px;
  margin: 15px 0;
}
#patient-preview h3 {
  margin: 20px 0 6px;
}
#print-content {
  white-space: pre-wrap;
}
.history-six {
  padding: 15px;
  border: 1px solid var(--line);
  line-height: 3;
  font-size: 12px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  header {
    padding: 0 18px;
    gap: 12px;
  }
  .brand small {
    display: none;
  }
  .layout {
    grid-template-columns: 200px 1fr;
    padding: 22px 18px 100px;
    gap: 18px;
  }
  .fields {
    grid-template-columns: repeat(2, 1fr);
  }
  .section-title .muted {
    display: none;
  }
  .exam-workspace {
    grid-template-columns: 65px 1fr 290px;
    gap: 10px;
  }
  .pulse-cell {
    min-height: 115px;
  }
  .verify {
    flex-wrap: wrap;
  }
  .demo {
    display: none;
  }
  .meeting > span {
    display: none;
  }
  .exam-card {
    padding: 10px;
  }
  .title-row h2 {
    font-size: 25px;
  }
}
@media (max-width: 760px) {
  .layout {
    display: block;
  }
  aside {
    position: static;
    max-height: none;
  }
  aside > details,
  aside > hr,
  aside > .muted {
    display: none;
  }
  header {
    flex-wrap: wrap;
    height: auto;
    padding: 12px;
  }
  .brand {
    font-size: 18px;
  }
  header #reset {
    display: none;
  }
  nav {
    overflow: auto;
  }
  .two {
    grid-template-columns: 1fr;
  }
  .table-head {
    display: none;
  }
  .pattern-row {
    grid-template-columns: 1fr;
  }
  .exam-grid {
    gap: 6px;
  }
  .exam-card {
    min-height: 200px;
  }
  .mini-six > div {
    font-size: 8px;
  }
  .mini-six strong {
    font-size: 9px;
  }
  .exam-workspace,
  .tongue-work,
  .belly-work,
  .rx-layout {
    display: block;
    height: auto;
  }
  .six-picks {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .pulse-tools {
    margin-top: 18px;
  }
  .meeting {
    padding: 8px 12px;
    gap: 8px;
  }
  .meeting > div {
    display: block;
  }
  .meeting button {
    padding: 7px;
  }
  .fields {
    grid-template-columns: 1fr 1fr;
  }
  .review-bar {
    display: block;
  }
  .section-title {
    flex-wrap: wrap;
  }
  .title-row .saved {
    display: none;
  }
  .rx-review {
    position: static;
    margin-top: 15px;
  }
  .dialog-head .pill {
    display: none;
  }
}
@media print {
  body > * {
    display: none !important;
  }
  #print-dialog[open],
  #print-content {
    display: block !important;
  }
  #print-dialog {
    position: static;
    border: 0;
    box-shadow: none;
    max-height: none;
    width: 100%;
  }
  #print-dialog .dialog-head,
  #print-dialog button {
    display: none !important;
  }
}

.feel-grid button {
  min-height: 44px;
}
#risk-picks button {
  padding: 5px 10px;
  min-height: 36px;
}
/* V2: clinic queue, nearby examination controls and whole-Note publication. */
.layout {
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 25px;
}
header {
  height: 72px;
}
#save-state {
  font-size: 11px;
  color: var(--green);
}
aside #patient-search {
  width: 100%;
  margin: 0 0 10px;
}
.patient-choice {
  width: 100%;
  display: block;
  text-align: left;
  padding: 10px 12px;
  margin: 6px 0;
  background: #fbfcf8;
  white-space: normal;
}
.patient-choice.on {
  background: #e6efe3;
  color: var(--ink);
  border-color: #91af96;
}
.patient-choice strong {
  font-size: 14px;
  display: block;
}
.patient-choice small {
  font-size: 10px;
  color: var(--muted);
  display: block;
}
.layout aside {
  top: 16px;
}
aside #manual-new {
  min-height: 34px;
  padding: 4px 8px;
  font-size: 11px;
}
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 8px;
}
.title-row .row {
  flex-shrink: 0;
}
.title-row h2 {
  font-size: 25px;
}
.title-row {
  gap: 12px;
}
#tabs {
  gap: 0;
  justify-content: space-between;
}
#tabs button {
  font-size: 12px;
  padding: 8px 9px;
}
#floating-note {
  right: 20px;
  bottom: 82px;
  width: 290px;
  background: #fffdf2;
  opacity: 0.98;
}
#floating-note textarea {
  height: 110px;
  min-height: 80px;
}
#floating-note .row button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 11px;
}

/* Compact diagnosis lookup and one-screen prescription reference context. */
.pattern-lookup {margin:6px 0 9px}
.pattern-search-row,.pattern-manual-entry {display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.pattern-search-row input,.pattern-manual-entry input {flex:1;min-width:180px;min-height:34px;padding:5px 9px}
.pattern-search-row button,.pattern-manual-entry button {min-height:34px;padding:5px 10px}
.pattern-manual-entry[hidden] {display:none}
.pattern-manual-entry {padding:7px;background:var(--pale);border:1px solid var(--line);border-radius:7px}
.pattern-manual-entry small {color:var(--muted);font-size:11px}
#pattern-results {margin-top:5px;gap:5px}
#pattern-results button {min-height:32px;padding:4px 9px;font-size:12px}
#rx-dialog {width:min(1320px,calc(100vw - 24px));max-width:calc(100vw - 24px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);padding:12px}
#rx-dialog .dialog-head {margin-bottom:7px;padding-bottom:7px;gap:8px}
#rx-dialog .dialog-head h2 {margin:0;font-size:20px}
#rx-dialog button {min-height:32px;padding:4px 8px}
#rx-dialog #rx-content>.row {gap:7px;margin:3px 0}
#rx-dialog #rx-content>.caution,#rx-dialog #rx-content>.muted {padding:5px 7px;margin:5px 0;font-size:12px}
#rx-dialog .rx-reference-grid {display:grid;grid-template-columns:2fr 1fr 1fr;gap:7px;margin:6px 0}
#rx-dialog .rx-chart {display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;min-width:0;padding:6px 8px;background:#fafbf7;border:1px solid var(--line);border-radius:7px;text-align:left;color:var(--ink)}
#rx-dialog .rx-chart>b {display:flex;align-items:center;justify-content:space-between;font-size:13px;line-height:1.2;margin-bottom:2px}
#rx-dialog .rx-chart>b>span {color:var(--muted);font-weight:400}
#rx-dialog .rx-chart>small {display:block;color:var(--muted);font-size:11px;line-height:1.3;max-height:29px;overflow:hidden}
#rx-dialog .rx-chart>.tongue-svg,#rx-dialog .rx-chart>.abdomen-svg {display:block;width:100%;height:148px}
#rx-dialog .rx-chart .abdomen-svg text {font-size:18px}
#rx-dialog .pulse-overview {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
#rx-dialog .pulse-overview-side {min-width:0}
#rx-dialog .pulse-overview-side h4 {font-size:12px;line-height:1.2;margin:0 0 2px}
#rx-dialog .pulse-overview-side+.pulse-overview-side {border-left:1px solid var(--line);padding-left:7px}
#rx-dialog .pulse-overview-part {display:grid;grid-template-columns:32px 26px minmax(0,1fr);gap:4px;align-items:center;min-height:42px;margin:0}
#rx-dialog .pulse-part-name b {font-size:12px}
#rx-dialog .pulse-part-name span {font-size:10px;line-height:1.1}
#rx-dialog .pulse-overview-frame {width:24px;height:42px}
#rx-dialog .pulse-overview-frame .strength-text {font-size:42px}
#rx-dialog .pulse-overview-feel {font-size:12px;line-height:1.25;min-width:0;overflow-wrap:anywhere}
#rx-dialog .pulse-overview-feel small {font-size:10px;line-height:1.2}
#rx-dialog .pulse-overview-total {flex-direction:row;flex-wrap:wrap;font-size:11px;line-height:1.2;gap:4px;margin-top:2px;padding-top:2px}
#rx-dialog .pulse-overview-total>span:first-child {white-space:nowrap}
#rx-dialog .rx-reference-head {display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 6px;padding:4px 0;border-bottom:1px solid var(--line)}
#rx-dialog .rx-reference-head>b {font-size:12px;font-weight:500;color:var(--muted)}
#rx-dialog .rx-reference-head .chips {margin:0;gap:5px}
#rx-dialog .rx-reference-head .pill {padding:2px 7px;font-size:12px}
#rx-dialog #rx-mode-tabs {display:flex;gap:5px;margin:4px 0 7px;padding-bottom:5px;border-bottom:1px solid var(--line)}
#rx-dialog #rx-mode-tabs button {min-width:90px;min-height:34px;font-size:13px}
#rx-dialog [role="tabpanel"][hidden] {display:none}
#rx-dialog .rx-prescription-heading {display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:5px 0}
#rx-dialog #prescription-tabs {margin:0;gap:4px;flex:0 1 auto}
#rx-dialog #prescription-tabs button {max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
#rx-dialog .rx-title-tools {display:flex;align-items:center;gap:4px}
#rx-dialog .icon-button {width:33px;min-width:33px;padding:3px;font-size:18px;font-weight:400}
#rx-dialog #rx-title {width:180px;min-height:32px;padding:4px 7px}
#rx-dialog #rx-title[hidden] {display:none}
#rx-dialog .rx-layout {grid-template-columns:minmax(0,1fr) 300px;gap:12px;align-items:start}
#rx-dialog .rx-review {padding:9px;border-radius:8px;top:0;font-size:12px}
#rx-dialog .rx-review h3,#rx-dialog .rx-layout h3 {margin:7px 0 5px;font-size:13px}
#rx-dialog .rx-layout>.row {gap:6px}
#rx-dialog #formula-search {min-height:34px;padding:5px 9px}
#rx-dialog .rx-layout p {margin:5px 0;font-size:11px}
#rx-dialog #selected-formulas .formula-card {padding:7px 9px;margin:5px 0;border-radius:6px}
#rx-dialog #selected-formulas .formula-card p {margin:3px 0;font-size:12px}
#rx-dialog .herb-row {gap:5px;padding:4px 0}
#rx-dialog .herb-row input {min-height:31px;padding:3px 6px}
#rx-dialog textarea {min-height:40px;padding:6px;font-size:13px;line-height:1.4}
#rx-dialog .rx-total {padding:8px 10px;border-radius:7px}
#rx-dialog .rx-total strong {font-size:32px;line-height:1.15}
#rx-dialog .rx-total strong span {font-size:16px}
#rx-dialog .rx-total p {margin:3px 0;font-size:12px}
#rx-dialog .dispensing-choice {margin:7px 0}
#rx-dialog .dispensing-choice>span {margin-bottom:3px}
#rx-dialog .rx-review .chips {margin:0;gap:4px}
#rx-dialog .rx-review .chips button {font-size:12px;min-height:30px;padding:3px 6px;margin:0}
#rx-dialog .rx-review button {margin-top:6px}
#rx-dialog #standard-prescription {min-height:45px;padding:7px;margin:5px 0;font-size:12px;line-height:1.5}
#rx-dialog .acu-editor {display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:7px;min-height:0;margin:5px 0;padding:6px 8px;border:1px solid var(--line);border-radius:7px}
#rx-dialog .acu-editor h3 {font-size:13px;margin:0}
#rx-dialog .acu-editor>.caution {font-size:11px;padding:3px 5px;margin:4px 0}
#rx-dialog .acu-editor>.row {gap:6px;margin:0}
#rx-dialog #acu-text {margin:0;height:40px}
#rx-dialog #acu-rounds {grid-column:1/-1;display:flex;gap:7px;flex-wrap:wrap}
#rx-dialog #acu-rounds:empty {display:none}
#rx-dialog #acu-rounds>.row {flex:1 1 280px;display:grid;grid-template-columns:45px minmax(0,1fr) 48px;gap:5px;margin:4px 0 0}
#rx-dialog #acu-rounds textarea {width:100%;min-height:38px;height:38px}
.rx-chart-dialog {width:min(1000px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:12px}
.rx-chart-dialog .dialog-head {margin:0 0 8px;padding-bottom:8px}
.rx-chart-large {display:flex;justify-content:center;min-width:0}
.rx-chart-large svg {width:100%;height:min(70dvh,610px)}
@media(max-width:900px) {
  #rx-dialog .rx-layout {grid-template-columns:minmax(0,1fr) 265px;gap:9px}
  #rx-dialog .rx-chart {padding:5px}
}
@media(max-width:650px) {
  #rx-dialog .acu-editor {grid-template-columns:1fr}
  #rx-dialog .rx-layout {grid-template-columns:1fr}
  #rx-dialog .rx-review {position:static}
  #rx-dialog .rx-reference-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
  #rx-dialog .rx-chart-pulse {grid-column:1/-1}
}
#floating-note p {
  margin: 4px 0;
}
#floating-note small {
  font-size: 10px;
  color: var(--muted);
}
.original-text {
  display: block;
  background: #f2f5ef;
  border-left: 2px solid #c5d4bf;
  padding: 7px;
  font-size: 11px;
  margin: 5px 0;
  color: #57705f;
  min-height: 34px;
  overflow-wrap: anywhere;
}
.risk-box {
  border: 1px solid #e1d7bd;
  background: #fbf7ea;
  padding: 16px;
  border-radius: 11px;
  margin-top: 10px;
}
.risk-box .row button {
  margin-left: auto;
}
.risk-confirm {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #f1e5ca;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
}
.summary-placeholder {
  background: #f5f7f1;
  border: 1px dashed #d5dfcf;
  border-radius: 9px;
  padding: 12px 15px;
  margin-bottom: 15px;
  font-size: 13px;
}
.summary-placeholder small {
  color: var(--muted);
}
.exam-grid {
  grid-template-columns: 1.25fr 0.85fr 1fr;
}
.exam-card {
  padding: 12px;
  min-height: 260px;
  overflow: hidden;
}
.exam-card > svg {
  width: 100%;
  height: 195px;
  display: block;
}
.exam-card > svg.pulse-svg {
  height: 195px;
  transform: scale(1.35);
  transform-origin: 50% 45%;
}
.exam-card small {
  position: relative;
  background: #fafcf9;
  line-height: 1.3;
  min-height: 26px;
}
.pulse-svg text {
  font-size: 17px;
  fill: #3b5146;
}
.pulse-svg .organ-text {
  font-size: 13px;
  fill: #8a8d78;
}
.pulse-svg .feel-text {
  font-size: 16px;
  fill: #49795f;
}
.pulse-svg .strength-text {
  font-size: 20px;
  fill: #6f7c67;
}
.pulse-stage {
  position: relative;
  width: 100%;
  height: calc(100dvh - 190px);
  max-height: 620px;
  min-height: 480px;
  background: #fcfdf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.pulse-stage > .pulse-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.pulse-pop {
  position: absolute;
  width: 305px;
  max-height: calc(100% - 25px);
  overflow: auto;
  background: #f1f5e9f5;
  border: 1px solid #b6caae;
  border-radius: 12px;
  padding: 11px;
  box-shadow: 0 8px 30px #233e3817;
  z-index: 2;
}
.pulse-pop.near-right {
  left: 34%;
}
.pulse-pop.near-left {
  right: 30%;
}
.pulse-pop > .row {
  justify-content: space-between;
  margin: 0 0 6px;
}
.pulse-pop .row > span {
  font-size: 10px;
}
.pulse-pop .chips {
  gap: 3px;
}
.pulse-pop .chips button {
  min-height: 36px;
  padding: 5px 10px;
}
.pulse-pop .feel-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}
.pulse-pop .feel-grid > button {
  font-size: 12px;
  min-height: 40px;
}
.pulse-pop .intensity {
  padding: 4px;
  gap: 2px;
  flex-wrap: wrap;
  font-size: 11px;
}
.pulse-pop .intensity button {
  min-height: 34px;
  padding: 3px 5px;
  font-size: 12px;
  flex: 1;
}
.pulse-pop .intensity button:last-child {
  flex: 1.5;
}
.pulse-pop .strength-inline {
  justify-content: flex-start;
  margin: 7px 0;
  font-size: 12px;
}
.pulse-pop .strength-inline input {
  height: 34px;
  min-height: 34px;
  width: 65px;
  padding: 4px 7px;
}
.local-tools {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin: 7px 0;
}
.local-tools button {
  padding: 5px 7px;
  font-size: 11px;
  min-height: 36px;
  flex: 1;
}
.pulse-pop details {
  font-size: 11px;
  padding: 4px 0;
}
.pulse-pop details input {
  display: block;
  width: 100%;
  margin: 3px 0;
  padding: 5px;
}
.pulse-pop details summary {
  min-height: 30px;
  padding: 4px 0;
}
.pulse-pop p {
  font-size: 10px;
  margin: 4px 0;
}
.six-judgement {
  position: absolute;
  top: 15px;
  left: 12px;
  width: 80px;
  z-index: 1;
}
.six-judgement .chips {
  display: grid;
}
.six-judgement button {
  min-height: 38px;
  padding: 5px;
}
.six-judgement details {
  max-height: 210px;
  overflow: auto;
  font-size: 10px;
}
.six-judgement details .chips {
  grid-template-columns: repeat(2, 1fr);
}
.six-judgement details button {
  font-size: 10px;
  min-height: 28px;
  padding: 3px;
}
.tongue-work {
  grid-template-columns: 1fr 1.2fr;
  height: calc(100% - 20px);
  gap: 20px;
}
.tongue-board {
  background: #fafbf6;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  padding: 10px;
  overflow: auto;
}
.tongue-board > svg {
  height: 390px;
  width: 100%;
  touch-action: none;
}
.tongue-options {
  overflow: auto;
  max-height: calc(94dvh - 140px);
}
.tongue-options h3 {
  margin: 10px 0 5px;
}
.tongue-options .chips button {
  min-height: 40px;
}
.photo-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
}
.photo-label input {
  max-width: 100%;
  font-size: 10px;
}
.tongue-photo {
  width: 120px;
  height: 90px;
  object-fit: contain;
}
.belly-work {
  grid-template-columns: 1.2fr 1fr;
  gap: 25px;
}
.abdomen-board {
  background: #fafbf5;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.abdomen-board > svg {
  height: calc(90dvh - 155px);
  max-height: 520px;
  width: 100%;
}
.abdomen-svg text {
  font-family: inherit;
  fill: #65765d;
  font-size: 13px;
}
.abdomen-options h3 {
  margin: 15px 0 7px;
}
.pattern-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  table-layout: fixed;
}
.pattern-table th {
  text-align: left;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  padding: 7px;
}
.pattern-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 7px;
  vertical-align: top;
}
.pattern-table th:first-child {
  width: 28px;
}
.pattern-table th:nth-child(2) {
  width: 22%;
}
.pattern-table th:nth-child(3) {
  width: 39%;
}
.pattern-table th:nth-child(4) {
  width: 19%;
}
.pattern-table th:nth-child(5) {
  width: 13%;
}
.pattern-table td input[type="number"] {
  width: 55px;
  padding: 5px;
}
.pattern-table td input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.pattern-table small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.tiny {
  min-height: 25px;
  font-size: 10px;
  padding: 2px 6px;
}
.pattern-table .empty-row {
  height: 35px;
  color: #9aa18f;
  font-size: 11px;
}
.symptom-picks {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.symptom-picks input:not([type="checkbox"]) {
  width: 100%;
  padding: 5px;
  font-size: 10px;
}
.candidate-strip {
  background: #f5f7ef;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.candidate-strip > details {
  border: 0;
  padding: 0;
}
.candidate-strip summary {
  min-height: 30px;
  padding: 2px;
  font-size: 12px;
}
.candidate-strip #pattern-library {
  max-width: 600px;
}
.candidate-strip input {
  padding: 5px;
  font-size: 12px;
}
.plan-doses {
  background: #f4f7ef;
  border-radius: 12px;
  padding: 15px;
}
.plan-doses input {
  width: 60px;
  padding: 6px;
}
.plan-doses label {
  font-size: 12px;
}
.estimate {
  background: #f8f3e6;
  border: 1px solid #e5dcc1;
  padding: 14px;
  border-radius: 10px;
  margin: 15px 0;
  font-size: 12px;
}
.fee-options {
  display: flex;
  gap: 20px;
  margin: 7px 0;
}
.advice-row {
  padding: 12px;
  background: #f7f9f3;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 9px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  font-size: 12px;
}
.advice-row small {
  color: var(--muted);
}
.advice-actions {
  display: flex;
  gap: 4px;
}
.advice-actions button {
  font-size: 11px;
  padding: 5px 8px;
  min-height: 34px;
}
.advice-row input {
  grid-column: 1/-1;
  width: 100%;
  font-size: 12px;
}
.advice-row.removed {
  opacity: 0.5;
}
.effect-box {
  border: 1px solid var(--line);
  padding: 14px;
  margin-top: 15px;
  border-radius: 9px;
}
.acu-editor {
  margin: 10px 0;
  padding: 15px;
}
.rx-mini > svg {
  width: 100%;
  height: 170px;
}
.rx-diagnostics .exam-grid {
  grid-template-columns: repeat(3, 1fr);
  max-width: 750px;
}
.rx-diagnostics .exam-grid:has(.rx-mini:only-child) {
  grid-template-columns: 1fr;
  max-width: 400px;
}
.rx-diagnostics .rx-mini:only-child > svg {
  height: 210px;
}
.rx-diagnostics {
  padding: 7px 0;
}
.rx-diagnostics summary {
  min-height: 32px;
}
.rx-review {
  font-size: 12px;
}
.rx-review h2 {
  margin: 15px 0;
}
.rx-layout {
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 20px;
}
.rx-layout .row input {
  min-width: 0;
}
#prescription-tabs {
  margin: 10px 0;
}
.patient-pattern {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.history-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 12px 0;
}
#note-editor {
  min-height: 280px;
}
#formal-records pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.8 inherit;
}
#print-content {
  font-size: 13px;
}
#records-dialog input {
  width: 100%;
}
#save-state {
  white-space: nowrap;
}
#patient-list {
  max-height: 280px;
  overflow: auto;
}
.meeting {
  padding: 10px 25px;
}
.meeting > div {
  gap: 12px;
}
.meeting button {
  min-height: 38px;
}
.treatment-summary {
  font-size: 13px;
}
#rx-dialog #rx-content > .row {
  flex-wrap: wrap;
}
.pattern-table-wrap {
  overflow: auto;
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 200px minmax(0, 1fr);
    padding: 18px 16px 100px;
    gap: 16px;
  }
  .title-row {
    display: block;
  }
  .title-row > .row {
    justify-content: flex-end;
    margin: 5px 0;
  }
  .title-row h2 {
    font-size: 23px;
  }
  .pulse-pop {
    width: 285px;
    padding: 8px;
  }
  .pulse-pop.near-left {
    right: 30%;
  }
  .pulse-pop.near-right {
    left: 33%;
  }
  .pulse-pop .feel-grid > button {
    min-height: 38px;
  }
  .pulse-stage {
    min-height: 480px;
    max-height: 540px;
  }
  .fields {
    grid-template-columns: repeat(2, 1fr);
  }
  #tabs button {
    font-size: 11px;
    padding: 8px 6px;
  }
  .exam-card > svg {
    height: 165px;
  }
  .exam-card > svg.pulse-svg {
    height: 165px;
  }
  .exam-card {
    min-height: 220px;
    padding: 8px;
  }
  .advice-row {
    display: block;
  }
  .advice-actions {
    margin: 7px 0;
  }
  .fee-options {
    display: block;
  }
  .section-title h2 {
    font-size: 19px;
  }
  .section-title button {
    font-size: 11px;
    padding: 6px 10px;
  }
  #floating-note {
    width: 250px;
    right: 12px;
  }
}
@media (max-width: 760px) {
  .layout {
    display: block;
  }
  .layout aside {
    max-height: none;
    position: static;
  }
  aside #patient-list {
    display: flex;
    gap: 6px;
    overflow: auto;
    max-height: 130px;
  }
  .patient-choice {
    min-width: 150px;
  }
  #patient-context {
    display: none;
  }
  .exam-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .pulse-stage {
    height: 630px;
    min-width: 650px;
  }
  .wide #exam-content {
    overflow: auto;
  }
  .pulse-pop {
    width: 270px;
  }
  .tongue-work,
  .belly-work,
  .rx-layout {
    display: block;
  }
  .tongue-options {
    max-height: none;
  }
  .tongue-board > svg {
    height: 300px;
  }
  .pattern-table {
    min-width: 650px;
  }
  .two {
    display: block;
  }
  .advice-row {
    font-size: 12px;
  }
  .meeting > div > span {
    display: none;
  }
  #floating-note {
    width: 235px;
    bottom: 70px;
  }
  .meeting {
    padding: 8px;
    gap: 5px;
  }
  .meeting button {
    font-size: 10px;
    padding: 5px;
  }
  header {
    height: auto;
    padding: 12px;
    gap: 7px;
    flex-wrap: wrap;
  }
  header #history-open {
    font-size: 11px;
  }
  .demo {
    display: none;
  }
  #save-state {
    font-size: 10px;
  }
  .plan-doses > div {
    margin-bottom: 12px;
  }
  #tabs {
    overflow: auto;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .pulse-stage {
    min-width: 600px;
  }
  .pulse-pop.near-left {
    right: 30%;
  }
}
#floating-note {
  left: 18px;
  right: auto;
  width: 230px;
}
#floating-note > .row {
  cursor: move;
  touch-action: none;
}
#floating-note > .row b {
  font-size: 12px;
}
#floating-note textarea {
  height: 110px;
}
.tongue-overlay-line {
  fill: #f5e3d9;
  stroke: #ad8d7d;
  stroke-width: 2;
}
/* Completion pass: keep queue controls accessible while comments are open. */
#floating-note {
  left: auto;
  right: 18px;
  width: 250px;
  bottom: 82px;
}
body.comments-open .review-bar {
  padding-right: 265px;
  flex-wrap: wrap;
  gap: 10px;
}
body.comments-open #treatment .section-title {
  padding-right: 265px;
  flex-wrap: wrap;
}
#pinned-history {
  position: fixed;
  left: 12px;
  bottom: 85px;
  width: 290px;
  max-height: 55dvh;
  overflow: auto;
  border: 1px solid #aec4aa;
  border-radius: 12px;
  background: #f8fcf2;
  padding: 12px;
  z-index: 14;
  box-shadow: 0 8px 30px #233e381a;
}
#pinned-history .exam-grid {
  display: block;
}
#pinned-history svg {
  width: 100%;
  height: 160px;
}
#comparison-content svg {
  width: 100%;
  height: 240px;
}
.conflict-row {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.conflict-row pre {
  max-height: 210px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 11px;
}
#records-content pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.patient-display-mode > :not(#patient-display-shell) {
  display: none !important;
}
#patient-display-shell {
  margin: 30px auto;
  padding: 35px;
  max-width: 1000px;
  background: #fff;
  border-radius: 20px;
  min-height: 80dvh;
}
.patient-screen-banner {
  font-size: 11px;
  color: #899779;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 25px;
}
#patient-display-shell h3 {
  margin-top: 24px;
}
#patient-display-shell .patient-pattern {
  font-size: 19px;
}
#patient-display-shell p {
  line-height: 1.9;
}
#patient-screen {
  font-size: 11px;
}
.risk-demo {
  font-size: 11px;
}
.risk-demo button {
  min-height: 32px;
  padding: 4px 8px;
}
.title-row > .row {
  flex-wrap: wrap;
}
.rx-diagnostics svg {
  max-width: 100%;
}
#followup-dialog p {
  margin: 12px 0;
}
#conflict {
  position: sticky;
  top: 0;
  z-index: 8;
}
.meeting {
  flex-wrap: wrap;
}
.meeting #display-state + button {
  font-size: 10px;
  padding: 5px 9px;
}
.tongue-photo {
  width: 140px;
}
.photo-label {
  padding: 4px;
}
@media (max-width: 760px) {
  #floating-note {
    width: 225px;
    right: 10px;
  }
  body.comments-open .review-bar,
  body.comments-open #treatment .section-title {
    padding-right: 0;
    padding-bottom: 15px;
  }
  .meeting {
    gap: 4px;
  }
  .meeting > div {
    flex-basis: 100%;
  }
  .meeting button {
    min-height: 30px;
  }
  .layout {
    padding-bottom: 145px;
  }
  #pinned-history {
    width: 240px;
  }
  #patient-display-shell {
    margin: 10px;
    padding: 20px;
  }
}

/* One-screen pulse workspace: no nested scrolling or expanding control rows. */
html:has(#exam-dialog[open]),
body:has(#exam-dialog[open]) {
  overflow: hidden;
}
#exam-dialog:has(.pulse-fixed-layout) {
  width: calc(100vw - 16px);
  max-width: none;
  height: calc(100dvh - 16px);
  max-height: none;
  padding: 12px;
  overflow: visible;
  box-sizing: border-box;
}
#exam-dialog[open]:has(.pulse-fixed-layout) {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
}
#exam-dialog:has(.pulse-fixed-layout) .dialog-head {
  margin: 0 0 8px;
  padding: 0 0 8px;
  min-height: 0;
}
#exam-dialog:has(.pulse-fixed-layout) .dialog-head .eyebrow {
  display: none;
}
#exam-dialog:has(.pulse-fixed-layout) #exam-title {
  margin: 0;
  font-size: 20px;
}
#exam-dialog:has(.pulse-fixed-layout) #exam-content {
  min-height: 0;
  overflow: visible;
}
.pulse-fixed-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.26fr) minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
}
.pulse-side {
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  padding: 9px;
  background: #fafcf7;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.pulse-side > h3 {
  margin: 0;
  text-align: center;
  font-size: 14px;
}
.pulse-three {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-height: 0;
}
.pulse-frame-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  touch-action: none;
}
.pulse-frame-svg text {
  font-size: 20px;
  fill: var(--ink);
}
.pulse-frame-svg .organ-text {
  font-size: 14px;
  fill: #89937f;
}
.pulse-frame-svg .strength-text {
  font-size: 25px;
  fill: #74836a;
}
.pulse-frame-svg .feel-text {
  font-size: 18px;
  fill: #467a62;
}
.overall-box {
  border-top: 1px solid var(--line);
  padding-top: 7px;
  margin-top: 5px;
}
.overall-box h3 {
  font-size: 11px;
  margin: 6px 0;
}
.overall-box h3 span {
  float: right;
  color: var(--green);
  font-weight: 500;
}
.overall-strength-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
}
.overall-strength-row h3 {
  margin: 0;
  white-space: nowrap;
  font-size: 10px;
}
.overall-strength .chips {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1px;
}
.overall-strength button {
  padding: 0;
  min-width: 0;
  min-height: 38px;
  font-size: 10px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.overall-feels {
  display: grid;
  grid-template-columns: repeat(var(--pulse-feel-columns, 6), minmax(0, 1fr));
  gap: 4px;
}
.overall-feels button {
  min-height: 42px;
  padding: 3px 1px;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
  min-width: 0;
}
.overall-scale {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  height: 40px;
  margin-top: 5px;
  font-size: 11px;
}
.overall-scale > .chips {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}
.overall-scale button {
  min-height: 36px;
  min-width: 0;
  padding: 2px 4px;
  font-size: 11px;
}
.overall-scale:empty::before {
  content: "点选总体脉感，再选0–5";
  color: var(--muted);
  font-size: 10px;
}
.pulse-scale-label {
  max-width: 66px;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 14px;
  font-size: 10px;
}
.pulse-center {
  min-width: 0;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  background: #eef4e8;
  border: 1px solid #c4d3ba;
  border-radius: 12px;
}
.pulse-center h3 {
  font-size: 11px;
  font-weight: 500;
  color: #687a62;
  margin: 0 0 4px;
  line-height: 16px;
}
.pulse-center button {
  padding: 4px 2px;
  min-width: 0;
}
.pulse-center input {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 5px 6px;
  font-size: 11px;
  height: 34px;
}
.pulse-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
}
.pulse-selection b {
  font-size: 15px;
}
.pulse-selection span {
  font-size: 10px;
  color: var(--muted);
}
.pulse-control-row {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}
.pulse-control-row h3 {
  margin: 0;
}
.pulse-center #pulse-depth .chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.pulse-center #pulse-depth button {
  min-height: 36px;
  font-size: 13px;
}
.pulse-center #part-strength .chips {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2px;
}
.pulse-center #part-strength button {
  min-height: 34px;
  font-size: 10px;
  padding: 2px 0;
}
.pulse-feel-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.pulse-center #feel-picks {
  display: grid;
  grid-template-columns: repeat(var(--pulse-feel-columns, 6), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 4px;
  flex: 1;
  min-height: 0;
}
.pulse-center #feel-picks > button {
  min-height: 32px;
  font-size: 12px;
  padding: 3px 1px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
.pulse-center #part-feel-scale {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  margin: 5px 0 0;
  font-size: 11px;
}
.pulse-center #part-feel-scale button {
  flex: 1;
  min-height: 34px;
  font-size: 11px;
  padding: 2px;
}
.pulse-center #part-feel-scale .muted {
  font-size: 10px;
}
.pulse-center .local-tools {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  margin: 0;
}
.pulse-center .local-tools button {
  min-height: 36px;
  font-size: 10px;
  padding: 3px 1px;
}
.pulse-shape-section p {
  font-size: 10px;
  line-height: 14px;
  margin: 3px 0 0;
}
.pulse-center #six-picks .chips {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}
.pulse-center #six-picks button {
  min-height: 36px;
  font-size: 11px;
  padding: 2px;
}
.pulse-custom-section,
.pulse-meanings-section {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}
.pulse-custom-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) 42px;
  gap: 4px;
}
.pulse-custom-fields button {
  font-size: 11px;
  min-height: 34px;
}
.pulse-meaning-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.pulse-meaning-fields label {
  display: grid;
  grid-template-rows: 14px 32px;
  gap: 3px;
  font-size: 10px;
  color: var(--muted);
}
.pulse-meaning-fields input {
  height: 32px;
  font-size: 11px;
}
#simulate-arrival {
  font-size: 10px;
  min-height: 30px;
  padding: 3px 8px;
  width: 100%;
  margin: 5px 0;
}
@media (max-height: 700px) {
  #exam-dialog:has(.pulse-fixed-layout) {
    padding: 8px;
  }
  #exam-dialog[open]:has(.pulse-fixed-layout) {
    grid-template-rows: 40px minmax(0, 1fr);
  }
  .pulse-center {
    gap: 4px;
    padding: 8px;
  }
  .pulse-selection {
    min-height: 20px;
  }
  .pulse-center #pulse-depth button,
  .pulse-center #part-strength button,
  .pulse-center .local-tools button,
  .pulse-center #six-picks button {
    min-height: 30px;
  }
  .pulse-center #part-feel-scale {
    height: 32px;
    min-height: 32px;
  }
  .pulse-center #part-feel-scale button,
  .pulse-custom-fields button {
    min-height: 30px;
  }
  .pulse-center input {
    height: 30px;
  }
  .pulse-meaning-fields label {
    grid-template-rows: 12px 28px;
  }
  .pulse-meaning-fields input {
    height: 28px;
  }
  .overall-feels button {
    min-height: 36px;
  }
  .overall-scale {
    height: 34px;
  }
  .overall-scale button {
    min-height: 30px;
  }
  .overall-strength button {
    min-height: 32px;
  }
}
@media (max-width: 900px) {
  .pulse-fixed-layout {
    min-width: 900px;
  }
  #exam-dialog:has(.pulse-fixed-layout) #exam-content {
    overflow-x: auto;
    overflow-y: visible;
  }
}

/* Transient scales stay beside their selected row; settings are deliberate. */
.pulse-settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.pulse-settings-actions button {
  min-height: 38px;
  font-size: 12px;
}
.pulse-inline-scale {
  grid-column: 1 / -1;
}
.pulse-center #feel-picks > .pulse-inline-scale,
.overall-feels > .pulse-inline-scale {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  margin: 0;
  font-size: 11px;
}
.pulse-center #feel-picks > .pulse-inline-scale button,
.overall-feels > .pulse-inline-scale button {
  flex: 1;
  min-height: 32px;
  min-width: 0;
  padding: 2px;
  font-size: 11px;
}
.pulse-fixed-layout {
  --pulse-overall-row-height: 42px;
}
.custom-feel-list {
  margin-top: 18px;
}
.custom-feel-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}
#pulse-settings-content input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.pulse-shape-settings-list {
  display: grid;
  gap: 12px;
}
.pulse-shape-settings-list label {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.tongue-mark {
  touch-action: none;
}
.tongue-mark:focus-visible {
  outline: 2px solid #527b8a;
  outline-offset: 3px;
}
.tongue-normal-reference {
  opacity: 0.9;
}
@media (max-height: 700px) {
  .pulse-fixed-layout {
    --pulse-overall-row-height: 36px;
  }
  .pulse-settings-actions button {
    min-height: 32px;
  }
}

.tongue-mark-symbol.hollow {
  filter: drop-shadow(0 0 0.6px #8b756d);
}

/* The tongue drawing and point choices share the available examination height. */
#exam-dialog[open]:has(.tongue-work) {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
}
#exam-dialog:has(.tongue-work) #exam-content {
  min-height: 0;
}
#exam-dialog:has(.tongue-work) .dialog-head {
  min-height: 0;
  margin-bottom: 12px;
}
#exam-dialog .tongue-work {
  height: 100%;
  min-height: 0;
}
#exam-dialog .tongue-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  overflow: visible;
}
#exam-dialog .tongue-board > svg {
  flex: 1;
  min-height: 0;
  height: auto;
}
#exam-dialog .tongue-board > p {
  flex: none;
  margin: 6px 0;
  font-size: 11px;
}
#exam-dialog .tongue-board > button {
  flex: none;
}
#exam-dialog .tongue-board .photo-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  min-height: 30px;
}
#exam-dialog .tongue-board .photo-label input {
  width: 160px;
  height: 28px;
  padding: 3px;
  margin: 0;
}
#exam-dialog .tongue-options {
  min-height: 0;
  max-height: none;
}
#exam-dialog .tongue-options h3 {
  margin: 7px 0 5px;
}
#exam-dialog .tongue-options textarea {
  min-height: 60px;
  height: 70px;
}
#exam-dialog .tongue-photo {
  flex: none;
  height: 70px;
}
@media (max-height: 700px) {
  #exam-dialog[open]:has(.tongue-work) {
    grid-template-rows: 48px minmax(0, 1fr);
    padding: 12px;
  }
  #exam-dialog .tongue-options .chips button {
    min-height: 34px;
  }
  #exam-dialog .tongue-options h3 {
    margin-top: 4px;
  }
  #exam-dialog .tongue-options textarea {
    min-height: 48px;
    height: 48px;
  }
}
/* 03–05 refinement: compact provenance, direct planning, familiar Rx workbench. */
.pattern-candidate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 92px;
}
.diagnostic-sources {
  display: flex;
  gap: 7px;
  font-size: 15px;
  line-height: 20px;
  color: var(--green);
}
.doctor-confirm {
  font-size: 20px;
  min-height: 40px;
  min-width: 44px;
  padding: 3px 8px;
  margin-right: 5px;
}
.pattern-table .doctor-confirm:not(.on) {
  opacity: 0.55;
}
.pattern-table .doctor-confirm.on {
  outline: 2px solid #64897a;
}
.plan-doses {
  gap: 18px;
  margin: 18px 0;
}
.plan-doses > div {
  background: #f7f9f3;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.plan-doses .chips {
  margin: 6px 0 14px;
}
.plan-doses .chips button {
  min-height: 44px;
}
.consensus-card {
  background: #edf4ee;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid #c9d9c9;
  margin: 18px 0;
}
#consensus-text {
  font-size: 14px;
  color: var(--green);
}
.mapping-state {
  background: #f5f2e9;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  margin-bottom: 15px;
}
.advice-category {
  padding: 3px 0 12px;
  border-bottom: 1px solid var(--line);
}
.advice-category h4 {
  margin: 12px 0 7px;
  font-weight: 600;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.catalog-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 44px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.5;
}
.catalog-option.selected {
  background: #eef5eb;
  border-color: #99b29b;
}
.catalog-option input {
  flex: 0 0 auto;
  accent-color: var(--green);
  width: 17px;
  height: 17px;
}
.monitor-dot {
  color: var(--green);
  margin-left: auto;
}
.advice-row {
  grid-template-columns: minmax(0, 1fr) auto;
}
.advice-actions {
  flex-wrap: wrap;
  align-content: center;
}
.advice-actions button {
  min-height: 42px;
  font-size: 12px;
}
#advice-preset-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}
.language-switch {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.language-switch button {
  min-height: 44px;
}
.patient-pattern small,
#patient-preview p small,
#patient-display-shell p small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}
#rx-dialog {
  width: min(1400px, 96vw);
  max-width: 96vw;
}
.rx-reference-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.rx-reference-tabs {
  display: flex;
  gap: 7px;
  margin: 12px 0;
}
.rx-reference-image {
  background: #f9fbf5;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 22px;
  padding: 8px 20px;
  min-height: 300px;
}
.rx-reference-image > .pulse-svg {
  width: min(100%, 800px);
  height: 435px;
}
.rx-reference-image > .tongue-svg,
.rx-reference-image > .abdomen-svg {
  width: 320px;
  height: 380px;
}
.rx-reference-image > p {
  max-width: 360px;
}
.rx-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 26px;
  align-items: start;
}
.rx-layout .rx-review {
  position: sticky;
  top: 0;
  padding: 20px;
  background: #f5f8f0;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.rx-layout h3 {
  margin: 16px 0 10px;
}
.rx-layout #formula-search {
  flex: 1;
  min-height: 48px;
}
#standard-prescription {
  background: white;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 15px/1.9 inherit;
  min-height: 90px;
}
.rx-total {
  background: #2f6557;
  color: white;
  border-radius: 12px;
  padding: 20px;
}
.rx-total small {
  color: #d4e5db;
}
.rx-total strong {
  display: block;
  font-size: 52px;
  font-weight: 500;
  line-height: 1.4;
}
.rx-total strong span {
  font-size: 23px;
}
.rx-total p {
  margin: 5px 0;
}
.dispensing-choice {
  margin: 12px 0;
}
.dispensing-choice > span {
  display: block;
  margin-bottom: 6px;
}
.rx-review #rx-merge {
  width: 100%;
}
#mechanism-groups .unavailable {
  color: #8b8d80;
  background: #fafaf6;
}
#selected-formulas .formula-card {
  padding: 14px;
}
#selected-formulas .formula-card p {
  font-size: 12px;
}
#selected-formulas .formula-card small {
  display: block;
  color: var(--muted);
}
@media (max-width: 1000px) {
  .catalog-grid,
  #advice-preset-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .advice-row {
    grid-template-columns: 1fr;
  }
  .rx-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    gap: 16px;
  }
}
@media (max-width: 700px) {
  .catalog-grid,
  #advice-preset-options,
  .rx-layout {
    grid-template-columns: 1fr;
  }
  .rx-layout .rx-review {
    position: static;
  }
  .rx-reference-image > .pulse-svg {
    height: auto;
  }
}
.rx-review .chips button {
  display: inline-flex;
  width: auto;
  margin: 0;
  min-height: 44px;
}
.rx-reference-image .pulse-svg text {
  font-size: 23px;
}
.rx-reference-image .pulse-svg .organ-text {
  font-size: 18px;
}
.rx-reference-image .pulse-svg .feel-text {
  font-size: 21px;
}
.rx-reference-image .pulse-svg .strength-text {
  font-size: 25px;
}
#advice-category-tabs {
  margin: 16px 0 8px;
}
/* Six doctor-requested refinements: single values, readable exams, neutral dots and direct agreement. */
.intake-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.intake-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.intake-value {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.intake-edit-trigger {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  color: var(--ink);
  text-align: left;
  white-space: normal;
}
.intake-edit-trigger:hover {
  background: #f6f8f3;
}
.edit-hint {
  font-size: 11px;
  color: #839187;
  flex-shrink: 0;
  opacity: 0;
}
.intake-edit-trigger:hover .edit-hint,
.intake-edit-trigger:focus .edit-hint {
  opacity: 1;
}
.intake-editor input {
  width: 100%;
}
.intake-editor button {
  min-height: 40px;
  padding: 6px 10px;
}
.intake-editor .row {
  margin: 7px 0 0;
}
.pending-edit {
  color: #9b763e;
}
.corrected-tag {
  color: var(--muted);
}
#exam-cards {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
}
#exam-cards .exam-card {
  padding: 18px;
  min-height: 0;
}
#exam-cards [data-exam="abdomen"] {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: 220px 1fr;
  column-gap: 24px;
  align-items: center;
}
#exam-cards [data-exam="abdomen"] h3 {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
}
#exam-cards [data-exam="abdomen"] > svg {
  grid-column: 1;
  grid-row: 1/3;
  height: 240px;
}
#exam-cards [data-exam="abdomen"] small {
  grid-column: 2;
  align-self: start;
}
#exam-cards [data-exam="tongue"] > svg {
  height: 395px;
  width: 100%;
  transform: none;
}
#exam-cards .exam-card > small {
  font-size: 14px;
}
.pulse-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.pulse-overview-side + .pulse-overview-side {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.pulse-overview-side h4 {
  font-size: 18px;
  margin: 4px 0 12px;
  font-weight: 500;
}
.pulse-overview-part {
  display: grid;
  grid-template-columns: 34px 52px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 113px;
  padding: 6px 0;
}
.pulse-part-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
}
.pulse-part-name span {
  font-size: 13px;
  color: var(--muted);
}
.pulse-overview-frame {
  display: block;
  width: 52px;
  height: 101px;
}
.pulse-overview-frame .strength-text {
  font-size: 29px;
  fill: #466354;
}
.pulse-overview-feel {
  font-size: 17px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  font-weight: 500;
}
.pulse-overview-feel small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
.pulse-overview-total {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
  line-height: 1.5;
}
.source-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  vertical-align: middle;
}
.source-pulse {
  background: #c5aa6b;
}
.source-tongue {
  background: #b58d97;
}
.source-abdomen {
  background: #8a9eaa;
}
.source-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}
.source-legend > span {
  display: flex;
  gap: 5px;
  align-items: center;
}
.diagnostic-sources {
  min-height: 12px;
  align-items: center;
  gap: 6px;
}
.pattern-candidate {
  min-width: 80px;
  background: white;
  border-color: #e2e6df;
  padding: 9px 12px;
}
.pattern-candidate b {
  font-weight: 500;
}
.pattern-table .pattern-rank {
  width: 100px;
  min-width: 100px;
}
.pattern-rank > b {
  font-weight: 500;
  font-size: 12px;
}
.pattern-order {
  display: flex;
  gap: 2px;
  margin-top: 4px;
}
.pattern-order button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  color: #6f7c73;
  border: 0;
  background: transparent;
  font-size: 18px;
}
.pattern-order button:disabled {
  opacity: 0.2;
  cursor: default;
}
.pattern-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pattern-delete {
  border: 0;
  background: transparent;
  color: #8c958d;
  font-size: 20px;
  padding: 0;
  min-width: 36px;
  min-height: 38px;
}
#pattern-rename-dialog {
  width: min(420px, 94vw);
}
#pattern-rename-form {
  display: grid;
  gap: 8px;
}
#pattern-rename-status:empty {
  display: none;
}
#pattern-rename-form button[type=submit] {
  justify-self: end;
}
.consensus-tick-group {
  display: flex;
  gap: 18px;
  margin: 12px 0;
  align-items: flex-start;
}
.consensus-tick-group > span {
  padding-top: 12px;
  width: 64px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
}
.consensus-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.consensus-tick {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d4ded1;
  padding: 10px 13px;
  border-radius: 8px;
  min-height: 46px;
  cursor: pointer;
  background: white;
  font-size: 14px;
}
.consensus-tick input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}
.consensus-tick small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.consensus-tick.selected {
  border-color: #93ae9a;
  background: #f5f9f2;
}
@media (max-width: 1100px) {
  #exam-cards {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  }
  .pulse-overview {
    gap: 10px;
  }
  .pulse-overview-side + .pulse-overview-side {
    padding-left: 9px;
  }
  .pulse-overview-part {
    grid-template-columns: 32px 46px minmax(0, 1fr);
    gap: 4px;
  }
  .pulse-overview-frame {
    width: 46px;
  }
  .pulse-overview-feel {
    font-size: 16px;
  }
}
@media (max-width: 850px) {
  #exam-cards {
    grid-template-columns: 1fr;
  }
  #exam-cards [data-exam="abdomen"] {
    grid-column: auto;
  }
  #exam-cards [data-exam="tongue"] > svg {
    width: 320px;
    max-width: 100%;
    margin: auto;
  }
}
@media (hover: none) {
  .edit-hint {
    opacity: 1;
  }
}
@media (max-width: 550px) {
  #exam-cards .exam-card {
    padding: 12px;
  }
  .pulse-overview-part {
    grid-template-columns: 32px 46px;
    justify-content: start;
    min-height: 146px;
  }
  .pulse-overview-feel {
    grid-column: 1/-1;
  }
  .pulse-overview-total {
    font-size: 15px;
  }
  .consensus-tick-group {
    flex-direction: column;
    gap: 5px;
  }
  .consensus-tick-group > span {
    width: auto;
    padding-top: 0;
  }
}
.pattern-table th:first-child {
  width: 104px;
}
.pattern-table th:nth-child(2) {
  width: 21%;
}
.pattern-table th:nth-child(3) {
  width: 35%;
}
.pattern-table th:nth-child(4) {
  width: 18%;
}
.pattern-table th:nth-child(5) {
  width: 12%;
}
.pattern-order button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
}
/* Compact clinical workspace: small gaps, real-size readable text, no enlarged overview canvases. */
header {
  height: 50px;
  padding: 0 16px;
  gap: 12px;
}
.brand {
  font-size: 20px;
}
.layout {
  grid-template-columns: 190px minmax(0, 1fr);
  padding: 10px 16px 60px;
  gap: 14px;
  font-size: 13px;
}
.layout aside {
  top: 8px;
  max-height: calc(100dvh - 64px);
}
.patient-choice {
  padding: 5px 8px;
  margin: 3px 0;
  min-height: 40px;
  border-radius: 6px;
}
.patient-choice strong {
  font-size: 13px;
}
#patient-list {
  max-height: 270px;
  overflow: auto;
}
aside #patient-search {
  margin: 3px 0 6px;
  padding: 6px 7px;
}
aside #patient-context .caution {
  padding: 7px;
  margin: 7px 0;
}
aside .row {
  margin: 4px 0;
}
.layout main > section {
  padding: 10px 12px;
  margin: 8px 0;
  border-radius: 8px;
  scroll-margin-top: 47px;
}
.layout .section-title {
  margin-bottom: 7px;
  gap: 8px;
  flex-wrap: wrap;
}
.layout h2 {
  font-size: 18px;
}
.layout h3 {
  font-size: 13px;
}
.layout p {
  margin: 4px 0;
}
.title-row {
  margin-bottom: 5px;
}
.title-row h2 {
  font-size: 20px;
}
.title-row .row {
  margin: 3px 0;
}
#tabs {
  padding: 3px 0;
  gap: 0;
}
#tabs button {
  min-height: 34px;
  padding: 4px 7px;
}
.layout main > section button {
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 6px;
}
.layout main > section input:not([type="checkbox"]),
.layout main > section textarea {
  padding: 6px 7px;
}
.layout .field {
  margin-bottom: 6px;
  gap: 3px;
}
.layout main > section > .muted:last-child {
  font-size: 10px;
  margin-top: 4px;
}
.layout .review-bar,
body.comments-open .layout .review-bar,
body.comments-open #treatment .section-title {
  padding: 5px 0 0;
  gap: 8px;
  margin-top: 6px;
}
.layout details {
  padding: 4px 0;
}
.layout summary {
  min-height: 26px;
  font-size: 12px;
}
.layout .row {
  margin: 5px 0;
}
.risk-box {
  margin-top: 0;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 12px;
}
.risk-box .row {
  margin: 0 0 2px;
}
.risk-box p {
  margin: 2px 0;
}
.risk-box .risk-confirm {
  padding: 5px 7px;
  font-size: 12px;
}
#basic .section-title .muted {
  margin-left: auto;
  font-size: 10px;
}
#intake-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 12px;
}
#intake-fields .intake-item {
  display: grid;
  grid-template-columns: minmax(54px, 0.7fr) minmax(0, 1fr);
  gap: 3px 6px;
  padding: 4px 0;
  min-height: 30px;
  align-items: start;
}
#intake-fields .intake-wide {
  grid-column: span 2;
  grid-template-columns: minmax(70px, 0.32fr) minmax(0, 1fr);
}
#intake-fields .intake-label {
  font-size: 11px;
  line-height: 1.35;
  margin: 0;
}
#intake-fields .intake-value {
  min-height: 0;
  padding: 0;
  line-height: 1.4;
  font-size: 12px;
  font-weight: 450;
}
#intake-fields .intake-edit-trigger {
  gap: 3px;
}
#intake-fields .edit-hint {
  font-size: 9px;
}
#intake-fields .intake-editor {
  min-width: 0;
}
#intake-fields .intake-editor input {
  width: 100%;
  padding: 4px;
  font-size: 12px;
}
#intake-fields .intake-editor .row {
  gap: 3px;
  flex-wrap: wrap;
}
#intake-fields .intake-editor button {
  min-height: 27px;
  padding: 2px 5px;
  font-size: 11px;
}
#intake-fields .corrected-tag,
#intake-fields .pending-edit {
  grid-column: 2;
  font-size: 9px;
  line-height: 1.2;
}
.summary-placeholder {
  padding: 5px 8px;
  margin-bottom: 6px;
  border-radius: 5px;
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 12px;
}
.summary-placeholder > b {
  flex-shrink: 0;
}
.summary-placeholder > p {
  margin: 0;
}
#exam-cards {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 6px;
  align-items: stretch;
}
#exam-cards .exam-card {
  padding: 7px 8px;
  border-radius: 6px;
  min-height: 0;
}
#exam-cards .exam-card h3 {
  margin: 0 0 3px;
}
#exam-cards [data-exam="abdomen"] {
  display: block;
  grid-column: auto;
}
#exam-cards [data-exam="abdomen"] h3,
#exam-cards [data-exam="abdomen"] > svg,
#exam-cards [data-exam="abdomen"] small {
  grid-column: auto;
  grid-row: auto;
}
#exam-cards [data-exam="tongue"] > svg,
#exam-cards [data-exam="abdomen"] > svg {
  height: 225px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  transform: none;
}
#exam-cards .exam-card > small {
  font-size: 13px;
  line-height: 1.3;
  display: block;
  min-height: 0;
}
#exam-cards .abdomen-svg text {
  font-size: 25px;
}
.pulse-overview {
  gap: 7px;
}
.pulse-overview-side + .pulse-overview-side {
  padding-left: 7px;
}
.pulse-overview-side h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}
.pulse-overview-part {
  grid-template-columns: 31px 34px minmax(0, 1fr);
  gap: 4px;
  padding: 0;
  min-height: 65px;
}
.pulse-overview-frame {
  width: 34px;
  height: 65px;
}
.pulse-overview-frame .strength-text {
  font-size: 36px;
}
.pulse-part-name {
  font-size: 15px;
  gap: 0;
}
.pulse-part-name span {
  font-size: 10px;
}
.pulse-overview-feel {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 500;
}
.pulse-overview-feel small {
  font-size: 11px;
  line-height: 1.2;
  min-height: 0;
}
.pulse-overview-total {
  margin-top: 0;
  padding-top: 3px;
  gap: 0;
  font-size: 13px;
  line-height: 1.3;
}
.layout .candidate-strip {
  padding: 6px 8px;
  gap: 6px;
  margin-bottom: 5px;
}
.layout .pattern-candidate {
  min-width: 65px;
  gap: 1px;
  padding: 4px 8px;
}
.pattern-table .empty-row {
  height: 24px;
}
.pattern-table td {
  padding: 5px 6px;
}
.pattern-rank > b {
  font-size: 11px;
}
.layout .pattern-order {
  margin-top: 1px;
}
.layout .pattern-order button {
  min-width: 30px;
  width: 30px;
  min-height: 30px;
  padding: 0;
}
.layout .pattern-delete {
  min-height: 30px;
  min-width: 24px;
  padding: 0;
}
.layout .pattern-table small {
  font-size: 9px;
}
.layout .pattern-table .tiny {
  min-height: 23px;
  padding: 1px 4px;
  font-size: 9px;
}
.layout .plan-doses {
  padding: 0;
  margin: 6px 0;
  gap: 8px;
  background: none;
}
.layout .plan-doses > div {
  padding: 7px 9px;
  border-radius: 6px;
}
.layout .plan-doses .chips {
  margin: 3px 0 5px;
  gap: 4px;
}
.layout .plan-doses .chips button {
  min-height: 31px;
}
.layout .consensus-card {
  padding: 7px 9px;
  margin: 7px 0;
  border-radius: 6px;
}
.layout .consensus-tick-group {
  margin: 5px 0;
  gap: 9px;
  align-items: center;
}
.layout .consensus-tick-group > span {
  padding-top: 0;
  width: 62px;
  font-size: 12px;
}
.layout .consensus-tick {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 12px;
  gap: 5px;
}
.layout .consensus-tick input {
  width: 16px;
  height: 16px;
}
.layout .consensus-ticks {
  gap: 5px;
}
.layout #consensus-text {
  margin: 3px 0 0;
  font-size: 12px;
}
.layout #plan textarea {
  min-height: 45px;
}
.layout .mapping-state {
  padding: 5px 7px;
  margin-bottom: 5px;
  font-size: 11px;
}
.layout #advice-category-tabs {
  margin: 6px 0;
  gap: 4px;
}
.layout .advice-category {
  padding: 0 0 5px;
}
.layout .advice-category h4 {
  margin: 3px 0;
  font-size: 12px;
}
.layout .catalog-grid {
  gap: 4px;
}
.layout .catalog-option {
  padding: 4px 6px;
  min-height: 30px;
  font-size: 12px;
}
.layout .advice-row {
  padding: 6px 8px;
  margin: 5px 0;
  gap: 4px;
}
.layout .advice-row p {
  margin: 0;
}
.layout .advice-actions button {
  min-height: 30px;
  padding: 3px 6px;
  font-size: 11px;
}
.layout .effect-box {
  margin-top: 6px;
  padding: 7px 9px;
}
.layout .effect-box textarea {
  min-height: 50px;
}
.layout .treatment-summary {
  padding: 7px 9px;
}
.note-language {
  display: flex;
  margin-left: auto;
  gap: 4px;
}
#note-editor,
#note-en {
  min-height: 280px;
  height: 340px;
  font-size: 13px;
  line-height: 1.5;
}
.meeting {
  padding: 6px 16px;
  min-height: 43px;
}
.meeting button {
  min-height: 30px;
  padding: 4px 8px;
}
#floating-note {
  width: 220px;
  bottom: 52px;
  padding: 8px;
}
#floating-note textarea {
  min-height: 46px;
  height: 60px;
  padding: 5px;
  font-size: 12px;
}
#floating-note p {
  display: none;
}
#floating-note .row {
  margin: 0 0 4px;
  gap: 4px;
}
#floating-note small {
  font-size: 9px;
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 170px minmax(0, 1fr);
    padding: 8px 12px 55px;
    gap: 12px;
  }
  #intake-fields {
    gap: 0 8px;
  }
  #intake-fields .intake-item {
    grid-template-columns: minmax(48px, 0.7fr) minmax(0, 1fr);
  }
  .pulse-overview-feel {
    font-size: 16px;
  }
  #exam-cards {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.9fr) minmax(0, 1fr);
  }
}
@media (max-width: 800px) {
  #intake-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #exam-cards {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  }
  #exam-cards [data-exam="abdomen"] {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 170px 1fr;
  }
  #exam-cards [data-exam="abdomen"] > svg {
    grid-row: 1/3;
    height: 180px;
  }
}
@media (max-width: 760px) {
  .layout {
    display: block;
  }
  .summary-placeholder {
    display: block;
  }
}
@media (max-width: 550px) {
  #intake-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #exam-cards {
    grid-template-columns: 1fr;
  }
  .pulse-overview-part {
    grid-template-columns: 31px 34px minmax(0, 1fr);
  }
  .pulse-overview-feel {
    grid-column: auto;
  }
  #exam-cards [data-exam="tongue"] > svg {
    width: 230px;
    margin: auto;
  }
  .layout .consensus-tick-group {
    flex-direction: row;
    align-items: flex-start;
  }
}
#basic summary {
  min-height: 22px;
  padding: 1px 0;
}
#basic .section-title {
  margin-bottom: 4px;
}
#basic h2 {
  line-height: 1.3;
}
#intake-fields {
  margin: 3px 0;
}
.host-additional-fields {display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:0 12px}
.host-additional-fields .intake-item {padding:4px 0;min-width:0;border-bottom:1px solid #e5e9e2}
.host-additional-fields .intake-label,.host-additional-fields summary {font-size:11px}
.host-additional-fields .intake-value {font-size:12px;line-height:1.4;margin:2px 0;overflow-wrap:anywhere}
.host-additional-fields details {margin:2px 0;font-size:10px}
#host-additional-intake h4 {margin:6px 0 2px;font-size:12px}
.host-diagnosis-pending {display:block;color:#77786c;font-size:11px}
.pulse-overview-feel small {
  background: transparent;
  position: static;
}
#intake-fields .edit-hint {
  display: none;
}
#intake-fields .intake-edit-trigger:hover {
  text-decoration: underline;
  text-decoration-color: #afc3b3;
}
@media (min-width: 761px) {
  #floating-note {
    left: 16px;
    right: auto;
    bottom: 50px;
    width: 188px;
  }
  .layout aside {
    padding-bottom: 125px;
  }
  #patient-context hr {
    margin: 6px 0;
  }
  #patient-context h3 {
    font-size: 13px;
  }
  #patient-context > button {
    min-height: 27px;
    padding: 3px 7px;
    font-size: 11px;
  }
  #patient-list {
    max-height: max(120px, calc(100dvh - 565px));
    margin-top: 5px;
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  #floating-note {
    left: 12px;
    width: 168px;
  }
}
#floating-note .row b {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Physician review refinements. Keep full-size pulse editing unchanged. */
#exam-cards .pulse-overview-feel,
#exam-cards .pulse-overview-side h4,
#exam-cards .pulse-part-name,
#exam-cards .pulse-overview-total {font-size:13px;line-height:1.3}
#exam-cards .pulse-overview-frame .strength-text {font-size:28px}
.source-pulse {background:#54859b}
.source-tongue {background:#967ea3}
.source-abdomen {background:#af8154}
.advice-catalog {display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:5px 8px}
.advice-choice {display:flex;align-items:stretch;gap:3px;min-width:0}
.advice-choice .catalog-option {flex:1;margin:0;padding:6px 8px;min-width:0;min-height:36px}
.advice-choice .catalog-option span {min-width:0;overflow-wrap:anywhere}
.advice-choice small {display:block;color:var(--muted);font-size:10px}
.advice-star {min-width:36px;min-height:36px;padding:3px 7px;font-size:19px;color:#7e7561}
.advice-star.on,.advice-star[aria-pressed="true"] {background:#f5efdc;border-color:#c4ae74;color:#8b6e32}
.advice-star:disabled {opacity:.35}
.effect-picks {display:flex;flex-wrap:wrap;gap:7px;margin:7px 0 9px}
.effect-picks button {border-radius:999px;min-height:38px;min-width:76px;padding:6px 13px;font-size:14px;color:#687b88;background:#f9fafb;border-color:#dce4eb}
.effect-picks button.on {background:var(--green);border-color:var(--green);color:white}
.effect-break {flex-basis:100%;height:0}
.effect-details {margin-top:4px;font-size:12px}
.effect-details > summary {color:var(--muted)}
.meeting {gap:8px;padding:6px 16px}
.meeting #meeting-slot {gap:8px;min-width:0;flex-wrap:wrap}
.meeting-controls-preview {display:flex;gap:4px;align-items:center}
.meeting .meeting-controls-preview button {min-height:32px;padding:4px 10px}
.meeting-unavailable {color:var(--muted)}
#comments-toggle {white-space:nowrap;min-height:34px}
@media(max-width:760px) {
  .meeting {padding:5px 8px;gap:5px;flex-wrap:wrap}
  .layout {padding-bottom:108px}
  .meeting #meeting-slot {flex:1 1 100%;gap:6px}
  .meeting .meeting-unavailable {display:inline}
  .meeting-controls-preview {margin-left:auto}
  #floating-note {bottom:95px}
}
#floating-note .row button {
  min-height: 24px;
  padding: 2px 5px;
  font-size: 10px;
}

/* Connected clinical workbench */
.clinical-workbench .prototype-only,
.clinical-workbench [hidden] {
  display: none !important;
}
.clinical-workbench #host-mode-status {
  padding: 6px 16px;
  color: #5d3d22;
  background: #f8f1e4;
  font-size: 13px;
}
.clinical-workbench #host-mode-status:is([data-phase=loaded], [data-phase=saved], [data-phase=loading], [data-phase=pending]) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.clinical-workbench .original-location-controller {
  margin-bottom: 10px;
}
.clinical-workbench .original-location-controller > span {
  display: block;
  margin-bottom: 4px;
}
.clinical-workbench .original-location-controller button {
  min-height: 36px;
  padding: 5px 8px;
  font-size: 12px;
}
.clinical-workbench .original-location-controller button + button {
  margin-left: 4px;
}
.clinical-workbench .original-location-controller button[aria-pressed=true] {
  background: #e6efe3;
  border-color: #91af96;
}
.clinical-workbench #location-status {
  margin: 3px 0 12px;
}
.clinical-workbench #host-capabilities {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}
.clinical-workbench #patient-context {
  margin: 8px 0 0;
}
.clinical-workbench #this-history {
  width: 100%;
  font-size: 12px;
}
.clinical-workbench .patient-choice {
  min-height: 44px;
}
.clinical-workbench .patient-choice strong {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 7px;
}
.clinical-workbench .current-visit-label {
  border-radius: 4px;
  background: #dce9df;
  color: #274c3d;
  padding: 1px 5px;
  font-size: 0.75em;
}
.clinical-workbench #basic .clinical-risk {
  background: #f8faf6;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 7px;
}
.clinical-workbench #basic .clinical-risk[data-allergy] {
  background: #faf3e7;
  border-color: #e7d5b9;
}
.clinical-workbench .clinical-risk p {
  margin: 4px 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.clinical-workbench .clinical-risk summary,
.clinical-workbench #intake-more > summary,
.clinical-workbench #host-additional-intake > summary {
  color: var(--muted);
  font-size: 12px;
}
.clinical-workbench #intake-more .fields {
  margin-top: 5px;
}
.clinical-workbench #intake-more .intake-item {
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.clinical-workbench #floating-note {
  width: min(244px, calc(100vw - 24px));
  max-height: calc(100dvh - 76px);
  left: auto;
  right: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.clinical-workbench #floating-note > .row {
  position: sticky;
  top: 0;
  background: inherit;
  cursor: auto;
  touch-action: auto;
  flex-wrap: nowrap;
  justify-content: space-between;
}
.clinical-workbench #comment-title {
  overflow-wrap: anywhere;
  font-size: 13px;
}
.clinical-workbench #comments-close {
  min-height: 38px;
  padding: 4px 8px;
  font-size: 12px;
  flex-shrink: 0;
}
.clinical-workbench #quick-note {
  width: 100%;
  height: 106px;
  min-height: 70px;
  resize: vertical;
  font-size: 14px;
}
.clinical-workbench #comment-status {
  font-size: 11px;
}
.clinical-workbench .meeting .drma-meeting-player[data-meeting-docked] nav button:disabled {
  display: none;
}
.clinical-workbench .meeting .meeting-dock-more > summary {
  min-height: 36px;
}
@media (max-width: 720px) {
  .clinical-workbench .original-location-controller {
    margin-bottom: 4px;
  }
  .clinical-workbench #patient-list {
    max-height: 135px;
  }
}
@media (max-width: 760px) {
  .clinical-workbench #floating-note {
    max-height: calc(100dvh - 116px);
  }
}
