/* Employee portal. Most staff open this on a phone, so it is laid out
   narrow-first and the calendar collapses to a list on small screens. */

/* Same pastel blue as the office app, so the two read as one system: a tinted
   page with the calendar sitting on it as a white card. The accent and the
   muted grey are darker than a dark theme's would be, since both are read
   against white here. */
:root {
  color-scheme: light; /* so the month dropdown and scrollbars come up light too */
  --bg: #eaf1f9;
  --surface: #ffffff;
  --surface-2: #e7eff8;
  --surface-3: #f4f8fd;
  --sunk: #e3ebf5;   /* days outside the month */
  --weekend: #f4f8fd;
  --line: #cfdcec;
  --line-soft: #e3ebf5;
  --text: #1b2b3a;
  --muted: #5a7288;
  --accent: #2b6cab;
  --accent-soft: #dcebfa;
  --accent-ink: #ffffff;
  --err: #c0262b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(29, 78, 132, .06), 0 6px 18px rgba(29, 78, 132, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", "Sarabun", system-ui, sans-serif;
}

/* ------------------------------------------------------------------ chrome */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: linear-gradient(180deg, #c5dcf3 0%, #e0edf9 55%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(29, 78, 132, .05);
}

.brand { font-weight: 700; color: var(--accent); }
.account { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.who { color: var(--muted); font-size: 13px; }
.btn-acct { display: inline-flex; align-items: center; gap: 6px; }
.acct-ico { width: 16px; height: 16px; flex: none; }

main { padding: 16px; max-width: 1100px; margin: 0 auto; }

.muted { color: var(--muted); }
.foot { font-size: 12px; margin-top: 16px; }
.loading { padding: 24px; }

/* ------------------------------------------------------------------ inputs */

.btn {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover:not([disabled]) { background: var(--accent-soft); border-color: #b9d4ee; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not([disabled]) { filter: brightness(1.1); }
.btn.block { width: 100%; padding: 10px; }

input, select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font: inherit;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.error {
  padding: 9px 12px;
  border-radius: 6px;
  background: rgba(192, 38, 43, .09);
  border-left: 3px solid var(--err);
  color: var(--err);
  font-size: 13px;
}

.title { font-size: 19px; margin: 0 0 16px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* ------------------------------------------------------------------- login */

.login-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }

.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.login-brand { font-weight: 700; font-size: 17px; color: var(--accent); margin-bottom: 22px; }
.login-card input { width: 100%; margin-bottom: 16px; }
.login-card .error { margin-bottom: 16px; }

/* ---------------------------------------------------------------- calendar */

.monthbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
#month-summary { font-size: 13px; }

/* The grid keeps its shape on every screen so staff see the same calendar on
   a phone as on a desktop. Narrow screens scroll this container sideways
   rather than the page itself. */
.calendar-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line-soft); /* shows through the gaps as the grid lines */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  /* Below this the day columns are too narrow to read a time in. */
  min-width: 620px;
}

.calendar .loading, .calendar .error { grid-column: 1 / -1; }

.dow {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 8px 4px;
}

.cell {
  background: var(--surface);
  min-height: 92px;
  padding: 6px;
}
.cell.is-empty { background: var(--sunk); }
.cell.is-weekend { background: var(--weekend); }
.cell.is-today { outline: 2px solid var(--accent); outline-offset: -2px; }

.daynum { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cell.has-data .daynum { color: var(--text); font-weight: 600; }

.times { display: flex; flex-direction: column; gap: 2px; }

.time {
  background: var(--accent-soft);
  color: #1c4e77;
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* A scan from before the first shift starts: the work it belongs to began the
   previous day. Amber rather than red - it is a normal late finish, not a
   fault - and the word carries the meaning where the colour cannot. */
.time.is-crossed {
  background: #fbeed6;
  color: #7a4a00;
  border-left-color: #b57812;
}

.crossed-tag {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  margin-left: 5px;
  white-space: nowrap;
}

/* Says how many scans the day really held, when the pair on show is not all
   of them. Quiet enough not to compete with the times themselves. */
.more {
  font-size: 11px;
  color: var(--muted);
  padding: 0 2px;
}

/* Only the page padding tightens on a phone. The calendar itself is left
   alone, so there is one layout to learn and one to explain. */
@media (max-width: 640px) {
  main { padding: 12px; }
  .account { gap: 6px; }
}



/* ------------------------------------------------------------------ dialog */

dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  width: min(340px, 92vw);
  box-shadow: 0 12px 36px rgba(29, 78, 132, .22);
}
dialog::backdrop { background: rgba(22, 35, 46, .35); }
dialog input { width: 100%; margin-bottom: 14px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(29, 78, 132, .18);
  padding: 10px 16px;
  max-width: 90vw;
}
.toast.is-error { border-left-color: var(--err); }

/* -------------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }

.tab {
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 7px 7px 0 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .55); }
.tab.is-active {
  background: var(--surface);
  border-color: var(--line);
  border-bottom-color: var(--surface);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: -13px;   /* sit on the topbar's lower edge */
  padding-bottom: 20px;
}

/* display below would otherwise beat the browser's own rule for [hidden],
   and an empty queue would show a red zero. Same trap as .field[hidden]. */
.tab-count[hidden] { display: none; }

.tab-count {
  display: inline-block;
  min-width: 19px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 10px;
  background: var(--err);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* Says plainly that this is not finished, wherever the tab is seen. */
.tab-dev {
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 9px;
  background: #fbeed6;
  color: #8a5300;
  font-size: 11px;
  font-weight: 600;
}

.panel { display: none; }
.panel.is-active { display: block; }

.dev-note {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid #edd9b0;
  border-left: 3px solid #d39b2a;
  border-radius: 8px;
  background: #fdf6e8;
  color: #7a4a00;
}
.dev-note b { display: block; margin-bottom: 2px; }

.section-title { font-size: 15px; margin: 22px 0 10px; }
.section-title:first-of-type { margin-top: 0; }
.section-note { font-size: 13px; margin: -6px 0 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card.scroll { padding: 0; overflow-x: auto; }

/* ------------------------------------------------------------------ quotas */

.quotas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px;
}

.quota {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* The type being filled in is lifted out of the row, so the number that is
   about to change is the one the eye lands on. */
.quota.is-picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.q-name { font-weight: 600; }
.q-value { font-weight: 700; color: var(--accent); white-space: nowrap; }
.q-of { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.q-bar {
  grid-column: 1 / -1;
  height: 5px;
  margin-top: 7px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}
.q-bar i { display: block; height: 100%; background: var(--accent); }
/* Sits inside the total line, so every card is the same height whether or
   not anything is waiting. */
.q-pending { color: #8a5300; font-weight: 600; }

/* -------------------------------------------------------------------- form */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
  /* A grid item will not shrink below the width of what is inside it unless
     it is told it may, and a pair of time inputs is wider than its column. */
  min-width: 0;
}
/* display:flex above would otherwise beat the browser's own rule for
   [hidden], and the time field would show even when it is switched off. */
.field[hidden] { display: none; }
.field select,
.field input,
.field textarea {
  font: inherit;
  min-width: 0;
  width: 100%;
  color: var(--text);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.field textarea { resize: vertical; }

/* Switched off because the choice does not apply, not because something is
   wrong: it reads as settled rather than broken. */
.field select:disabled,
.field input:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}
.field.is-locked { opacity: .75; }
.field-wide { grid-column: 1 / -1; }

/* Two inputs in a column sized for one, so it is given a column of its own
   to grow into rather than being pushed past the edge of the card. */
/* Only where there are two columns to span: asking for two in a one-column
   grid creates a second one and puts it back over the edge. */
@media (min-width: 620px) {
  #l-time-wrap { grid-column: span 2; }
}
.time-pair { display: flex; align-items: center; gap: 8px; min-width: 0; }
.time-pair input { flex: 1 1 0; }
.form-actions { display: flex; align-items: center; gap: 12px; }

/* The running total, answered by the server while the form is still open. */
.calc {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 15px;
  border-radius: 8px;
  background: var(--surface-3);
  border-left: 3px solid var(--accent);
}
.calc b { font-size: 17px; }
.calc .sub { font-size: 13px; color: var(--muted); }
.calc.is-bad { background: #fdeceb; border-left-color: var(--err); }
.calc.is-bad b { color: var(--err); }

/* ------------------------------------------------------------------ tables */

#my-leave { width: 100%; border-collapse: collapse; font-size: 14px; }
#my-leave th,
#my-leave td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
#my-leave th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-3); }
#my-leave tr:last-child td { border-bottom: 0; }
.nowrap { white-space: nowrap; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.p-wait { background: #fbeed6; color: #8a5300; }
.p-ok   { background: #dcf1e6; color: #17794c; }
.p-no   { background: #fbe0e0; color: var(--err); }
.p-cx   { background: var(--surface-2); color: var(--muted); }

/* ----------------------------------------------------------------- approve */

.req {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 17px;
  margin-bottom: 10px;
}
.req-top { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.req-who { font-weight: 700; }
.req-top .muted { font-size: 13px; }

.req-line { margin-top: 8px; line-height: 1.65; }
.req-reason { margin-top: 4px; color: var(--muted); line-height: 1.55; }

/* One row across the foot: what to look at on the left, what to do about
   it on the right, both on the same baseline. */
.req-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.req-act { margin-left: auto; display: flex; gap: 8px; }
.req-doc { font-size: 13px; }
.req-doc.is-missing { color: #8a5300; font-weight: 600; }
.btn-ok { border-color: #b3ddc6; color: #17794c; }
.btn-ok:hover:not([disabled]) { background: #dcf1e6; border-color: #8fcdaf; }
.btn-no { border-color: #edc0c0; color: var(--err); }
.btn-no:hover:not([disabled]) { background: #fbe0e0; border-color: #e09a9a; }
.empty { padding: 26px; text-align: center; }

#decide-dialog { width: min(460px, 94vw); }
#decide-dialog textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  padding: 8px 10px;
  margin: 6px 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  resize: vertical;
}
#decide-dialog .title { margin-top: 0; }

/* --------------------------------------------------------------- documents */

.field input[type="file"] {
  padding: 6px 10px;
  background: var(--surface-3);
  cursor: pointer;
}

.btn-file { white-space: nowrap; }

#files-dialog { width: min(480px, 94vw); }
#files-dialog .title { margin-top: 0; }

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.file-row:last-child { border-bottom: 0; }
.file-row a { color: var(--accent); text-decoration: none; word-break: break-all; }
.file-row a:hover { text-decoration: underline; }
.file-row .muted { margin-left: auto; font-size: 12px; white-space: nowrap; }

.files-add {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.files-add input[type="file"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-3);
  margin-bottom: 8px;
}
.files-note { font-size: 12px; margin: 0 0 12px; }

/* ------------------------------------------------- the other leave types */

/* Sized like the three real cards so the row reads as four of a kind, but
   plainly a way in rather than a balance: no bar, and an invitation instead. */
.quota-more {
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-style: dashed;
  background: var(--surface-3);
}
.quota-more:hover { border-color: var(--accent); background: var(--accent-soft); }
.quota-more .q-value { color: var(--text); font-weight: 600; }
.quota-more .q-of {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.q-open {
  grid-column: 1 / -1;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

#quota-dialog { width: min(440px, 94vw); }

.quota-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1px 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid transparent;
}
.quota-row:last-child { border-bottom: 0; }
.quota-row.is-picked {
  border-left-color: var(--accent);
  background: var(--surface-3);
}
.qr-name { font-weight: 600; }
.qr-value { color: var(--accent); font-weight: 700; white-space: nowrap; }
.qr-of { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

/* =============================================================== check-in */

:root {
  --bad: #c0262b;
  --bad-soft: #fbe0e0;
  --warn: #b7700c;
  --warn-soft: #fbeed6;
  --ok: #1f8a57;
  --ok-soft: #dcf1e6;
}

/* ------------------------------------------------- the employee's phone */

/* Narrow on purpose: this is used on a phone, and on a desktop it should
   still look like the thing people will hold. */
.ci { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.ci-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ci-small { font-size: 13px; }
.ci-center { text-align: center; }
.ci-clock { text-align: center; padding: 6px 0 2px; }
.ci-clock b { font-size: 48px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ci-clock div { font-size: 13px; }

.ci-loc { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; font-size: 14px; }
.ci-loc > .muted { grid-column: 2; }
/* How to switch precise location on: the whole width of the card. */
.ci-loc > .ci-help { grid-column: 1 / -1; margin-top: 8px; display: grid; gap: 4px; }
.ci-loc.is-weak { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.ci-loc-title { font-weight: 600; }
.ci-dot {
  width: 10px; height: 10px; margin-top: 6px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent);
}
.ci-dot.is-weak { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 22%, transparent); }
.ci-dot.is-wait { background: var(--muted); animation: ci-blink 1.2s ease-in-out infinite; }
@keyframes ci-blink { 50% { opacity: .3; } }

.ci-big {
  width: 100%; border: 0; border-radius: 14px; padding: 16px; cursor: pointer;
  font: inherit; font-size: 18px; font-weight: 700; line-height: 1.2;
  display: flex; justify-content: center; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
}
.ci-big:disabled { opacity: .45; cursor: not-allowed; }

.ci-hist-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.ci-hist { display: grid; gap: 8px; }
.ci-hist-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.ci-hist-place { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }

.ci-consent h2 { font-size: 18px; margin: 0 0 8px; }
.ci-consent p, .ci-consent ul { font-size: 14px; margin: 0 0 10px; }
.ci-consent ul { padding-left: 20px; display: grid; gap: 3px; }
.ci-dl { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 4px 10px; margin: 0 0 12px; font-size: 14px; }
.ci-dl dt { color: var(--muted); }
.ci-dl dd { margin: 0; overflow-wrap: anywhere; }

/* The camera keeps the shape of a phone screen, mirrored the way a front
   camera always looks to the person in front of it. */
.ci-cam { background: #0b0f14; border-radius: 16px; padding: 12px; display: grid; gap: 12px; color: #fff; }
.ci-cam-view { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 4; background: #000; }
.ci-cam-view video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.ci-oval {
  position: absolute; left: 50%; top: 45%; width: 62%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%);
  border: 3px dashed rgba(255, 255, 255, .85); border-radius: 50%; pointer-events: none;
}
.ci-cam-hint { text-align: center; font-size: 14px; }
/* "Smile", over the camera while the frames for the smile check are taken. */
.ci-smile {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%);
  background: var(--ok); color: #fff; font-size: 26px; font-weight: 700; line-height: 1.2;
  padding: 10px 22px; border-radius: 999px; white-space: nowrap; display: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.ci-cam.is-smiling .ci-smile { display: block; }
.ci-cam.is-smiling .ci-oval { border-color: var(--ok); border-style: solid; }
.ci-cam.is-smiling .ci-shutter { opacity: .4; pointer-events: none; }
.ci-cam-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.ci-cam-bar .btn { justify-self: start; }
.ci-shutter {
  width: 70px; height: 70px; border-radius: 50%; border: 5px solid #fff; background: #fff;
  box-shadow: inset 0 0 0 4px #0b0f14; cursor: pointer;
}

.ci-confirm { display: grid; gap: 10px; }
.ci-confirm h3, .ci-stop h3, .ci-done h3 { margin: 0; font-size: 18px; text-wrap: balance; }
.ci-shot { width: 100%; border-radius: 10px; display: block; }
.ci-note {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  font: inherit; resize: vertical; background: var(--surface); color: var(--text);
}
.ci-row2 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.ci-warn-txt { color: var(--warn); font-weight: 600; }

.ci-done, .ci-stop { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 26px 16px; }
.ci-done-ring {
  width: 86px; height: 86px; border-radius: 50%; background: var(--ok-soft); color: var(--ok);
  display: grid; place-items: center;
}
.ci-done-time { font-size: 32px; font-weight: 700; }
.ci-stop-ico {
  width: 70px; height: 70px; border-radius: 50%; background: var(--warn-soft); color: var(--warn);
  display: grid; place-items: center;
}
.ci-stop p { margin: 0; font-size: 14px; }
.ci-help { text-align: left; width: 100%; font-size: 14px; }
.ci-steps { margin: 4px 0 0; padding-left: 20px; text-align: left; display: grid; gap: 2px; }
.ci-file { width: 100%; }

/* The admin map and report moved to the office app (public/checkin-map.js). */

@media (prefers-reduced-motion: reduce) {
  .ci-dot.is-wait { animation: none; }
}

.ci-shot-small { max-width: 180px; border-radius: 12px; }

/* What to try after a picture that did not pass. */
.ci-tip {
  width: 100%; text-align: left; font-size: 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
}
.ci-tip b { color: var(--warn); }
.ci-tip ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 2px; }

/* Said before the first refusal rather than after it: an iPhone with location
   switched off never asks, it just says no. */
.ci-ios-tip { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); font-size: 13.5px; margin-bottom: 12px; }

/* ------------------------------------------------------ topbar on a phone */
/* Last in the file on purpose: it overrides the tab rules above. */
/* The same menu, the same order: the system's name and the account on one
   line, the tabs on the next as a single row of pills that scrolls sideways
   when there are more than fit - the way wide content is handled everywhere
   else here - rather than wrapping into a jumble. */
@media (max-width: 640px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px 10px;
  }
  .brand { font-size: 17px; }
  /* Placed, not left to flow: after a full-width row of tabs, auto
     placement would put the account on a third line. */
  .brand { grid-row: 1; grid-column: 1; }
  .account { margin-left: 0; grid-row: 1; grid-column: 2; }
  .who {
    max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px;
  }
  .btn-acct { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 10px; }
  .acct-ico { width: 18px; height: 18px; }
  .acct-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }

  .tabs {
    grid-row: 2;
    grid-column: 1 / -1;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin: 0 -12px;
    padding: 2px 12px 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex: none;
    white-space: nowrap;
    border-radius: 999px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, .7);
    border: 1px solid var(--line);
    font-size: 14px;
  }
  .tab.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    margin-bottom: 0;
    padding-bottom: 7px;
  }
  .tab.is-active .tab-dev { background: rgba(255, 255, 255, .85); }
}
