/* Clinical Note App — TEC colours from the roster app. Compact: more on one screen, less scrolling. */
:root {
  --teal: #61abb8;
  --teal-dark: #4d96a3;
  --teal-deep: #326e79;
  --pale: #e1eff2;
  --pale-2: #f0f7f9;
  --ink: #2a2a2c;
  --charcoal: #3f3f41;
  --grey: #58585b;
  --mute: #85868a;
  --line: #dcdfe0;
  --line-soft: #eceeef;
  --paper: #fbfcfc;
  --card: #ffffff;
  --warn: #a8661c; --warn-bg: #fdf3e3;
  --ok: #2f7d5f;   --ok-bg: #e9f5ef;
  --sans: Mulish, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --r: 8px;          /* squarer corners throughout */
  --tap: 38px;       /* still a comfortable touch target */
  --banner-h: 56px;
  --shadow: 0 1px 2px rgba(42,42,44,.05), 0 3px 10px rgba(42,42,44,.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0; font-family: var(--sans); font-size: 14px; line-height: 1.4;
  color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }

/* --------------------------------------------------------------- banner */
.banner {
  position: sticky; top: 0; z-index: 30; height: var(--banner-h);
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; margin-right: auto; min-width: 0; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand-name { margin: 0; padding-left: 14px; border-left: 1px solid var(--line); font-size: 15px; font-weight: 700; color: var(--grey); white-space: nowrap; }
.who { display: flex; align-items: baseline; gap: 8px; padding: 6px 12px; background: var(--pale); border-radius: var(--r); }
.who-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-deep); font-weight: 700; }
.who-name { font-size: 18px; font-weight: 800; color: var(--teal-deep); line-height: 1.15; white-space: nowrap; }
.mock-strip {
  padding: 3px 18px; font-size: 12px; font-weight: 600; text-align: center;
  color: var(--warn); background: var(--warn-bg); border-bottom: 1px solid #f1dfc0;
}

