/* Prestag Attendance web portal. The phone app uses the same colour tokens. */
:root {
  /* surfaces */
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #EEF2F6;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  /* text */
  --text: #0F172A;
  --text-2: #334155;
  --text-muted: #64748B;
  --text-faint: #94A3B8;
  /* brand */
  --primary: #2952CC; --primary-hover: #1F43AD; --primary-press: #19388F; --primary-soft: #EAF0FF; --on-primary: #FFFFFF;
  /* status (text on soft background is AA) */
  --success: #13794A; --success-soft: #E6F5EC;
  --warning: #995C00; --warning-soft: #FFF4DC;
  --danger:  #C2261C; --danger-soft: #FDECEA; --danger-hover: #A31F16;
  --info:    #1D63C4; --info-soft: #E7F0FC;
  --purple:  #6B3FC0; --purple-soft: #F1EBFB;
  --neutral: #475569; --neutral-soft: #EEF2F6;
  /* type */
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Gurmukhi", "Nirmala UI", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600;
  /* spacing (4-pt) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  /* radius */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  /* elevation */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, .18);
  --focus: 0 0 0 3px rgba(41, 82, 204, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* layout */
  --rail: 232px; --topbar: 56px; --tabrow: 48px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-md); line-height: 20px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-variant-numeric: tabular-nums;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-weight: var(--fw-semibold); color: var(--text); }
h1 { font-size: var(--fs-xl); line-height: 28px; }
h2 { font-size: var(--fs-lg); line-height: 24px; }
h3 { font-size: var(--fs-md); line-height: 20px; }
p { margin: 0; }
button { font-family: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.amber { color: var(--warning); } .red { color: var(--danger); } .green { color: var(--success); }
.quiet-link { font-weight: var(--fw-medium); color: var(--primary); background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; text-decoration: none; }
.quiet-link:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- shell ---------- */
.shell { display: grid; height: 100vh; grid-template-columns: var(--rail) minmax(0, 1fr); grid-template-rows: var(--topbar) auto minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; height: var(--topbar); background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 12px 0 16px; z-index: 30; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; min-height: 40px; border-radius: var(--r-sm); padding-right: 4px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; display: inline-flex; color: var(--primary); }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-name { font-weight: var(--fw-semibold); font-size: 15px; white-space: nowrap; }
.brand-div { width: 1px; height: 20px; background: var(--border-strong); flex: none; margin: 0 4px; }
.brand-org { font-size: var(--fs-md); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tb-space { flex: 1; }
.finder { flex: 0 1 420px; min-width: 200px; position: relative; display: flex; align-items: center; height: 36px; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r-sm); transition: border-color 120ms var(--ease), background 120ms var(--ease), box-shadow 120ms var(--ease); }
.finder.on { border-color: var(--primary); background: var(--surface); box-shadow: var(--focus); }
.finder .f-ic { display: inline-flex; padding: 0 8px 0 10px; color: var(--text-muted); }
.finder .f-ic svg { width: 16px; height: 16px; }
.finder .f-in { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-md); outline: none; box-shadow: none; }
.finder .f-in::placeholder { color: var(--text-faint); }
.finder .f-in::-webkit-search-cancel-button { display: none; }
.finder .f-kbd { margin-right: 8px; font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-muted); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 5px; line-height: 18px; background: var(--surface); }
.finder.on .f-kbd { display: none; }
.finder-list { padding: 4px; }
.menu-i.f-row { display: flex; align-items: center; gap: 10px; }
.f-row .avatar { width: 28px; height: 28px; font-size: 11px; }
.f-row .f-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.f-row .f-t b { font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-row .f-t small { color: var(--text-muted); font-size: var(--fs-sm); }
.menu-i.f-row.on { background: var(--surface-3); }
.f-none { padding: 10px 12px; color: var(--text-muted); font-size: var(--fs-sm); }
.who { display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid transparent; color: var(--text); border-radius: var(--r-md); padding: 4px 8px 4px 6px; cursor: pointer; text-align: left; min-width: 0; min-height: 44px; }
.who:hover, .who[aria-expanded="true"] { background: var(--surface-3); }
.who > svg { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
.who .avatar { width: 32px; height: 32px; font-size: 12px; background: var(--primary-soft); color: var(--primary); border: 0; }
.who-t { display: flex; flex-direction: column; line-height: 17px; min-width: 0; }
.who-name { font-weight: var(--fw-semibold); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.who-role { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.offbar { grid-column: 1 / -1; background: var(--warning-soft); color: var(--warning); border-bottom: 1px solid var(--border); font-size: var(--fs-sm); padding: 6px 16px; }

.sidebar { grid-row: 3; grid-column: 1; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; padding: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none; font-weight: var(--fw-medium); font-size: var(--fs-md); position: relative; white-space: nowrap;
}
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--text-muted); }
.nav a:hover { background: var(--surface-3); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav a.active svg { color: var(--primary); }
.nav .badge { margin-left: auto; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 4px; }
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font-size: var(--fs-xs); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; line-height: 1;
}
.badge.dot { min-width: 8px; width: 8px; height: 8px; padding: 0; background: var(--warning); }
.badge.quiet { background: var(--surface-3); color: var(--text-muted); }
.main { grid-row: 3; grid-column: 2; overflow-y: auto; overflow-x: hidden; min-width: 0; }
.view { padding: var(--s-6); max-width: 1440px; animation: fadein 120ms var(--ease); }
@keyframes fadein { from { opacity: 0; } }

/* ---------- menus ---------- */
.menu.pop { position: fixed; z-index: 2100; min-width: 200px; max-width: min(340px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 4px; animation: fadein 120ms var(--ease); }
.menu-i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; text-align: left; border: 0; background: none; padding: 6px 10px; border-radius: var(--r-sm); font-size: var(--fs-md); color: var(--text); cursor: pointer; }
.menu-i .mi-ic { display: inline-flex; color: var(--text-muted); }
.menu-i .mi-ic svg { width: 16px; height: 16px; }
.menu-i .mi-l { flex: 1; min-width: 0; }
.menu-i small { display: block; color: var(--text-muted); font-size: var(--fs-xs); line-height: 16px; margin-top: 2px; }
.menu-i:hover, .menu-i:focus-visible { background: var(--surface-3); box-shadow: none; }
.menu-i.danger { color: var(--danger); }
.menu-i:disabled { color: var(--text-faint); cursor: not-allowed; background: none; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }

/* ---------- older page header ---------- */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: var(--s-5); }
.page-h .ph-l { min-width: 0; }
.page-h .sub { color: var(--text-muted); margin-top: 4px; font-size: var(--fs-sm); max-width: 760px; }
.page-h .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { font-size: var(--fs-sm); margin-bottom: 6px; color: var(--text-muted); }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--primary); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--r-sm);
  font-size: var(--fs-md); font-weight: var(--fw-medium); cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1;
  transition: background 120ms var(--ease), border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
.btn:active { background: var(--surface-3); }
.btn.primary, .btn.dark { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover, .btn.dark:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.primary:active, .btn.dark:active { background: var(--primary-press); }
.btn.danger { color: var(--danger); border-color: #EBB2AD; background: var(--surface); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.link { background: transparent; border-color: transparent; color: var(--primary); padding: 0 6px; }
.btn.link:hover { text-decoration: underline; background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: var(--fs-sm); }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:disabled, .btn.primary:disabled, .btn.danger:disabled, .btn.danger-solid:disabled { background: var(--surface-3); border-color: var(--border); color: var(--text-faint); cursor: not-allowed; }
.btn.busy { position: relative; pointer-events: none; }
.btn.busy::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.input, select.input, textarea.input {
  height: 36px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--r-sm);
  padding: 0 10px; font: inherit; font-size: var(--fs-md); min-width: 0;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 72px; line-height: 20px; }
select.input { padding-right: 30px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748B' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.input:hover { border-color: var(--text-faint); }
.input:focus, textarea.input:focus { border-color: var(--primary); outline: none; box-shadow: var(--focus); }
.input::placeholder { color: var(--text-faint); }
.input:disabled { background: var(--surface-2); color: var(--text-muted); cursor: not-allowed; }
.input.mono { font-family: var(--mono); }
input[type=date].input, input[type=month].input, input[type=time].input { font-variant-numeric: tabular-nums; }
.input.err, .input[aria-invalid="true"] { border-color: var(--danger); box-shadow: none; }
.input.err:focus, .input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(194, 38, 28, .18); }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: var(--s-4); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2); }
.field .hint { font-size: var(--fs-xs); color: var(--text-muted); line-height: 16px; }
.field .ferr { font-size: var(--fs-sm); color: var(--danger); line-height: 18px; }
.field.grow { flex: 1; }
.search { position: relative; }
.search .input { padding-left: 32px; width: 240px; }
.search svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.datestep { display: inline-flex; }
.datestep .btn { border-radius: 0; }
.datestep .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.datestep .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.datestep > * + * { margin-left: -1px; }
.datestep .input { border-radius: 0; position: relative; height: 36px; }
.datestep .input:focus { z-index: 1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-md); }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 34px; font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; color: var(--text-2); border-right: 1px solid var(--border-strong); white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--primary-soft); color: var(--primary); }
.seg button:not(.on):hover { background: var(--surface-2); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; min-height: 52px; }
.card-h h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-b { padding: 16px 20px; }
.card-b.flush { padding: 0; }
.card-note { padding: 10px 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--fs-sm); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: var(--s-4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack > * + * { margin-top: var(--s-4); }

/* older KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: var(--s-5); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 14px 16px; text-decoration: none; color: inherit; display: block; position: relative; }
a.kpi:hover { border-color: var(--primary); text-decoration: none; }
.kpi .k-l { font-size: var(--fs-sm); color: var(--text-muted); display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.kpi .k-v { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); line-height: 32px; margin-top: 4px; }
.kpi .k-s { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.kpi.hot .k-v { color: var(--danger); }
.kpi .k-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* definition lists */
.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.dl dt { color: var(--text-muted); font-size: var(--fs-sm); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.stats > div { background: var(--surface); padding: 10px 12px; box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); }
.stats .s-l { font-size: var(--fs-xs); color: var(--text-muted); }
.stats .s-v { font-size: var(--fs-lg); font-weight: var(--fw-semibold); margin-top: 2px; }
.stats .s-v.hot, .stats .s-v.bad { color: var(--danger); }

/* ---------- badges (status pills) ---------- */
.chip, .ui-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; border: 0; line-height: 1; vertical-align: middle;
  color: var(--neutral); background: var(--neutral-soft);
}
.t-success, .st-P, .rq-ok { color: var(--success); background: var(--success-soft); }
.t-success-soft, .st-HD { color: var(--success); background: var(--surface); box-shadow: inset 0 0 0 1px #A9D9BE; }
.t-warning, .st-INC, .st-NS, .rq-pend, .rq-red { color: var(--warning); background: var(--warning-soft); }
.t-danger, .st-A, .rq-no { color: var(--danger); background: var(--danger-soft); }
.t-info, .st-OD { color: var(--info); background: var(--info-soft); }
.t-purple, .st-L, .st-LWP, .st-LLWP { color: var(--purple); background: var(--purple-soft); }
.t-neutral, .st-H, .st-WO, .st-FUT, .st-NJ, .st-EX, .st-NM, .rq-mute { color: var(--neutral); background: var(--neutral-soft); }
.t-primary { color: var(--primary); background: var(--primary-soft); }
.chip.risk-lwp { color: var(--purple); background: var(--purple-soft); }
.chip.risk-bad { color: var(--danger); background: var(--danger-soft); }
.chip.risk-amb { color: var(--warning); background: var(--warning-soft); }
.chip.risk-grey { color: var(--neutral); background: var(--neutral-soft); }
.chip.out { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text-2); }
.flag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: var(--fw-medium);
  border: 1px solid var(--border-strong); color: var(--text-muted); background: var(--surface); white-space: nowrap; vertical-align: middle;
}
.flag.corr { color: var(--text-2); }
.flag.off { color: var(--neutral); }
.flag.warn { color: var(--warning); border-color: transparent; background: var(--warning-soft); }
.flag.bad { color: var(--danger); border-color: transparent; background: var(--danger-soft); }
.flag.ok { color: var(--success); border-color: transparent; background: var(--success-soft); }
.flag.dark { color: var(--info); background: var(--info-soft); border-color: transparent; }
.flag.acc { color: var(--primary); border-color: transparent; background: var(--primary-soft); }
.flags { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }

