/* ACE DNTL | NOTA — editorial utility. Ink on paper, hairlines, red only while recording. */

:root {
  --paper: #F5F2EC;
  --ink: #0B0B0C;
  --dim: #6b6660;
  --hair: #E2DCD2;
  --red: #C41E1E;
  --green: #1d6b45;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  max-width: 560px;
  margin-inline: auto;
  padding: max(20px, env(safe-area-inset-top)) 24px 40px;
  -webkit-font-smoothing: antialiased;
}

header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 18px; border-bottom: 1px solid var(--ink);
  margin-bottom: 28px;
}
.wm { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 19px; }
.wm b { font-style: normal; font-family: "Helvetica Neue", Helvetica, sans-serif; font-weight: 700; letter-spacing: .08em; }
.clinic-tag { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }

.screen { display: flex; flex-direction: column; gap: 18px; }
.hidden { display: none !important; }

.lead { font-size: 20px; line-height: 1.45; margin: 8px 0; }
.sub { display: block; color: var(--dim); font-size: 13px; margin-top: 6px; line-height: 1.5; }
.center { text-align: center; }
.err { color: var(--red); font-size: 14px; }
.hint { text-align: center; color: var(--dim); font-size: 13px; letter-spacing: .04em; margin-top: -6px; }

.row label, .recent label {
  display: block; font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 8px;
}

input[type="text"], textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--ink); background: transparent;
  font-family: inherit; font-size: 20px; padding: 8px 2px 10px; border-radius: 0;
  outline: none; color: var(--ink);
}
input::placeholder { color: #b9b2a6; }

.seg { display: flex; border: 1px solid var(--ink); border-radius: 2px; overflow: hidden; }
.segstack { display: flex; flex-direction: column; gap: 8px; }
.seg button {
  flex: 1; padding: 13px 4px; background: transparent; border: 0; font-family: inherit;
  font-size: 14px; letter-spacing: .02em; color: var(--ink); cursor: pointer;
  border-right: 1px solid var(--hair);
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--paper); }

button.primary, button.ghost, button.stop {
  width: 100%; padding: 18px; font-family: inherit; font-size: 15px; font-weight: 700;
  letter-spacing: .12em; border-radius: 2px; cursor: pointer;
}
button.primary { background: var(--ink); color: var(--paper); border: 0; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
button:disabled { opacity: .4; }

/* record button */
.record {
  width: 132px; height: 132px; border-radius: 50%;
  border: 1px solid var(--ink); background: transparent;
  margin: 26px auto 0; cursor: pointer; display: grid; place-items: center;
}
.record .dot { width: 88px; height: 88px; border-radius: 50%; background: var(--red); display: block; }
.record:active .dot { transform: scale(.94); }

/* recording state */
#rec { min-height: 62vh; justify-content: center; text-align: center; }
.recbanner {
  position: fixed; inset: 0 auto auto 0; width: 100%; z-index: 5;
  background: var(--red); color: #fff; font-weight: 700; letter-spacing: .22em; font-size: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 0 10px; text-align: center;
}
body.recording header { visibility: hidden; }
.pulse {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #fff;
  margin-right: 8px; animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
.timer { font-size: 76px; font-weight: 200; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.rec-meta { font-size: 15px; color: var(--ink); }
.seg-status { font-size: 12px; color: var(--dim); letter-spacing: .06em; min-height: 16px; }
.level { width: 220px; height: 3px; background: var(--hair); margin: 6px auto 0; border-radius: 2px; overflow: hidden; }
#levelBar { height: 100%; width: 0%; background: var(--ink); transition: width .12s linear; }
.mic-warn { color: var(--red); font-size: 13px; font-weight: 700; }
.stop { background: var(--red); color: #fff; border: 0; margin-top: 22px; }

/* processing */
#proc { min-height: 50vh; justify-content: center; align-items: center; text-align: center; }
.spinner {
  width: 34px; height: 34px; border: 2px solid var(--hair); border-top-color: var(--ink);
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* review */
.review-head { font-size: 14px; color: var(--dim); line-height: 1.5; margin: 0; }
#noteEdit {
  min-height: 52vh; border: 1px solid var(--hair); background: #fff; padding: 20px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; line-height: 1.65;
  border-radius: 2px;
}

.linklike {
  background: none; border: 0; color: var(--dim); font-family: inherit; font-size: 13px;
  letter-spacing: .04em; text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; align-self: flex-start; padding: 0;
}
.transcript {
  white-space: pre-wrap; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  line-height: 1.6; color: var(--dim); background: #fff; border: 1px solid var(--hair);
  padding: 16px; border-radius: 2px; max-height: 30vh; overflow-y: auto; margin: 0;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; margin-top: 1px; }

/* patient message */
.pmsg { width: 100%; border: 1px solid var(--ink); border-radius: 2px; padding: 18px; text-align: left; }
.pmsg label { display: block; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; }
.pmsg pre { white-space: pre-wrap; font-family: inherit; font-size: 15px; line-height: 1.6; margin: 0 0 14px; }
.pmsg-actions { display: flex; gap: 10px; }
.pmsg-actions button { flex: 1; padding: 13px; font-size: 13px; }

/* done */
#done { align-items: center; text-align: center; }
.qr { background: #fff; border: 1px solid var(--hair); padding: 14px; border-radius: 2px; margin-top: 6px; }
.qr img, .qr canvas { display: block; }
.note-url { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; margin: 4px 0 0; word-break: break-all; }

/* recent notes */
.recent { margin-top: 26px; border-top: 1px solid var(--hair); padding-top: 18px; }
.recent-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 14px;
}
.recent-item a { color: var(--ink); }
.recent-item .when { color: var(--dim); font-size: 12px; white-space: nowrap; }

/* consent */
.consent-text { font-size: 19px; line-height: 1.55; margin: 12px 0 6px; }
