/* Phone-first timeclock. One column, big touch targets, readable outdoors.
   Brand (rpmdenver.com): purple, white, black and gray. Site purple #6261C5 (buttons, links), a frosted
   light header carrying the logo, gray-purple #56556B headings, Source Sans Pro headings,
   Open Sans text. Green/red stay for clock in/out because they carry meaning. */
:root {
  --bg: #f5f5f8;
  --surface: #ffffff;
  --text: #1a1f24;
  --heading: #56556b;
  --muted: #5f5e74;
  --line: #e4e3ec;
  --chrome: rgba(250, 250, 252, .78);
  --hairline: rgba(60, 60, 67, .29);
  --primary: #6261c5;
  --primary-soft: #efeffa;
  --shadow: 0 2px 14px rgba(52, 51, 70, .08);
  --success: #17803d;
  --success-soft: #e6f4ea;
  --danger: #c0352b;
  --danger-soft: #fbe9e7;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --radius: 14px;
  --font-text: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-head: "Source Sans 3", "Source Sans Pro", var(--font-text);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e18;
    --surface: #1a1928;
    --text: #ecebf5;
    --muted: #a3a1bb;
    --line: #2d2b42;
    --heading: #d6d5e6;
    --chrome: rgba(26, 25, 40, .78);
    --hairline: rgba(84, 84, 88, .65);
    --primary: #a9a7f0;
    --primary-soft: #262147;
    --shadow: none;
    --success: #2fa75a;
    --success-soft: #15301f;
    --danger: #e0574c;
    --danger-soft: #3a1c1a;
    --warn: #e5b54a;
    --warn-soft: #33290f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 var(--font-text);
}

h1, h2, h3, .btn, .tabs a, .topbar .brand, .stat-num, .day-big, .who .name, .status .site {
  font-family: var(--font-head);
}
h1, h2 { letter-spacing: -.01em; color: var(--heading); }

/* Company logo (white background) on the sign-in pages. */
.logo { display: block; width: min(240px, 70%); height: auto; margin: 0 auto 18px; border-radius: 8px; }
@media (prefers-color-scheme: dark) { .logo { background: #fff; padding: 8px 12px; } }

.topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  height: calc(46px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  color: var(--text);
  font-size: 15px;
}
/* Frosted header and tabs read as one bar (iOS style); a hairline only under the last piece. */
body:not(:has(.tabs)) .topbar { border-bottom: .5px solid var(--hairline); }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--muted); }
/* The full logo (swish included). Its white background drops out with multiply; in dark mode it is
   inverted with hues kept, and screen drops the then-black background. */
.topbar .brand-logo { display: block; height: 28px; width: auto; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) {
  .topbar .brand-logo { filter: invert(1) hue-rotate(180deg) brightness(1.1); mix-blend-mode: screen; }
}
.topbar .clock { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }

.tabs {
  position: sticky;
  top: calc(46px + env(safe-area-inset-top));
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--hairline);
}
.tabs a {
  padding: 12px 4px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
}

