:root {
  --ink: #1b2430; --muted: #5b6676; --line: #dfe3e8; --line2: #eef0f3; --bg: #f6f7f9; --card: #fff;
  --accent: #1f5f8b; --accent-ink: #fff; --closed: #eceef1; --danger: #b42318; --ok: #1e7b4a;
  --ppm: 3.4px; /* pixels per minute: tall enough for 5-minute exams (Alan, Nov 12) */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
body.plain .center { max-width: 520px; margin: 15vh auto; text-align: center; }
.top { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--accent); letter-spacing: .2px; }
.nav, .filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav h1 { font-size: 16px; margin: 0 0 0 8px; font-weight: 600; }
.me { margin-left: auto; color: var(--muted); }
.me a { color: var(--accent); }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 6px 10px; cursor: pointer; color: var(--ink); font: inherit; }
.btn:hover { border-color: #b8c0ca; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: #f1c4c0; }
.btn.icon { padding: 4px 9px; font-size: 18px; line-height: 1; }
.btn:disabled { opacity: .5; cursor: default; }
.input { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; background: var(--card); color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 6px 10px; cursor: pointer; font: inherit; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: #e8f0f6; color: var(--accent); font-weight: 600; }
.check { color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
main { padding: 12px 16px 40px; }
.msg { background: #fff7e6; border: 1px solid #f3d9a4; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; }
.msg.err { background: #fdecea; border-color: #f4c0bb; color: var(--danger); }

/* Grid */
.grid { display: grid; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: calc(100vh - 150px); }
.grid .corner, .grid .colhead { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); padding: 8px; font-weight: 600; min-height: 48px; }
.grid .corner { left: 0; z-index: 6; }
.colhead small { display: block; font-weight: 400; color: var(--muted); }
.axis { position: sticky; left: 0; z-index: 4; background: var(--card); border-right: 1px solid var(--line); }
.axis .tick { position: absolute; right: 6px; transform: translateY(-50%); color: var(--muted); font-size: 11px; }
.col { position: relative; border-left: 1px solid var(--line2); background: var(--closed); min-width: 150px; cursor: crosshair; }
.col .open { position: absolute; left: 0; right: 0; background: #fff; }
.col .hr { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line2); pointer-events: none; }
.col .blk { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #f3e3e3 0 6px, #fbf3f3 6px 12px);
  border-left: 3px solid #c97a7a; font-size: 11px; color: #7a3b3b; padding: 2px 6px; overflow: hidden; cursor: pointer; }
.appt { position: absolute; left: 3px; right: 3px; background: #f4f8fb; border: 1px solid #cfdbe5; border-left: 4px solid var(--c, var(--accent));
  border-radius: 4px; font-size: 11px; line-height: 13px; padding: 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.appt:hover, .appt:focus { z-index: 3; box-shadow: 0 2px 6px rgba(0,0,0,.15); outline: none; }
.appt.cancelled { opacity: .45; text-decoration: line-through; }
.appt .t { font-weight: 600; margin-right: 4px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 3px; vertical-align: middle; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.now { position: absolute; left: 0; right: 0; border-top: 2px solid #e5484d; z-index: 2; pointer-events: none; }

/* Drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--card); border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px rgba(0,0,0,.08); z-index: 30; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 16px; margin: 0; }
.drawer-body { padding: 12px 16px 24px; overflow: auto; }
.drawer-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 18px 0 6px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.form label.full, .form .full { grid-column: 1 / -1; }
.form .input, .form textarea, .form select { width: 100%; }
textarea.input { min-height: 56px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 14px; padding: 3px 10px; background: var(--card); cursor: pointer; font: inherit; font-size: 12px; }
.chip.on { background: #e8f0f6; border-color: #9cbad3; color: var(--accent); font-weight: 600; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.hist { list-style: none; padding: 0; margin: 0; font-size: 12px; }
.hist li { padding: 6px 0; border-bottom: 1px solid var(--line2); }
.hist .who { color: var(--muted); }
.warn { color: #8a5a00; background: #fff7e6; border: 1px solid #f3d9a4; padding: 6px 8px; border-radius: 6px; font-size: 12px; }
.err { color: var(--danger); font-size: 12px; }
@media (max-width: 760px) { :root { --ppm: 3.2px; } .col { min-width: 120px; } .me { width: 100%; } }
[hidden] { display: none !important; }

.col .blk.note { background: #eef5fb; border-left-color: #5b8db8; color: #234e74; z-index: 1; opacity: .92; pointer-events: auto; }
.col .blk.hold { background: repeating-linear-gradient(135deg, #fbf1dc 0 6px, #fdf8ec 6px 12px); border-left-color: #c99a2e; color: #6b4f0e; }

.sections { display: flex; gap: 2px; }
.sections a { padding: 6px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 500; }
.sections a:hover { background: #f0f3f6; color: var(--ink); }
.sections a.on { background: #e8f0f6; color: var(--accent); font-weight: 600; }
.page { max-width: 1200px; margin: 0 auto; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.panel h2 { font-size: 15px; margin: 0 0 10px; }
.row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.row label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; position: sticky; top: 0; background: var(--card); }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: #f6f9fc; }
table.data tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
table.data td.num, table.data th.num { text-align: right; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; font: inherit; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; background: #eef0f3; color: var(--muted); }
.pill.ok { background: #e6f4ec; color: var(--ok); } .pill.bad { background: #fdecea; color: var(--danger); } .pill.warn { background: #fff4dd; color: #8a5a00; }
.muted { color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
pre.preview { white-space: pre-wrap; background: #f6f7f9; border: 1px solid var(--line); border-radius: 6px; padding: 10px; font: inherit; font-size: 13px; }
.form .chips label.chip, .chips label.chip { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: 12px; }
.form input[type=color].input { height: 34px; padding: 2px 4px; }

/* Nov 11: one column per doctor, office colors, month view, Acuity overlay */
.otags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; justify-content: center; }
.otag { font-size: 10px; font-weight: 600; letter-spacing: .02em; padding: 1px 6px; border-radius: 9px; color: var(--o); background: color-mix(in srgb, var(--o) 12%, white); border: 1px solid color-mix(in srgb, var(--o) 35%, white); }
.otag.off { color: #6b7280; background: #f3f4f6; border-color: #e5e7eb; }
.oband { position: absolute; left: 0; right: 0; background: color-mix(in srgb, var(--o) 6%, white); border-left: 3px solid color-mix(in srgb, var(--o) 60%, white); pointer-events: none; }
.oband span { position: absolute; right: 4px; top: 2px; font-size: 9px; font-weight: 600; color: color-mix(in srgb, var(--o) 70%, #333); opacity: .7; text-transform: uppercase; letter-spacing: .04em; }
.appt { border-left: 3px solid var(--k); background: color-mix(in srgb, var(--k) 10%, white); border-color: color-mix(in srgb, var(--k) 35%, white); border-left-color: var(--k); }
.appt.alert { box-shadow: inset 0 0 0 1.5px #d97706; }
.appt .warn { display: inline-block; width: 13px; height: 13px; line-height: 13px; text-align: center; border-radius: 50%; background: #d97706; color: #fff; font-size: 9px; }
.acu { position: absolute; left: 2px; right: 2px; z-index: 1; font-size: 10px; line-height: 1.2; color: #374151; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 1px 4px; border-radius: 3px;
  background: color-mix(in srgb, var(--k) 7%, white); border: 1px dashed color-mix(in srgb, var(--k) 55%, white); border-left: 3px solid color-mix(in srgb, var(--k) 70%, white); cursor: default; }
.acu .t { font-weight: 600; margin-right: 3px; }
.col.ro { cursor: default; }
.loadnote { margin: 0 0 6px; font-size: 12px; color: #4b5563; padding: 4px 10px; background: #f3f4f6; border-radius: 6px; display: inline-block; }
.where { margin: 0 0 8px; font-size: 13px; color: #374151; display: flex; align-items: center; gap: 6px; }
.odot { width: 9px; height: 9px; border-radius: 50%; background: var(--o); display: inline-block; }
.grid.month { gap: 1px; background: #e5e7eb; border: 1px solid #e5e7eb; }
.grid.month .mhead { background: #f9fafb; font-size: 11px; font-weight: 600; color: #6b7280; text-align: center; padding: 4px 0; }
.grid.month .mday { background: #fff; min-height: 92px; padding: 4px 5px; cursor: pointer; }
.grid.month .mday.other { background: #fafafa; color: #9ca3af; }
.grid.month .mday.today .mnum { color: #fff; background: #1f5f8b; border-radius: 9px; padding: 0 6px; display: inline-block; }
.grid.month .mday.closed { background: #f3f4f6; }
.grid.month .mnum { font-size: 11px; font-weight: 600; margin-bottom: 3px; }
.grid.month .mnum small { font-weight: 500; color: #6b7280; }
.grid.month .mi { font-size: 10.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--o); padding-left: 4px; margin-bottom: 1px; color: #374151; }
.grid.month .mi span { color: color-mix(in srgb, var(--o) 75%, #222); font-weight: 600; }
.grid.month .mi.away { border-left-color: #d1d5db; color: #9ca3af; }
.grid.month .mi.away span { color: #9ca3af; font-weight: 500; }
.clash { margin: 6px 0 0; font-size: 12px; color: #92400e; background: #fef3c7; border-radius: 6px; padding: 4px 8px; }
.chip.busy { color: #9ca3af; background: #f9fafb; text-decoration: line-through; text-decoration-color: #d1d5db; }

.oband { background: color-mix(in srgb, var(--o) 13%, white) !important; }
.picker { position: relative; }
.picker summary { list-style: none; cursor: pointer; min-width: 140px; }
.picker summary::-webkit-details-marker { display: none; }
.picker summary::after { content: '▾'; float: right; margin-left: 8px; color: #6b7280; }
.picker .pop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.08); padding: 6px 4px; min-width: 190px; max-height: 360px; overflow: auto; }
.picker .pop label { display: flex; gap: 8px; padding: 4px 10px; border-radius: 6px; font-size: 13px; }
.picker .pop label:hover { background: #f3f4f6; }
.picker .pop [data-all] { border-bottom: 1px solid #f0f0f0; margin-bottom: 3px; padding-bottom: 6px; }
.xlink { margin-right: 10px; font-size: 13px; color: #1f5f8b; text-decoration: none; }
.xlink:hover { text-decoration: underline; }

/* Nov 11 cleanup: click menu, confirm pop-up, CRMS pickers, readable rules and change log */
.actmenu { position: fixed; z-index: 40; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(20,30,45,.16); padding: 6px; min-width: 210px; }
.actmenu .when { font-size: 12px; color: var(--muted); padding: 4px 8px 6px; border-bottom: 1px solid var(--line2); margin-bottom: 4px; }
.actmenu button { display: flex; width: 100%; gap: 8px; align-items: center; border: 0; background: none; padding: 7px 8px; border-radius: 6px; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.actmenu button:hover:not(:disabled) { background: var(--line2); }
.actmenu button:disabled { color: #a0a8b3; cursor: default; }
.actmenu button small { margin-left: auto; color: #a0a8b3; font-size: 11px; }
.actmenu .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--k, #8a94a6); flex: none; }
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(20,30,45,.35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--card); border-radius: 10px; box-shadow: 0 16px 40px rgba(20,30,45,.25); max-width: 440px; width: 100%; padding: 18px 20px 16px; }
.modal h2 { font-size: 16px; margin: 0 0 8px; }
.modal ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.lookup { position: relative; }
.lookup .results { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 20px rgba(20,30,45,.12); max-height: 260px; overflow: auto; }
.lookup .results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; font: inherit; cursor: pointer; border-bottom: 1px solid var(--line2); }
.lookup .results button:hover, .lookup .results button.hi { background: #e8f0f6; }
.lookup .results small { display: block; color: var(--muted); font-size: 12px; }
.linked { font-size: 12px; color: var(--ok); margin-top: 3px; }
.linked.no { color: var(--muted); }
.rulecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.rulecard { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: var(--card); cursor: pointer; }
.rulecard:hover { border-color: #b8c0ca; }
.rulecard h3 { font-size: 14px; margin: 0 0 6px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.rulecard ul { margin: 0 0 6px; padding-left: 18px; }
.rulecard li { margin: 2px 0; }
.small { font-size: 12px; }
table.log ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Nov 11 (later): now line, calendar arrows, double bookings, month depositions and hours */
.now { border-top: 2px solid #e5484d; z-index: 4; height: 0; }
.nowtick { position: absolute; right: 4px; transform: translateY(-50%); font-size: 10px; font-weight: 600; color: #fff; background: #e5484d; border-radius: 3px; padding: 0 3px; z-index: 4; }
.gnav { border: 1px solid var(--line); background: var(--card); border-radius: 6px; width: 26px; height: 26px; font-size: 18px; line-height: 22px; padding: 0; cursor: pointer; color: var(--muted); }
.gnav:hover { color: var(--accent); border-color: #9cbad3; }
.gridwrap { position: relative; }
.gnext { position: absolute; top: 8px; right: 8px; z-index: 7; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.grid .colhead:last-child { padding-right: 40px; }
.appt.shifted, .acu.shifted { box-shadow: 0 -2px 0 #fff, 0 1px 3px rgba(0,0,0,.18); }
.grid.month .mi small { display: block; font-size: 10px; color: #6b7280; font-weight: 400; }
.grid.month .mdepo { font-size: 10.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid #2f6fa8; background: #eef4fa; color: #1f4e79; padding: 0 4px; margin-top: 2px; border-radius: 2px; cursor: pointer; }
.grid.month .mdepo:hover { background: #dde9f5; }

/* Nov 12: readable blocks (one full line each) */
.appt, .acu { font-size: 11.5px; line-height: 16px; padding: 0 5px; box-sizing: border-box; }
.wicon { display: inline-flex; width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; color: #2f6fa8; }
.wicon svg { width: 12px; height: 12px; fill: currentColor; }
.wicon.w-unknown { color: #9ca3af; }
.wicon.w-unknown svg { fill: none; }
.kv dd .wicon { width: 14px; height: 14px; } .kv dd .wicon svg { width: 14px; height: 14px; }
.grid.month .mdepo span { display: block; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.grid.month .mdepo small { display: flex; align-items: center; gap: 3px; font-size: 10px; color: #4b6a8a; font-weight: 400; }
.addswitch { margin: 0 0 10px; width: 100%; display: flex; }
.addswitch button { flex: 1; }
.addswitch button:disabled { color: #b0b7c1; cursor: default; }
@media (max-width: 760px) {
  .grid.month { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
  .grid.month .mday { min-height: 74px; padding: 3px 2px; }
  .grid.month .mi, .grid.month .mdepo { font-size: 9.5px; padding-left: 2px; }
  .grid.month .mi small, .grid.month .mdepo small { font-size: 9px; letter-spacing: -.2px; }
  .grid.month .mhead { font-size: 11px; }
}
.drawer .form > * { min-width: 0; }
.drawer .form .input { width: 100%; min-width: 0; box-sizing: border-box; }
.drawer-body { overflow-x: hidden; }
@media (max-width: 760px) {
  .grid.month .mi span, .grid.month .mdepo span { white-space: normal; overflow-wrap: normal; word-break: keep-all; line-height: 1.15; font-size: 9px; letter-spacing: -.25px; text-overflow: clip; }
}
/* the scheduling site's screens over the calendar (Nov 12) */
.toolpanel { position: fixed; inset: 0; z-index: 50; background: rgba(20,30,45,.35); display: flex; flex-direction: column; padding: 2vh 2vw; }
.toolpanel .tp-head { display: flex; gap: 8px; align-items: center; background: var(--card); padding: 8px 12px; border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--line); }
.toolpanel .tp-head b { margin-right: auto; }
.toolpanel iframe { flex: 1; width: 100%; border: 0; background: #fff; border-radius: 0 0 10px 10px; }
.acu { cursor: pointer; }
@media (max-width: 760px) { .toolpanel { padding: 0; } .toolpanel .tp-head { border-radius: 0; } .toolpanel iframe { border-radius: 0; } }

/* Printable list (Nov 12) */
.grid.list { display: block; max-height: none; overflow: visible; padding: 10px 14px 20px; }
.listbar { display: flex; gap: 10px; align-items: center; margin: 2px 0 12px; }
.lsec { margin: 0 0 18px; break-inside: avoid-page; }
.lsec h2 { font-size: 15px; margin: 0 0 6px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.lsec h2 span { font-weight: 500; color: var(--muted); }
.lsec h2 small { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 12px; }
.ltable { width: 100%; font-size: 12.5px; }
.ltable td, .ltable th { padding: 4px 8px; vertical-align: top; }
.ltable tr td:first-child { border-left: 3px solid transparent; font-weight: 600; }
.ltable tr.k-pi td:first-child { border-left-color: #c0392b; } .ltable tr.k-wc td:first-child { border-left-color: #2e8b57; } .ltable tr.k-testimony td:first-child { border-left-color: #2f6fa8; }
.ltable tr.lcancel td { text-decoration: line-through; color: #9ca3af; }
@media (max-width: 760px) { .ltable { font-size: 11.5px; } .ltable td, .ltable th { padding: 3px 4px; } }
@media print {
  @page { size: letter portrait; margin: 0.5in; }
  body { background: #fff; }
  .top, .drawer, .noprint, #msg, #loadNote, #gnext, .actmenu, .toolpanel { display: none !important; }
  main { padding: 0; }
  .grid, .grid.list { border: 0; padding: 0; max-height: none; overflow: visible; }
  .lsec { break-inside: avoid; page-break-inside: avoid; }
  .lsec + .lsec { margin-top: 14px; }
  .ltable { font-size: 10.5pt; }
  .ltable th { background: #f3f4f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ltable tr td:first-child { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.rem-master { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; margin-bottom: 10px; }
.rem-master.on { border-color: #9fd4b1; background: #eefaf2; }
.rem-master .btn { margin-left: auto; }
.rem-prev { white-space: pre-wrap; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 12px; max-height: 360px; overflow: auto; }
.rulecard[data-rr] { cursor: pointer; }

/* New appointment form (Nov 12) */
.xf-who { font-size: 15px; }
.form label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.form label.check input { width: auto; }
.xmatch { border: 1px solid #e3c770; background: #fff8e1; border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; }
.xm-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.xm-row small { display: block; color: #555; }
#xTimeNote:empty, #xMatch:empty { display: none; }
.kv dd.pre { white-space: pre-wrap; }
/* Month view: booked exams (Dr. Tosk, Nov 12) */
.grid.month .mexam { font-size: 10.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--k); background: color-mix(in srgb, var(--k) 9%, white); padding: 0 4px; margin-top: 1px; border-radius: 2px; cursor: pointer; color: #333; }
.grid.month .mexam:hover { background: color-mix(in srgb, var(--k) 18%, white); }
.grid.month .mexam b { font-weight: 600; }
.grid.month .mmore { font-size: 10px; color: #666; padding: 0 4px; }
/* Open time stands out (Ruth, Nov 12: "open appointments are in an undefined colored area"): office hours are plain
   white with the office's color as a stripe on the left; time outside office hours stays grey; booked exams are solid. */
.oband { background: #fff !important; border-left: 4px solid var(--o) !important; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--o) 45%, white), inset 0 -1px 0 color-mix(in srgb, var(--o) 45%, white); }
.oband span { opacity: 1; }
.col { background: #e5e7eb; }
.acu { background: color-mix(in srgb, var(--k) 16%, white); border: 1px solid color-mix(in srgb, var(--k) 45%, white); border-left: 4px solid var(--k); color: #1f2937; }
/* Month view fits about 20 exam lines a day (Alan, Nov 12) */
.grid.month .mexam { font-size: 10px; line-height: 13px; margin-top: 0; }
.grid.month .mday { min-height: 120px; }
.find { display: flex; gap: 6px; } .find .input { width: 210px; }
.ftable { width: 100%; border-collapse: collapse; font-size: 13px; } .ftable th, .ftable td { text-align: left; padding: 5px 6px; border-bottom: 1px solid #eee; vertical-align: top; }
.ftable tr[data-acu]:hover { background: #f3f7fb; } .ftable small { color: #6b7280; } .ftable .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--k); margin-right: 5px; }
@media (max-width: 760px) { .find .input { width: 100%; } .find { width: 100%; } }
.grid.month .mblock { background: repeating-linear-gradient(135deg, #f3e3e3 0 6px, #fbf3f3 6px 12px); border-left-color: #b45454; } .grid.month .mblock span { color: #7f1d1d; font-weight: 600; }
/* Nov 12 (Alan): month totals, two-column exam list, week totals, compact phone view */
.grid.month .mday { min-height: 64px; }
.grid.month .mnum { display: flex; align-items: center; gap: 4px; }
.grid.month .mtot { margin-left: auto; font-size: 10px; font-weight: 700; color: #1f5f8b; background: #e8f0f7; border-radius: 8px; padding: 0 5px; line-height: 15px; }
.grid.month .mexams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 2px; margin: 1px 0 2px; }
.grid.month .mexams .mexam { margin: 0; padding: 0 3px; min-width: 0; }
.grid.month .mcnt { font-weight: 700; color: #1f2937; margin-left: 2px; }
.grid.month .mweek { background: #f9fafb; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #1f5f8b; cursor: default; }
.grid.month .mweek b { font-size: 14px; }
.grid.month .mweek small { font-size: 9px; color: #6b7280; }
.grid.month.narrow .mday { min-height: 58px; padding: 2px; }
.grid.month.narrow .mi { white-space: normal; }
.grid.month.narrow .mi small { display: none; }
.grid.month.narrow .mtot { font-size: 9px; padding: 0 3px; }
.grid.month.narrow .mweek b { font-size: 12px; }
.otag.dep { --o: #2f6fa8; }
/* Reports chart (Nov 12) */
.chart { margin: 6px 0 14px; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; margin-top: 4px; }
.chart .lg { display: inline-flex; align-items: center; gap: 5px; }
.chart .lg i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.grid.month .mday.today .mnum { color: inherit; background: none; padding: 0; display: flex; }
.grid.month .mday.today .mdate { color: #fff; background: #1f5f8b; border-radius: 9px; padding: 0 6px; }
@media (max-width: 760px) { .grid.month { grid-template-columns: repeat(7, minmax(0, 1fr)) 34px !important; } }
