/* Copied from docs/mockups/provider/shared.css so the console matches the approved mockups;
   console-only additions follow the copy. Keep the two in step when the mockup changes. */
/* =============================================================================
   With You — Provider mockup stylesheet
   =============================================================================
   Shared by the Android screen mockups and the web console mockups so the two
   read as one product. Placeholder-neutral palette: swap the accent for brand
   colour later.

   Light and dark are both defined because a consulting room is bright and a
   ward round at 2am is not.
   ========================================================================== */

:root {
  --bg:        #f4f5f7;
  --surface:   #ffffff;
  --surface-2: #f8f9fb;
  --line:      #dfe3e8;
  --text:      #1b1f24;
  --text-2:    #5c6670;
  --text-3:    #8b949e;

  --accent:    #2f6fdb;   /* interactive, links, primary action */
  --recording: #d1384a;   /* the recording state, and only that */
  --good:      #1f9d55;
  --warn:      #d98324;
  --danger:    #c62828;

  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 1px 2px rgba(16,24,40,.06), 0 4px 12px rgba(16,24,40,.06);
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  /* Indic scripts need a font stack that will not fall back to tofu. */
  --indic: "Noto Sans Telugu", "Noto Sans Devanagari", "Nirmala UI", var(--sans);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- page scaffolding --------------------------------------------------- */

.page { max-width: 1400px; margin: 0 auto; padding: 32px 24px 80px; }

.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 26px; font-weight: 650; margin: 0 0 6px; letter-spacing: -.01em; }
.page-head p  { margin: 0; color: var(--text-2); max-width: 70ch; }

