/* 22-Nov-2026 (Dr Shah: "how can you use white fonts on white screen?"): every rule here that sets a background sets its own text colour too
   (the tick buttons had background #fff and inherited the app's global button colour #fff). The Rx shell is light-only (UI_STANDARD U11.10):
   color-scheme light so a phone in dark mode never repaints form controls. Gate: test_otform_contrast.js (>= 4.5:1, light + dark). */
.otfapp { color-scheme: light; color: var(--ink, #1b2733); }
/* OT note form (l1, 20-Nov-2026): the form (labels above boxes, 44 px targets) and the printed A4 on the Jivraj header (the approved mock's look). */
.otfapp .otf-f { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.otfapp .otf-f label { font-weight: 600; font-size: 14px; }
.otfapp .otf-f input, .otfapp .otf-f textarea { min-height: 44px; color: var(--ink, #1b2733); background: var(--card, #fff); font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid #b8c2cc; border-radius: 8px; width: 100%; box-sizing: border-box; }
.otfapp .otf-f textarea { min-height: 120px; }
.otfapp .otf-from { color: #667; font-size: 13px; }
.otfapp .otf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.otfapp .otf-sec { margin: 18px 0 8px; padding: 6px 10px; background: #f6f1ee; color: var(--ink, #1b2733); border-left: 3px solid #c8203e; font-weight: 700; font-size: 14px; }
.otfapp .otf-tk { display: flex; flex-wrap: wrap; gap: 8px; }
.otfapp .otf-tk button { min-height: 44px; padding: 8px 14px; border: 1px solid #b8c2cc; border-radius: 22px; background: var(--card, #fff); color: var(--ink, #1b2733); font: inherit; font-weight: 400; }
.otfapp .otf-tk button:hover { background: #f6eef5; color: var(--ink, #1b2733); }
.otfapp .otf-tk button[aria-pressed="true"], .otfapp .otf-tk button[aria-pressed="true"]:hover { background: #b0129c; border-color: #b0129c; color: #fff; }
.otfapp .otf-tk button:disabled { color: #4a5663; background: #eef1f4; }
.otfapp .otf-tk button[aria-pressed="true"]:disabled { color: #fff; background: #8a0f7a; }
.otfapp .otf-acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; position: sticky; bottom: 0; background: var(--card, #fff); color: var(--ink, #1b2733); padding: 8px 0; }
.otfapp .otf-acts button, .otfapp .otf-acts a, .otfapp .otf-pick button, .otfapp .otf-list a { min-height: 44px; padding: 10px 16px; border-radius: 8px; font: inherit; display: inline-flex; align-items: center; }
.otfapp .otf-acts .go, .otfapp .otf-acts .go:hover { background: #b0129c; color: #fff; border: 0; font-weight: 700; }
.otfapp .otf-acts .ghost, .otfapp .otf-row-acts .ghost, .otfapp .otf-today .ghost, .otfapp #otfhits .ghost { background: var(--card, #fff); color: #8a0f7a; border: 1px solid #b0129c; text-decoration: none; }
.otfapp .otf-acts .ghost:hover, .otfapp .otf-row-acts .ghost:hover { background: #f6eef5; color: #8a0f7a; }
.otfapp .otf-msg { min-height: 22px; color: #345; }
.otfapp .otf-msg.err { color: #b00020; font-weight: 700; }
.otfapp .otf-acts .otf-msg { flex: 1 1 100%; margin: 0; background: var(--card, #fff); }   /* B45 item 5: the save / approve reason, in the sticky bar */
.otfapp .otf-state { padding: 8px 12px; border-radius: 8px; background: #eef3f8; color: var(--ink, #1b2733); margin: 0 0 12px; }
.otfapp .otf-state.approved { background: #e7f5ea; }
.otfapp .otf-state.returned { background: #fdecea; }
.otfapp .otf-list { list-style: none; padding: 0; }
.otfapp .otf-list li { border-bottom: 1px solid #e3e7ec; padding: 6px 0; }
.otfapp .otf-pick input { color: var(--ink, #1b2733); background: var(--card, #fff); min-height: 44px; font-size: 16px; padding: 8px 10px; width: 100%; box-sizing: border-box; }
.otfapp .otf-tplrow { display: flex; flex-wrap: wrap; gap: 8px; }
.otfapp .otf-tplrow select { min-height: 44px; color: var(--ink, #1b2733); background: var(--card, #fff); font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid #b8c2cc; border-radius: 8px; flex: 1 1 200px; min-width: 0; max-width: 100%; box-sizing: border-box; }
.otfapp .otf-tplrow button { min-height: 44px; min-width: 44px; padding: 10px 16px; border-radius: 8px; font: inherit; }
/* 22-Nov-2026: approach chips beside the operation picker (they reuse .otf-tk button) + the inline "replace what you typed?" bar */
.otfapp .otf-aprow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.otfapp .otf-aplab { font-weight: 600; color: var(--ink, #1b2733); }
.otfapp .otf-askbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 12px; border-radius: 8px; border: 1px solid #b0129c; background: var(--card, #fff); color: var(--ink, #1b2733); }
.otfapp .otf-askbar button { min-height: 44px; padding: 10px 16px; border-radius: 8px; font: inherit; }
.otfapp .otf-askbar .go, .otfapp .otf-askbar .go:hover { background: #b0129c; color: #fff; border: 0; font-weight: 700; }
.otfapp .otf-askbar .ghost, .otfapp .otf-askbar .ghost:hover { background: var(--card, #fff); color: #8a0f7a; border: 1px solid #b0129c; }
@media (max-width: 600px) { .otfapp .otf-grid { grid-template-columns: 1fr; } }
/* 22-Nov-2026: the view row, quick start, library (grouped by organ, search), Copy toast. Computers use the width (UI_STANDARD U13). */
.otfapp .otf-nav { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid #E3E8EE; margin: 0 0 12px; }
.otfapp .otf-nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; color: #5d6b7a; text-decoration: none; box-shadow: inset 0 -2px 0 transparent; }
.otfapp .otf-nav a.on { color: #0F2233; font-weight: 600; box-shadow: inset 0 -2.5px 0 #b0129c; }
.otfapp .otf-start { display: grid; gap: 14px; grid-template-columns: 1fr; }
.otfapp .otf-card { border: 1px solid #e3e7ec; border-radius: 10px; padding: 10px 14px; background: var(--card, #fff); color: var(--ink, #1b2733); }
.otfapp .otf-card h2 { font-size: 17px; margin: 4px 0 8px; }
.otfapp .otf-today { list-style: none; padding: 0; margin: 0; }
.otfapp .otf-today li { border-bottom: 1px solid #eef1f4; padding: 4px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.otfapp .otf-today a.otf-pt { min-height: 44px; display: flex; flex-direction: column; justify-content: center; text-decoration: none; color: inherit; flex: 1 1 260px; }
.otfapp .otf-today .otf-src { font-size: 12px; color: #8a5a85; }
.otfapp .otf-libsearch input { color: var(--ink, #1b2733); background: var(--card, #fff); min-height: 44px; font-size: 16px; padding: 8px 10px; width: 100%; box-sizing: border-box; margin: 4px 0 10px; border: 1px solid #b8c2cc; border-radius: 8px; }
.otfapp .otf-lib { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.otfapp .otf-grp { border: 1px solid #e3e7ec; border-radius: 10px; padding: 6px 12px; break-inside: avoid; background: var(--card, #fff); color: var(--ink, #1b2733); }
.otfapp .otf-grp h3 { font-size: 15px; margin: 6px 0; color: #c8203e; }
.otfapp .otf-grp ul { list-style: none; padding: 0; margin: 0; }
.otfapp .otf-grp li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid #f0f2f5; padding: 2px 0; }
.otfapp .otf-grp a.otf-tpl { flex: 1 1 160px; min-width: 0; min-height: 44px; display: flex; align-items: center; text-decoration: none; color: #0F2233; }
/* 23-Nov-2026: the approach chips (Lap / Open / Lap → open / Open Hybrid MIE) now show on every operation — the row wraps, never overflows, taps 8 px apart */
.otfapp .otf-row-acts { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.otfapp .otf-row-acts button, .otfapp .otf-row-acts a { min-height: 44px; padding: 0 10px; font: inherit; font-size: 13px; border-radius: 8px; display: inline-flex; align-items: center; }
.otf-toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #0F2233; color: #fff; padding: 10px 18px; border-radius: 22px;
  font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.otf-toast.show { opacity: 1; }
@media (min-width: 1025px) { .otfapp .otf-start { grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr); } .otfapp .otf-start > .otf-card:last-child { grid-column: 1 / -1; } }
@media (min-width: 1280px) { body #otf { max-width: 1600px; } }

/* ---------- the printed A4 (otf_print_html) ---------- */
.otp-print { margin: 0; background: #fff; color: #111; font: 10.5pt/1.38 Arial, Helvetica, sans-serif; }
.otp-sheet { width: 186mm; margin: 0 auto; }
.otp-sheet table.frame { width: 100%; border-collapse: collapse; }
.otp-sheet table.frame > thead td, .otp-sheet table.frame > tbody > tr > td { padding: 0; }
.otp-sheet .hd { display: flex; align-items: center; gap: 12px; padding-bottom: 5px; }
.otp-sheet .hd img { height: 15mm; }
.otp-sheet .hd .addr { margin-left: auto; text-align: right; font-size: 8.3pt; line-height: 1.35; color: #333; }
.otp-sheet .rule { height: 2.2px; background: linear-gradient(90deg, #f58220, #c8203e); margin-bottom: 3mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.otp-sheet .title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 2.5mm; }
.otp-sheet .title h1 { margin: 0; font-size: 14pt; letter-spacing: 2.5px; color: #c8203e; }
.otp-sheet .title span { font-size: 8.5pt; color: #555; }
.otp-sheet .grid { display: grid; border-top: 1px solid #9a9a9a; border-left: 1px solid #9a9a9a; margin-bottom: 2.5mm; break-inside: avoid; }
.otp-sheet .grid > div { border-right: 1px solid #9a9a9a; border-bottom: 1px solid #9a9a9a; padding: 1.2mm 2mm; min-height: 8.5mm; }
.otp-sheet .g4 { grid-template-columns: 2.2fr 1fr 1.4fr 1.2fr; }
.otp-sheet .g2 { grid-template-columns: 1fr 1fr; }
.otp-sheet .span2 { grid-column: span 2; } .otp-sheet .span4 { grid-column: 1 / -1; }
.otp-sheet .lb { display: block; font-size: 7.4pt; font-weight: bold; letter-spacing: .4px; text-transform: uppercase; color: #555; }
.otp-sheet .f { white-space: pre-wrap; word-break: break-word; }
.otp-sheet .secbar { background: #f6f1ee; border-left: 3px solid #c8203e; padding: 1mm 2mm; font-size: 8.2pt; font-weight: bold; letter-spacing: .6px; text-transform: uppercase; margin: 3mm 0 1.5mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.otp-sheet .blk { border: 1px solid #9a9a9a; padding: 1.8mm 2.2mm; margin-bottom: 2.2mm; }
.otp-sheet .ticks { display: flex; flex-wrap: wrap; gap: 1mm 3.5mm; font-size: 9.3pt; }
.otp-sheet .tk { white-space: nowrap; }
.otp-sheet .tk:before { content: ''; display: inline-block; width: 3mm; height: 3mm; border: 1px solid #333; margin-right: 1.2mm; vertical-align: -.4mm; }
.otp-sheet .tk.on:before { background: #111; box-shadow: inset 0 0 0 .6mm #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.otp-sheet .sign { display: grid; grid-template-columns: 1.3fr 1fr; gap: 6mm; margin-top: 9mm; break-inside: avoid; }
.otp-sheet .sign > div { border-top: 1px solid #333; padding-top: 1mm; font-size: 8.5pt; }
.otp-sheet .otp-ok { font-weight: bold; }
.otp-sheet .grid.wr > div { min-height: 11mm; }   /* a blank note: patient lines left to write in by hand */
.otp-sheet .otp-draft { background: #d9d9d9; color: #333; text-align: center; font-weight: bold; letter-spacing: 2px; padding: 1.5mm; margin: 0 0 2.5mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* B45b (26-Nov-2026): on screen the preview is one A4 sheet on grey, like a print preview; on paper only the sheet (margins from @page) */
@media screen { body.otp-print { background: #e9ecef; color: #111; padding: 12px 0; } body.otp-print .otp-sheet { background: #fff; color: #111; width: 210mm; max-width: 100%; box-sizing: border-box; padding: 9mm 11mm 13mm; box-shadow: 0 1px 6px rgba(0,0,0,.25); } }
@media screen and (max-width: 600px) { body.otp-print .otp-sheet { padding: 4mm; } body.otp-print .otp-sheet .g4 { grid-template-columns: 1fr 1fr; } }
@media print {
  body.otp-print { background: #fff; }
  @page { size: A4; margin: 9mm 11mm 13mm; @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 7.5pt Arial; color: #555; } @bottom-left { content: "Dr. Jivraj Mehta Hospital · Operation Note"; font: 7.5pt Arial; color: #555; } }
  .otp-sheet { width: auto; }
}
/* 25-Nov-2026: GI database section (otform_reg.php) — operative registry fields, N/A, "Use" from the wording, his past entries, his own fields */
.otfapp .otf-reg select { min-height: 44px; font: inherit; max-width: 100%; }
.otfapp .otf-regsum { font-weight: 600; margin: 8px 0; color: #1d6b3a; }
.otfapp .otf-regsum.miss { color: #9a4a00; }
.otfapp .otf-regmiss > label { color: #9a4a00; }
.otfapp .otf-regmiss input { background: #fffbeb; }
.otfapp .otf-auto .otf-autov { min-height: 44px; display: flex; align-items: center; padding: 0 10px; background: #eef1f4; border-radius: 6px; color: #2b3540; }
.otfapp .otf-regin { display: flex; gap: 6px; align-items: stretch; flex-wrap: wrap; }
.otfapp .otf-regin input { flex: 1 1 140px; min-width: 0; }
.otfapp .otf-na, .otfapp .otf-hint { min-height: 44px; padding: 6px 12px; border: 1px solid #b8c2cc; border-radius: 22px; background: var(--card, #fff); color: var(--ink, #1b2733); font: inherit; }
.otfapp .otf-na[aria-pressed="true"] { background: #4a5663; border-color: #4a5663; color: #fff; }
.otfapp .otf-hint { border-color: #b0129c; color: #8a0f7a; font-weight: 600; }
.otfapp .otf-other { min-height: 44px; flex: 1 1 140px; min-width: 120px; font: inherit; }
.otfapp .otf-extra { margin: 14px 0 0; }
.otfapp .otf-exrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.otfapp .otf-exrow input { min-height: 44px; flex: 1 1 180px; min-width: 0; font: inherit; }
.otfapp .otf-exrow button, .otfapp .otf-extra > button, .otfapp .otf-reg p > button { min-height: 44px; }
@media (max-width: 600px) { .otfapp .otf-exrow input { flex-basis: 100%; } }