/* -------------------------------------------------------------- buttons */
.btn {
  min-height: var(--tap); padding: 7px 14px; font-weight: 700; border-radius: var(--r);
  border: 1px solid transparent; cursor: pointer; transition: background .12s, border-color .12s;
}
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 12.5px; }
.btn-primary { background: var(--teal-dark); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); }
.btn-quiet { background: var(--card); color: var(--grey); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--teal); color: var(--teal-dark); }
.btn-add { background: var(--pale-2); color: var(--teal-deep); border: 1px dashed var(--teal); }
.btn-add:hover { background: var(--pale); }
.btn-danger { background: var(--card); color: #b03a4b; border-color: #e3b7be; }
.btn-danger:hover { background: #b03a4b; color: #fff; border-color: #b03a4b; }
.same-patient { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-weight: 700; }
.same-patient input { width: 18px; height: 18px; }
.btn-x {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--card); color: var(--mute); cursor: pointer; font-size: 15px; line-height: 1;
}
.btn-x:hover { color: #b03a4b; border-color: #b03a4b; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }

/* --------------------------------------------------------------- drafts */
.page { max-width: 1100px; margin: 0 auto; padding: 18px 18px 48px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 12px; }
.page-head h1 { margin: 0 auto 0 0; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
table.drafts { width: 100%; border-collapse: collapse; min-width: 760px; }
.drafts th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); padding: 9px 12px; border-bottom: 1px solid var(--line); }
.drafts td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.drafts tr:last-child td { border-bottom: 0; }
.drafts tbody tr { cursor: pointer; }
.drafts tbody tr:hover { background: var(--pale-2); }
.drafts .pt { font-weight: 700; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 700; }
.badge-draft { background: var(--pale); color: var(--teal-deep); }
.badge-copied { background: var(--ok-bg); color: var(--ok); }
.muted { color: var(--mute); }
.fineprint { margin: 10px 2px 0; font-size: 12.5px; color: var(--mute); }

/* ------------------------------------------------------------ new note */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(42,42,44,.35); }
.modal-card { width: 100%; max-width: 520px; padding: 20px; background: var(--card); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.modal-card h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.kind-grid { display: grid; gap: 8px; }
.kind-btn { display: grid; gap: 2px; text-align: left; padding: 12px 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; }
.kind-btn:hover { border-color: var(--teal); background: var(--pale-2); }
.kind-btn b { font-size: 16px; }
.kind-btn span { font-size: 13px; color: var(--grey); }
.kind-btn:disabled { opacity: .5; cursor: default; background: var(--paper); }
.next-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0 4px; border-top: 2px dashed var(--line); margin-top: 6px; }
.next-note .btn { min-height: 44px; padding: 8px 20px; font-size: 15px; }
.add-tx { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.add-tx .btn { min-height: 44px; padding: 8px 20px; font-size: 15px; }

/* --------------------------------------------------------------- editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 42%); gap: 16px; max-width: 1560px; margin: 0 auto; padding: 10px 18px 60px; }
.edit-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.edit-head h1 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.kind-tag { padding: 2px 8px; border-radius: 5px; background: var(--charcoal); color: #fff; font-size: 12px; font-weight: 700; }
.save-state { font-size: 12px; color: var(--mute); margin-left: auto; }

.jump { position: sticky; top: var(--banner-h); z-index: 20; display: flex; gap: 5px; overflow-x: auto; padding: 6px 0; margin: -2px 0 4px; background: var(--paper); scrollbar-width: none; }
.jump a { flex: none; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--grey); font-size: 12.5px; font-weight: 700; text-decoration: none; }
.jump a:hover { border-color: var(--teal); color: var(--teal-dark); }

.panels { display: grid; gap: 10px; align-content: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; box-shadow: var(--shadow); scroll-margin-top: calc(var(--banner-h) + 44px); }
.card > h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.card > h2 .hint { font-size: 12px; font-weight: 600; color: var(--mute); letter-spacing: 0; }
.card > h2 .right { margin-left: auto; }
.card.tx { border-left: 4px solid var(--teal); }
.sub { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.sub-title { margin: 0 0 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--grey); }

.row { position: relative; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--pale-2); }
.row > .btn-x { position: absolute; top: 8px; right: 8px; }

.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px; margin-top: 4px; }
.field { display: grid; gap: 2px; }
.field label, .lbl { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
input[type=text], input[type=number], input:not([type]), textarea {
  width: 100%; min-height: var(--tap); padding: 7px 10px; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
}
textarea { resize: vertical; min-height: 38px; line-height: 1.4; }
.upper { text-transform: uppercase; }
input.invalid { border-color: #b03a4b; background: #fdeef0; }
.field-error { min-height: 0; font-size: 12px; font-weight: 700; color: #b03a4b; }
.field-error:empty { display: none; }
.typebox { margin-top: 6px; }
.typebox textarea { background: #fffef9; border-style: dashed; }
.typebox textarea:focus { border-style: solid; }
textarea.rfr-box { height: 180px; min-height: 120px; overflow-y: auto; resize: vertical; font-size: 14.5px; line-height: 1.5; background: #fffef9; }
.typebox-large textarea { min-height: 60px; font-size: 14.5px; line-height: 1.45; }

/* ----------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0; }
.chips + .chips { margin-top: 0; }
.chip-label { width: 100%; margin: 2px 0 -1px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.chip {
  position: relative; min-height: 34px; padding: 5px 11px; border-radius: 6px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--charcoal);
  font-weight: 700; font-size: 13.5px; cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: manipulation; transition: background .1s, border-color .1s, transform .06s;
}
.chip:hover { border-color: var(--teal); }
.chip:active { transform: scale(.97); }
.chip.used { border-color: var(--teal); background: var(--pale-2); }
.chip.on { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.chip:disabled { opacity: .3; cursor: not-allowed; transform: none; border-style: dashed; }
.chip.small { min-height: 30px; padding: 3px 9px; font-size: 12.5px; font-weight: 600; }
.chip.big { min-height: var(--tap); padding: 6px 13px; font-size: 14.5px; }
.chip .n { position: absolute; top: -6px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 4px; background: var(--teal-deep); color: #fff; font-size: 10.5px; line-height: 17px; }
.chip.preset b { font-size: 15px; margin-right: 2px; }
.chip.preset small { margin-left: 6px; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; opacity: .7; }

.tokens { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 2px 0 4px; padding: 4px 6px; border-radius: 6px; background: var(--pale); }
.tokens .lbl { margin-right: 3px; color: var(--teal-deep); }
.token { display: inline-flex; align-items: center; gap: 1px; padding: 1px 2px 1px 8px; border-radius: 5px; background: var(--card); border: 1px solid #c5dfe5; font-size: 13px; font-weight: 700; }
.token button { width: 22px; height: 22px; border: 0; background: none; color: var(--mute); cursor: pointer; font-size: 15px; border-radius: 4px; }
.token button:hover { background: var(--pale); color: #b03a4b; }

.tests { display: grid; gap: 0; margin-top: 6px; }
.test-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.test-row .chips { margin: 2px 0; align-items: center; }
.test-row .chips .inline-input { margin-left: 4px; }
.test-name { flex-shrink: 0; min-width: 56px; padding-right: 4px; font-size: 12.5px; font-weight: 800; letter-spacing: .03em; color: var(--charcoal); }
.test-hint { font-size: 12px; color: var(--mute); }
.inline-input { width: 220px; }
.other-input { display: inline-flex; align-items: center; gap: 4px; }
.other-input .inline-input { min-height: 32px; padding: 4px 8px; }
.inline-input.narrow { width: 150px; }
.chip.surface { min-width: 42px; }
.surface-now { margin-left: 4px; padding: 3px 8px; border-radius: 5px; background: var(--charcoal); color: #fff; font-weight: 800; letter-spacing: .06em; }

.ref-search { position: relative; max-width: 520px; }
.ref-field { display: flex; align-items: stretch; }
.ref-title { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px; background: var(--pale); color: var(--teal-deep); font-weight: 800; }
.ref-field input { border-radius: 0 6px 6px 0; }
.ref-list { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 25; display: grid; max-height: 320px; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.ref-item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; cursor: pointer; }
.ref-item:last-child { border-bottom: 0; }
.ref-item span { color: var(--mute); white-space: nowrap; }
.ref-item:hover, .ref-item.on { background: var(--pale); }

.resto { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 16px; margin: 6px 0 2px; }
.resto-chart { display: grid; justify-items: center; gap: 3px; }
.surface-chart { width: 104px; height: 104px; display: block; touch-action: manipulation; }
.surf { cursor: pointer; outline: none; }
.surf polygon { fill: var(--card); stroke: var(--grey); stroke-width: 1.5; transition: fill .1s; }
.surf text { font: 800 15px var(--sans); fill: var(--charcoal); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.surf:hover polygon, .surf:focus-visible polygon { fill: var(--pale); }
.surf.other polygon { fill: var(--pale); stroke: var(--teal); }
.surf.other text { fill: var(--teal-deep); }
.resto-pill { display: inline-flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--card); }
.resto-pill.on { border-color: var(--teal-dark); }
.resto-pill-name { min-height: 34px; padding: 4px 10px; border: 0; background: none; font-weight: 700; font-size: 13px; cursor: pointer; }
.resto-pill.on .resto-pill-name { background: var(--teal-dark); color: #fff; }
.resto-pill-x { width: 28px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--mute); cursor: pointer; font-size: 15px; }
.resto-pill-x:hover { color: #b03a4b; }
.surf.on polygon { fill: var(--teal-dark); stroke: var(--teal-deep); }
.surf.on text { fill: #fff; }
.surface-chart.off { opacity: .35; }
.surface-chart.off .surf { cursor: default; }
.resto-code { min-width: 52px; padding: 1px 8px; border-radius: 5px; background: var(--charcoal); color: #fff; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-align: center; }
.resto-types { display: grid; align-content: start; gap: 0; min-width: 0; flex: 1 1 260px; }
.resto-types .chips { margin: 2px 0; }
.chip-label.inline { width: auto; margin: 0 4px 0 0; }

.points { display: grid; gap: 4px; margin: 6px 0; }
.point { display: flex; align-items: flex-start; gap: 6px; }
.point-dot { padding-top: 9px; font-weight: 800; color: var(--mute); }
.point textarea { flex: 1; min-height: 36px; background: #fffef9; border-style: dashed; }
.point textarea:focus { border-style: solid; }
.point .btn-x { margin-top: 4px; }

.trauma-grid { display: grid; grid-template-columns: 40px repeat(6, minmax(40px, 52px)); gap: 3px; justify-content: start; margin-bottom: 6px; }
.grid-label { display: grid; place-items: center end; padding-right: 6px; font-size: 11.5px; font-weight: 800; color: var(--grey); }
.grid-cell, .grid-tooth { min-height: 34px; border-radius: 5px; border: 1px solid var(--line); background: var(--card); font-weight: 800; font-size: 14px; cursor: pointer; touch-action: manipulation; }
.grid-cell.mid, .grid-tooth.mid { margin-left: 6px; }
.grid-cell.has { background: var(--pale); border-color: var(--teal); color: var(--teal-deep); }
.grid-cell.v-neg { background: #fdeef0; border-color: #e3b7be; color: #b03a4b; }
.grid-cell.v-na { background: var(--paper); color: var(--mute); font-size: 11px; }
.grid-tooth { display: flex; align-items: center; justify-content: center; cursor: default; font-size: 15px; background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.grid-tooth.upper { border-bottom: 3px solid var(--grey); }
.grid-tooth.lower { border-top: 3px solid var(--grey); }
.trauma-notes { display: grid; gap: 4px; }
.trauma-table { display: grid; gap: 4px; }
.trauma-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 8px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--pale-2); }
.trauma-row.all { background: var(--pale); border-style: dashed; }
.trauma-tooth { min-width: 40px; font-size: 17px; font-weight: 800; }
.trauma-test { display: inline-flex; align-items: center; gap: 4px; }
.trauma-test .lbl { color: var(--charcoal); }
.trauma-test .chips { margin: 0; }
.trauma-note { flex: 1 1 160px; min-height: 34px; padding: 5px 8px; }

/* ---------------------------------------------------------- tooth picker */
.tooth { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.tooth-now { display: grid; place-items: center; min-width: 52px; height: 40px; padding: 0 8px; border-radius: var(--r); background: var(--charcoal); color: #fff; font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tooth-now.empty { background: var(--card); color: var(--mute); border: 1.5px dashed var(--line); font-size: 13px; font-weight: 700; }
.tooth-pick { display: grid; gap: 4px; }
.tooth-rowline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tooth-rowline .lbl { width: 72px; }
.tbtn { width: 38px; height: 38px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--card); font-size: 16px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.tbtn:hover { border-color: var(--teal); }
.tbtn.on { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.tbtn:disabled { opacity: .35; cursor: default; }
.tbtn.quick { width: auto; padding: 0 10px; background: var(--pale); border-color: #c5dfe5; color: var(--teal-deep); }

/* --------------------------------------------------------------- canals */
.canal-table { width: 100%; border-collapse: separate; border-spacing: 0 3px; margin-top: 4px; }
.canal-table th { text-align: left; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); padding: 0 5px; }
.canal-table td { padding: 0 3px; }
.canal-table tr.active td { background: var(--pale); }
.canal-table tr.active td:first-child { border-radius: 6px 0 0 6px; }
.canal-table tr.active td:last-child { border-radius: 0 6px 6px 0; }
.canal-table input { min-height: 34px; padding: 5px 8px; }
.canal-table .c-name { width: 84px; }
.canal-table .c-len { width: 84px; }
.len-step { display: inline-flex; align-items: center; gap: 3px; }
.step-btn { width: 34px; height: 34px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--card); font-size: 18px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.step-btn:hover { border-color: var(--teal); }
.step-btn:active { background: var(--pale); }
.len-wrap { position: relative; display: inline-block; }
.len-wrap input { padding-right: 32px; }
.len-wrap span { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--mute); font-size: 12.5px; pointer-events: none; }
.canal-help { margin: 2px 0 2px; font-size: 12.5px; color: var(--grey); }

.la-row { display: grid; gap: 2px; }
.la-n { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.la-n input { width: 64px; text-align: center; font-size: 15px; font-weight: 700; }

.quote-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.quote-line .t { font-size: 17px; font-weight: 800; width: 34px; }
.quote-line .kind { color: var(--grey); width: 76px; }
.quote-line input { width: 110px; }
.empty-note { margin: 0; padding: 7px 10px; border-radius: 6px; background: var(--pale-2); color: var(--grey); font-size: 13px; }

/* --------------------------------------------------------------- preview */
.preview-col { position: sticky; top: calc(var(--banner-h) + 8px); align-self: start; display: grid; gap: 10px; max-height: calc(100vh - var(--banner-h) - 16px); overflow: auto; padding-bottom: 4px; }
.preview-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.preview-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--pale-2); }
.preview-top .lbl { margin-right: auto; }
.copy-btn { min-height: 46px; padding: 8px 22px; font-size: 16.5px; border-radius: var(--r); }
.copy-btn.done { background: var(--ok); }
.preview-foot { display: flex; justify-content: flex-end; padding: 8px 12px; border-top: 1px solid var(--line-soft); background: var(--pale-2); }
.status-line { padding: 5px 12px; font-size: 12.5px; color: var(--grey); border-bottom: 1px solid var(--line-soft); }
textarea.note {
  display: block; width: 100%; min-height: 360px; margin: 0; padding: 12px 14px 16px; border: 0; border-radius: 0;
  resize: none; overflow: hidden; background: var(--card); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 8;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: var(--ink);
}
textarea.note:focus { outline: none; box-shadow: inset 0 0 0 2px var(--pale); }
.edited { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 12px; font-size: 12.5px; color: var(--warn); background: var(--warn-bg); border-bottom: 1px solid #f1dfc0; }

.bottom-bar { display: none; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; padding: 9px 16px; border-radius: var(--r); background: var(--charcoal); color: #fff; font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,.2); }

@media (max-width: 700px) {
  .editor { grid-template-columns: minmax(0, 1fr); padding-bottom: 90px; }
  .preview-col { position: static; max-height: none; overflow: visible; }
  .bottom-bar {
    display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line);
  }
  .bottom-bar .btn { flex: 1; }
}
@media (max-width: 700px) {
  :root { --banner-h: 50px; }
  .brand-logo { height: 30px; }
  .brand-name, .who-label { display: none; }
  .who-name { font-size: 15px; }
  .page, .editor { padding-left: 10px; padding-right: 10px; }
  .jump { position: static; }
}

/* Are-you-sure pop-up */
.modal-card p { margin: 0; line-height: 1.45; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn-danger-solid { background: #b03a4b; color: #fff; border-color: #b03a4b; }
.btn-danger-solid:hover { background: #8f2e3d; border-color: #8f2e3d; }

/* Review teeth: a pill per tooth with its own remove button */
.tooth-block { display: grid; gap: 6px; }
.tooth-pill .resto-pill-name { display: inline-flex; align-items: center; cursor: default; font-size: 16px; font-weight: 800; }

/* Language row (Morgan): room above and below, so it doesn't run into the DOB and Relevant MH boxes */
.lang-row { margin: 10px 0 12px; }

/* ---------------------------------------------------------------- the app (Phase 1) */
.loading { padding: 40px 20px; color: var(--mute); text-align: center; }
.save-state.bad { color: #b03a4b; font-weight: 700; }
.conflict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; padding: 10px 12px;
  border: 1.5px solid #e3b7be; border-radius: var(--r); background: #fdeef0; color: #7a1f2e; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.accounts td { vertical-align: middle; }
.invite-card { margin-top: 16px; }
.invite-card select { width: 100%; min-height: 38px; }

/* Login */
.login-body { min-height: 100vh; }
.login-wrap { display: grid; justify-items: center; gap: 12px; padding: 40px 16px; }
.login-card { width: 100%; max-width: 420px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.06); }
.login-form { display: grid; gap: 8px; }
.login-form h1 { margin: 0 0 4px; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.login-intro { margin: 0 0 6px; color: var(--charcoal); line-height: 1.45; }
.login-label { margin-top: 6px; font-size: 13px; font-weight: 800; }
.login-input { width: 100%; min-height: 44px; font-size: 16px; }
.login-btn { margin-top: 10px; min-height: 46px; font-size: 16px; }
.login-links { margin: 6px 0 0; text-align: center; }
.link-btn { border: 0; background: none; color: var(--teal-dark); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.login-foot { max-width: 420px; text-align: center; }