/* ---------- older tables ---------- */
.tbl-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); position: relative; transition: opacity 120ms var(--ease); }
.card .tbl-wrap { border: 0; border-radius: 0 0 var(--r-md) var(--r-md); background: transparent; }
.tbl-wrap.tall { max-height: calc(100vh - 250px); min-height: 220px; }
.tbl-wrap.mid { max-height: 460px; }
.is-loading { opacity: .5; pointer-events: none; }
table.tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--fs-sm); }
.tbl th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-weight: var(--fw-semibold); font-size: var(--fs-xs);
  color: var(--text-muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: bottom; text-transform: none; letter-spacing: 0;
}
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th .sort { color: var(--text-faint); font-size: 11px; margin-left: 4px; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; line-height: 18px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.code { font-size: var(--fs-sm); white-space: nowrap; color: var(--text-2); }
.tbl td.wrap { min-width: 180px; max-width: 360px; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface-2); }
.tbl tbody tr.sel td { background: var(--primary-soft); }
.tbl tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.tbl tbody tr.dim td { color: var(--text-muted); }
.tbl tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--surface-2); font-weight: var(--fw-semibold); border-top: 1px solid var(--border); padding: 10px 12px; }
.tbl .stick { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.tbl th.stick { z-index: 3; background: var(--surface-2); }
.tbl tfoot td.stick { z-index: 3; background: var(--surface-2); }
.tbl tbody tr.click:hover td.stick { background: var(--surface-2); }
.tbl .stick.s2 { left: var(--s2, 70px); box-shadow: 1px 0 0 var(--border); }
.tbl td.err-cell { background: var(--danger-soft) !important; color: var(--danger); font-weight: var(--fw-semibold); }
.tbl tr.row-err td { background: #FFF8F7; }
.tbl tr.row-ok td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.tbl tr.row-err td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.tbl .sub { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.tbl .strike, s.strike { text-decoration: line-through; color: var(--text-muted); }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 2px 0; color: var(--text-muted); font-size: var(--fs-sm); flex-wrap: wrap; }
.empty { padding: 36px 20px; text-align: center; color: var(--text-muted); }
.empty b { display: block; color: var(--text); font-weight: var(--fw-semibold); margin-bottom: 4px; }
.thumb { width: 34px; height: 34px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); border: 1px solid var(--border); display: block; cursor: zoom-in; }
.thumb.lg { width: 96px; height: 96px; border-radius: var(--r-md); }
.thumb.none { cursor: default; display: inline-block; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: var(--fw-semibold); flex: none; object-fit: cover; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
img.avatar { cursor: default; }
.json { font-family: var(--mono); font-size: var(--fs-xs); line-height: 18px; white-space: pre-wrap; word-break: break-word; max-width: 360px; min-width: 150px; }
.json .k { color: var(--text-muted); }
.json.clip { max-height: 3.2em; overflow: hidden; position: relative; }
.more { border: 0; background: none; color: var(--primary); font-size: var(--fs-xs); padding: 2px 0 0; cursor: pointer; font-weight: var(--fw-medium); }

/* ---------- skeletons ---------- */
.skel { display: block; background: var(--surface-3); border-radius: var(--r-sm); position: relative; overflow: hidden; }
.skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-rows { display: flex; flex-direction: column; }
.skel-rows .skel { border-radius: 0; }
.skel-rows .skel:first-child { border-radius: var(--r-sm) var(--r-sm) 0 0; } .skel-rows .skel:last-child { border-radius: 0 0 var(--r-sm) var(--r-sm); }
.skel-page { display: flex; flex-direction: column; gap: 8px; }

/* ---------- banners and alerts ---------- */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); margin-bottom: var(--s-4); }
.banner .b-t { font-weight: var(--fw-semibold); }
.banner .b-x { flex: 1; min-width: 0; }
.banner .b-a { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.banner.info { background: var(--info-soft); border-color: transparent; color: var(--text); }
.banner.warn { border-color: transparent; background: var(--warning-soft); color: #5C3A00; }
.banner.bad { border-color: transparent; background: var(--danger-soft); color: #7A1D16; }
.banner.grey { background: var(--surface-2); color: var(--text-2); }
.banner.lock { background: var(--surface-2); color: var(--text); }
.banner.draft { background: var(--warning-soft); border-color: transparent; color: #5C3A00; }
.stamp { font-weight: var(--fw-semibold); font-size: var(--fs-xs); padding: 3px 8px; border-radius: var(--r-pill); flex: none; margin-top: 1px; }
.stamp.draft { color: var(--warning); background: var(--surface); }
.stamp.locked { color: var(--neutral); background: var(--neutral-soft); }
.alert { padding: 10px 12px; border-radius: var(--r-sm); font-size: var(--fs-md); }
.alert.bad { background: var(--danger-soft); color: #7A1D16; }
.alert.lwp { background: var(--purple-soft); color: #4A2475; }
.alert.warn { background: var(--warning-soft); color: #5C3A00; }
.alert.grey { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.alert.ok { background: var(--success-soft); color: #0E4F2F; }
.alert b { font-weight: var(--fw-semibold); }
.alert .big { font-size: 15px; font-weight: var(--fw-semibold); display: block; }
.err-card { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; background: var(--danger-soft); color: #7A1D16; border-radius: var(--r-md); }

/* ---------- older tabs ---------- */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: var(--s-4); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 12px; font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.tab .badge.quiet { font-weight: var(--fw-semibold); }

/* ---------- dialog, drawer, viewer, toasts ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; overflow-y: auto; animation: fadein 120ms var(--ease); }
.modal { background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); }
.modal.sm { max-width: 440px; }
.modal.wide { max-width: 720px; }
.modal.xl { max-width: 960px; }
.modal-h { display: flex; align-items: flex-start; gap: 10px; padding: 18px 16px 6px 20px; }
.modal-h .mh-t { flex: 1; min-width: 0; padding-top: 4px; }
.modal-h h2 { font-size: var(--fs-lg); line-height: 24px; }
.modal-h .mh-sub { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 2px; }
.x { border: 0; background: none; color: var(--text-muted); cursor: pointer; width: 32px; height: 32px; border-radius: var(--r-sm); flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.x svg { width: 18px; height: 18px; }
.x:hover { background: var(--surface-3); color: var(--text); }
.modal-b { padding: 10px 20px 8px; }
.modal-b .field + .field, .modal-b .row2 + .field, .modal-b .field + .row2, .modal-b .row2 + .row2, .modal-b .field + .row3, .modal-b .row3 + .field { margin-top: 14px; }
.modal-b .input { width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.modal-err { margin: 4px 20px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-soft); color: #7A1D16; font-size: var(--fs-md); }
.modal-err .err-list { margin: 0; padding-left: 18px; }
.modal-err .btn { margin-top: 8px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 20px; flex-wrap: wrap; }
.modal-f .spacer { flex: 1; }
.modal p + p { margin-top: 8px; }
.note { font-size: var(--fs-sm); color: var(--text-muted); background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; margin-top: 12px; }
.preview { font-size: var(--fs-md); color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 12px; }
.preview.amber { background: var(--warning-soft); border-color: transparent; color: #5C3A00; }
.current { font-size: var(--fs-md); color: var(--text-2); padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.drawer-ov { position: fixed; inset: 0; background: rgba(15, 23, 42, .32); z-index: 900; animation: fadein 180ms var(--ease); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 901; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slidein 180ms var(--ease); }
@keyframes slidein { from { transform: translateX(48px); opacity: 0; } }
.drawer-h { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 14px 24px; border-bottom: 1px solid var(--border); }
.drawer-h .dh-t { flex: 1; min-width: 0; padding-top: 4px; }
.drawer-h .dh-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drawer-h h2 { font-size: var(--fs-lg); line-height: 24px; }
.drawer-h .dh-sub { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 2px; }
.drawer-tabs { padding: 0 24px; border-bottom: 1px solid var(--border); }
.drawer-tabs .ui-tabs { border-bottom: 0; margin: 0; }
.drawer-b { flex: 1; overflow-y: auto; padding: 20px 24px 32px; }
.drawer-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.lightbox { max-width: min(900px, 96vw); background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.lightbox .lb-body { background: var(--surface-3); display: flex; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 74vh; display: block; }
.lightbox img[src*=".svg"] { width: min(420px, 90vw); height: auto; }
.lightbox iframe { width: min(860px, 94vw); height: 74vh; border: 0; background: #fff; }
.lightbox .lb-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; justify-content: space-between; flex-wrap: wrap; }
#toasts, #toasts-l { position: fixed; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: calc(100vw - 32px); }
#toasts { right: 20px; align-items: flex-end; }
#toasts-l { left: 20px; align-items: flex-start; }
.toast { pointer-events: auto; background: #1E293B; color: #fff; padding: 12px 16px; border-radius: var(--r-md); max-width: 440px; font-size: var(--fs-md); box-shadow: var(--shadow-lg); display: flex; gap: 16px; align-items: center; position: relative; overflow: hidden; animation: toastin 180ms var(--ease); transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }
.toast .t-msg { flex: 1; min-width: 0; }
.toast.err { background: #7A1D16; }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast small { display: block; color: #CBD5E1; margin-top: 2px; font-size: var(--fs-sm); }
.toast .t-act { background: none; border: 0; color: #A5BEFF; font-weight: var(--fw-semibold); cursor: pointer; font-size: var(--fs-md); padding: 4px; }
.toast .t-act:hover { text-decoration: underline; }
.toast .t-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255, 255, 255, .45); transform-origin: left; animation: tbar linear forwards; }
@keyframes tbar { to { transform: scaleX(0); } }

/* ---------- loading and errors ---------- */
.loading { padding: 50px 0; text-align: center; color: var(--text-muted); }
.loading.inline { padding: 18px 0; }
.page-err { max-width: 520px; margin: 64px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.page-err .pe-t { font-size: var(--fs-lg); color: var(--text); }
.page-err .alert { text-align: left; }

/* ---------- log in ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 32px; }
.login-top { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 24px; }
.login-top .brand-mark { width: 40px; height: 40px; margin-bottom: 12px; }
.login-top .lt-name { font-size: var(--fs-xl); font-weight: var(--fw-semibold); line-height: 28px; }
.login-top .lt-org { font-size: var(--fs-md); color: var(--text-muted); }
.login-form .field + .field { margin-top: 16px; }
.login-form .input { width: 100%; height: 40px; }
.login-form .btn { width: 100%; height: 40px; margin-top: 20px; }
.login-err { margin-top: 16px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-soft); color: #7A1D16; font-size: var(--fs-md); }
.login-note { margin-top: 16px; color: var(--text-muted); font-size: var(--fs-sm); text-align: center; }

/* ---------- Help and About ---------- */
.help-list { margin: 0; padding: 0; list-style: none; }
.help-list li { padding: 10px 0 10px 18px; border-top: 1px solid var(--border); position: relative; color: var(--text-2); }
.help-list li:first-child { border-top: 0; }
.help-list li::before { content: ''; position: absolute; left: 2px; top: 18px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.help-foot { margin-top: 12px; color: var(--text-muted); font-size: var(--fs-sm); }
.about { display: flex; gap: 16px; align-items: flex-start; }
.about .brand-mark { width: 40px; height: 40px; }
.about-n { font-weight: var(--fw-semibold); font-size: var(--fs-lg); line-height: 24px; }
.about-m { color: var(--text-2); margin-top: 2px; }
.about-c { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 10px; }

/* =====================================================================================================
   LM.ui components
   ===================================================================================================== */
.ui-wrap { display: contents; }
/* page header */
.ui-ph { margin-bottom: var(--s-5); }
.ui-ph.has-tabs { margin-bottom: var(--s-4); }
.ui-ph-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.ui-ph-l { min-width: 0; flex: 1 1 320px; }
.ui-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 4px; }
.ui-crumbs a { color: var(--text-muted); }
.ui-crumbs a:hover { color: var(--primary); }
.ui-crumbs .sep { color: var(--text-faint); }
.ui-ph-tt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ui-ph-meta { display: flex; align-items: center; gap: 0 8px; flex-wrap: wrap; color: var(--text-muted); font-size: var(--fs-sm); margin-top: 4px; }
.ui-ph-meta .dot { color: var(--text-faint); }
.ui-ph-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ui-ph .ui-tabs { margin-top: var(--s-4); }
/* tabs */
.ui-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ui-tabs::-webkit-scrollbar { display: none; }
.ui-tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-muted); font-size: var(--fs-md); font-weight: var(--fw-medium); cursor: pointer; white-space: nowrap; text-decoration: none; }
.ui-tab:hover { color: var(--text); text-decoration: none; }
.ui-tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.ui-tab-n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-muted); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.ui-tab.on .ui-tab-n { background: var(--primary-soft); color: var(--primary); }
/* filter bar */
.ui-fbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: var(--s-4); }
.ui-fbar-l, .ui-fbar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ui-fbar-l { flex: 1 1 0; min-width: 240px; }
.ui-fbar-r { flex: none; margin-left: auto; }
.ui-fsearch { display: inline-flex; align-items: center; height: 34px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); width: 240px; max-width: 100%; }
.ui-fsearch:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.ui-fsearch .ic { display: inline-flex; padding: 0 6px 0 10px; color: var(--text-muted); }
.ui-fsearch .ic svg { width: 16px; height: 16px; }
.ui-fsearch input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: inherit; font-size: var(--fs-md); color: var(--text); outline: none; box-shadow: none; padding-right: 8px; }
.ui-fsearch input::placeholder { color: var(--text-faint); }
.ui-fsel { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 8px 0 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-size: var(--fs-md); cursor: pointer; max-width: 100%; }
.ui-fsel:hover { border-color: var(--text-faint); }
.ui-fsel:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.ui-fsel .l { color: var(--text-muted); white-space: nowrap; }
.ui-fsel select, .ui-fsel input { border: 0; background: transparent; font: inherit; font-size: var(--fs-md); color: var(--text); font-weight: var(--fw-medium); outline: none; box-shadow: none; min-width: 0; max-width: 220px; cursor: pointer; padding: 0; }
.ui-fsel select { appearance: none; -webkit-appearance: none; padding-right: 18px; margin-right: -18px; position: relative; z-index: 1; }
.ui-fsel > svg { width: 14px; height: 14px; color: var(--text-muted); flex: none; }
.ui-fdate input { max-width: 150px; }
.ui-frange { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ui-frange .dash { color: var(--text-muted); }
.ui-fchips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ui-fchip { height: 30px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; white-space: nowrap; }
.ui-fchip:hover { border-color: var(--text-faint); }
.ui-fchip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.ui-fchip .n { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ui-fchip.on .n { color: var(--primary); }
.ui-fcheck { display: inline-flex; align-items: center; gap: 8px; height: 34px; font-size: var(--fs-md); color: var(--text-2); cursor: pointer; }
.ui-fcheck input { width: 16px; height: 16px; margin: 0; }
.ui-fclear { border: 0; background: none; color: var(--primary); font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; padding: 0 6px; height: 34px; }
.ui-fclear:hover { text-decoration: underline; }
/* data table */
.ui-dt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); min-width: 0; overflow: hidden; }
.card .ui-dt { border: 0; border-radius: 0; box-shadow: none; }
.ui-dt-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); min-height: 46px; }
.ui-dt-bl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ui-dt-bl b { font-weight: var(--fw-semibold); margin-right: 4px; }
.ui-dt-bar [data-cols] { margin-left: auto; }
.ui-dt-scroll { overflow: auto; position: relative; }
.ui-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.ui-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-muted); font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-align: left; padding: 0 12px; height: 40px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ui-table td { padding: 0 12px; height: 44px; border-bottom: 1px solid var(--border); vertical-align: middle; line-height: 18px; color: var(--text); }
.ui-dt.dense .ui-table td { height: 36px; }
.ui-table td.nw { white-space: nowrap; }
.ui-table tbody tr:last-child td { border-bottom: 0; }
.ui-table .ta-r { text-align: right; font-variant-numeric: tabular-nums; }
.ui-table .ta-c { text-align: center; }
.ui-table th.ta-r .ui-sort { flex-direction: row-reverse; }
.ui-sort { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.ui-sort:hover { color: var(--text); }
.ui-sort .ar { color: var(--text-faint); font-size: 11px; opacity: 0; transition: opacity 120ms var(--ease); }
.ui-sort:hover .ar, .ui-sort.on .ar { opacity: 1; }
.ui-sort.on { color: var(--text); }
.ui-sort.on .ar { color: var(--primary); }
.ui-table tr.is-click { cursor: pointer; }
.ui-table tbody tr.is-click:hover td, .ui-table tbody tr.is-click:focus-visible td { background: var(--surface-2); }
.ui-table tbody tr.is-click:focus-visible { box-shadow: none; outline: none; }
.ui-table tbody tr.is-click:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.ui-table tr.is-sel td { background: var(--primary-soft); }
.ui-table .ui-sel { width: 40px; padding-right: 0; }
.ui-table .ui-sel input { width: 16px; height: 16px; margin: 0; vertical-align: middle; }
.ui-table tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: var(--fw-semibold); border-top: 1px solid var(--border); border-bottom: 0; }
.ui-empty-row td { height: auto; padding: 0; }
.ui-dt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--fs-sm); }
.ui-dt-foot .pg { display: inline-flex; gap: 4px; }
.ui-colpick { display: inline-flex; align-items: center; gap: 8px; }
.ui-colpick .ck { width: 16px; height: 16px; border: 1px solid var(--border-strong); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.ui-colpick .ck svg { width: 12px; height: 12px; }
.ui-colpick .ck.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ui-person { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.ui-person .avatar { width: 28px; height: 28px; font-size: 11px; }
.ui-person .pn { display: flex; flex-direction: column; min-width: 0; line-height: 17px; }
.ui-person .pn b, .ui-person .pn a { font-weight: var(--fw-medium); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-person .pn small { color: var(--text-muted); font-size: var(--fs-xs); }
/* KPI tiles */
.ui-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: var(--s-4); }
.ui-kpi { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); color: var(--text); font: inherit; min-width: 0; text-decoration: none; }
.ui-kpi.is-click { cursor: pointer; transition: border-color 120ms var(--ease); }
.ui-kpi.is-click:hover { border-color: var(--border-strong); text-decoration: none; }
.ui-kpi.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ui-kpi .k-l { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-kpi .k-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--neutral); }
.ui-kpi .k-dot.t-success, .ui-kpi .k-dot.t-success-soft { background: var(--success); }
.ui-kpi .k-dot.t-warning { background: #D98B00; }
.ui-kpi .k-dot.t-danger { background: var(--danger); }
.ui-kpi .k-dot.t-info { background: var(--info); }
.ui-kpi .k-dot.t-purple { background: var(--purple); }
.ui-kpi .k-dot.t-primary { background: var(--primary); }
.ui-kpi .k-dot.t-neutral { background: var(--text-faint); }
.ui-kpi .k-v { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); line-height: 32px; font-variant-numeric: tabular-nums; }
.ui-kpi .k-s { font-size: var(--fs-xs); color: var(--text-muted); }
/* card, key/value list, empty */
.ui-card-f { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ui-kv { display: grid; gap: 14px 24px; margin: 0; }
.ui-kv.c1 { grid-template-columns: minmax(0, 1fr); }
.ui-kv.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ui-kv.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ui-kv-i { min-width: 0; }
.ui-kv dt { color: var(--text-muted); font-size: var(--fs-sm); line-height: 18px; }
.ui-kv dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.ui-none { color: var(--text-faint); }
.ui-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 20px; text-align: center; color: var(--text-muted); }
.ui-empty p { font-size: var(--fs-md); }
/* form fields */
.ui-opt { color: var(--text-muted); font-weight: var(--fw-regular); }
.ui-affix { display: flex; align-items: stretch; }
.ui-affix .pre, .ui-affix .suf { display: inline-flex; align-items: center; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-muted); font-size: var(--fs-md); }
.ui-affix .pre { border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.ui-affix .suf { border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.ui-affix .input { flex: 1; border-radius: 0; }
.ui-affix .input:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.ui-affix .input:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.ui-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-md); font-weight: var(--fw-regular); color: var(--text); }
.ui-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ui-switch .sw { width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--border-strong); position: relative; flex: none; transition: background 120ms var(--ease); }
.ui-switch .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 120ms var(--ease); }
.ui-switch input:checked + .sw { background: var(--primary); }
.ui-switch input:checked + .sw::after { transform: translateX(16px); }
.ui-switch input:focus-visible + .sw { box-shadow: var(--focus); }
.ui-field-checkbox > label, .ui-field-switch > label { font-weight: var(--fw-regular); }
.ui-confirm-msg { color: var(--text-2); }
.ui-confirm-msg + .field { margin-top: 14px; }
/* monthly register grid */
.ui-reg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.card .ui-reg { border: 0; border-radius: 0; box-shadow: none; }
.ui-reg-scroll { overflow: auto; max-height: calc(100vh - 220px); }
.ui-reg-t { border-collapse: separate; border-spacing: 0; font-size: var(--fs-xs); min-width: 100%; }
.ui-reg-t th, .ui-reg-t td { border-bottom: 1px solid var(--border); padding: 0; text-align: center; height: 40px; }
.ui-reg-t thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-muted); font-weight: var(--fw-semibold); }
.ui-reg-t .rg-name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 4px 12px; min-width: 190px; max-width: 220px; border-right: 1px solid var(--border); }
.ui-reg-t thead .rg-name { z-index: 3; background: var(--surface-2); }
.ui-reg-t .rg-name .rg-p { display: block; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; background: none; padding: 0; text-align: left; max-width: 100%; font-family: inherit; }
.ui-reg-t .rg-name button.rg-p { cursor: pointer; color: var(--primary); }
.ui-reg-t .rg-name small { color: var(--text-muted); font-size: var(--fs-xs); font-weight: var(--fw-regular); }
.ui-reg-t .rg-d { min-width: 32px; width: 32px; line-height: 14px; }
.ui-reg-t .rg-d .dn { display: block; color: var(--text-2); }
.ui-reg-t .rg-d .dw { display: block; font-weight: var(--fw-regular); color: var(--text-faint); font-size: 11px; }
.ui-reg-t .rg-d.today .dn { color: var(--primary); }
.ui-reg-t .off { background: var(--surface-2); }
.ui-reg-t thead .off { background: var(--surface-3); }
.ui-reg-t .rg-c.is-click { cursor: pointer; }
.ui-reg-t .rg-c.is-click:hover { background: var(--surface-3); }
.ui-reg-t .rg-t { min-width: 64px; padding: 0 10px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; text-align: right; color: var(--text); }
.ui-reg-t thead .rg-t { font-size: var(--fs-xs); color: var(--text-muted); }
.ui-reg-t .rg-t.first { border-left: 1px solid var(--border); }
.ui-reg-t tbody tr:last-child > * { border-bottom: 0; }
.rg-l { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 20px; padding: 0 3px; border-radius: 4px; font-size: 11px; font-weight: var(--fw-semibold); line-height: 1; }
.ui-reg-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 12px; border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-muted); }
.ui-reg-legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- shell at smaller widths ---------- */
@media (max-width: 1023px) {
  :root { --rail: 64px; }
  .sidebar { padding: 12px 8px; }
  .nav a { justify-content: center; padding: 0; height: 40px; }
  .nav a .nav-l { display: none; }
  .nav a .badge { position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
  .nav a .badge.dot { top: 6px; right: 10px; min-width: 8px; width: 8px; height: 8px; padding: 0; }
  .view { padding: var(--s-4); }
  .brand-org { max-width: 22vw; }
  .who-name { max-width: 140px; }
}
@media (max-width: 719px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--topbar) auto var(--tabrow) minmax(0, 1fr); }
  .offbar { grid-row: 2; }
  .sidebar { grid-row: 3; grid-column: 1; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .nav { flex-direction: row; height: 100%; align-items: stretch; gap: 0; }
  .nav a { height: auto; width: auto; border-radius: 0; padding: 0 12px; gap: 6px; border-bottom: 2px solid transparent; justify-content: flex-start; }
  .nav a .nav-l { display: inline; }
  .nav a svg { display: none; }
  .nav a.active { background: none; border-bottom-color: var(--primary); }
  .nav a .badge { position: static; }
  .nav-sep { width: 1px; height: auto; margin: 12px 4px; }
  .main { grid-row: 4; grid-column: 1; }
  .finder { display: none; }
  .brand-name { font-size: var(--fs-md); }
  .brand-div, .brand-org { display: none; }
  .who-t { display: none; }
  .ui-ph-act { justify-content: flex-start; }
  .ui-kv.c2, .ui-kv.c3 { grid-template-columns: minmax(0, 1fr); }
  .ui-fsearch { width: 100%; }
  .login-card { padding: 24px; }
}