.note {
  background: #fff8e6; border: 1px solid #f0d9a0; border-left: 3px solid var(--warn);
  border-radius: var(--radius); padding: 12px 14px; margin: 20px 0;
  font-size: 13px; color: #6b4e11;
}
.note strong { color: #4a3608; }

.section-title {
  font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); margin: 36px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* ---- screen grid ------------------------------------------------------- */

.screens { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }

.screen { width: 320px; }
.screen > figcaption {
  margin-top: 10px; font-size: 13px; color: var(--text-2);
}
.screen > figcaption b { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }

.wide { width: 100%; }

/* ---- phone frame ------------------------------------------------------- */

.phone {
  background: #11141a; border-radius: 26px; padding: 8px;
  box-shadow: var(--shadow);
}
.phone-screen {
  background: var(--surface); border-radius: 19px; overflow: hidden;
  min-height: 600px; display: flex; flex-direction: column;
}
.status-bar {
  background: var(--surface); color: var(--text-3);
  font-size: 10px; padding: 6px 12px; display: flex; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.app-bar {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.app-bar h2 { font-size: 15px; font-weight: 600; margin: 0; }
.app-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 12px; }

/* Android notification shade, for the foreground-service indicator */
.notif {
  background: #e9edf2; padding: 8px; font-size: 10px; color: var(--text-2);
}
.notif-card {
  background: var(--surface); border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 1px 3px rgba(16,24,40,.14);
}
.notif-card b { font-size: 11px; }

/* ---- browser frame ----------------------------------------------------- */

.browser { background: #11141a; border-radius: 12px; padding: 8px; box-shadow: var(--shadow); }
.browser-bar { display: flex; gap: 6px; align-items: center; padding: 2px 4px 8px; }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #48505c; display: block; }
.browser-bar span {
  flex: 1; background: #252a33; color: #9aa4b2; border-radius: 6px;
  font: 10px/1.8 var(--mono); padding: 0 8px; margin-left: 6px;
}
.browser-screen { background: var(--surface); border-radius: 8px; overflow: hidden; }

.console { display: flex; min-height: 520px; }
.console-nav {
  width: 176px; background: var(--surface-2); border-right: 1px solid var(--line);
  padding: 14px 0; font-size: 12px; flex-shrink: 0;
}
.console-nav a {
  display: block; padding: 8px 16px; color: var(--text-2); text-decoration: none;
}
.console-nav a.on { background: #e8f0fd; color: var(--accent); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent); }
.console-main { flex: 1; padding: 18px 20px; min-width: 0; }

/* ---- components -------------------------------------------------------- */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
}
.card.flat { background: var(--surface-2); border-color: transparent; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 600; cursor: default; text-align: center;
}
.btn.block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-danger  { background: var(--recording); color: #fff; }
.btn-good    { background: var(--good); color: #fff; }
.btn-quiet   { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-link    { background: none; color: var(--accent); padding: 6px 0; font-weight: 500; }
.btn-sm      { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }

.field { display: block; margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; font: inherit; font-size: 14px; background: var(--surface);
  color: var(--text);
}
.input.ph { color: var(--text-3); }

.chip {
  display: inline-block; padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 650; letter-spacing: .01em;
}
.chip-warn { background: #fdf0dd; color: #8a5411; }
.chip-good { background: #e3f5eb; color: #146c3a; }
.chip-rec  { background: #fbe4e7; color: #9c2431; }
.chip-info { background: #e8f0fd; color: #2456a6; }
.chip-grey { background: #eceff3; color: var(--text-2); }

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.tiny  { font-size: 11px; }
.mono  { font-family: var(--mono); }
.indic { font-family: var(--indic); }
.center { text-align: center; }

.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-item { padding: 11px 13px; border-bottom: 1px solid var(--line); background: var(--surface); }
.list-item:last-child { border-bottom: 0; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
td { padding: 10px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }

/* The recording bar: pinned, undismissable. Never a toast. */
.rec-bar {
  background: var(--recording); color: #fff; padding: 9px 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; font-weight: 600;
}
.rec-bar .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
  display: inline-block; margin-right: 7px;
}
.rec-bar button {
  background: rgba(255,255,255,.2); border: 0; color: #fff;
  border-radius: 6px; padding: 4px 9px; font: inherit; font-size: 12px;
}

.meter { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.meter i { width: 4px; border-radius: 2px; background: var(--recording); display: block; }

.sync { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.sync.ok { color: var(--good); }
.sync.pending { color: var(--warn); }

/* Provenance: the verbatim transcript snippet behind an extracted item. */
.provenance {
  background: var(--surface-2); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 9px 11px; font-size: 12px; color: var(--text-2);
}
.provenance .ts { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c; --surface: #1c2027; --surface-2: #22272f; --line: #2f353e;
    --text: #e6e9ee; --text-2: #a4adb8; --text-3: #7b848f;
    --accent: #6da2f5;
  }
  .note { background: #2b2415; border-color: #4a3d1c; color: #e8d5a8; }
  .note strong { color: #f5e6bd; }
  .chip-warn { background: #3a2c14; color: #f0c477; }
  .chip-good { background: #14311f; color: #7ed9a4; }
  .chip-rec  { background: #3a1c22; color: #f09aa6; }
  .chip-info { background: #1a2a45; color: #9dc0f7; }
  .chip-grey { background: #272c34; color: var(--text-2); }
  .console-nav a.on { background: #1d2a40; }
}

/* =============================================================================
   Console additions. From docs/mockups/provider/web-console.html's <style> block, plus the
   minimum a working (not static) console needs. No inline styles anywhere: the CSP has no
   'unsafe-inline' for styles, so every look is a class here.
   ========================================================================== */

html, body { height: 100%; }
.app-frame { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; font-size: 15px; }
.topbar select { width: auto; padding: 6px 10px; font-size: 13px; }
.console { flex: 1; min-height: 0; }
.console-nav a { cursor: pointer; }
.console-main { overflow: auto; }
.btn { cursor: pointer; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.view-title { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.view-sub { margin-bottom: 14px; }
.mb { margin-bottom: 12px; }
.mb-lg { margin-bottom: 16px; }
.mt { margin-top: 10px; }
.gap-sm { gap: 8px; }
.wrap { flex-wrap: wrap; }
.note-error { background: #fdecee; border-color: #f2c3c9; border-left-color: var(--danger); color: #7d1d27; }
.note-ok { background: #e9f7ef; border-color: #bfe6cf; border-left-color: var(--good); color: #145a32; }
.signin { max-width: 380px; margin: 10vh auto; }
.input-narrow { max-width: 120px; }
.input-mid { max-width: 260px; }
.input-auto { width: auto; }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.empty { padding: 24px; text-align: center; color: var(--text-2); }
.clickable { cursor: pointer; }
.list-item.on { background: #e8f0fd; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.side { position: sticky; top: 0; max-height: calc(100vh - 120px); overflow: auto; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; font-size: 13px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.board-col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 0 0 8px; }
.chip-tiny { font-size: 10.5px; }
.float-right { float: right; }
.seg-ts { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-right: 6px; }
.seg-speaker { font-weight: 600; margin-right: 4px; }
.seg-hit { outline: 2px solid var(--accent); outline-offset: 1px; }
mark.quote { background: rgba(47,111,219,.18); color: inherit; padding: 0 1px; border-radius: 2px; }
.flag-word { font-weight: 700; text-decoration: underline; text-decoration-color: var(--warn); text-decoration-thickness: 2px; }
.flag-neg { font-weight: 800; color: var(--danger); text-transform: uppercase; }
.readonly-body { white-space: pre-wrap; font-size: 13.5px; }
.blocked { opacity: .9; }
details > summary { cursor: pointer; }

/* Three visual states, never a percentage (spec §6, amended 2026-09-27). */
.conf-seg { padding: 9px 11px; border-radius: 6px; border-left: 3px solid var(--line); margin-bottom: 7px; font-size: 13.5px; line-height: 1.5; }
.conf-clear     { border-color: var(--good); background: rgba(31,157,85,.07); }
.conf-flag      { border-color: var(--warn); background: rgba(217,131,36,.09); }
.conf-uncertain { border-color: var(--danger); background: rgba(198,40,40,.09); }
/* No confidence data at all (today: ASR is not built). Deliberately NOT the clear style: shading
   an unscored segment green is exactly the false reassurance the spec forbids. */
.conf-unscored  { border-color: var(--line); background: transparent; }

.stepper { display: flex; align-items: center; gap: 5px; font-size: 11.5px; flex-wrap: wrap; }
.stepper .step { padding: 4px 11px; border-radius: 99px; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--line); font-weight: 600; }
.stepper .step.done { background: #e3f5eb; color: #146c3a; border-color: transparent; }
.stepper .step.current { background: var(--accent); color: #fff; border-color: transparent; }
.stepper .arrow { color: var(--text-3); font-size: 11px; }

.play-tap { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--accent); font-weight: 700; margin-left: 8px; white-space: nowrap; background: none; border: 0; cursor: pointer; padding: 0; }
.play-tap::before { content: "▶"; font-size: 8px; }

/* Dosage tap-to-confirm (spec §7, amended 2026-09-27): a pre-filled value renders visibly
   differently from a confirmed one, so "tapped past it" and "checked it" differ afterwards. */
.dose-confirm { background: var(--surface-2); border: 1px dashed var(--warn); border-radius: 8px; padding: 9px 11px; margin-top: 9px; }
.tap-field { display: inline-flex; gap: 6px; align-items: baseline; margin: 3px 8px 3px 0; padding: 5px 10px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; border: 1px dashed var(--warn); background: var(--surface); color: var(--text); }
.tap-field .k { font-size: 11px; color: var(--text-2); }
.tap-field .v { font-weight: 700; font-family: var(--mono); }
.tap-field.confirmed { border: 1px solid var(--good); background: #e3f5eb; color: #146c3a; }
.tap-field.confirmed::after { content: "✓"; font-weight: 700; }

.needs-clar { border-color: var(--warn); background: #fff8e6; }
.escalated { border-color: var(--danger); }

.retain-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); }

/* W11 record sidebar: the allergy status line is first and never looks empty. */
.allergy-line { border-radius: 8px; padding: 8px 10px; font-weight: 700; margin-bottom: 10px; }
.allergy-rec  { background: #fbe4e7; color: #9c2431; }
.allergy-good { background: #e3f5eb; color: #146c3a; }
.allergy-grey { background: #eceff3; color: var(--text-2); }
.record-head { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 3px; }
.record-list { margin: 0; padding-left: 18px; }
.record-list li { margin-bottom: 4px; }

/* W12 results. Struck values stay visible (O11). Pre-filled values are dashed until tapped. */
.struck { text-decoration: line-through; color: var(--text-3); }
.fact-lines { margin: 4px 0 0; padding-left: 16px; }
.alert-open { border: 2px solid var(--danger); background: #fdecee; color: #7d1d27; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.value-row { border: 1px dashed var(--warn); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--surface-2); }
.value-row.confirmed { border: 1px solid var(--good); background: #e3f5eb; }
.value-row .tap { cursor: pointer; }
.value-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.page-photo { max-width: 100%; max-height: 70vh; border: 1px solid var(--line); border-radius: 8px; }
.phone-block { border: 2px solid var(--danger); background: #fdecee; color: #7d1d27; border-radius: 10px; padding: 12px; margin: 10px 0; }
.trend-svg { width: 100%; height: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.trend-band { fill: rgba(31,157,85,.14); }
.trend-band-open { fill: rgba(31,157,85,.07); }
.trend-line { stroke: var(--text-2); stroke-width: 1.5; fill: none; }
.trend-pt-in { fill: var(--text-2); }
.trend-pt-out { fill: var(--accent); stroke: var(--text); stroke-width: 1; }
.trend-alert { fill: none; stroke: var(--danger); stroke-width: 2; }
.trend-step { stroke: var(--warn); stroke-dasharray: 3 3; }
.trend-axis { font-size: 10px; fill: var(--text-3); }

@media (prefers-color-scheme: dark) {
  .note-error { background: #3a1c22; border-color: #5a2a33; color: #f5c2ca; }
  .note-ok { background: #14311f; border-color: #1f4a30; color: #a8e6c1; }
  .needs-clar { background: #2b2415; }
  .tap-field.confirmed { background: #14311f; color: #7ed9a4; }
  .list-item.on { background: #1d2a40; }
}

.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
audio { width: 100%; margin-top: 6px; }

/* TEST PRACTICE band (organizations.is_demo). Striped so it cannot be mistaken for a notice. */
.demo-band { background: repeating-linear-gradient(135deg, #fff1c2 0 14px, #ffe69a 14px 28px); color: #5c4300;
  font-weight: 700; font-size: 12.5px; letter-spacing: .04em; text-align: center; padding: 5px 10px; border-bottom: 1px solid #e8c766; }

/* W15 BEGIN: the family bridge (views/family.js, views/familysummary.js) */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pair-col { max-height: calc(100vh - 260px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface); }
.pair-line.amber { background: #fffaf2; border-radius: var(--radius); padding: 4px; }
.input.amber { border-color: var(--warn); }
.diff-before { text-decoration: line-through; color: var(--text-3); }
/* W15 END */
.drug-suggest .btn { display: block; text-align: left; }