h1 { font-size: 26px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 15px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card.narrow { max-width: 420px; margin: 8px auto 16px; }

.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
label.check input { width: 22px; height: 22px; }

input, textarea {
  width: 100%;
  font: inherit;
  font-size: 20px; /* 16px+ stops iOS zooming on focus */
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
textarea { font-size: 17px; resize: vertical; }
input:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); border-color: var(--primary); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 650;
  color: #fff;
  background: var(--primary);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn.big { width: 100%; min-height: 56px; font-size: 19px; }
.btn.huge { width: 100%; min-height: 76px; font-size: 22px; }
.btn.success { background: var(--success); }
.btn.danger { background: var(--danger); }
.btn.link { background: none; color: var(--primary); padding: 8px 0; min-height: 44px; font-weight: 600; }
.btn.busy::after {
  content: "";
  width: 18px; height: 18px; margin-left: 12px;
  border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn.shift { flex-direction: column; gap: 2px; text-align: center; }
.btn.shift .site { font-size: 21px; }
.btn.shift .desc { font-size: 15px; font-weight: 500; opacity: .92; }

.banner {
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-weight: 600;
  transition: opacity .6s, max-height .6s, margin .6s, padding .6s;
  max-height: 200px;
  overflow: hidden;
}
.banner.ok { background: var(--success-soft); color: var(--success); }
.banner.error { background: var(--danger-soft); color: var(--danger); }
.banner.gone { opacity: 0; max-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; }

.who { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.who .name { font-size: 22px; font-weight: 700; }

.status .label { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.status.on { border-color: var(--success); box-shadow: inset 6px 0 0 var(--success); }
.status.on .label { color: var(--success); }
.status.off .label { color: var(--muted); }
.status .site { font-size: 24px; font-weight: 700; margin-top: 4px; }
.status .since { font-size: 18px; margin: 4px 0 16px; font-variant-numeric: tabular-nums; }
.status .hint { margin: 4px 0 14px; color: var(--muted); }
.shifts { display: grid; gap: 12px; }

.location { margin: -4px 4px 16px; font-size: 14px; color: var(--muted); }
.location.ok { color: var(--success); }
.location.warn { color: var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: 10px; margin: 0 0 16px; }

.punches, .notes { list-style: none; margin: 0; padding: 0; }
.punches li, .notes li { padding: 12px 0; border-top: 1px solid var(--line); }
.punches li:first-child, .notes li:first-child { border-top: 0; padding-top: 0; }
.punches li { display: flex; justify-content: space-between; gap: 12px; }
.punches .site { font-weight: 600; }
.punches .times { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.notes { margin-top: 16px; }
.notes .reply { margin-top: 6px; padding: 8px 10px; background: var(--bg); border-radius: 8px; font-size: 15px; }

.btn.secondary { background: var(--surface); color: var(--primary); border: 1px solid var(--line); }

.period { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.period h1 { margin: 0; }
.period-total { text-align: right; }
.period-total .hours { font-size: 30px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.pager { display: flex; justify-content: space-between; margin-bottom: 16px; }

.day-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.day-head h2 { margin: 0; }
.day-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.punches .hours { font-weight: 600; }
.punches .edited { text-decoration: underline dotted; text-underline-offset: 3px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tag.ok { background: var(--success-soft); color: var(--success); }
.tag.info { background: var(--warn-soft); color: var(--warn); }
.footnote { font-size: 13px; color: var(--muted); margin: 0 4px 16px; }

.languages {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
}
.languages a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}
.languages a.active { background: var(--surface); color: var(--text); font-weight: 650; border: 1px solid var(--line); }

.footer-link { text-align: center; font-size: 14px; }
.footer-link a { color: var(--muted); }

.location-dialog {
  width: min(480px, calc(100vw - 32px));
  border: 0; border-radius: var(--radius); padding: 22px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.location-dialog::backdrop { background: rgba(10, 15, 25, .55); }
.location-dialog h2 { font-size: 22px; margin-bottom: 8px; }
.location-dialog .help { background: var(--warn-soft); color: var(--text); padding: 12px; border-radius: 10px; font-weight: 600; }
.location-dialog [data-punch-anyway] { color: var(--muted); font-weight: 500; font-size: 15px; }

/* ---------- Manager pages: phone first, two columns on a laptop ---------- */
.page.wide { max-width: 1200px; }
.manager-tabs { display: flex; align-items: center; gap: 4px; padding: 0 12px; grid-template-columns: none; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.manager-tabs a { padding: 12px 10px; flex: none; }
.manager-tabs form, .manager-tabs .btn { flex: none; }
.manager-tabs .spacer { flex: 1; }
.manager-tabs .who-small { color: var(--muted); font-size: 14px; margin-right: 8px; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 15px; }
.small { font-size: 14px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
/* "Clock back in?" right after clocking out: deliberate, so an extra tap can't do it. */
.confirm-reclock { display: grid; gap: 10px; border: 2px solid var(--warn); }
.confirm-reclock p { margin: 0; font-weight: 600; }
.banner.warn ul { margin: 6px 0 0; padding-left: 20px; font-weight: 500; }
.btn.warn-btn { background: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.muted-tag { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
/* Worth a look, not an error (e.g. another employee used the same device). */
.tag.warn { background: var(--surface); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); }

.period-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px; margin-bottom: 16px; }
.period-form { order: 3; flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 8px; }
.period-form label { font-size: 13px; min-width: 0; }
.period-form input { font-size: 16px; padding: 8px 10px; min-width: 0; }
.period-form button { grid-column: 1 / -1; }
.manager-tabs .who-small { display: none; }
@media (min-width: 900px) {
  .period-form { order: 0; flex: 1; flex-basis: auto; display: flex; justify-content: center; }
  .period-form input { width: auto; }
  .manager-tabs .who-small { display: inline; }
}

.approve-grid { display: grid; gap: 16px; }
.approve-grid.has-employee .queue { display: none; }
.approve-grid:not(.has-employee) .detail { display: none; }
.back-to-list { display: inline-block; margin-bottom: 8px; color: var(--primary); text-decoration: none; font-weight: 600; }
@media (min-width: 900px) {
  .approve-grid { grid-template-columns: 330px 1fr; align-items: start; }
  .approve-grid .queue, .approve-grid .detail { display: block !important; }
  .approve-grid .queue { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow: auto; }
  .detail .back-to-list { display: none; }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.queue-search { font-size: 16px; padding: 10px 12px; margin-bottom: 10px; }
.queue-list { list-style: none; margin: 0; padding: 0; }
.queue-list a { display: grid; gap: 2px; padding: 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.queue-list a:hover { background: var(--bg); }
.queue-list a.active { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.queue-list .queue-site {
  padding: 14px 10px 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line);
}
.queue-list .queue-site:first-child { padding-top: 4px; }

.device-list { list-style: none; margin: 0; padding: 0; }
.device-list .device { padding: 10px 0; border-top: 1px solid var(--line); }
.device-list .device:first-child { border-top: 0; }
a.tag { text-decoration: none; }
.coords { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 14px; }
p.bad { color: var(--danger); }
.q-name { font-weight: 650; }
.q-meta { font-size: 14px; color: var(--muted); }

.detail-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.detail-head h1 { margin: 0; }
.location-summary { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.location-summary.bad { color: var(--warn); }
.day.empty { padding: 10px 18px; }
.day.empty .day-head { margin: 0; }
.day-actions { display: flex; align-items: center; gap: 8px; }
.mpunches { list-style: none; margin: 0; padding: 0; }
.mp { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.mp:first-child { border-top: 0; padding-top: 4px; }
.mp-check input { width: 24px; height: 24px; margin-top: 2px; }
.mp-times { font-size: 18px; font-variant-numeric: tabular-nums; }
.mp-times .edited { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.mp-side { display: grid; justify-items: end; align-content: start; gap: 8px; }
.mp-hours { font-weight: 700; font-variant-numeric: tabular-nums; }
.mp.locked { opacity: .75; }
.mp.open .mp-times { color: var(--danger); }
.variance { font-size: 14px; font-weight: 600; margin-top: 4px; }
.variance.over { color: var(--danger); }
.variance.under { color: var(--muted); }
.action-bar {
  position: sticky; bottom: 0; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
  padding: 12px; margin: 0 -4px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px); border-top: 1px solid var(--line);
}

.editor.narrow-wide { max-width: 640px; margin: 0 auto 16px; }
.day-picker .label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.day-big { font-size: 26px; font-weight: 750; flex: 1; text-align: center; }
.shift-choices { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.shift-choices legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.shift-choice { display: grid; grid-template-columns: 28px 1fr; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font-weight: 400; cursor: pointer; }
.shift-choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent); }
.shift-choice input { width: 20px; height: 20px; margin: 2px 0 0; }
.shift-choice.inactive { opacity: .7; }
.shift-choice.unscheduled .schedule-line { color: var(--warn); }
.schedule-line { display: block; margin-top: 2px; }
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview { font-weight: 650; font-size: 17px; min-height: 1.4em; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.button-row .btn { flex: 1; }

/* ---------- Daily report ---------- */
.daily-bar { flex-wrap: nowrap; justify-content: flex-start; align-items: center; }
.day-form { display: flex; align-items: center; justify-content: center; gap: 4px 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
.day-form input { width: auto; font-size: 16px; padding: 8px 10px; }
.day-name { font-weight: 700; font-size: 18px; font-family: var(--font-head); }
@media (min-width: 900px) { .day-form { flex: none; justify-content: flex-start; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.stat-num { color: var(--heading); }
.stat-num { font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat.bad { border-color: var(--danger); }
.stat.bad .stat-num { color: var(--danger); }
.refresh-note { align-self: center; margin-left: auto; }
.site.attention { box-shadow: inset 5px 0 0 var(--danger); }
.site-link { color: inherit; text-decoration: none; }
.site-link:hover { color: var(--primary); text-decoration: underline; }
.daily-rows { list-style: none; margin: 0; padding: 0; }
.daily-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.daily-row:first-child { border-top: 0; padding-top: 4px; }
.dr-who { display: grid; gap: 2px; }
.dr-name { font-weight: 650; color: var(--text); text-decoration: none; }
.dr-name:hover { color: var(--primary); }
.dr-punches { grid-column: 1 / -1; display: grid; gap: 6px; }
.dr-punch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.dr-actions { display: flex; align-items: center; gap: 6px; }
.dr-hours { grid-column: 2; grid-row: 1; text-align: right; }
@media (min-width: 900px) {
  .daily-row { grid-template-columns: minmax(220px, 1.2fr) 2fr 140px; align-items: start; }
  .dr-punches { grid-column: 2; }
  .dr-hours { grid-column: 3; }
}

/* ---------- People and shifts ---------- */
.people-search input { font-size: 16px; padding: 10px 12px; margin-bottom: 10px; }
.contact { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 15px; }
.contact a { color: var(--primary); text-decoration: none; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-self: flex-start; }
.shift-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.shift-card { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.shift-card.inactive { opacity: .65; }
.shift-card.stale { border-color: var(--warn); }
.sc-desc { font-weight: 600; margin: 2px 0; }
.sc-actions { display: grid; gap: 6px; justify-items: end; align-content: start; }
.narrow-left { max-width: 640px; }
select { width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
.schedule { border: 0; padding: 0; margin: 0; }
.schedule legend { font-weight: 600; font-size: 15px; }
.schedule-grid { display: grid; grid-template-columns: minmax(80px, auto) 1fr 90px; gap: 6px 8px; align-items: center; margin: 8px 0; }
.schedule-grid input { font-size: 16px; padding: 8px 10px; }
.day-label { font-weight: 600; }

/* ---------- Sites ---------- */
.hours-chart { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 150px; }
.hours-chart li { display: grid; grid-template-rows: auto 1fr auto; align-items: end; justify-items: center; height: 100%; min-width: 0; }
.hours-chart .bar { width: 100%; max-width: 28px; min-height: 2px; border-radius: 5px 5px 2px 2px; background: var(--primary); align-self: end; }
.hours-chart .bar-value { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hours-chart .bar-label { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; margin-top: 4px; }
.hours-chart .bar-label.today { color: var(--text); font-weight: 700; }
.add-shift-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 14px; }
.add-shift-form label { flex: 1; min-width: 220px; }
.add-shift-form input { font-size: 16px; padding: 10px 12px; }

/* ---------- Notes ---------- */
.count-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700;
}
.chip-count { margin-left: 4px; font-variant-numeric: tabular-nums; }
.queue-title { font-size: 20px; margin-bottom: 10px; }
.inline-form { display: inline; }
.convo-top { display: flex; justify-content: space-between; gap: 8px; }
.convo-preview { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notes-detail { display: grid; gap: 16px; }
@media (min-width: 1100px) { .notes-detail { grid-template-columns: 1fr 280px; align-items: start; } }
.messages { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; max-height: 55vh; overflow: auto; }
.msg { display: grid; max-width: 85%; }
.msg .bubble { padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { font-size: 12px; color: var(--muted); margin: 2px 6px 0; }
.msg.from-employee { justify-self: start; }
.msg.from-employee .bubble { background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.from-employee.open .bubble { border-color: var(--warn); box-shadow: inset 4px 0 0 var(--warn); }
.msg.from-manager { justify-self: end; text-align: right; }
.msg.from-manager .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; text-align: left; }
.msg.system { justify-self: center; font-size: 13px; color: var(--muted); }
.msg .new-tag { justify-self: start; font-size: 11px; font-weight: 700; color: var(--danger); text-transform: uppercase; }
.quick-replies { margin-top: 6px; }
.quick-replies .chip { background: var(--surface); cursor: pointer; font: inherit; font-size: 14px; }
.context h2 { font-size: 16px; }
.context-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.context-day { display: flex; justify-content: space-between; align-items: center; }
.context-punch { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; padding: 4px 0 4px 10px; border-left: 3px solid var(--line); }
.context-punch .times { font-variant-numeric: tabular-nums; color: var(--muted); }
.context-punch.open { border-left-color: var(--danger); }
.messages.employee-view { max-height: none; }
.msg.mine { justify-self: end; text-align: right; }
.msg.mine .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; text-align: left; }
.msg.theirs { justify-self: start; }
.msg.theirs .bubble { background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.earlier { margin-bottom: 12px; }
.earlier summary { cursor: pointer; color: var(--primary); font-weight: 600; margin-bottom: 10px; }
.tabs a .dot { display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--danger); vertical-align: middle; }

/* Shared tablet: bigger everything, no clutter. */
body.kiosk { font-size: 19px; }
body.kiosk .page { max-width: 640px; }