/* ---------- page parts still used by the current page files ---------- */
.ov-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.weekchart { width: 100%; height: auto; display: block; }
.weekchart text { font-family: var(--font); }
.weekchart .n { font-size: 11px; }
.qlinks { list-style: none; margin: 0; padding: 0; }
.qlinks li { border-top: 1px solid var(--border); }
.qlinks li:first-child { border-top: 0; }
.qlinks a { display: flex; align-items: center; gap: 12px; padding: 11px 16px; text-decoration: none; color: inherit; }
.qlinks a:hover { background: var(--surface-3); }
.qlinks .q-n { font-size: 20px; font-weight: 600; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.qlinks .q-n.hot { color: var(--danger); }
.qlinks .q-t { flex: 1; min-width: 0; }
.qlinks .q-t small { display: block; color: var(--text-muted); font-size: 12px; }
.qlinks .go { color: var(--text-muted); font-size: 13px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; gap: 10px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--border); cursor: pointer; }
.mini-list li:hover { background: var(--surface-3); }
.mini-list .ml-t { flex: 1; min-width: 0; }
.mini-list .ml-t small { display: block; color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kind { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); width: 74px; flex: none; }

.map { height: 560px; width: 100%; background: var(--surface-3); border-radius: var(--r-md) var(--r-md) 0 0; }
.map.short { height: 420px; }
.map-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 500; pointer-events: none; }
.map-msg span { background: rgba(255, 255, 255, 0.96); border: 1px solid var(--border); padding: 10px 14px; border-radius: var(--r-md); color: var(--text-muted); font-size: 14px; pointer-events: auto; max-width: 80%; text-align: center; }
.map-box { position: relative; }
.map, .map-box { isolation: isolate; z-index: 0; }
.leaflet-container { font-family: var(--font); background: var(--surface-3); }
.leaflet-tile-pane { filter: grayscale(0.85) contrast(0.96) brightness(1.04); }
.leaflet-popup-content-wrapper { border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 18px; }
.leaflet-tooltip { font-size: 12px; padding: 3px 6px; border-radius: 4px; }
.pin { display: inline-flex; align-items: center; justify-content: center; height: 22px; padding: 0 7px; border-radius: 999px; font-family: var(--mono); font-size: 11px; font-weight: 700; color: #fff; background: var(--neutral); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); white-space: nowrap; transform: translate(-50%, -50%); position: absolute; left: 0; top: 0; cursor: pointer; }
.pin.p-OD { background: var(--text); gap: 4px; padding-left: 6px; }
.pin.p-OD::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex: none; }
.pin.p-P { background: var(--success); }
.pin.p-INC { background: var(--warning); }
.pin.p-A { background: var(--danger); }
.pin.sel { box-shadow: 0 0 0 2px var(--text), 0 2px 8px rgba(0, 0, 0, .4); z-index: 2; }
.lm-icon { background: none; border: 0; }
.ev-mk { width: 26px; height: 26px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4); transform: translate(-50%, -50%); position: absolute; }
.ev-in { background: var(--success); }
.ev-out { background: var(--danger); }
.ev-mode { background: var(--text); }
.pop { min-width: 220px; }
.pop-top { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.pop-top img { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); cursor: zoom-in; }
.pop .dl { font-size: 13px; gap: 3px 12px; margin-bottom: 8px; }
.pop .mono { font-size: 12px; color: var(--text-muted); }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.people { max-height: 560px; overflow-y: auto; }
.person { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--border); cursor: pointer; }
.person:first-child { border-top: 0; }
.person:hover { background: var(--surface-3); }
.person.sel { background: var(--bg); box-shadow: inset 3px 0 0 var(--text); }
.person .p-t { flex: 1; min-width: 0; }
.person .p-t b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .p-t small { color: var(--text-muted); font-size: 12px; display: block; }
.person .p-r { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.person .p-r small { font-size: 12px; color: var(--text-muted); }

.trail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; margin: 14px 0; }
.times > div { background: var(--surface); padding: 10px 12px; }
.times .t-l { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.times .t-v { font-size: 28px; font-weight: 600; line-height: 34px; font-variant-numeric: tabular-nums; }
.times .t-o { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 18px; }
.times .t-o s { color: var(--text-muted); }
.segs { list-style: none; margin: 0; padding: 0; }
.segs li { display: flex; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--border); align-items: baseline; }
.segs li > span:last-child { min-width: 0; }
.segs li:first-child { border-top: 0; }
.segs .tm { font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 92px; flex: none; color: var(--text-2); }
.kv-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); align-items: center; }
.kv-row:first-child { border-top: 0; }
.kv-row .k { color: var(--text-muted); font-size: 13px; }
.kv-row .v { text-align: right; }
.section-t { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 6px; }
.cmp { border-collapse: collapse; font-size: 14px; margin-bottom: 10px; }
.cmp th { font-size: 12px; font-weight: 600; color: var(--text-muted); text-align: left; padding: 3px 20px 3px 0; }
.cmp td { padding: 5px 20px 5px 0; font-variant-numeric: tabular-nums; }
.cmp td:first-child { color: var(--text-muted); }
.cmp td.chg { color: var(--text); font-weight: 700; }
.cmp-corr td { color: var(--text); }
.cmp td:first-child small { display: block; font-size: 12px; line-height: 16px; color: var(--text-muted); }
.reason { border-left: 3px solid var(--border-strong); padding: 2px 0 2px 10px; color: var(--text-2); margin: 10px 0; }
.meta { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); align-items: center; }
.meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.ceil { margin-top: 12px; }
.ceil-bar { height: 10px; border-radius: 999px; background: var(--surface-3); position: relative; overflow: hidden; display: flex; gap: 1px; }
.ceil-bar > span { height: 100%; display: block; flex: none; }
.ceil-bar .c-ap { background: var(--text); }
.ceil-bar .c-pend, .ceil-bar .c-this, .ceil-leg i.c-pend { background: repeating-linear-gradient(-45deg, var(--warning) 0 2px, var(--warning-soft) 2px 5px); }
.ceil-bar .c-over, .ceil-leg i.c-over { background: repeating-linear-gradient(-45deg, var(--danger) 0 2px, var(--danger-soft) 2px 5px); }
.ceil-leg { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--text-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.ceil-leg b { color: var(--text); font-weight: 600; }
.ceil-leg i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: -1px; background: var(--surface-3); }
.ceil-leg i.c-ap { background: var(--text); }
.ceil-leg i.c-left { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); }
.ceil-h { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; flex-wrap: wrap; }
.kmcmp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.kmcmp > div { background: var(--surface); padding: 8px 10px; }
.kmcmp .s-l { font-size: 12px; color: var(--text-muted); line-height: 16px; }
.kmcmp .s-v { font-size: 16px; font-weight: 600; margin-top: 3px; }
.kmcmp .adv { background: var(--bg); }
.kmcmp .adv .s-v { color: var(--text-muted); }
.daysplit { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.daysplit span { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--info-soft); color: var(--info); }
.daysplit span.lwp { background: var(--purple-soft); color: var(--purple); }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hist-note { font-size: 12px; color: var(--text-muted); }
.cur { font-size: 12px; font-weight: 600; color: var(--success); background: var(--success-soft); border-radius: 999px; padding: 1px 8px; }
.prev { font-size: 12px; font-weight: 600; color: var(--neutral); background: var(--neutral-soft); border-radius: 999px; padding: 1px 8px; }
.upc { font-size: 12px; font-weight: 600; color: var(--info); background: var(--info-soft); border-radius: 999px; padding: 1px 8px; }
.checklist { max-height: 220px; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); padding: 4px 0; }
.checklist label { display: flex; gap: 8px; align-items: center; padding: 5px 10px; cursor: pointer; font-size: 14px; }
.checklist label:hover { background: var(--surface-3); }
.checklist input { accent-color: var(--text); }
.hist-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1400px) { .hist-grid { grid-template-columns: minmax(0, 1fr); } }
.stats.tight { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.stats.tight .s-v { font-size: 15px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; }
.step .n { font-size: 12px; color: var(--text-muted); font-weight: 700; letter-spacing: .06em; }
.step h3 { margin: 4px 0 6px; }
.step p { color: var(--text-muted); font-size: 13px; margin-bottom: 10px; }
.drop { display: block; border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); padding: 14px; text-align: center; color: var(--text-muted); font-size: 14px; background: var(--surface); cursor: pointer; }
.drop.over { border-color: var(--text); background: var(--bg); }
.drop input { display: none; }
.result-strip { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

.imp-top { display: flex; gap: 16px; align-items: stretch; margin-bottom: 14px; flex-wrap: wrap; }
.imp-drop { flex: 1 1 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 128px; padding: 18px; }
.imp-drop svg { width: 26px; height: 26px; color: var(--text-muted); margin-bottom: 4px; }
.imp-d1 { color: var(--text); font-weight: 600; }
.imp-d2 { font-size: 13px; }
.imp-side { flex: 0 1 260px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.imp-side .quiet-link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }
.imp-side svg { width: 16px; height: 16px; }
.imp-strip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px 10px 14px; justify-content: space-between; }
.imp-strip .rs-x { min-width: 0; }

