/* KADGIS office app — "The Minute Sheet". Tokens live in /common/theme.css. */

.boot { position: fixed; inset: 0; display: grid; place-items: center; }

/* ---------------------------------------------------------------- request progress (top edge) */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 90;
  background: var(--amber);
  opacity: 0; transition: width .4s var(--ease), opacity .3s;
}
#progress.on { opacity: 1; width: 72%; transition: width 6s cubic-bezier(.1, .7, .2, 1), opacity .1s; }
#progress.done { opacity: 0; width: 100%; transition: width .2s ease-out, opacity .35s .15s; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; background: var(--navy); color: var(--navy-200);
  display: flex; flex-direction: column; padding: 18px 0 0; overflow-y: auto; scrollbar-color: var(--navy-600) transparent;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 18px 18px; color: #fff; text-decoration: none; }
.brand img { width: 42px; height: 42px; flex: none; }
.brand b { display: block; font-size: 15px; letter-spacing: .08em; font-weight: 800; }
.brand small { display: block; font-size: 11px; color: var(--navy-300); line-height: 1.3; }
.rail nav { display: flex; flex-direction: column; padding: 4px 0 16px 10px; }
.rail h6 { margin: 16px 8px 4px; font-size: 10.5px; letter-spacing: .14em; color: var(--navy-300); font-weight: 700; }
.rail nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 1px 0;
  color: var(--navy-100); text-decoration: none; font-weight: 500; border-radius: var(--radius) 0 0 var(--radius);
  transition: background .15s, color .15s;
}
.rail nav a svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.rail nav a:hover { background: var(--navy-700); color: #fff; }
/* The active section is a file tab: the page's own ground, joined into the content edge. */
.rail nav a[aria-current='page'] { background: var(--ground); color: var(--navy); font-weight: 700; }
.rail nav a[aria-current='page'] svg { opacity: 1; }
.rail .who {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-top: 1px solid var(--navy-700); color: #fff; text-decoration: none;
}
.rail .who small { display: block; color: var(--navy-300); font-size: 11.5px; }
.rail .who:hover { background: var(--navy-700); }
.rail .out { color: var(--navy-200); background: none; border: 0; padding: 10px 16px 16px; text-align: left; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.rail .out:hover { color: #fff; }
.rail a.out { text-decoration: none; }
.rail .out svg { width: 16px; height: 16px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 54px; display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: rgba(238, 240, 246, .92); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: var(--hair);
}
.crumbs { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.crumbs b { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .today { color: var(--ink-3); font-size: 12.5px; }
.content { padding: 22px 28px 40px; max-width: 1560px; width: 100%; }

/* ---------------------------------------------------------------- page head */
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.head h1 { font-size: 25px; font-weight: 800; letter-spacing: -.015em; }
.head .sum { color: var(--ink-2); margin-top: 3px; }
.head .actions { margin-left: auto; display: flex; gap: 8px; }
.tabs-page { display: flex; gap: 2px; border-bottom: var(--hair); margin: -4px 0 16px; }
.tabs-page button { background: none; border: 0; padding: 9px 14px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; }
.tabs-page button[aria-selected='true'] { color: var(--navy); border-color: var(--navy); }

/* ---------------------------------------------------------------- icons */
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); color: var(--ink);
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--navy-300); color: var(--navy); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-700); color: #fff; }
/* Amber is the "this needs doing" action: one per screen at most. */
.btn.act { background: var(--amber); border-color: var(--amber); color: #1d1300; }
.btn.act:hover { background: #ffb53f; border-color: #ffb53f; color: #1d1300; }
.btn.danger { color: var(--bad); border-color: var(--bad-line); }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--navy-700); padding: 0 8px; }
.btn.ghost:hover { background: var(--navy-50); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.busy { pointer-events: none; color: transparent !important; position: relative; }
.btn.busy::after {
  content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--busy, var(--navy)); border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn.primary.busy { --busy: #fff; }
.btn.act.busy { --busy: #1d1300; }

/* ---------------------------------------------------------------- stamps (status marks) */
.stamp {
  display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border: 1px solid; border-radius: 2px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
}
.stamp.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.stamp.info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.stamp.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.stamp.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.stamp.mute { color: var(--mute); background: var(--mute-bg); border-color: var(--mute-line); }
.ref { font-weight: 700; letter-spacing: .02em; color: var(--navy); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.num { text-align: right; }

/* ---------------------------------------------------------------- filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters .search { position: relative; flex: 0 1 300px; min-width: 220px; }
.filters .search .ico { position: absolute; left: 10px; top: 50%; margin-top: -8px; color: var(--ink-3); }
.filters .search input { padding-left: 32px; width: 100%; max-width: none; }
.fctl {
  height: 32px; border: 1px solid var(--rule); border-radius: var(--radius); background-color: var(--sheet);
  padding: 0 9px; font-size: 12.5px; color: var(--ink-2); max-width: 210px; width: auto;
}
.pager label { display: inline-flex; align-items: center; gap: 6px; }
.fctl:hover { border-color: var(--navy-300); }
.fctl.set { border-color: var(--navy); color: var(--navy); font-weight: 600; background-color: var(--navy-50); }
.frange { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.frange input { width: 132px; }
.frange input[type='number'] { width: 104px; }
.filters .clear { font-size: 12.5px; }
.filters .ftoggle { display: none; }
.filters .count { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }

/* ---------------------------------------------------------------- the register (data table) */
.sheet { background: var(--sheet); border: var(--hair); border-radius: var(--radius); box-shadow: var(--shadow-sheet); }
.reg-wrap { overflow-x: auto; }
table.reg { width: 100%; border-collapse: collapse; }
.reg th {
  position: sticky; top: 0; background: var(--sheet-2); text-align: left; font-size: 10.5px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); padding: 0 12px; height: 36px;
  border-bottom: var(--hair); white-space: nowrap;
}
.reg th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.reg th button:hover, .reg th[aria-sort] button { color: var(--navy); }
.reg th button:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.reg th .ico { width: 12px; height: 12px; }
.reg td { padding: 9px 12px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; white-space: nowrap; }
.reg td.wrap { white-space: normal; min-width: 200px; }
.reg tbody tr:last-child td { border-bottom: 0; }
.reg tbody tr.click { cursor: pointer; }
.reg tbody tr.click:hover td { background: var(--navy-50); }
.reg tbody tr.sel td { background: var(--amber-50); }
.reg .cb { width: 36px; padding-right: 0; }
.reg .mark { width: 22px; padding: 0 0 0 12px; }
.reg input[type='checkbox'] { width: 15px; height: 15px; accent-color: var(--navy); vertical-align: middle; }
.reg .strong { font-weight: 600; }
.reg .sub { display: block; font-size: 12px; color: var(--ink-3); }
/* changed since you last opened it */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); display: inline-block; box-shadow: 0 0 0 3px var(--amber-100); }
.who-cell { display: flex; align-items: center; gap: 9px; }
.skel td { padding: 13px 12px; }
.skel span { display: block; height: 10px; border-radius: 2px; background: linear-gradient(90deg, var(--rule-2), var(--navy-50), var(--rule-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: var(--hair); color: var(--ink-3); font-size: 12.5px; flex-wrap: wrap; }
.pager .pages { margin-left: auto; display: flex; gap: 3px; align-items: center; }
.pager .pages button { min-width: 30px; height: 28px; border: 1px solid transparent; border-radius: var(--radius); background: none; cursor: pointer; color: var(--ink-2); font-weight: 600; }
.pager .pages button:hover { border-color: var(--rule); }
.pager .pages button[aria-current='true'] { background: var(--navy); color: #fff; }
.pager .pages button[disabled] { opacity: .35; pointer-events: none; }
.pager select { height: 28px; }
.bulkbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--navy); color: #fff;
  border-radius: var(--radius) var(--radius) 0 0; font-weight: 600;
}
.bulkbar .btn { height: 28px; }
.reg-loading { position: relative; }
.reg-loading tbody { opacity: .45; transition: opacity .15s; }

/* ---------------------------------------------------------------- forms */
label.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
label.f > span:not(.ss) { font-size: 12px; font-weight: 600; color: var(--ink-2); }
label.f.req > span:not(.ss)::after { content: ' *'; color: var(--bad); }
label.f small { color: var(--ink-3); font-size: 11.5px; }
/* :where() keeps these base styles at zero specificity so components (.fctl, filters) can adjust them. */
:where(input:not([type='checkbox']):not([type='radio']):not([type='file'])), :where(select), :where(textarea) {
  height: 36px; border: 1px solid var(--rule); border-radius: var(--radius); background-color: var(--sheet);
  padding: 0 10px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
:where(textarea) { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
:where(input, select, textarea):hover { border-color: var(--navy-300); }
:where(input, select, textarea):focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-100); }
:where(input, select, textarea):disabled { background-color: var(--sheet-2); color: var(--ink-3); }
input::placeholder, textarea::placeholder { color: #767b9b; }
select { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2362678a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.fctl { appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2362678a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
input.fctl { background-image: none; padding-right: 9px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid .full { grid-column: 1 / -1; }
.grid .three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; grid-column: 1 / -1; }
.legend { grid-column: 1 / -1; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding-top: 8px; border-top: var(--hair); margin-top: 4px; }
.legend:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-error { grid-column: 1 / -1; color: var(--bad); background: var(--bad-bg); border: 1px solid var(--bad-line); border-radius: var(--radius); padding: 8px 10px; font-weight: 500; }
.form-error:empty { display: none; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 2px; accent-color: var(--navy); width: 15px; height: 15px; }
.drop {
  border: 1px dashed var(--navy-300); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--ink-2);
  background: var(--navy-50); cursor: pointer; transition: background .15s, border-color .15s;
}
.drop:hover, .drop.over { background: var(--navy-100); border-color: var(--navy); }
.drop input { display: none; }
.drop b { color: var(--navy); }

/* ---------------------------------------------------------------- modals: files (right) and dialogs (centre) */
.scrim { position: fixed; inset: 0; background: rgba(6, 8, 42, .42); opacity: 0; transition: opacity .25s var(--ease); }
.layer { position: fixed; inset: 0; z-index: 60; }
.layer.in .scrim { opacity: 1; }
.file {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(800px, 100vw); background: var(--sheet);
  display: flex; flex-direction: column; box-shadow: var(--shadow-file);
  transform: translateX(40px); opacity: 0; transition: transform .35s var(--ease), opacity .25s var(--ease);
}
.dialog {
  position: absolute; left: 50%; top: 8vh; width: min(var(--w, 600px), calc(100vw - 32px)); max-height: 84vh;
  background: var(--sheet); border-radius: var(--radius); display: flex; flex-direction: column; box-shadow: var(--shadow-pop);
  transform: translate(-50%, 10px) scale(.985); opacity: 0; transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.layer.in .file { transform: none; opacity: 1; }
.layer.in .dialog { transform: translate(-50%, 0); opacity: 1; }
.layer.out .scrim { opacity: 0; }
.layer.out .file { transform: translateX(40px); opacity: 0; }
.layer.out .dialog { transform: translate(-50%, 6px) scale(.99); opacity: 0; }
.m-head { padding: 18px 24px 0; border-bottom: var(--hair); flex: none; }
.dialog .m-head { padding-bottom: 14px; }
.m-head .top { display: flex; align-items: flex-start; gap: 12px; }
.m-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin-top: 3px; }
.dialog .m-head h2 { font-size: 17px; }
.m-head .meta { color: var(--ink-2); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.m-head .x { margin-left: auto; flex: none; }
.m-tabs { display: flex; gap: 2px; margin-top: 14px; overflow-x: auto; }
.m-tabs button { background: none; border: 0; padding: 9px 13px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.m-tabs button:hover { color: var(--ink); }
.m-tabs button[aria-selected='true'] { color: var(--navy); border-color: var(--navy); }
.m-tabs .n { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.m-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }
.m-foot { flex: none; padding: 12px 24px; border-top: var(--hair); display: flex; gap: 8px; justify-content: flex-end; align-items: center; background: var(--sheet-2); }
.m-foot .left { margin-right: auto; }
.m-loading { flex: 1; display: grid; place-items: center; min-height: 240px; }
.m-loading .lbl { margin-top: 12px; color: var(--ink-3); font-size: 12.5px; text-align: center; }

/* ---------------------------------------------------------------- file contents */
.sec { margin-bottom: 22px; }
.sec > h3 { font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 7px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sec > h3 .btn { margin-left: auto; letter-spacing: 0; text-transform: none; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
dl.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); margin: 0; }
dl.kv dt { color: var(--ink-3); padding: 6px 0; border-bottom: 1px solid var(--rule-2); }
dl.kv dd { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--rule-2); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
dl.kv dd.blank { color: var(--ink-3); font-weight: 400; }
.note { background: var(--amber-50); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 10px 12px; color: #4a3200; }
.note.info { background: var(--navy-50); border-color: var(--navy-100); color: var(--ink); }
.note.bad { background: var(--bad-bg); border-color: var(--bad-line); color: #5a0f0a; }
.next {
  border: 1px solid var(--warn-line); background: var(--amber-50); border-radius: var(--radius);
  padding: 14px 16px; display: flex; gap: 14px; align-items: center;
}
.next.done { border-color: var(--ok-line); background: var(--ok-bg); }
.next .what { flex: 1; }
.sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.next .what b { display: block; font-size: 14px; }
.next .what span { color: var(--ink-2); font-size: 12.5px; }
.linkrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule-2); }
.linkrow:last-child { border-bottom: 0; }
.linkrow .grow { flex: 1; min-width: 0; }

/* the minute sheet */
.minutes { list-style: none; margin: 0; padding: 0; }
.minutes li { display: grid; grid-template-columns: 62px 104px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule-2); }
.minutes .no { font-weight: 800; color: var(--navy); }
.minutes .at { color: var(--ink-3); font-size: 12px; line-height: 1.35; }
.minutes .what { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.minutes .what b { font-weight: 700; }
.minutes p { flex-basis: 100%; color: var(--ink-2); }
.minutes .by { flex-basis: 100%; color: var(--ink-3); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.sheet-head { display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: .13em; font-weight: 700; color: var(--ink-3); padding-bottom: 7px; border-bottom: 1px solid var(--rule-strong); }

/* avatars */
.av {
  --a: 30px; width: var(--a); height: var(--a); border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: var(--navy-100); color: var(--navy); font-weight: 800; font-size: calc(var(--a) * .36); overflow: hidden;
  border: 1px solid var(--navy-200); letter-spacing: .02em;
}
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.xs { --a: 22px; }
.av.lg { --a: 72px; border-width: 2px; }
.photo-edit { display: flex; gap: 14px; align-items: center; }
.photo-edit label { cursor: pointer; }
.photo-edit input { display: none; }

/* masked sensitive values */
.masked { display: inline-flex; align-items: center; gap: 6px; }
.masked code { font-family: inherit; letter-spacing: .06em; font-weight: 600; }
.masked .btn { height: 24px; padding: 0 7px; font-size: 11.5px; }

/* verification */
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.chk { border: var(--hair); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.chk .t { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.chk .d { color: var(--ink-2); font-size: 12.5px; min-height: 36px; }

/* stepper */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 12px 0 2px; }
.steps div { font-size: 11px; color: var(--ink-3); font-weight: 600; padding-top: 7px; border-top: 3px solid var(--rule); }
.steps div.done { border-color: var(--navy); color: var(--ink-2); }
.steps div.now { border-color: var(--amber); color: var(--ink); }
.steps div.held { border-color: var(--bad); color: var(--bad); }

/* evidence */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fcard { border: var(--hair); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; background: var(--sheet); }
.fcard .th { aspect-ratio: 4 / 3; background: var(--sheet-2); display: grid; place-items: center; color: var(--ink-3); cursor: zoom-in; border-bottom: var(--hair); }
.fcard .th img { width: 100%; height: 100%; object-fit: cover; }
.fcard .th .ico { width: 26px; height: 26px; }
.fcard .cap { padding: 7px 9px; font-size: 12px; }
.fcard .cap b { display: block; font-size: 12px; }
.fcard .cap span { color: var(--ink-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer { display: grid; place-items: center; background: #0b0d2a; min-height: 60vh; }
.viewer img { max-width: 100%; max-height: 74vh; }

/* ---------------------------------------------------------------- toasts */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow-pop);
  max-width: 420px; display: flex; gap: 10px; align-items: flex-start; animation: toast-in .3s var(--ease);
}
.toast.bad { background: var(--bad); }
.toast .ico { margin-top: 2px; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- dashboard */
.dash { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.panel { background: var(--sheet); border: var(--hair); border-radius: var(--radius); padding: 16px 18px; }
.panel > h2 { font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 8px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 4px; display: flex; justify-content: space-between; }
.ledger { width: 100%; border-collapse: collapse; }
.ledger td { padding: 9px 0; border-bottom: 1px solid var(--rule-2); }
.ledger td.num { font-weight: 700; font-size: 15px; }
.ledger tr:last-child td { border-bottom: 0; }
.dash .minutes li { grid-template-columns: 74px 92px minmax(0, 1fr); }
.dash .minutes .no { font-size: 12px; }

/* ---------------------------------------------------------------- auth screens */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); }
.auth .side { background: var(--navy); color: var(--navy-100); padding: 48px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth .side img { width: 96px; height: 96px; }
.auth .side h1 { color: #fff; font-size: 30px; font-weight: 800; margin-top: 28px; max-width: 14ch; letter-spacing: -.02em; }
.auth .side p { max-width: 44ch; margin-top: 12px; color: var(--navy-200); }
.auth .side .foot { margin-top: auto; font-size: 12px; color: var(--navy-300); }
.auth .side .foot a { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 10px; color: #fff; font-size: 13px; font-weight: 600; }
.auth .side .foot a svg { width: 16px; height: 16px; }
.auth .side::after {
  content: ''; position: absolute; right: -180px; bottom: -180px; width: 520px; height: 520px; border-radius: 50%;
  border: 2px solid var(--navy-700); box-shadow: 0 0 0 26px var(--navy), 0 0 0 28px var(--navy-700);
  background: radial-gradient(circle, transparent 56%, var(--navy-700) 56.5%, transparent 57%);
}
.auth form { align-self: center; padding: 48px; display: flex; flex-direction: column; gap: 16px; max-width: 460px; width: 100%; justify-self: center; }
.auth form h2 { font-size: 22px; font-weight: 800; }
.auth form .btn { height: 40px; }

/* ---------------------------------------------------------------- locations explorer */
.explorer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.explorer .panel { padding: 0; }
.explorer .panel > h2 { padding: 14px 16px 8px; margin: 0; }
.explorer ul { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.explorer li { display: flex; align-items: center; gap: 6px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--rule-2); }
.explorer li a { flex: 1; padding: 9px 0; text-decoration: none; color: var(--ink); }
.explorer li.on { background: var(--navy-50); }
.explorer li.on a { color: var(--navy); font-weight: 700; }
.explorer li .acts { display: flex; gap: 2px; opacity: 0; }
.explorer li:hover .acts, .explorer li:focus-within .acts { opacity: 1; }
.explorer form { display: flex; gap: 6px; padding: 12px 16px; border-top: var(--hair); }
.explorer .hint { padding: 16px; color: var(--ink-3); }

/* ---------------------------------------------------------------- role matrix */
.matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.matrix fieldset { border: var(--hair); border-radius: var(--radius); padding: 10px 12px 12px; margin: 0; }
.matrix legend { font-weight: 700; padding: 0 4px; display: flex; gap: 8px; align-items: center; }
.matrix label { display: flex; gap: 8px; padding: 4px 0; cursor: pointer; align-items: flex-start; }
.matrix input { accent-color: var(--navy); width: 15px; height: 15px; margin-top: 2px; flex: none; }
.perm-key { color: var(--ink-3); font-size: 11px; }

/* ---------------------------------------------------------------- messaging */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--navy-200); background: var(--navy-50); color: var(--navy); border-radius: 2px; padding: 2px 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.chips button:hover { background: var(--navy-100); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.seg label { padding: 7px 14px; cursor: pointer; font-weight: 600; color: var(--ink-2); border-right: var(--hair); }
.seg label:last-child { border-right: 0; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--navy); color: #fff; }
.preview { border: var(--hair); border-radius: var(--radius); background: var(--sheet-2); padding: 14px; position: sticky; top: 0; }
.preview .bubble { background: #fff; border: var(--hair); border-radius: 10px 10px 10px 2px; padding: 10px 12px; margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.counter { font-size: 11.5px; color: var(--ink-3); text-align: right; }
.counter.over { color: var(--bad); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: var(--hair); border-radius: var(--radius); }
.stats div { padding: 10px 12px; border-right: var(--hair); }
.stats div:last-child { border-right: 0; }
.stats b { display: block; font-size: 20px; font-weight: 800; }
.stats span { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.prov { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; }
  .compose { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px 12px; align-items: center; }
  .brand { padding: 0 8px 0 0; }
  .rail nav { flex-direction: row; overflow-x: auto; padding: 0; flex-basis: 100%; order: 3; margin-top: 8px; }
  .rail h6 { display: none; }
  .rail nav a { border-radius: var(--radius); white-space: nowrap; }
  .rail .who { margin: 0 0 0 auto; border: 0; padding: 6px; }
  .rail .who > div { display: none; }
  .rail .out { padding: 6px; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .grid, .cols, .checks, .matrix, .prov, .explorer { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth .side { padding: 28px; min-height: 0; }
  .auth .side h1 { font-size: 22px; margin-top: 14px; }
  .auth form { padding: 28px; }
  .dialog { top: 0; max-height: 100vh; height: 100%; width: 100vw; border-radius: 0; }
  .topbar .today { display: none; }
  .next { flex-direction: column; align-items: stretch; }
  .m-foot { flex-wrap: wrap; padding: 10px 16px; }
  .m-head, .m-body { padding-left: 16px; padding-right: 16px; }
  .head .actions { margin-left: 0; }
  /* Filters fold behind one button on phones; the search box stays out. */
  .filters .ftoggle { display: inline-flex; }
  .filters:not(.open) > :not(.search):not(.ftoggle):not(.count):not(.xport) { display: none; }
  .filters .search { flex: 1 1 100%; }
  .minutes li { grid-template-columns: 52px minmax(0, 1fr); }
  .minutes .at { grid-column: 2; grid-row: 1; }
  .minutes .what { grid-column: 1 / -1; }
  dl.kv { grid-template-columns: 120px minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  .rail, .topbar, .filters, .pager, #toasts, .m-foot, .m-tabs, .scrim, .x { display: none !important; }
  .shell { display: block; }
  .file, .dialog { position: static; transform: none; box-shadow: none; width: auto; opacity: 1; }
  .layer { position: static; }
  body { background: #fff; }
}

/* photos load after the page: initials sit underneath until the image is ready */
.av { position: relative; }
.av img { position: absolute; inset: 0; opacity: 0; transition: opacity .25s; }
.av img.ok, .fcard .th img.ok, .viewer img.ok { opacity: 1; }
.fcard .th img, .viewer img { opacity: 0; transition: opacity .25s; }

/* reference as identity inside the heading; location as plain text after the meta */
.m-head h2 .ref { margin-right: 4px; }
.m-head .meta .where { color: var(--ink-3); }

/* the signed-in officer, top right */
.officer { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; padding: 4px 8px; border-radius: var(--radius); }
.officer:hover { background: var(--navy-50); color: var(--ink); }
.officer b { display: block; font-size: 13px; line-height: 1.2; }
.officer small { display: block; font-size: 11.5px; color: var(--ink-3); }

/* initials in a ring — how a minute is initialled */
.ini { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--navy); color: var(--navy); font-size: 9.5px; font-weight: 800; letter-spacing: .02em; flex: none; background: var(--sheet); }
.lastmin { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule-2); font-size: 12.5px; }
.lastmin .no { font-weight: 800; color: var(--navy); }
.lastmin .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lastmin .when { flex: none; white-space: nowrap; color: var(--ink-3); }

/* dashboard ledger */
.ledger.reg td, .ledger.reg th { padding-left: 0; }
.ledger td.num.share { color: var(--ink-3); font-weight: 500; font-size: 12.5px; }

/* printed file: jacket header with the seal, reference and print date */
.print-head { display: none; }
@media print {
  .print-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 2px solid #000; }
  .print-head img { width: 48px; height: 48px; }
  .print-head span { margin-left: auto; font-size: 11px; }
  .layer ~ .layer, .scrim { display: none !important; }
  .shell { display: none; }
  .m-body { overflow: visible; }
}

/* scrollbar arrows are browser chrome, not part of the design */
@media (max-width: 860px) {
  .rail nav, .m-tabs { scrollbar-width: none; }
  .rail nav::-webkit-scrollbar, .m-tabs::-webkit-scrollbar { display: none; }
  .officer > div { display: none; }
}

/* dashboard ledgers: the register's own table rules, compact */
.panel .reg.ledger th { background: none; height: 30px; padding: 0; }
.panel .reg.ledger td { padding: 8px 0; }
.panel .reg.ledger td.num, .panel .reg.ledger th.num { padding-left: 16px; }
.minutes .by { padding-left: 32px; }
.reg th.num { text-align: right; }
@media (max-width: 860px) { .lastmin .when { display: none; } }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border: 1px solid var(--rule); border-radius: 2px; background: var(--sheet-2); font-size: 12.5px; }

/* ---------------------------------------------------------------- searchable selects
   The native select stays underneath (value, required, validation bubble); the button shows it. */
.ss { position: relative; display: block; min-width: 0; }
.ss.ss-f { display: inline-block; }
.ss .ss-native { position: absolute; inset: auto 0 0 0; height: 1px; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.ss-btn {
  display: block; width: 100%; height: 36px; border: 1px solid var(--rule); border-radius: var(--radius); background-color: var(--sheet);
  padding: 0 28px 0 10px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2362678a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; transition: border-color .15s, box-shadow .15s;
}
.ss-btn:hover { border-color: var(--navy-300); }
/* the hidden select takes focus when the form reports it as missing: ring the button instead */
.ss-btn:focus-visible, .ss-btn[aria-expanded='true'], .ss:has(.ss-native:focus) .ss-btn { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-100); }
.ss-btn.ph:not(.fctl) { color: #767b9b; }
.ss-btn:disabled { background-color: var(--sheet-2); color: var(--ink-3); cursor: default; }
.ss-btn.fctl { height: 32px; padding: 0 26px 0 9px; font-size: 12.5px; color: var(--ink-2); background-position: right 8px center; }
.ss-btn.fctl.set { color: var(--navy); }
/* a required list left empty, once the form has been checked */
.ss:has(.ss-native:user-invalid) .ss-btn { border-color: var(--bad); }

.ss-pop {
  position: absolute; z-index: 55; max-width: min(420px, calc(100vw - 16px)); background: var(--sheet); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: hidden;
}
.ss-pop.up { flex-direction: column-reverse; }
.ss-q { position: relative; padding: 8px; border-bottom: var(--hair); }
.ss-pop.up .ss-q { border-bottom: 0; border-top: var(--hair); }
.ss-q .ico { position: absolute; left: 17px; top: 50%; margin-top: -8px; color: var(--ink-3); }
.ss-q input { height: 32px; padding-left: 30px; font-size: 13px; }
.ss-pop ul { position: relative; list-style: none; margin: 0; padding: 4px 0; max-height: 264px; overflow-y: auto; }
.ss-pop li { padding: 7px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-pop li.ph { color: var(--ink-3); }
.ss-pop li[aria-selected='true'] { font-weight: 700; color: var(--navy); }
.ss-pop li.on { background: var(--navy-50); box-shadow: inset 3px 0 0 var(--navy); }
.ss-pop li.none { color: var(--ink-3); cursor: default; }
@media print { .ss-pop { display: none; } }

/* ---------------------------------------------------------------- export / import */
.filters .xport { flex: none; }
.imp-tpl { display: flex; align-items: center; gap: 8px; }
.imp-tpl > span { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-right: 4px; }
.imp-file input[type='file'] { font: inherit; font-size: 13px; }
.imp-cols { border: var(--hair); border-radius: var(--radius); padding: 10px 12px; }
.imp-cols summary { cursor: pointer; font-weight: 600; color: var(--navy-700); }
.imp-cols table { margin-top: 8px; }
.imp-cols td { padding: 6px 12px 6px 0; }
.req-mark { font-size: 11px; font-weight: 600; color: var(--bad); margin-left: 4px; }
.imp-sum { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding: 12px 14px; border: var(--hair); border-radius: var(--radius); background: var(--sheet-2); }
.imp-sum b { font-size: 15px; }
.imp-table { max-height: 320px; overflow-y: auto; border: var(--hair); border-radius: var(--radius); }
.imp-table td { padding: 7px 12px; }