.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.mon { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 9px 9px; }
.mon h4 { font-size: 13px; margin-bottom: 5px; }
.mon .wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; }
.mon .wk span { font-size: 11px; line-height: 21px; border-radius: 3px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mon .wk .hd { color: var(--text-muted); font-size: 10px; }
.mon .wk .wo { color: var(--text-muted); background: var(--surface-3); }
.mon .wk .hol { background: var(--primary); color: #fff; font-weight: 600; cursor: help; }
.mon .wk .dhol { background: var(--neutral-soft); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--text-2); cursor: help; }
.mon .wk .td { outline: 1.5px solid var(--text); outline-offset: -1px; }
.wo-days { display: flex; gap: 6px; flex-wrap: wrap; }
.wo-days label { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: var(--r-sm); padding: 6px 10px; cursor: pointer; font-size: 14px; }
.wo-days label.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.wo-days input { display: none; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: center; }
.set-row:first-child { border-top: 0; }
.set-row .s-n { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.set-row .s-d { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.set-row .input { width: 100%; }
.set-row.changed { background: var(--bg); box-shadow: inset 3px 0 0 var(--text); }
.ceil-edit { padding: 0 16px 12px; }
.ceil-edit table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ceil-edit th { text-align: left; font-size: 12px; color: var(--text-muted); font-weight: 600; padding: 4px 6px 4px 0; }
.ceil-edit td { padding: 3px 6px 3px 0; }
.ceil-edit .input { width: 100%; }
.savebar { position: sticky; bottom: 0; background: rgba(247, 245, 240, 0.96); border-top: 1px solid var(--border); padding: 12px 0; margin-top: 16px; display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; z-index: 5; }
.calc { font-family: var(--mono); font-size: 13px; line-height: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; overflow-x: auto; }
.calc div { white-space: nowrap; }
.calc .eq { color: var(--text-muted); }
.calc b { font-weight: 600; }
.calc .tot { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.used td { background: var(--bg) !important; }
.rep-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.rep-list { list-style: none; margin: 0; padding: 6px 0; }
.rep-list a { display: flex; gap: 10px; align-items: baseline; padding: 7px 14px; text-decoration: none; color: var(--text-2); border-left: 3px solid transparent; }
.rep-list a:hover { background: var(--surface-3); }
.rep-list a.on { background: var(--bg); border-left-color: var(--text); font-weight: 600; color: var(--text); }
.rep-list .rid { font-family: var(--mono); font-size: 11px; color: var(--text-muted); width: 30px; flex: none; }
.rep-sel { display: none; }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.fbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.fbtn:hover { border-color: var(--text); color: var(--text); }
.fbtn.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.fbtn b { font-weight: 700; font-variant-numeric: tabular-nums; }
.fbtn .n { font-variant-numeric: tabular-nums; color: inherit; opacity: .8; }

.disc { border-top: 1px solid var(--border); }
.disc > summary { list-style: none; cursor: pointer; padding: 11px 16px; font-weight: 600; display: flex; gap: 8px; align-items: center; color: var(--text-2); }
.disc > summary::-webkit-details-marker { display: none; }
.disc > summary::before { content: '▸'; color: var(--text-muted); font-size: 12px; transition: transform 120ms var(--ease); display: inline-block; }
.disc[open] > summary::before { transform: rotate(90deg); }
.disc > summary:hover { color: var(--text); }
.disc-b { padding: 0 16px 14px; }
.line-list { list-style: none; margin: 0; padding: 0; }
.line-list > li { padding: 10px 0; border-top: 1px solid var(--border); }
.line-list > li:first-child { border-top: 0; }
.big-n { font-size: 22px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.callout { border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; line-height: 20px; margin: 10px 0; border: 1px solid; }
.callout.lwp { background: var(--purple-soft); color: #4A2475; border-color: #D9C4EE; }
.callout.bad { background: var(--danger-soft); color: #7A1D16; border-color: #F0B9B2; }
.callout.grey { background: var(--neutral-soft); color: var(--text-2); border-color: var(--border-strong); }
.callout.amber { background: var(--warning-soft); color: #4F3200; border-color: #E8CF96; }
.callout.ok { background: var(--success-soft); color: #0E4F26; border-color: #B6D5C1; }
.callout b { font-weight: 700; }
.ink-note { font-size: 13px; color: var(--text-muted); }
.call { display: inline-flex; align-items: center; gap: 6px; }
.call svg { width: 15px; height: 15px; }
.updated { font-size: 13px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .skel::after { display: none; }
}

@media (max-width: 1100px) {
  .ov-grid, .set-grid { grid-template-columns: minmax(0, 1fr); }
  .trail-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .live-grid { grid-template-columns: minmax(0, 1fr) 290px; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rep-grid { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .trail-grid, .live-grid { grid-template-columns: minmax(0, 1fr); }
  .people { max-height: 360px; }
  .rep-grid { grid-template-columns: minmax(0, 1fr); }
  .rep-list-card { display: none; }
  .rep-sel { display: block; margin-bottom: 12px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .kmcmp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-row { grid-template-columns: minmax(0, 1fr); }
  .map { height: 420px; }
  .search .input { width: 100%; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .btn, .seg button { min-height: 40px; }
  .btn.sm { min-height: 34px; }
}
@media (max-width: 520px) {
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
  .who-name { max-width: 34vw; }
  .page-h { align-items: flex-start; }
  .page-h .actions { width: 100%; }
}

.today { max-width: 1120px; }
.today-ctl { gap: 8px; }
.today-ctl select.input { max-width: 200px; }

.needs { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 18px; overflow: hidden; }
.needs-h { font-size: 12px; line-height: 16px; font-weight: 700; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; padding: 9px 14px 3px; }
.nrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: center; min-height: 42px; padding: 5px 10px 5px 14px; border-top: 1px solid var(--border); }
.needs-h + .nrow { border-top: 0; }
.nrow.link { cursor: pointer; }
.nrow.link:hover { background: var(--surface-3); }
.nrow .n-x { display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; }
.nrow .n-t { font-weight: 600; flex: none; font-variant-numeric: tabular-nums; }
.nrow .n-d { color: var(--text-muted); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nrow .n-d::before { content: '·'; margin-right: 8px; }
.nrow .n-a { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.nrow .n-a .btn.sm { height: 28px; }
.n-list { grid-column: 1 / -1; list-style: none; margin: 4px 0 4px; padding: 0; }
.n-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--border); font-size: 13px; }
.n-list li.n-help { color: var(--text-muted); font-size: 12px; display: block; }
.nothing { display: flex; gap: 8px; align-items: center; font-weight: 600; margin: 0 0 16px; color: var(--success); }
.nothing svg { width: 18px; height: 18px; }
.roster-sum { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.rgroup { margin-bottom: 14px; }
.rg-h { display: flex; align-items: center; gap: 8px; padding: 4px 2px 8px; font-weight: 700; cursor: pointer; background: none; border: 0; font-size: 14px; color: var(--text); }
.rg-h .cnt { color: var(--text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.rg-caret { color: var(--text-muted); font-size: 11px; transition: transform 120ms var(--ease); display: inline-block; }
.rgroup.shut .rg-caret { transform: rotate(-90deg); }
.rgroup.shut .rg-b { display: none; }
.rg-b { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.rrow { display: grid; grid-template-columns: 32px minmax(150px, 210px) 152px minmax(0, 1fr) auto 66px; align-items: center; gap: 12px; min-height: 52px; padding: 0 12px; border-top: 1px solid var(--border); cursor: pointer; }
.rrow:first-child { border-top: 0; }
.rrow:hover { background: var(--surface-3); }
.rrow.enter { animation: fadein 150ms var(--ease); }
.rr-pic { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); cursor: zoom-in; display: inline-flex; }
span.rr-pic { cursor: inherit; }
.rr-who { min-width: 0; line-height: 18px; }
.rr-name { font-weight: 600; color: var(--text); text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-name:hover { text-decoration: underline; }
.rr-who small { display: block; color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-mid { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-2); }
.rr-mid b { font-weight: 600; color: var(--text); }
.rr-right { min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-right:has(.rr-mode) { display: flex; }
.rr-mode, .rr-seen { flex: none; white-space: pre; }
.rr-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.rr-flags { display: flex; gap: 4px; flex-wrap: nowrap; justify-content: flex-end; overflow: hidden; }
.rr-acts { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity 120ms var(--ease); }
.rrow:hover .rr-acts, .rrow:focus-within .rr-acts { opacity: 1; }
.rr-acts .btn { width: 32px; height: 32px; }
.roster-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.roster-foot .quiet-link { display: inline-flex; align-items: center; gap: 6px; }
.roster-foot svg { width: 16px; height: 16px; }
.you-line { display: inline-flex; gap: 8px; align-items: center; margin-top: 18px; color: var(--text-muted); text-decoration: none; font-size: 14px; }
.you-line:hover { color: var(--text); text-decoration: underline; }
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.today-map { height: calc(100vh - 250px); min-height: 420px; }
.map-list .people { max-height: calc(100vh - 250px + 40px - 46px); min-height: 200px; }
@media (max-width: 1199px) { .map-wrap { grid-template-columns: minmax(0, 1fr); } .map-list .people { max-height: 360px; } }
@media (hover: none) { .rr-acts { opacity: 1; } }
@media (max-width: 520px) { .nrow { padding: 6px 8px 6px 12px; } .nrow .n-x { flex-direction: column; gap: 0; } .nrow .n-d { max-width: 100%; } .nrow .n-d::before { display: none; } .n-list li { flex-wrap: wrap; } }
@media (max-width: 860px) {
  .rrow { grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "pic who acts" "pic mid acts" "pic right acts"; row-gap: 2px; padding: 8px 12px; }
  .rrow > .rr-pic { grid-area: pic; align-self: start; margin-top: 2px; }
  .rr-who { grid-area: who; } .rr-mid { grid-area: mid; font-size: 13px; } .rr-right { grid-area: right; white-space: normal; }
  .rr-right:has(.rr-mode) { display: block; } .rr-note { white-space: normal; }
  .rr-flags { grid-column: 2; flex-wrap: wrap; } .rr-acts { grid-area: acts; opacity: 1; }
  .rr-mid:empty, .rr-right:empty, .rr-flags:empty { display: none; }
  .today-ctl { width: 100%; }
}

.apv-page { max-width: 1280px; }
.apv-seg { margin-bottom: 12px; }
.apv-filters .fchips { margin-bottom: 14px; }
.fbtn.pill { padding-right: 8px; }
.fbtn.pill svg { width: 14px; height: 14px; }
.apv { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.apv-q { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: auto; max-height: calc(100vh - 230px); position: sticky; top: 0; }
.qi { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--border); background: var(--surface); padding: 12px 14px; cursor: pointer; font: inherit; color: var(--text); position: relative; transition: height 180ms var(--ease), opacity 180ms var(--ease), padding 180ms var(--ease); overflow: hidden; }
.qi:first-child { border-top: 0; }
.qi:hover { background: var(--surface-3); }
.qi.sel { background: var(--bg); box-shadow: inset 3px 0 0 var(--text); }
.qi.collapsing { height: 0 !important; opacity: 0; padding-top: 0; padding-bottom: 0; border-top-width: 0; }
.qi-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.qi-top b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi-age { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.qi-age.amber { color: var(--warning); font-weight: 600; }
.qi-line { font-size: 13px; color: var(--text-2); }
.qi-with { font-size: 12px; color: var(--text-muted); }
.qi-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.qi.back { animation: qiback 1.2s var(--ease); }
.keys { gap: 8px 18px; }
.keys kbd { display: inline-block; min-width: 22px; padding: 1px 7px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; font-family: var(--mono); font-size: 12px; background: var(--bg); text-align: center; }
@keyframes qiback { from { background: var(--warning-soft); } }

.apv-page.is-decided #apv, .apv-page.is-decided #a-seg { display: none; }
.dec-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.dec-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; gap: 14px; align-items: center; min-height: 56px; padding: 8px 14px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.dec-row:first-child { border-top: 0; }
.dec-row:hover { background: var(--surface-3); }
.dec-x { display: flex; flex-direction: column; min-width: 0; }
.dec-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dec-t b { font-weight: 600; }
.dec-m { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dec-m q { color: var(--text-2); }
.dec-row .chev { color: var(--text-muted); }
#a-dec .apv-empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.dec-st { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.dec-amt { font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .dec-row { grid-template-columns: minmax(0, 1fr) 16px; row-gap: 6px; } .dec-st { grid-column: 1; justify-content: flex-start; } .dec-row .chev { grid-row: 1 / span 2; grid-column: 2; } .dec-t, .dec-m { white-space: normal; } }
.apv-empty, .apv-none { padding: 32px 20px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.apv-empty b, .apv-none b { color: var(--text); font-size: 15px; }
.apv-p { min-width: 0; }
.dp { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.dp-back { display: none; margin: 12px 16px 0; }
.dp-person { display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dp-pw { flex: 1; min-width: 180px; }
.dp-name { font-size: 16px; font-weight: 700; text-decoration: none; }
.dp-name:hover { text-decoration: underline; }
.dp-raised { white-space: nowrap; }
.dp-body { padding: 16px 18px 6px; }
.dp-title { font-size: 17px; line-height: 24px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.dp-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.dp-amt { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dp-line { margin: 8px 0; }
.dp-ev { margin: 8px 0; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: baseline; }
.dp-freq { font-size: 13px; margin: 6px 0; }
.dp-freq.amber { font-weight: 600; }
.dp-selfie { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.dp-selfie img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); cursor: zoom-in; }
.dp-att-row { margin: 8px 0; }
.dp-att { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); cursor: zoom-in; display: block; }
.dp-disc { margin: 10px -18px 0; }
.dp-disc > summary { padding-left: 18px; }
.dp-disc .disc-b { padding: 0 18px 12px; color: var(--text-2); }
.dp-km { display: flex; gap: 6px 24px; flex-wrap: wrap; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.dp-evid { display: flex; gap: 14px; align-items: flex-start; margin: 12px 0; flex-wrap: wrap; }
.dp-doc { height: 160px; width: auto; max-width: 240px; border-radius: 8px; border: 1px solid var(--border); object-fit: cover; cursor: zoom-in; display: block; background: var(--surface-3); }
.dp-doc.pdf { width: 160px; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; font: inherit; font-size: 13px; color: var(--text-2); }
.dp-doc.pdf svg { width: 32px; height: 32px; }
.dp-doc.none { width: 160px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 13px; cursor: default; }
.dp-evid-t { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.ceil-cap { font-size: 13px; color: var(--text-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.ceil-cap b { color: var(--text); }
.dp-less { margin: 12px 0 4px; max-width: 280px; }
.dbar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 18px 14px; border-radius: 0 0 var(--r-md) var(--r-md); z-index: 3; }
.dbar .remark { width: 100%; resize: none; min-height: 38px; height: 38px; line-height: 20px; padding: 8px 10px; overflow-y: auto; }
.dbar-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dbar-note { font-size: 13px; color: var(--text-2); background: var(--bg); border-radius: var(--r-sm); padding: 7px 10px; margin-bottom: 10px; }
.dbar-block { font-size: 13px; color: #4F3200; background: var(--warning-soft); border: 1px solid #E8CF96; border-radius: var(--r-sm); padding: 7px 10px; margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
.dbar-block svg { width: 15px; height: 15px; flex: none; }
.dbar-err { color: var(--danger); font-size: 13px; margin-top: 8px; }
.dbar-foot { color: var(--text-muted); font-size: 12px; margin-top: 8px; }
@media (max-width: 1099px) {
  .apv { grid-template-columns: minmax(0, 1fr); }
  .apv-q { max-height: none; position: static; }
  .apv-p { display: none; }
  .apv.detail .apv-q { display: none; }
  .apv.detail .apv-p { display: block; }
  .apv.detail ~ * { display: none; }
  .apv-page:has(.apv.detail) .page-h, .apv-page:has(.apv.detail) #a-seg, .apv-page:has(.apv.detail) .apv-filters { display: none; }
  .dp-back { display: inline-block; }
  .dbar { box-shadow: 0 -6px 18px rgba(19, 19, 17, .08); }
}
@media (max-width: 520px) {
  .dp-person, .dp-body { padding-left: 14px; padding-right: 14px; }
  .dbar { padding: 10px 14px 12px; }
  .dbar-btns .btn { flex: 1 1 auto; }
  .dp-disc { margin: 10px -14px 0; }
  .dp-doc { max-width: 100%; }
}

.ppl { max-width: 1240px; }
.pp-filters { gap: 8px; align-items: center; }
.pp-filters .fchips { margin: 0 0 0 4px; }
.pp-tbl td { height: 56px; }
.pp-cell { display: flex; gap: 10px; align-items: center; min-width: 180px; }
.pp-nw { min-width: 0; }
.pp-name { font-weight: 600; text-decoration: none; }
.pp-name:hover { text-decoration: underline; }
.chip.sm { height: 20px; padding: 0 8px; font-size: 11px; }
.tbl td.chev, .tbl th.chev { width: 28px; color: var(--text-muted); text-align: right; }
.own-rec { margin-top: 18px; }
.own-rec a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.own-rec a:hover { color: var(--text); text-decoration: underline; }
.add-top { display: flex; gap: 16px; align-items: flex-end; }
.photo-pick { flex: none; cursor: pointer; }
.photo-pick input { display: none; }
.pp-ph { width: 72px; height: 72px; border-radius: 50%; border: 1.5px dashed var(--border-strong); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); overflow: hidden; background: var(--bg); }
.pp-ph svg { width: 26px; height: 26px; }
.pp-ph small { font-size: 11px; }
.pp-ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick:hover .pp-ph { border-color: var(--text); color: var(--text); }

.prs { max-width: 1240px; }
.ph { display: flex; gap: 16px; align-items: flex-start; margin: 6px 0 16px; flex-wrap: wrap; }
.avatar.xl { width: 48px; height: 48px; font-size: 16px; }
.ph-main { flex: 1; min-width: 220px; }
.ph-sub { color: var(--text-2); margin-top: 2px; }
.ph-contact { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; }
.ph-contact a { color: var(--text-muted); text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.ph-contact a:hover { color: var(--text); text-decoration: underline; }
.ph-contact svg { width: 14px; height: 14px; }
.ph-side { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.ph-st { display: flex; gap: 10px; align-items: center; }
.ph-acts { display: flex; gap: 8px; align-items: center; }
.ph-nav { display: inline-flex; }
.ph-nav .btn { border-radius: 0; }
.ph-nav > :first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.ph-nav > :last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-left: -1.5px; }
.ph-nav span.btn { color: var(--border-strong); cursor: default; }
.ph-nav span.btn:hover { border-color: var(--border-strong); }
.ov2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.card-h.sub-h { border-top: 1px solid var(--border); }
.now li { line-height: 22px; }
.now .now-link { font-weight: 400; text-align: left; text-decoration-color: var(--border-strong); color: var(--text); }
.now .now-link:hover { text-decoration-color: var(--text); }
.ns-h { font-weight: 600; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }

.mstrip { display: grid; grid-template-columns: repeat(var(--n, 31), minmax(0, 1fr)); gap: 4px; }
@media (max-width: 1023px) { .mstrip { gap: 2px; } .mc-w { font-size: 10px; } .mc-d { font-size: 11px; } }
.mstrip.compact { grid-template-columns: repeat(var(--n, 31), minmax(6px, 1fr)); gap: 3px; }
.mc { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; font: inherit; color: var(--text-muted); min-width: 0; }
.mc[data-off] { cursor: default; }
.mc-w { font-size: 11px; line-height: 12px; }
.mc-d { font-size: 12px; line-height: 14px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.mc-b { width: 100%; height: 28px; border-radius: 6px; background: var(--surface-3); border: 1px solid transparent; }
.mstrip.compact .mc-b { height: 22px; border-radius: 4px; }
.mc.c-P .mc-b { background: var(--success); }
.mc.c-INC .mc-b { background: #D99A2B; }
.mc.c-A .mc-b { background: var(--danger); }
.mc.c-L .mc-b { background: var(--info); }
.mc.c-LWP .mc-b { background: var(--purple); }
.mc.c-H .mc-b, .mc.c-WO .mc-b { background: #C9C5BC; }
.mc.c-OD .mc-b { background: var(--surface); border: 2px solid var(--text); }
.mc.c-NM .mc-b { background: var(--surface); border: 1.5px dashed var(--border-strong); }
.mc.c-FUT .mc-b { background: var(--surface); border: 1px solid var(--border); }
.mc.c-NJ .mc-b, .mc.c-EX .mc-b { background: repeating-linear-gradient(45deg, var(--surface-3) 0 3px, var(--surface) 3px 6px); border-color: var(--border); }

.mc.today .mc-d { font-weight: 700; color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mstrip.compact .mc.today .mc-b { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--text-2); }
.mc.sel .mc-b { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.mc.sel .mc-d { color: var(--text); font-weight: 700; }
.mc:not([data-off]):hover .mc-b { filter: brightness(.92); }
.att-h { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.att-mon { display: flex; align-items: center; gap: 8px; }
.att-mon h2 { min-width: 150px; text-align: center; }
#att-strip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 16px; }
.dayview { display: grid; grid-template-columns: minmax(0, 760px); gap: 16px; align-items: start; }
.dayview.with-map { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.dayview.with-map .dv-more { grid-column: 1 / -1; }
.daymore > .disc:first-child { border-top: 0; }
.pts-tbl .pt-k, .pts-tbl .pt-s { display: none; }
@media (max-width: 640px) {
  .pts-tbl .pt-kind, .pts-tbl .pt-l { display: none; }
  .pts-tbl .pt-k { display: block; font-size: 12px; line-height: 16px; }
  .pts-tbl .pt-s { display: inline; }
  .pts-tbl th, .pts-tbl td { padding-left: 8px; padding-right: 8px; }
}
.stop-mk { position: absolute; transform: translate(-50%, calc(-100% - 14px)); white-space: nowrap; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; line-height: 18px; font-variant-numeric: tabular-nums; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.day-map { height: 460px; border-radius: var(--r-md) var(--r-md) 0 0; }
.dm-hide { margin-left: auto; font-size: 13px; }
.daycard .dc-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px 0; }
.daycard .dc-h h2 { font-size: 17px; }
.dc-b { display: flex; gap: 16px; padding: 14px 16px 16px; align-items: flex-start; flex-wrap: wrap; }
.dc-selfie { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); cursor: zoom-in; flex: none; }
.dc-x { flex: 1; min-width: 240px; }
.dc-ctx { color: var(--text-2); margin-bottom: 8px; font-weight: 600; }
.dc-times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.tb-l { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.tb-v { font-size: 28px; line-height: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tb-in { font-size: 18px; height: 40px; width: 100%; max-width: 160px; margin: 2px 0; }
.tb-o { font-size: 12px; color: var(--text-muted); line-height: 16px; }
.tb-o s { color: var(--text-muted); }
.dc-flags { margin: 8px 0; }
.dc-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dc-reason { margin-top: 12px; }
.dc-reason textarea { width: 100%; min-height: 60px; }
.dc-map { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.dc-map .btn svg { width: 16px; height: 16px; }
.ink-note { margin-top: 8px; }
.md-dev { margin-top: 12px; }
.req { display: flex; flex-direction: column; gap: 16px; }
.hist { display: flex; flex-direction: column; gap: 16px; }

.hist-card { max-width: 900px; }
.hist-chips { padding: 12px 16px 0; margin: 0; }
.tl { list-style: none; margin: 0; padding: 6px 16px 10px; }
.tl-i { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); position: relative; }
.tl-i:first-child { border-top: 0; }
.tl-d { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-t { line-height: 22px; }
.tl-t .cur, .tl-t .upc, .tl-t .prev { margin-left: 6px; vertical-align: 1px; }
.tl-r { color: var(--text-2); margin-top: 2px; }
.tl-m { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

.act-seg button { height: 30px; }
.act { list-style: none; margin: 0; padding: 4px 16px 8px; }
.act li { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--border); }
.act li:first-child { border-top: 0; }
.act-w { color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 1px; }
.act-c { font-family: var(--mono); font-size: 12px; color: var(--text-muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 2px 14px; overflow-wrap: anywhere; }
.act-r { color: var(--text-2); margin-top: 2px; }
@media (max-width: 640px) { .tl-i, .act li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.disc-card > summary { list-style: none; cursor: pointer; }
.disc-card > summary::-webkit-details-marker { display: none; }
@media (max-width: 900px) { .pp-chk { display: none; } }
@media (max-width: 1099px) {
  .ov2 { grid-template-columns: minmax(0, 1fr); }
  .ov2 > section:nth-child(2) { order: -1; }
  .dayview.with-map { grid-template-columns: minmax(0, 1fr); }
  .day-map { height: 380px; }
}
@media (max-width: 760px) {
  .ph-side { align-items: flex-start; width: 100%; }
  .mstrip { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .pp-tbl td { height: auto; }
}

.modal-b .row2 > .field + .field, .modal-b .row3 > .field + .field { margin-top: 0; }

.datestep .ds-pick { position: relative; border-radius: 0; margin: 0 -1.5px; padding: 0 12px; gap: 6px; }
.datestep .ds-pick:focus-visible { z-index: 1; }
.ds-pick .ds-ic { display: inline-flex; }
.ds-pick .ds-in { position: absolute; left: 50%; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }

.nrow > .n-help { grid-column: 1 / -1; color: var(--text-muted); font-size: 12px; line-height: 17px; margin: 0 0 4px; white-space: normal; }

.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
@media (max-width: 520px) { .tab { padding: 10px 10px 9px; } }

@media (max-width: 1099px) {
  body:has(.apv.detail) #toasts-l, body:has(.apv.detail) #toasts { bottom: auto; top: calc(var(--topbar) + 8px); }
}

.m-l, .m-code { display: none; }
.pp-msort { display: none; }

@media (max-width: 1023px) {
  .pp-tbl .tbl td, .pp-tbl .tbl th { padding-left: 8px; padding-right: 8px; }
  .pp-tbl .tbl .chev, .pp-tbl .tbl .c-code { display: none; }
  .pp-tbl .m-code { display: inline; }
  .pp-cell { min-width: 0; }
  .pp-cell > .avatar { display: none; }
  .pp-nw .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
  .pp-tbl td.c-sync .pp-nsu { white-space: normal; }
}
@media (max-width: 640px) {
  .pp-msort { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 8px; font-size: 13px; color: var(--text-muted); }
  .pp-msort .input { width: auto; height: 34px; min-height: 34px; }
  .pp-tbl thead { display: none; }
  .pp-tbl table.tbl, .pp-tbl tbody { display: block; width: 100%; }
  .pp-tbl tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 14px; position: relative; padding: 10px 12px 10px 54px; border-bottom: 1px solid var(--border); }
  .pp-tbl tbody tr:last-child { border-bottom: 0; }
  .pp-tbl tbody tr::before { content: ''; order: 2; flex-basis: 100%; height: 0; }
  .pp-tbl .tbl td { display: block; height: auto; padding: 0; border: 0; background: none; }
  .pp-tbl td.c-name { order: 0; flex: 1 1 0; min-width: 0; }
  .pp-tbl td.c-today { order: 1; flex: none; }
  .pp-tbl td.c-code, .pp-tbl td:empty { display: none; }
  .pp-tbl td.c-dist, .pp-tbl td.c-coord, .pp-tbl td.c-leave, .pp-tbl td.c-open, .pp-tbl td.c-sync, .pp-tbl td.c-notice { order: 3; font-size: 13px; color: var(--text-2); text-align: left; }
  .pp-tbl .pp-cell > .avatar { display: inline-flex; position: absolute; left: 12px; top: 10px; }
  .pp-nw .sub { max-width: none; white-space: normal; }
  .pp-tbl .m-l { display: inline; color: var(--text-muted); }
  .pp-tbl .c-open .m-l { color: inherit; }
  .pp-tbl tbody tr.click:hover { background: var(--surface-3); }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .pp-tbl td.c-sync { white-space: normal; }
  .pp-tbl td.c-sync .pp-nsu { white-space: normal; }
}
@media (min-width: 1100px) and (max-width: 1279px) { .pp-tbl .pp-nw .sub { white-space: nowrap; } }

.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

.stk-host { container-type: inline-size; }
.req .stk-host { --stk-pad: 16px; --stk-first: 12px; --stk-last: 12px; }
@container (max-width: 760px) {
  .stk:not(.sm) thead { display: none; }
  .stk:not(.sm) table.tbl, .stk:not(.sm) tbody { display: block; width: 100%; }
  .stk:not(.sm) tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px var(--stk-pad, 0px); border-bottom: 1px solid var(--border); }
  .stk:not(.sm) tbody tr:first-child { padding-top: var(--stk-first, 2px); }
  .stk:not(.sm) tbody tr:last-child { border-bottom: 0; padding-bottom: var(--stk-last, 0px); }
  .stk:not(.sm) .tbl td { display: block; padding: 0; border: 0; height: auto; color: var(--text-2); font-size: 13px; text-align: left; }
  .stk:not(.sm) .tbl td:empty { display: none; }
  .stk:not(.sm) .tbl td.stk-k { font-weight: 600; color: var(--text); font-size: 14px; }
  .stk:not(.sm) .tbl td.wrap { flex-basis: 100%; min-width: 0; max-width: none; color: var(--text); font-size: 14px; order: 2; }
  .stk:not(.sm) .tbl td.stk-st { margin-left: auto; }
  .stk:not(.sm) .m-l { display: inline; color: var(--text-muted); }
  .stk:not(.sm) .stk-hide { display: none; }
}
@container (max-width: 640px) {
  .stk.sm thead { display: none; }
  .stk.sm table.tbl, .stk.sm tbody { display: block; width: 100%; }
  .stk.sm tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px var(--stk-pad, 0px); border-bottom: 1px solid var(--border); }
  .stk.sm tbody tr:first-child { padding-top: var(--stk-first, 2px); }
  .stk.sm tbody tr:last-child { border-bottom: 0; padding-bottom: var(--stk-last, 0px); }
  .stk.sm .tbl td { display: block; padding: 0; border: 0; height: auto; color: var(--text-2); font-size: 13px; text-align: left; }
  .stk.sm .tbl td:empty { display: none; }
  .stk.sm .tbl td.stk-k { font-weight: 600; color: var(--text); font-size: 14px; }
  .stk.sm .tbl td.wrap { flex-basis: 100%; min-width: 0; max-width: none; color: var(--text); font-size: 14px; order: 2; }
  .stk.sm .tbl td.stk-st { margin-left: auto; }
  .stk.sm .m-l { display: inline; color: var(--text-muted); }
  .stk.sm .stk-hide { display: none; }
}

@media (max-width: 760px) {
  .mstrip:not(.compact) { row-gap: 10px; }
  .mstrip:not(.compact) .mc:nth-child(n+8) .mc-w { display: none; }
}

.lm-icon .pin { transform: translate(-50%, calc(-50% + var(--dy, 0px))); transition: transform 180ms var(--ease); }
@media (prefers-reduced-motion: reduce) { .lm-icon .pin { transition: none; } }

@media (max-width: 640px) {
  .nrow { padding: 6px 8px 6px 12px; }
  .nrow .n-x { flex-direction: column; align-items: flex-start; gap: 0; white-space: normal; }
  .nrow .n-d { max-width: 100%; white-space: normal; overflow: hidden; text-overflow: clip; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-height: 18px; }
  .nrow .n-d::before { display: none; }
}

@media (max-width: 1023px) {
  body:has(.apv.detail) #toasts-l, body:has(.apv.detail) #toasts { top: calc(var(--topbar) + var(--tabrow) + 8px); }
}

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; min-height: 78px; padding: 12px 14px 11px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); text-align: left; font: inherit; color: var(--text); text-decoration: none; position: relative; min-width: 0; }
button.tile, a.tile { cursor: pointer; transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease); }
button.tile:hover, a.tile:hover { border-color: var(--text); }
.tile.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.t-k { font-size: 13px; line-height: 18px; color: var(--text-2); font-weight: 600; padding-right: 14px; }
.t-v { font-size: 28px; line-height: 34px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-v.t-ok { color: var(--success); } .t-v.t-bad { color: var(--danger); } .t-v.t-warn { color: var(--warning); }
.t-s { font-size: 13px; color: var(--text-muted); line-height: 18px; }
.t-go { position: absolute; right: 12px; top: 10px; color: var(--text-muted); font-size: 16px; line-height: 18px; }
a.tile:hover .t-go { color: var(--text); }
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { min-height: 72px; padding: 10px 12px; }
  .t-v { font-size: 24px; line-height: 30px; }
}

.today { max-width: 1180px; }
.t-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 270px); gap: 12px 18px; align-items: center; margin-bottom: 14px; }
.t-top:has(> .t-links:empty) { grid-template-columns: minmax(0, 1fr); }
.t-links { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.t-links:empty { display: none; }
.t-link { background: none; border: 0; padding: 6px 0; min-height: 32px; text-align: left; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; line-height: 20px; }
.t-link:hover, .t-link.on { text-decoration-color: var(--text); }
.t-link span { color: var(--text-muted); }
@media (max-width: 1199px) {
  .t-top { grid-template-columns: minmax(0, 1fr); }
  .t-links { flex-direction: row; flex-wrap: wrap; gap: 0 20px; }
}
.t-plist { list-style: none; margin: 0 0 14px; padding: 2px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.t-plist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.t-plist li:first-child { border-top: 0; }
@media (max-width: 640px) { .t-plist li { flex-wrap: wrap; } .t-link { min-height: 48px; } }
.t-filt { font-size: 13px; color: var(--text-muted); margin: 8px 2px 0; }
.t-note { font-size: 13px; line-height: 19px; color: var(--text-2); margin: 12px 2px 0; max-width: 820px; }
.today .roster-foot { margin-top: 10px; }

.tt-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; container: tt / inline-size; transition: opacity 120ms var(--ease); }
.tt th { position: static; font-size: 13px; padding: 9px 12px; }
.tt td { height: 58px; padding: 7px 12px; }
.tt tbody tr { cursor: pointer; }
.tt tbody tr:hover td { background: var(--surface-3); }
.tt tbody tr.enter { animation: fadein 150ms var(--ease); }
.tt-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tt-pic { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); flex: none; cursor: zoom-in; display: inline-flex; }
span.tt-pic { cursor: inherit; }
.tt-nm { min-width: 0; display: flex; flex-direction: column; line-height: 18px; }
.tt-name { font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-name:hover { text-decoration: underline; }
.tt-nm small { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt .c-who { max-width: 260px; }
.tt-st { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tt-d { display: block; font-size: 13px; line-height: 17px; color: var(--text-muted); margin-top: 3px; }
.tt-d.amber { color: var(--warning); }
.tt .c-mode { white-space: nowrap; }
.tt .tt-note { display: block; font-size: 13px; line-height: 17px; color: var(--text-muted); max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tt .c-act { width: 46px; padding-left: 0; padding-right: 8px; text-align: right; }
.tt .c-act .btn { opacity: 0; transition: opacity 120ms var(--ease); width: 34px; height: 34px; }
.tt tbody tr:hover .c-act .btn, .tt tbody tr:focus-within .c-act .btn { opacity: 1; }
@media (hover: none) { .tt .c-act .btn { opacity: 1; } }
.tt .m-l { display: none; }
.tt td.c-meta { display: none; }

.tpill.tp-in { color: var(--info); background: var(--info-soft); padding-left: 8px; }
.tpill.tp-in::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--info); flex: none; }
.tpill.tp-ok { color: var(--success); background: var(--success-soft); }
.tpill.tp-bad { color: var(--danger); background: var(--danger-soft); }
.tpill.tp-warn { color: var(--warning); background: var(--warning-soft); }
.tpill.tp-leave { color: var(--purple); background: var(--purple-soft); }
.tpill.tp-lwp { color: var(--purple); background: var(--purple-soft); }
.tpill.tp-off { color: var(--neutral); background: var(--neutral-soft); }

@container tt (max-width: 860px) {
  .tt th, .tt td { padding-left: 8px; padding-right: 8px; }
  .tt .tt-pic { display: none; }
  .tt .c-who { max-width: 180px; }
  .tt .tt-note { max-width: 120px; }
  .tt .c-mode { white-space: normal; }
}

@container tt (max-width: 600px) {
  .tt thead { display: none; }
  table.tt, .tt tbody { display: block; width: 100%; }
  .tt tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; padding: 10px 12px; border-bottom: 1px solid var(--border); min-height: 56px; }
  .tt tbody tr:last-child { border-bottom: 0; }
  .tt td { display: block; height: auto; padding: 0; border: 0; background: none !important; }
  .tt td.c-who { flex: 1 1 0; min-width: 0; max-width: none; order: 0; }
  .tt .tt-pic { display: inline-flex; width: 28px; height: 28px; }
  .tt td.c-st { display: contents; }
  .tt .tt-st { order: 1; margin-left: 8px; justify-content: flex-end; }
  .tt td.c-act { order: 2; width: auto; padding: 0 0 0 4px; }
  .tt td.c-act:empty { display: none; }
  .tt tbody tr::after { content: ''; order: 3; flex-basis: 100%; height: 0; }
  .tt td.c-dist, .tt td.c-in, .tt td.c-mode, .tt td.c-pts, .tt td.c-km { display: none; }
  .tt td.c-meta { display: block; order: 4; flex-basis: 100%; padding-left: 38px; font-size: 13px; line-height: 18px; color: var(--text-2); }
  .tt .tt-note { display: none; }
  .tt .m-l { display: inline; color: var(--text-muted); }
  .tt .tt-d { order: 5; flex-basis: 100%; padding-left: 38px; margin-top: 0; }
  .tt .c-act .btn { opacity: 1; width: 40px; height: 40px; }
}

.dvw { max-width: 1240px; }
.dvw .page-h { margin-bottom: 14px; }
.dvw-map { margin-bottom: 14px; }
.dvw-map .day-map { height: 440px; }
.dvw-map .legend { font-size: 13px; gap: 6px 16px; }
.dvw-map .legend i { width: 12px; height: 12px; border-radius: 50%; }
.legend i.lg-in { background: var(--success); } .legend i.lg-out { background: var(--danger); }
.legend i.lg-stop { background: var(--text); }
.legend i.lg-gap { background: var(--warning); border-radius: 2px; transform: rotate(45deg); width: 10px; height: 10px; }
#dm-hidden:empty { display: none; }
.dvw-tiles { margin-bottom: 14px; }
.dvw-sg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-bottom: 4px; }
.sg-col { padding: 12px 16px 14px; min-width: 0; scroll-margin-top: 12px; }
.sg-col + .sg-col { border-left: 1px solid var(--border); }
.sg-col h3 { margin-bottom: 8px; }
.sg-list { list-style: none; margin: 0; padding: 0; }
.sg-list li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; line-height: 20px; }
.sg-list li:first-child { border-top: 0; padding-top: 0; }
.sg-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; position: relative; top: 1px; font-variant-numeric: tabular-nums; }
.sg-g { flex: none; width: 10px; height: 10px; background: var(--warning); transform: rotate(45deg); margin: 0 6px 0 5px; position: relative; top: -1px; }
.sg-gap { color: #6B4000; }
.sg-none { color: var(--text-2); font-size: 14px; }
.flash { animation: flash 900ms var(--ease); }
@keyframes flash { 0%, 40% { background: var(--warning-soft); } 100% { background: transparent; } }
.dvw-day { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.dvw .daycard .dc-h h2 { font-size: 15px; }
.dvw-day .dv-more:empty { display: none; }

.stop-n { position: absolute; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.leaflet-tooltip.stop-lab { background: rgba(255, 255, 255, 0.96); border: 1px solid var(--border-strong); border-radius: 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); color: var(--text-2); font-size: 13px; line-height: 17px; padding: 2px 7px; white-space: nowrap; }
.leaflet-tooltip.stop-lab b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.leaflet-tooltip.stop-lab::before { display: none; }
.stop-n.nudge { transform: translate(-50%, calc(-50% - 26px)); }
.gap-mk.side { transform: translate(calc(-50% - 22px), calc(-50% - 24px)) rotate(45deg); }
.stop-n.multi { width: auto; padding: 0 7px; border-radius: 999px; white-space: nowrap; }
.ev-mk.beside { transform: translate(calc(-50% - 26px), -50%); }
.dvw-none { padding: 16px; color: var(--text-2); }
.dc-loc { font-size: 13px; color: var(--text-2); margin-top: 10px; }
.dc-gaps { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13px; color: #6B4000; }
.dc-gaps li::before { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--warning); transform: rotate(45deg); margin: 0 8px 1px 2px; }
.dvw-none b { color: var(--text); }
.gap-mk { position: absolute; width: 14px; height: 14px; background: var(--warning); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); transform: translate(-50%, -50%) rotate(45deg); }
.pts-tbl tr.gap-after td { border-bottom: 2px solid var(--warning); }
@media (max-width: 760px) {
  .dvw-sg { grid-template-columns: minmax(0, 1fr); }
  .sg-col + .sg-col { border-left: 0; border-top: 1px solid var(--border); }
  .dvw-map .day-map { height: 360px; }
  .dvw .page-h .actions { width: 100%; }
}
@media (max-width: 520px) { .dvw-map .day-map { height: 320px; } }

.tt .chip, .tt .flag, .tt-nm small, .dvw .chip, .dvw .flag, .daycard .chip, .daycard .flag { font-size: 13px; }
.tt .chip, .dvw .chip, .daycard .chip { height: 24px; }
.daycard .tb-l, .daycard .tb-o { font-size: 13px; line-height: 18px; }
.sg-n { font-size: 13px; width: 24px; height: 24px; }

.mc.c-NS .mc-b { background: repeating-linear-gradient(45deg, #F2C66E 0 3px, var(--warning-soft) 3px 7px); border: 1.5px solid var(--warning); }

.ds-pick .ds-d { white-space: nowrap; font-variant-numeric: tabular-nums; }

.ev-mk { width: auto; min-width: 30px; height: 28px; padding: 0 6px; border-radius: 14px; font-size: 13px; line-height: 1; letter-spacing: .02em; }
.ev-mk.beside { transform: translate(calc(-100% - 17px), -50%); }
.ev-mk.ev-mode { min-width: 28px; padding: 0; }
.stop-n.nudge { transform: translate(-50%, calc(-50% - 29px)); }

.last-mk { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--info); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); transform: translate(-50%, -50%); }
.last-mk.beside { transform: translate(calc(-50% + 26px), -50%); }

.dvw-map .dm-legend i { display: inline-flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box; }
.dvw-map .dm-legend i.lg-in, .dvw-map .dm-legend i.lg-out { width: auto; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 11px; color: #fff; font-size: 13px; font-weight: 700; font-style: normal; }
.dvw-map .dm-legend i.lg-stop { width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: #fff; font-size: 13px; font-weight: 700; font-style: normal; }
.dvw-map .dm-legend i.lg-pt { width: 7px; height: 7px; border-radius: 50%; background: var(--info); opacity: .55; margin: 0 4px; }
.dvw-map .dm-legend i.lg-last { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--info); }
.dvw-map .dm-legend i.lg-gap { width: 11px; height: 11px; border-radius: 1px; margin: 0 3px; }
.dvw-map .dm-legend span[hidden] { display: none; }

.prs .tbl th { font-size: 13px; }

.sg-open { font-weight: 600; }
.tile .t-s .amber { color: var(--warning); font-weight: 600; }

.st-NS { color: var(--warning); background: var(--warning-soft); }

.stop-n { font-size: 13px; }
.pts-tbl .pt-k { font-size: 13px; }
.ph-st .chip { font-size: 13px; height: 24px; }
.mc-w, .mc-d { font-size: 13px; line-height: 15px; }
@media (max-width: 1023px) { .mc-w, .mc-d { font-size: 13px; } }

.pin { font-size: 13px; height: 24px; }
.pin.p-OD.stale { background: #fff; color: var(--warning); border: 2px dashed var(--warning); }
.pin.p-OD.stale::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--warning); }
.legend.t-mlg i.pin.lg { position: static; transform: none; display: inline-flex; width: 30px; height: 18px; padding: 0 0 0 7px; border-radius: 999px; box-shadow: 0 0 0 1px var(--border-strong); cursor: default; flex: none; }
.legend.t-mlg i.pin.p-OD.stale.lg { box-shadow: none; }
.legend.t-mlg { font-size: 13px; color: var(--text-2); gap: 6px 18px; width: 100%; }
.person .p-t small { font-size: 13px; }
#tml .person { flex-wrap: wrap; row-gap: 2px; }
#tml .person .p-d { flex-basis: 100%; font-size: 13px; line-height: 18px; color: var(--text-muted); }
#tml .person .p-d.amber { color: var(--warning); font-weight: 600; }
#tmc { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.pop-stale { font-weight: 600; }
#tmc .amber { font-weight: 600; }

.t-rest { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.t-rest .t-link { font-size: 13px; padding: 4px 0; min-height: 28px; }
.t-rest .t-link:disabled { cursor: default; text-decoration: none; }
.t-rest-why { color: var(--text-muted); }

.ev-mk.beside.beside-r { transform: translate(17px, -50%); }

.sg-gap.sg-open { font-weight: 600; }

.qi-age, .qi-with, .qi-chips .chip, .apv-page .chip { font-size: 13px; }
.tt .avatar { font-size: 13px; }

@media (max-width: 640px) {
  :is(.today, .prs, .ppl, .apv-page) .btn, :is(.today, .prs, .ppl, .apv-page) .btn.sm, :is(.today, .prs, .ppl, .apv-page) .seg button { min-height: 48px; }
  :is(.today, .prs, .ppl, .apv-page) .btn.icon { min-width: 48px; }
  .datestep .btn { height: 48px; min-height: 48px; }
  .datestep .btn.icon { width: 48px; }
  :is(.today, .prs, .ppl, .apv-page) .seg button { height: 48px; }
  .apv-page .fbtn { height: auto; min-height: 48px; padding: 0 14px; }
  .apv-page .fchips { gap: 8px; }
  .today .roster-foot .quiet-link, .prs .quiet-link, .today .t-filt .quiet-link { display: inline-flex; align-items: center; min-height: 48px; }
  .crumb a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 2px; }
  .crumb { margin-bottom: 0; }
  .leaflet-container .leaflet-bar a.leaflet-control-zoom-in, .leaflet-container .leaflet-bar a.leaflet-control-zoom-out { width: 48px; height: 48px; line-height: 46px; font-size: 24px; }
  .t-rest .t-link { min-height: 48px; }
  :is(.today, .prs, .ppl, .apv-page) .seg button { min-width: 48px; }
  .crumb a { padding: 0 10px; margin: 0 -10px; }
  .prs dd a[href^="tel:"] { display: inline-flex; align-items: center; min-height: 48px; }
  .you-line { min-height: 48px; }
  .prs .disc > summary { min-height: 48px; }
  :is(.today, .prs, .ppl, .apv-page) :is(input.input, select.input) { min-height: 48px; }
  :is(.today, .prs, .ppl, .apv-page) .quiet-link { display: inline-flex; align-items: center; min-height: 48px; }
  .prs .tabs .tab { min-height: 48px; }
  .ph-contact { row-gap: 0; }
  .ph-contact a { min-height: 48px; }
  #att-strip { padding: 10px 4px; }
  #att-strip .mstrip:not(.compact) { column-gap: 2px; }
  #att-strip .mstrip:not(.compact) .mc { min-height: 48px; }
}

.map-list .chip { font-size: 13px; height: 24px; }

@container tt (max-width: 600px) {
  .tt .c-act .btn { width: 48px; height: 48px; min-height: 48px; }
  .tt tbody tr { position: relative; }
  .tt .tt-name::after { content: ''; position: absolute; inset: 0; }
  .tt img.tt-pic, .tt .c-act .btn { position: relative; z-index: 1; }
}

.ev-mk.ev-mode { background: var(--purple); min-width: 0; padding: 0 7px; }
.ev-mk.ev-mode.below { transform: translate(-50%, calc(-50% + var(--mb, 1) * 31px)); }
.stop-lab .lab-mode, .dvw-map .dm-legend i.lg-mode { display: inline-flex; align-items: center; justify-content: center; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--purple); color: #fff; font-size: 13px; font-weight: 700; font-style: normal; letter-spacing: .02em; vertical-align: 1px; }
.dvw-map .dm-legend i.lg-mode { width: auto; height: 22px; border-radius: 11px; }
.stop-lab .lab-mode { height: 18px; padding: 0 5px; }
.last-mk.beside { transform: translate(calc(-50% + var(--bx, 26px)), -50%); }
