:root {
  --brand: #14283f;
  --brand-dark: #0e1f31;
  --brand-light: #2f6f9e;
  --accent: #a48b60;
  --ink: #252a30;
  --ink-soft: #46515b;
  --muted: #5d6670;
  --line: #d8d5cd;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --success: #176b4d;
  --success-bg: #e9f5ee;
  --danger: #b42318;
  --danger-bg: #fdf0ee;
  --warning: #80591f;
  --warning-bg: #faf1df;
  --info: #2f6f9e;
  --focus: #2f6f9e;
  --primary: var(--brand);
  --primary-lighter: #e8edf0;
  --border: var(--line);
  --bg-alt: var(--surface-2);
  --danger-light: var(--danger-bg);
  --text-muted: var(--muted);
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(20, 40, 63, .06);
  --shadow: 0 12px 32px rgba(20, 40, 63, .12);
  --shadow-lg: 0 20px 48px rgba(20, 40, 63, .14);
  --font: "Source Sans 3", Arial, sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
  --maxw: 1200px;
}

* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

html { scroll-behavior: smooth; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 3px; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 1100; padding: .65rem 1rem; border-radius: 8px; background: var(--brand); color: #fff; }
.skip-link:focus { top: 1rem; color: #fff; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 { line-height: 1.2; color: var(--brand); margin: 0 0 .6em; }
h1, h2 { font-family: var(--font-display); font-weight: 600; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.01em; }
p { color: var(--ink-soft); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 720px; }

/* ---------- Top navigation ---------- */
.marketing-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 240, .95);
  backdrop-filter: blur(12px);
}
.marketing-header-inner { display: flex; height: 64px; align-items: center; justify-content: space-between; gap: 1rem; }
.marketing-logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.marketing-logo img, .marketing-dialog-top img { display: block; width: 136px; height: auto; }
.marketing-nav { display: none; align-items: center; gap: 1.25rem; }
.marketing-nav > a, .marketing-industries summary {
  color: var(--ink); font-size: 1rem; font-weight: 600; line-height: 1.5;
}
.marketing-nav > a:hover, .marketing-industries summary:hover { color: var(--brand); }
.marketing-nav > a[aria-current="page"] { color: var(--brand); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.marketing-industries { position: relative; }
.marketing-industries summary { cursor: pointer; list-style: none; }
.marketing-industries summary::-webkit-details-marker { display: none; }
.marketing-industry-links {
  position: absolute; left: 50%; top: calc(100% + 1rem); width: 560px;
  display: grid; grid-template-columns: 1fr 1fr; gap: .25rem;
  transform: translateX(-50%); padding: 1rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); box-shadow: var(--shadow);
}
.marketing-industry-links a { padding: .5rem; border-radius: 4px; color: var(--ink); }
.marketing-industry-links a:hover { background: var(--bg); }
.marketing-nav .marketing-demo, .marketing-mobile-links .marketing-demo {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: .5rem 1rem; border-radius: 8px; background: var(--brand); color: var(--bg);
}
.marketing-nav .marketing-demo:hover, .marketing-mobile-links .marketing-demo:hover { background: var(--brand-dark); color: var(--bg); }
.marketing-menu-button { min-width: 44px; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--brand); border-radius: 8px; background: transparent; color: var(--brand); cursor: pointer; font-weight: 600; }
.marketing-dialog { box-sizing: border-box; margin: 0 0 0 auto; width: min(100%, 384px); height: 100dvh; max-height: 100dvh; padding: 1.5rem; border: 0; background: var(--bg); box-shadow: var(--shadow-lg); }
.marketing-dialog::backdrop { background: rgba(20, 40, 63, .3); }
.marketing-dialog nav { display: flex; height: 100%; flex-direction: column; }
.marketing-dialog-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2.5rem; }
.marketing-mobile-links { display: flex; flex-direction: column; gap: .25rem; overflow-y: auto; }
.marketing-mobile-links > a { padding: .75rem .5rem; color: var(--brand); font-size: 1.1rem; font-weight: 600; }
.marketing-mobile-links .marketing-demo { margin-top: 1.5rem; }
@media (min-width: 1280px) {
  .marketing-header-inner { height: 80px; }
  .marketing-logo img { width: 154px; }
  .marketing-nav { display: flex; }
  .marketing-menu-button { display: none; }
}
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: 1.15rem; color: var(--brand); letter-spacing: -.02em;
}
.brand img { display: block; object-fit: contain; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  display: grid; place-items: center; color: #fff; font-size: 1rem;
  box-shadow: var(--shadow-sm);
}
.portal-brand-lockup { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.portal-header .nav { max-width: none; padding: 0; }
.portal-header .portal-brand-lockup {
  width: 240px;
  height: 60px;
  flex: 0 0 240px;
  padding: 0 1.1rem;
  border-right: 1px solid var(--line);
}
.portal-header .brand { width: 100%; gap: .75rem; letter-spacing: 0; }
.portal-header .brand img { width: 36px !important; height: 36px !important; flex: 0 0 36px; }
.portal-brand-copy { display: grid; min-width: 0; line-height: 1.15; }
.portal-brand-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-brand-copy small {
  display: flex;
  align-items: center;
  gap: .38rem;
  margin-top: .22rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.portal-brand-copy small span {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success-bg);
}
.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a {
  padding: .5rem .85rem; border-radius: 8px; color: var(--ink-soft);
  font-weight: 500; font-size: .95rem; transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.active { color: var(--brand); background: var(--surface-2); box-shadow: inset 0 -2px var(--accent); }
.nav-links .nav-link-disabled {
  padding: .5rem .85rem;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  cursor: not-allowed;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}
.nav-links .btn-primary { color: #fff; }

.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; color: var(--ink); cursor: pointer; }

@media (max-width: 1023px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: .75rem 20px 1rem; box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .portal-header .nav-toggle,
  .portal-header .nav-links { display: none; }
  .portal-header .portal-brand-lockup { width: auto; height: 60px; flex: 0 1 auto; border-right: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer; transition: background-color .18s ease, border-color .18s ease;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #866b42; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #11523b; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f2019; color: #fff; }
.btn-warning { background: #facc15; color: #422006; border-color: #eab308; }
.btn-warning:hover { background: #eab308; color: #422006; }
.btn-sm { padding: .4rem .7rem; font-size: .82rem; border-radius: 6px; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 1.6rem;
}
.card-pad-lg { padding: 2.2rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: var(--ink); }
.field-label { display: block; margin: 0 0 .4rem; color: var(--ink); font-size: .9rem; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: .55rem .75rem; border: 1px solid #aeb5b9;
  border-radius: 8px; font: inherit; font-size: .92rem; color: var(--ink); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47, 111, 158, .16);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.textarea { resize: vertical; min-height: 120px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: .35rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data th, table.data td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; }
table.data th { background: var(--surface-2); font-weight: 700; color: var(--brand); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.is-current { background: var(--success-bg); }
table.data tbody tr:hover { background: #faf9f5; }
table.data caption { padding: .75rem 1rem; text-align: left; font-weight: 600; }

/* ---------- Roster import preview ---------- */
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-heading h1 { margin: .25rem 0 .35rem; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1rem 1.1rem; }
.stat-card span { display: block; color: var(--muted); font-size: .84rem; margin-bottom: .35rem; }
.stat-card strong { display: block; color: var(--ink); font-size: 1.55rem; line-height: 1; }
.pill-row { display: flex; flex-wrap: wrap; gap: .55rem; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); padding: .35rem .7rem; font-size: .84rem; color: var(--ink-soft); }
.actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.help-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; margin-left: .35rem; color: var(--brand); cursor: help; vertical-align: middle; }
.help-tip i { font-size: .95rem; }
.help-tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + .65rem); transform: translateX(-50%); width: min(360px, 78vw); padding: .85rem 1rem; border-radius: 10px; background: #0f172a; color: #fff; box-shadow: 0 18px 42px rgba(15, 23, 42, .22); font-size: .86rem; line-height: 1.45; font-weight: 500; text-transform: none; letter-spacing: 0; opacity: 0; visibility: hidden; pointer-events: none; z-index: 40; }
.help-tip::before { content: ''; position: absolute; left: 50%; bottom: calc(100% + .28rem); transform: translateX(-50%); border: .42rem solid transparent; border-top-color: #0f172a; opacity: 0; visibility: hidden; pointer-events: none; z-index: 41; }
.help-tip:hover::after, .help-tip:focus::after, .help-tip:hover::before, .help-tip:focus::before { opacity: 1; visibility: visible; }
.roster-positioning { display: grid; grid-template-columns: minmax(280px, .95fr) 1.45fr; gap: 1.25rem; align-items: stretch; }
.dashboard-command-panel { border-left: 4px solid var(--brand); }
.roster-positioning-copy h2 { margin: .2rem 0 .55rem; font-size: clamp(1.35rem, 2vw, 2rem); line-height: 1.15; max-width: 780px; }
.roster-positioning-copy p:last-child { margin-bottom: 0; max-width: 760px; }
.roster-value-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.roster-value-item { display: grid; grid-template-columns: 2rem 1fr; column-gap: .75rem; row-gap: .2rem; align-content: start; padding: .85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.roster-value-item i { grid-row: span 2; color: var(--brand); font-size: 1.15rem; margin-top: .15rem; }
.roster-value-item strong { color: var(--ink); font-size: .95rem; }
.roster-value-item span { color: var(--muted); font-size: .84rem; line-height: 1.4; }
.admin-status-card h3 { margin: .2rem 0 .35rem; font-size: 1.12rem; }
.admin-status-card p { margin: 0; }
.project-card-status { display: flex; flex-direction: column; gap: .35rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .86rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h2 { margin: .1rem 0 0; font-size: 1.15rem; }
.panel-heading > i { color: var(--brand); font-size: 1.35rem; }

/* ---------- Roster management workspace ---------- */
.roster-control-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  margin-bottom: 1rem; padding: 1.25rem 1.35rem; border: 1px solid var(--line);
  border-left: 4px solid var(--warning); border-radius: 8px; background: #fff;
}
.roster-control-panel.is-live { border-left-color: var(--success); }
.roster-control-status { display: flex; align-items: flex-start; gap: 1rem; min-width: 0; }
.roster-status-icon {
  display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px;
  border-radius: 8px; background: var(--warning-bg); color: var(--warning); font-size: 1.1rem;
}
.roster-control-panel.is-live .roster-status-icon { background: var(--success-bg); color: var(--success); }
.roster-control-status h2 { margin: .1rem 0 .25rem; font-size: 1.2rem; }
.roster-control-status p:last-child { margin: 0; color: var(--muted); font-size: .88rem; }
.roster-control-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: .5rem; }
.roster-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.25rem; }
.roster-metric { min-width: 0; min-height: 112px; padding: 1rem 1.05rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.roster-metric > span { display: block; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.roster-metric > strong { display: block; margin: .2rem 0; overflow: hidden; color: var(--ink); font-size: 1.5rem; line-height: 1.2; text-overflow: ellipsis; }
.roster-metric > small { display: block; color: var(--muted); font-size: .78rem; }
.roster-metric .roster-metric-status { font-size: 1.15rem; }
.roster-metric-status.is-active { color: var(--success); }
.roster-metric-status.is-paused { color: var(--warning); }
.roster-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 340px); align-items: start; gap: 1.25rem; }
.roster-workspace-main, .roster-workspace-side { display: grid; gap: 1.25rem; min-width: 0; }
.roster-history-panel { min-width: 0; }
.roster-history-panel .table-wrap { border-radius: 8px; }
.roster-history-table td:first-child { max-width: 220px; overflow-wrap: anywhere; }
.roster-empty-state { display: grid; place-items: center; min-height: 150px; color: var(--muted); text-align: center; }
.roster-empty-state i { font-size: 1.6rem; }
.roster-empty-state p { margin: .5rem 0 0; }
.roster-link-panel p { margin: 0 0 1rem; font-size: .86rem; }
.share-link-label { display: block; margin-bottom: .35rem; color: var(--ink); font-size: .8rem; font-weight: 700; }
.roster-link-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .45rem; margin-top: .6rem; }
.roster-link-actions .btn { min-width: 42px; padding-right: .75rem; padding-left: .75rem; }
.roster-link-toggle { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.roster-project-details { padding: 1.1rem; }
.roster-project-details summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; cursor: pointer; color: var(--ink); font-weight: 700; list-style: none; }
.roster-project-details summary::-webkit-details-marker { display: none; }
.roster-project-details summary span { display: inline-flex; align-items: center; gap: .55rem; }
.roster-project-details[open] summary { margin-bottom: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.roster-project-details[open] summary > i { transform: rotate(180deg); }
.roster-project-details .textarea { min-height: 84px; }

/* ---------- Dashboard reporting ---------- */
.dashboard-health-band {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  margin-bottom: 1rem; padding: 1.2rem 1.3rem; border: 1px solid #bbf7d0;
  border-left: 4px solid var(--success); border-radius: 8px; background: #f7fef9;
}
.dashboard-health-band.has-warning { border-color: #fde68a; border-left-color: var(--warning); background: #fffcf4; }
.dashboard-health-copy { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.dashboard-health-icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 8px; background: var(--success-bg); color: var(--success); }
.dashboard-health-band.has-warning .dashboard-health-icon { background: var(--warning-bg); color: var(--warning); }
.dashboard-health-copy h2 { margin: .1rem 0 .2rem; font-size: 1.16rem; }
.dashboard-health-copy p:last-child { margin: 0; color: var(--muted); font-size: .86rem; }
.dashboard-plan-summary { flex: 0 0 auto; padding-left: 1.25rem; border-left: 1px solid var(--line); text-align: right; }
.dashboard-plan-summary span, .dashboard-plan-summary strong { display: block; }
.dashboard-plan-summary span { color: var(--muted); font-size: .78rem; }
.dashboard-plan-summary strong { font-size: .88rem; }
.dashboard-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.25rem; }
.dashboard-metric { min-width: 0; min-height: 118px; padding: 1rem 1.05rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.dashboard-metric > span { display: block; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.dashboard-metric > strong { display: block; margin: .25rem 0; color: var(--ink); font-size: 1.65rem; line-height: 1.15; }
.dashboard-metric > strong.dashboard-metric-date { padding-top: .2rem; font-size: 1.15rem; }
.dashboard-metric > small { display: block; color: var(--muted); font-size: .78rem; }
.dashboard-report-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(275px, 330px); align-items: start; gap: 1.25rem; }
.dashboard-project-report { min-width: 0; padding: 1.2rem; }
.dashboard-project-list { border-top: 1px solid var(--line); }
.dashboard-project-row {
  display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(105px, .8fr) 70px minmax(100px, .85fr) 16px;
  align-items: center; gap: .8rem; min-height: 78px; padding: .8rem .2rem;
  border-bottom: 1px solid var(--line); color: var(--ink);
}
.dashboard-project-row:last-child { border-bottom: 0; }
.dashboard-project-row:hover { color: var(--ink); background: #f8fafc; }
.dashboard-project-identity { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.dashboard-project-code { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 7px; background: #eff6ff; color: var(--brand); font-size: .7rem; font-weight: 800; overflow: hidden; }
.dashboard-project-identity > span:last-child { display: grid; min-width: 0; }
.dashboard-project-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.dashboard-project-identity small, .dashboard-project-publication small, .dashboard-project-number small, .dashboard-project-range small { color: var(--muted); font-size: .73rem; }
.dashboard-project-publication, .dashboard-project-number, .dashboard-project-range { display: grid; gap: .2rem; }
.dashboard-project-publication .badge { justify-self: start; }
.dashboard-project-number strong, .dashboard-project-range strong { font-size: .86rem; }
.dashboard-project-row > i { color: var(--muted); font-size: .75rem; }
.dashboard-report-side { display: grid; gap: 1.25rem; }
.dashboard-attention-panel, .dashboard-account-panel { padding: 1.15rem; }
.dashboard-count-badge { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--warning-bg); color: var(--warning); font-weight: 800; }
.dashboard-attention-list { display: grid; gap: .45rem; }
.dashboard-attention-list a { display: grid; grid-template-columns: 18px 1fr 12px; align-items: center; gap: .6rem; padding: .7rem; border: 1px solid #fde68a; border-radius: 7px; background: #fffcf4; color: var(--ink); }
.dashboard-attention-list a > i:first-child { color: var(--warning); }
.dashboard-attention-list a > i:last-child { color: var(--muted); font-size: .7rem; }
.dashboard-attention-list span { display: grid; }
.dashboard-attention-list strong { font-size: .84rem; }
.dashboard-attention-list small { color: var(--muted); font-size: .72rem; }
.dashboard-all-clear { padding: 1.3rem .5rem .5rem; text-align: center; }
.dashboard-all-clear > i { display: block; margin-bottom: .45rem; color: var(--success); font-size: 1.6rem; }
.dashboard-all-clear p { margin: .25rem 0 0; color: var(--muted); font-size: .82rem; }
.dashboard-account-panel dl { margin: .3rem 0 0; }
.dashboard-account-panel dl > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.dashboard-account-panel dl > div:last-child { border-bottom: 0; }
.dashboard-account-panel dt { color: var(--muted); font-size: .8rem; }
.dashboard-account-panel dd { margin: 0; color: var(--ink); font-size: .82rem; font-weight: 700; text-align: right; }
.dashboard-empty-report { display: grid; place-items: center; min-height: 250px; text-align: center; }
.dashboard-empty-report > i { color: var(--muted); font-size: 2rem; }
.dashboard-empty-report h3 { margin: .7rem 0 .2rem; }
.dashboard-empty-report p { margin: 0; color: var(--muted); }
.notice-card { border: 1px solid var(--line); border-radius: 10px; padding: .9rem; background: var(--surface-2); }
.news-target-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .45rem .75rem; padding: .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.news-target-list label { display: flex; align-items: center; gap: .45rem; font-weight: 500; }
.news-template-list { display: grid; gap: .65rem; }
.news-template-list > div { border: 1px solid var(--line); border-radius: 10px; padding: .8rem; background: var(--surface-2); }
.news-template-list strong { display: block; color: var(--ink); margin-bottom: .2rem; }
.news-template-list span { color: var(--muted); font-size: .9rem; }
@media (max-width: 980px) { .roster-positioning { grid-template-columns: 1fr; } }
@media (max-width: 1080px) {
  .roster-workspace, .dashboard-report-layout { grid-template-columns: 1fr; }
  .roster-workspace-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-report-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .roster-metric-grid, .dashboard-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-project-row { grid-template-columns: minmax(180px, 1fr) minmax(100px, .7fr) 65px 16px; }
  .dashboard-project-range { display: none; }
}
@media (max-width: 620px) { .roster-value-grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .roster-control-panel, .dashboard-health-band { align-items: stretch; flex-direction: column; }
  .roster-control-actions { display: grid; grid-template-columns: 1fr; }
  .roster-control-actions .btn { width: 100%; min-height: 46px; }
  .roster-workspace-side, .dashboard-report-side { grid-template-columns: 1fr; }
  .dashboard-plan-summary { padding: .75rem 0 0; border-top: 1px solid var(--line); border-left: 0; text-align: left; }
  .dashboard-project-row { grid-template-columns: minmax(0, 1fr) auto 12px; gap: .6rem; }
  .dashboard-project-number { display: none; }
  .dashboard-project-publication { justify-items: end; text-align: right; }
}
@media (max-width: 430px) {
  .roster-metric-grid, .dashboard-metric-grid { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .roster-metric, .dashboard-metric { min-height: 104px; padding: .8rem; }
  .roster-control-status, .dashboard-health-copy { align-items: flex-start; }
  .roster-status-icon, .dashboard-health-icon { flex-basis: 36px; width: 36px; height: 36px; }
}

/* ---------- Badges & alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-brand { background: #eff6ff; color: var(--brand); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: #e9f1f6; color: #16466b; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }

.alert { padding: .9rem 1.1rem; border-radius: 10px; margin-bottom: 1.1rem; font-size: .93rem; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: #166534; border-color: #bbf7d0; }
.alert-danger { background: var(--danger-bg); color: #991b1b; border-color: #fecaca; }
.alert-info { background: #e9f1f6; color: #16466b; border-color: #bbcedc; }
.alert-warning { background: var(--warning-bg); color: #92400e; border-color: #fde68a; }

/* Toast notifications */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 9999; animation: slideIn 0.3s ease; }
.toast { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.1rem; border-radius: 10px; font-size: 0.93rem; box-shadow: 0 10px 25px rgba(0,0,0,0.15); cursor: pointer; max-width: 400px; }
.toast-success { background: #166534; color: #fff; }
.toast-danger { background: #991b1b; color: #fff; }
.toast-info { background: #075985; color: #fff; }
.toast-warning { background: #92400e; color: #fff; }
.toast-close { background: none; border: none; color: inherit; opacity: 0.7; font-size: 1.25rem; cursor: pointer; padding: 0; margin-left: auto; }
.toast-close:hover { opacity: 1; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Utilities ---------- */
.section { padding: 3.5rem 0; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: #755f3b; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 410px; }

/* ---------- Dashboard shell ---------- */
.dashboard-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 60px);
}

.dashboard-sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: .85rem .65rem 1rem;
}

.app-rail {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  background: #fff;
}

.app-rail-menu { flex: 1; overflow-y: auto; }

.app-nav-group h2 {
  margin: .65rem .7rem .25rem;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 38px;
  padding: .38rem .7rem;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: .875rem;
  font-weight: 500;
}

.app-nav-link i { width: 1.15rem; text-align: center; }
.app-nav-link:hover { background: var(--surface-2); color: var(--ink); }
.app-nav-link.active { background: #eff6ff; color: var(--brand); font-weight: 700; }
.app-nav-link.is-disabled { color: var(--muted); cursor: not-allowed; }
.app-project-nav { display: flex; align-items: center; border-radius: 7px; }
.app-project-link { flex: 1; min-width: 0; }
.app-project-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-project-toggle {
  display: grid; place-items: center; flex: 0 0 34px; height: 34px;
  margin-right: .3rem; border: 0; border-radius: 6px; background: transparent;
  color: var(--muted); cursor: pointer;
}
.app-project-toggle:hover, .app-project-toggle:focus-visible {
  background: var(--surface-2); color: var(--brand);
}
.app-project-toggle i { font-size: .7rem; transition: transform .2s ease; }
.app-project-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.app-project-submenu {
  display: none; margin: .1rem .25rem .35rem 1.2rem;
  padding-left: .45rem; border-left: 2px solid var(--line);
}
.app-project-submenu.open { display: block; }
.app-project-sub-link { min-height: 34px; padding: .38rem .5rem; font-size: .82rem; }
.app-rail-account { padding-top: .7rem; border-top: 1px solid var(--line); }
.app-rail-legal { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin: .7rem .7rem 0; }
.app-rail-legal a { color: var(--muted); font-size: .76rem; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.app-nav-link.app-nav-logout { margin-top: .35rem; color: var(--ink-soft); }
.app-nav-link.app-nav-logout:hover { background: var(--danger-bg); color: var(--danger); }
.mobile-app-nav { display: none; }

.app-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.app-page-heading { min-width: 0; }
.app-page-context {
  margin: 0 0 .3rem;
  color: #866b42;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.app-page-heading h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.2rem); letter-spacing: 0; }
.app-page-subtitle { max-width: 70ch; margin: .35rem 0 0; color: var(--muted); font-size: .92rem; }
.app-page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.app-page-actions .btn:first-child { order: 0; }

.billing-control-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem 1.5rem;
  margin-bottom: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}
.billing-control-panel h2 { margin: 0; font-size: 1.05rem; }
.billing-control-panel h2 i { margin-right: .35rem; color: var(--brand); }
.billing-control-panel p { margin: .25rem 0 0; color: var(--muted); font-size: .86rem; }
.billing-control-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.billing-control-actions form { margin: 0; }
.billing-sync-note { grid-column: 1 / -1; padding-top: .65rem; border-top: 1px solid #dbeafe; }
.billing-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.billing-project-row.is-archived { border-style: dashed; background: var(--surface-2); opacity: .85; }
.billing-project-identity,
.billing-project-actions { display: flex; align-items: center; gap: .8rem; }

.dashboard-side-head {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: .85rem .9rem;
  margin-bottom: .9rem;
}

.dashboard-side-head h3 {
  margin: 0;
  font-size: .98rem;
}

.dashboard-side-head p {
  margin: .2rem 0 0;
  font-size: .82rem;
  color: var(--muted);
}

.dashboard-home-link {
  display: block;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.dashboard-home-link:hover {
  color: inherit;
  border-color: #bfdbfe;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.dashboard-main {
  min-width: 0;
  padding: 0 clamp(1rem, 2.1vw, 2rem) 2rem;
}

.dashboard-menu {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.dash-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.dash-group-btn {
  width: 100%;
  border: 0;
  background: #fff;
  padding: .78rem .85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  font: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 600;
}

.dash-group-btn.has-active {
  color: var(--brand);
  background: #eff6ff;
}

.dash-group-btn span {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

.dash-chevron {
  transition: transform .2s ease;
  font-size: .8rem;
}

.dash-group-btn[aria-expanded="true"] .dash-chevron {
  transform: rotate(180deg);
}

.dash-submenu {
  display: none;
  border-top: 1px solid var(--line);
  background: #fcfdff;
  padding: .3rem;
}

.dash-submenu.open {
  display: block;
}

.dash-sub-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .9rem;
  color: var(--ink-soft);
  border-radius: 8px;
  padding: .58rem .62rem;
}

.dash-sub-link:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.dash-sub-link.active {
  background: #eff6ff;
  color: var(--brand);
  font-weight: 600;
}

.dash-sub-link.disabled {
  color: var(--muted);
  cursor: not-allowed;
  background: #f8fafc;
}

@media (max-width: 1024px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--brand); color: #e0e6e7; margin-top: 4rem; padding: 3rem 0 2rem; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 2rem; padding-top: 1.5rem; font-size: .85rem; color: #94a3b8; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* ---------- Nav link button colour fix ---------- */
.nav-links .btn-primary { color: #fff; }
.nav-links a.btn-primary:hover { background: var(--brand-dark); color: #fff; }

/* ---------- Mobile sidebar ---------- */
.sidebar-mobile-bar {
  display: none;
  padding: .55rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.sidebar-mobile-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .4rem .75rem;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--ink);
}
.sidebar-mobile-btn:hover { background: var(--surface-2); }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 66px 0 0 0;
  background: rgba(0, 0, 0, .45);
  z-index: 39;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 1024px) {
  .sidebar-mobile-bar { display: none; }

  .dashboard-sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(78vh, 680px);
    z-index: 40;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    overflow-y: auto;
    transform: translateY(105%);
    transition: transform .25s ease;
    background: #fff;
    padding-bottom: calc(5.25rem + env(safe-area-inset-bottom));
  }
  .dashboard-sidebar.sidebar-open { transform: translateY(0); }
  .sidebar-overlay { inset: 0; z-index: 39; }
  body.navigation-open { overflow: hidden; }

  .mobile-app-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: calc(64px + env(safe-area-inset-bottom));
    padding: .35rem .35rem env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
  }

  .mobile-app-nav-link {
    display: flex;
    min-width: 0;
    min-height: 56px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .7rem;
    font-weight: 600;
  }

  .mobile-app-nav-link i { font-size: 1.05rem; }
  .mobile-app-nav-link.active { color: var(--brand); background: #eff6ff; }

  .dashboard-main { padding: 0 1rem calc(5.25rem + env(safe-area-inset-bottom)); }
}

/* ---------- Mobile responsive enhancements ---------- */
@media (max-width: 768px) {
  .section { padding: 2rem 0; }
  .card { padding: 1.1rem; }
  .card-pad-lg { padding: 1.4rem; }
  .auth-card { max-width: 100%; }

  .toast-container { top: auto; bottom: 1rem; right: .75rem; left: .75rem; }
  .toast { max-width: 100%; }

  table.data th,
  table.data td { padding: .6rem .75rem; font-size: .85rem; }

  .btn-lg { padding: .65rem 1.1rem; font-size: .95rem; }

  .flex.justify-between { flex-wrap: wrap; gap: .6rem; }

  .footer-bottom { flex-direction: column; text-align: center; }

  .app-page-header { align-items: stretch; flex-direction: column; gap: 1rem; margin-bottom: 1.1rem; }
  .portal-brand-lockup { gap: .55rem; }
  .app-page-actions { display: grid; grid-template-columns: 1fr 1fr; justify-content: stretch; }
  .app-page-actions .btn { min-width: 0; min-height: 48px; white-space: normal; }
  .app-page-actions .btn:first-child { grid-column: 1 / -1; }
  .billing-control-panel { grid-template-columns: 1fr; padding: 1rem; }
  .billing-control-actions { display: grid; grid-template-columns: 1fr; justify-content: stretch; }
  .billing-control-actions .btn { width: 100%; min-height: 48px; white-space: normal; }
  .billing-sync-note { grid-column: auto; }
  .billing-project-row { align-items: stretch; flex-direction: column; }
  .billing-project-actions { justify-content: space-between; }
  .billing-project-actions form .btn { min-height: 44px; }
}

/* Location and interaction states across every page family. */
.app-rail-mobile-head { display: none; }
.auth-card { max-width: 460px; }
.auth-card.card, .onboard-card, .billing-card, .success-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
}
.auth-card h1 { font-size: clamp(1.8rem, 5vw, 2.15rem) !important; }
.card, .dashboard-metric, .roster-metric, .worker-panel { box-shadow: none; }
.card h2, .billing-control-panel h2 { color: var(--brand); }
.badge-brand { background: #ebe8df; color: var(--brand); }
.app-nav-link.active, .mobile-app-nav-link.active {
  background: #e8edf0;
  color: var(--brand);
  box-shadow: inset 3px 0 var(--accent);
}
.app-nav-link.is-disabled { opacity: .72; }
.dashboard-sidebar { background: var(--surface); }
.dashboard-shell { background: var(--bg); }
.dashboard-project-code { background: #e8edf0; }
.dashboard-project-row:hover, table.data tbody tr:hover { background: #faf8f2; }
.billing-control-panel { border-color: var(--line); background: var(--surface); }
.roster-control-panel, .dashboard-health-band { background: var(--surface); }
.toast { cursor: auto; border: 1px solid rgba(255, 255, 255, .24); }
.toast-close { min-width: 32px; min-height: 32px; }
.table-wrap { max-width: 100%; scrollbar-color: var(--accent) var(--surface-2); }
.table-wrap:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.alert { border-left-width: 4px; }
.alert a { color: inherit; text-decoration: underline; }
.roster-empty-state, .empty-state { padding: clamp(2rem, 5vw, 3.5rem); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.empty-state > i { display: block; margin: 0 0 1rem; color: var(--accent); font-size: 1.6rem; }
.empty-state h2 { margin-bottom: .35rem; font-size: 1.5rem; }
.empty-state p { margin: 0 auto; max-width: 48ch; color: var(--muted); }
.loading-state { padding: 1.5rem; color: var(--muted); text-align: center; }
.section > .container, .dashboard-main > .container { min-width: 0; }
.onboard-layout, .billing-layout { max-width: 1050px; }
.onboard-card, .billing-card, .success-card { background: var(--surface); }
.onboard-card h1, .billing-card h1, .success-title { font-size: clamp(1.8rem, 4vw, 2.5rem) !important; }
.progress-step.current .step-icon { animation: none !important; }
.progress-step.current .step-icon, .success-icon { background: var(--brand) !important; }
.progress-step.completed .step-icon { background: var(--success) !important; }
.progress-step.current .step-content h4 { color: var(--brand) !important; }
.progress-step.completed .step-content h4 { color: var(--success) !important; }
@media (max-width: 1024px) {
  .dashboard-sidebar { visibility: hidden; }
  .dashboard-sidebar.sidebar-open { visibility: visible; }
  .app-rail-mobile-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .app-rail-mobile-head button {
    display: grid; width: 44px; height: 44px; place-items: center;
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
    color: var(--brand); cursor: pointer;
  }
  .dashboard-main { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 620px) {
  .nav-links { max-height: calc(100dvh - 66px); overflow-y: auto; }
  .app-page-actions { grid-template-columns: 1fr; }
  .app-page-actions .btn:first-child { grid-column: auto; }
  .dashboard-project-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .8rem; }
  .dashboard-project-identity { grid-column: 1 / -1; }
  .dashboard-project-row > i:last-child { display: none; }
  .dashboard-project-identity strong { white-space: normal; }
  .roster-control-panel, .dashboard-health-band { align-items: stretch; flex-direction: column; }
  .roster-control-actions { width: 100%; }
  .roster-control-actions .btn { flex: 1 1 130px; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Application workspace: the public site retains its own editorial scale. */
body.app-portal {
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(20, 40, 63, .035);
  --shadow: 0 10px 28px rgba(20, 40, 63, .09);
  line-height: 1.5;
}
body.app-portal h1,
body.app-portal h2,
body.app-portal h3,
body.app-portal h4 {
  font-family: var(--font);
  letter-spacing: -.015em;
}
body.app-portal h1 { font-size: clamp(1.6rem, 2vw, 2rem); font-weight: 700; }
body.app-portal h2 { font-size: 1.3rem; font-weight: 700; }
body.app-portal h3 { font-size: 1.06rem; font-weight: 700; }
body.app-portal .portal-header { background: #fff; backdrop-filter: none; }
body.app-portal .portal-header .nav { height: 60px; max-width: none; }
.portal-toolbar { display: flex; align-items: center; gap: 1.1rem; min-width: 0; padding: 0 clamp(1rem, 2vw, 2rem); }
.portal-toolbar-label { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.portal-user { display: inline-flex; align-items: center; gap: .55rem; min-height: 40px; min-width: 0; color: var(--ink); font-size: .83rem; font-weight: 600; }
.portal-user:hover { color: var(--brand); }
.portal-user-avatar { display: grid; width: 32px; height: 32px; place-items: center; flex: 0 0 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--brand); }
.portal-user-name { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-rail-intro { display: grid; gap: .1rem; padding: .2rem .7rem .65rem; border-bottom: 1px solid var(--line); }
.app-rail-kicker { color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.app-rail-intro strong { color: var(--brand); font-size: .93rem; }
.app-rail-notice { display: grid; grid-template-columns: 15px minmax(0, 1fr); align-items: start; gap: .3rem .45rem; padding: .7rem; border: 1px solid #e4d1ad; border-radius: 7px; background: var(--warning-bg); color: var(--warning); font-size: .76rem; line-height: 1.35; }
.app-rail-notice i { margin-top: .12rem; }
.app-rail-notice a { grid-column: 2; font-weight: 700; text-decoration: underline; }
body.app-portal .app-rail-menu { min-height: 0; scrollbar-color: var(--line) transparent; }
body.app-portal .app-nav-group { padding-bottom: .35rem; }
body.app-portal .app-nav-group + .app-nav-group { border-top: 1px solid #eeeae2; }
body.app-portal .app-nav-link { min-width: 0; line-height: 1.3; }
body.app-portal .app-nav-link > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.app-portal .app-nav-link:hover { background: #f3f1eb; color: var(--brand); }
body.app-portal .app-nav-link.active { background: #e8edf0; box-shadow: inset 3px 0 var(--accent); color: var(--brand); }
body.app-portal .app-nav-link.is-disabled { background: transparent; color: var(--muted); font-size: .82rem; }
body.app-portal .app-rail-account { flex: 0 0 auto; padding-top: .4rem; }
body.app-portal .app-rail-legal { margin-top: .45rem; }
body.app-portal .dashboard-main > .container {
  width: 100%;
  max-width: 1580px;
  margin-inline: auto;
  padding-inline: 0;
}
body.app-portal .dashboard-main > .section,
body.app-portal .dashboard-main > .container.section { padding-top: 1.35rem; padding-bottom: 2rem; }
body.app-portal .dashboard-main > .section > .container { max-width: 1580px; padding-inline: 0; }
body.app-portal .dashboard-main > .container:not(.section) { padding-top: 1.35rem; }
body.app-portal .dashboard-main .app-page-header {
  align-items: center;
  gap: .75rem 1.25rem;
  margin-bottom: 1.1rem;
  padding-bottom: .85rem;
}
body.app-portal .app-page-context { margin-bottom: .15rem; font-size: .69rem; color: #755f3b; }
body.app-portal .app-page-heading h1 { line-height: 1.17; font-size: clamp(1.5rem, 2vw, 1.95rem); }
body.app-portal .app-page-subtitle { margin-top: .25rem; font-size: .87rem; line-height: 1.45; }
body.app-portal .app-page-actions .btn { min-height: 38px; }
body.app-portal .card,
body.app-portal .stat-card { padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm); }
body.app-portal .card-pad-lg { padding: 1.5rem; }
body.app-portal .grid { gap: .9rem; }
body.app-portal .dashboard-main .grid > * { min-width: 0; }
body.app-portal .dashboard-main .flex.items-center.gap-2 { flex-wrap: wrap; }
body.app-portal a.card { transition: border-color .15s ease, box-shadow .15s ease; }
body.app-portal a.card:hover { border-color: #b5ac99; box-shadow: var(--shadow); }
body.app-portal .panel-heading { margin-bottom: .75rem; }
body.app-portal .panel-heading h2 { font-size: 1.08rem; }
body.app-portal .eyebrow { margin: 0 0 .3rem; font-size: .7rem; }
body.app-portal .dashboard-metric,
body.app-portal .roster-metric { min-height: 94px; padding: .8rem 1rem; box-shadow: var(--shadow-sm); }
body.app-portal .dashboard-metric-grid,
body.app-portal .roster-metric-grid { gap: .65rem; margin-bottom: 1rem; }
body.app-portal .dashboard-metric > strong,
body.app-portal .roster-metric > strong { font-size: 1.5rem; }
body.app-portal .dashboard-project-row { min-height: 64px; padding: .55rem .4rem; }
body.app-portal .dashboard-health-band,
body.app-portal .roster-control-panel { padding: .95rem 1.1rem; }
body.app-portal .dashboard-report-layout,
body.app-portal .roster-workspace { gap: 1rem; }
body.app-portal .roster-workspace-main,
body.app-portal .roster-workspace-side,
body.app-portal .dashboard-report-side { gap: 1rem; }
body.app-portal .btn { border-radius: 6px; }
body.app-portal .btn-sm { min-height: 36px; }
body.app-portal .field { margin-bottom: .9rem; }
body.app-portal .field label,
body.app-portal .field-label { margin-bottom: .3rem; font-size: .83rem; }
body.app-portal .input,
body.app-portal .select,
body.app-portal .textarea { min-height: 42px; border-color: #b9bdbb; border-radius: 6px; }
body.app-portal .input:hover,
body.app-portal .select:hover,
body.app-portal .textarea:hover { border-color: var(--brand-light); }
body.app-portal .input:focus,
body.app-portal .select:focus,
body.app-portal .textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
body.app-portal .hint { line-height: 1.4; }
body.app-portal .table-wrap { border-radius: 7px; }
body.app-portal table.data th,
body.app-portal table.data td { padding: .64rem .8rem; font-size: .85rem; vertical-align: middle; }
body.app-portal table.data th { background: #f2f0e9; color: var(--ink-soft); font-size: .73rem; letter-spacing: .035em; text-transform: uppercase; }
body.app-portal table.data tbody tr:nth-child(even) { background: #fcfbf8; }
body.app-portal table.data tbody tr:hover { background: #e8edf0; }
body.app-portal table.data tbody tr.is-current { background: var(--success-bg); }
body.app-portal table.data td { overflow-wrap: anywhere; }
body.app-portal table.data td .btn { white-space: nowrap; }
body.app-portal table.data td details { min-width: 0; }
body.app-portal table.data td details > summary.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  list-style: none;
  cursor: pointer;
}
body.app-portal table.data td details > summary.btn::-webkit-details-marker { display: none; }
body.app-portal table.data td details > summary.btn::after {
  content: "";
  width: .35rem;
  height: .35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
body.app-portal table.data td details[open] > summary.btn { background: var(--primary-lighter); border-color: #a9bac6; color: var(--brand); }
body.app-portal table.data td details[open] > summary.btn::after { transform: rotate(225deg) translateY(-2px); }
body.app-portal table.data td details > form.field {
  width: min(250px, 100%);
  margin: .55rem 0 0;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}
body.app-portal table.data td details > form.field .input { margin-bottom: .55rem; }
body.app-portal table.data:has(summary.btn) { min-width: 960px; }
body.app-portal table.data:has(summary.btn) td:last-child .flex { align-items: flex-start; }
body.app-portal .badge { border-radius: 5px; font-size: .72rem; }
body.app-portal .alert { padding: .75rem .9rem; border-radius: 7px; line-height: 1.45; }
body.app-portal .empty-state,
body.app-portal .roster-empty-state,
body.app-portal .dashboard-empty-report { min-height: 170px; padding: 1.8rem; border: 1px dashed #c9c3b7; border-radius: 8px; background: #fff; }
body.app-portal .empty-state > i { margin-bottom: .55rem; }
body.app-portal .empty-state h2 { font-size: 1.17rem; }
body.app-portal .empty-state .btn { margin-top: .7rem; }

/* Setup pages have their own inline layout rules; scope these to win without editing their PHP. */
body.app-portal .onboard-layout,
body.app-portal .billing-layout {
  width: 100%;
  max-width: 1120px;
  grid-template-columns: minmax(0, 1fr) minmax(235px, 280px);
  align-items: start;
  gap: 1rem;
  padding: 1.35rem 0 2rem;
}
body.app-portal .onboard-main,
body.app-portal .billing-main,
body.app-portal .onboard-sidebar,
body.app-portal .billing-sidebar { min-width: 0; }
body.app-portal .onboard-card,
body.app-portal .billing-card,
body.app-portal .success-card { padding: 1.5rem; }
body.app-portal .onboard-sidebar .progress-card,
body.app-portal .billing-sidebar .progress-card { border-radius: 8px; background: #fff; padding: 1rem; }
body.app-portal .progress-step { padding: .5rem 0; }

@media (max-width: 1024px) {
  body.app-portal .dashboard-main { padding: 0 1.25rem calc(5.25rem + env(safe-area-inset-bottom)); }
  body.app-portal .portal-header .portal-brand-lockup { padding-left: 1.25rem; }
  body.app-portal .sidebar-overlay { background: rgba(14, 31, 49, .55); }
  body.app-portal .dashboard-sidebar { top: auto; height: min(78dvh, 690px); }
  body.app-portal .app-nav-link { min-height: 44px; }
  body.app-portal .app-page-actions .btn,
  body.app-portal .btn-sm { min-height: 44px; }
}
@media (min-width: 701px) and (max-width: 1024px) {
  body.app-portal .sidebar-mobile-bar { display: flex; margin: .75rem 0 0; padding: 0; border: 0; background: transparent; }
  body.app-portal .mobile-app-nav { display: none; }
  body.app-portal .dashboard-sidebar { top: 0; right: auto; width: min(320px, 90vw); height: 100dvh; border-radius: 0; border: 0; border-right: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); transform: translateX(-105%); }
  body.app-portal .dashboard-sidebar.sidebar-open { transform: translateX(0); }
  body.app-portal .dashboard-main { padding-bottom: 2rem; }
}
@media (max-width: 700px) {
  .portal-toolbar-label, .portal-user-name { display: none; }
  body.app-portal .portal-header .portal-brand-lockup { padding-left: 1rem; }
  body.app-portal .portal-toolbar { padding-right: 1rem; }
  body.app-portal .dashboard-main { padding: 0 .85rem calc(5.5rem + env(safe-area-inset-bottom)); }
  body.app-portal .dashboard-main .app-page-header { align-items: stretch; flex-direction: column; }
  body.app-portal .app-page-actions { justify-content: flex-start; }
  body.app-portal .onboard-layout,
  body.app-portal .billing-layout { grid-template-columns: minmax(0, 1fr); padding: 1rem .85rem 2rem; }
  body.app-portal .onboard-sidebar,
  body.app-portal .billing-sidebar { order: 0; }
  body.app-portal .onboard-card,
  body.app-portal .billing-card { padding: 1.15rem; }
  body.app-portal .roster-link-actions { grid-template-columns: minmax(0, 1fr) auto auto; }
  body.app-portal .dashboard-project-report { padding: .9rem; }
  body.app-portal .roster-page-shell .roster-control-status {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  body.app-portal .roster-page-shell .roster-control-status > div {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  body.app-portal .dashboard-main .card > .flex.items-center.gap-2 .btn {
    max-width: 100%;
    white-space: normal;
  }
  body.app-portal table.data:has(summary.btn) th:first-child,
  body.app-portal table.data:has(summary.btn) td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 115px;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line);
  }
  body.app-portal table.data:has(summary.btn) th:first-child { z-index: 2; background: #f2f0e9; }
  body.app-portal table.data:has(summary.btn) tbody tr:nth-child(even) td:first-child { background: #fcfbf8; }
  body.app-portal table.data:has(summary.btn) tbody tr:hover td:first-child { background: #e8edf0; }
}
@media (max-width: 430px) {
  body.app-portal .dashboard-metric,
  body.app-portal .roster-metric { min-height: 92px; padding: .7rem; }
  body.app-portal .app-page-actions { display: flex; flex-direction: column; }
  body.app-portal .app-page-actions .btn { width: 100%; }
  body.app-portal .roster-link-actions { grid-template-columns: 1fr 1fr; }
  body.app-portal .roster-link-actions > :first-child { grid-column: 1 / -1; }
}

/* Roster publishing: format choice and spreadsheet diagrams. */
body.app-portal .dashboard-main > .container.import-chooser-page { max-width: 1180px; }
.import-progress { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1.25rem; margin: 0 0 1.1rem; color: var(--muted); font-size: .81rem; font-weight: 650; }
.import-progress span { display: inline-flex; align-items: center; gap: .45rem; }
.import-progress b { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: .72rem; }
.import-progress [aria-current="step"] { color: var(--brand); }
.import-progress [aria-current="step"] b { background: var(--brand); color: #fff; }
.import-chooser { display: grid; gap: 1rem; }
.import-chooser-section { min-width: 0; padding: clamp(1.1rem, 2.6vw, 1.7rem); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); }
.import-step-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: 1.2rem; }
.import-step-number { color: #75643f; font-size: .69rem; font-weight: 750; letter-spacing: .11em; }
.import-step-heading h2 { margin: .2rem 0 .35rem; font-family: var(--font); font-size: clamp(1.2rem, 2vw, 1.55rem); }
.import-step-heading p { margin: 0; color: var(--muted); font-size: .88rem; }
.import-help-button { display: inline-flex; align-items: center; gap: .4rem; min-height: 38px; padding: .35rem .65rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--brand); font-size: .78rem; font-weight: 700; cursor: pointer; }
.import-help-button:hover { background: var(--primary-lighter); }
.import-popover { max-width: min(350px, calc(100vw - 2rem)); padding: 1rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); color: var(--ink); line-height: 1.5; }
.import-popover p { margin: .3rem 0 0; font-size: .85rem; }
.import-layout-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.import-layout-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.import-layout-option { position: relative; display: flex; align-items: center; gap: .9rem; min-width: 0; min-height: 102px; padding: 1rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; transition: border-color .17s, background-color .17s, box-shadow .17s; }
.import-layout-option:hover { border-color: #a7acaa; background: #fcfbf8; }
.import-layout-option.is-selected { border-color: var(--brand); background: var(--primary-lighter); box-shadow: 0 0 0 1px var(--brand); }
.import-layout-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.import-layout-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.import-layout-icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 9px; background: var(--primary-lighter); color: var(--brand); font-size: 1.14rem; }
.import-layout-option.is-selected .import-layout-icon { background: #fff; }
.import-layout-copy { display: grid; gap: .25rem; min-width: 0; }
.import-layout-copy strong { color: var(--brand); font-size: .98rem; }
.import-layout-copy > span { color: var(--muted); font-size: .83rem; line-height: 1.35; }
.import-layout-direction { display: inline-flex; align-items: center; gap: .35rem; margin-left: auto; flex: 0 0 auto; color: var(--brand-light); font-size: .72rem; font-weight: 750; }
.import-layout-preview[hidden] { display: none; }
.import-layout-preview { display: grid; gap: 1rem; margin-top: 1rem; padding: clamp(.85rem, 2vw, 1.2rem); border: 1px solid #c6d4db; border-radius: 9px; background: #f7fafb; }
.import-preview-heading { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .75rem 1rem; }
.import-preview-heading h3 { margin: 0 0 .2rem; font-size: .96rem; }
.import-preview-heading p { margin: 0; font-size: .8rem; color: var(--muted); }
.import-preview-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .6rem; border-radius: 5px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.import-sheet-scroller { min-width: 0; max-width: 100%; overflow: auto; border: 1px solid #c8d5dc; border-radius: 7px; background: #fff; scrollbar-color: #9bacb6 #f2f5f7; }
.import-sheet { min-width: 800px; width: 100%; margin: 0; border-spacing: 0; border-collapse: separate; color: #263748; font-size: .78rem; line-height: 1.35; }
#columnarPreview .import-sheet { min-width: 580px; }
.import-sheet th, .import-sheet td { padding: .55rem .75rem; border-right: 1px solid #e1e8ea; border-bottom: 1px solid #e1e8ea; text-align: left; white-space: nowrap; }
.import-sheet tr > :last-child { border-right: 0; }
.import-sheet tbody tr:last-child > * { border-bottom: 0; }
.import-sheet thead th { background: #e7edf0; color: var(--brand); font-size: .69rem; font-weight: 700; }
.import-sheet th:first-child { position: sticky; left: 0; width: 40px; min-width: 40px; background: #eef2f3; color: var(--muted); font-size: .69rem; text-align: center; z-index: 1; }
.import-sheet thead th:first-child { z-index: 2; background: #e7edf0; }
.import-sheet .import-sheet-headers td { background: #edf3f5; color: var(--brand); font-weight: 700; }
.import-sheet .import-sheet-date td:first-of-type { background: #edf3f5; color: var(--brand); font-weight: 700; }
.import-sheet .import-sheet-identity { font-weight: 750; color: var(--brand); }
.import-sheet .import-sheet-divider td { background: #faf2df; color: var(--warning); font-weight: 700; }
.import-sheet .import-sheet-divider span { margin-left: .5rem; font-size: .7rem; font-weight: 500; }
.import-sheet-status { display: inline-block; padding: .2rem .45rem; border-radius: 4px; font-size: .72rem; font-weight: 650; }
.import-sheet-status.is-work { background: #e9f5ee; color: #176b4d; }
.import-sheet-status.is-rest { background: #f1eee7; color: #5a564d; }
.import-sheet-status.is-travel { background: #e8edf0; color: #285471; }
.import-sheet-caption { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--ink-soft); font-size: .74rem; }
.import-sheet-caption i { margin-right: .25rem; color: var(--brand-light); }
.import-template-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .7rem; padding-top: .7rem; border-top: 1px solid #dce5e8; font-size: .77rem; }
.import-template-actions > span { margin-right: auto; color: var(--muted); }
.import-template-actions a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .65rem; border: 1px solid #a9bdc9; border-radius: 6px; background: #fff; color: var(--brand); font-weight: 700; }
.import-template-actions a:hover { border-color: var(--brand); background: var(--primary-lighter); }
.import-template-actions small { flex-basis: 100%; color: var(--muted); font-size: .7rem; }
.import-file-fields { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.import-file-group { min-width: 0; }
.import-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.import-file-target { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-content: center; gap: 0 .75rem; min-height: 106px; padding: 1rem; border: 1px dashed #91a5b1; border-radius: 8px; background: #f7fafb; color: var(--brand); cursor: pointer; }
.import-file-target > i { grid-row: span 2; align-self: center; font-size: 1.45rem; text-align: center; }
.import-file-target strong { font-size: .9rem; }
.import-file-target span { overflow: hidden; color: var(--muted); font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.import-file-input:focus-visible + .import-file-target { outline: 3px solid var(--focus); outline-offset: 3px; }
.import-file-step.is-disabled .import-file-target { border-color: var(--line); background: #f4f3ef; color: var(--muted); cursor: not-allowed; }
.import-version-field { margin: 0; }
.import-version-field label { display: block; }
.import-version-field .hint { margin-top: .35rem; }
.import-chooser-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .85rem 1rem; margin-top: 1.1rem; }
.import-chooser-actions > span { color: var(--muted); font-size: .78rem; }
.import-chooser-actions > span i { color: var(--success); margin-right: .3rem; }
.import-chooser-actions .btn { min-height: 44px; }
.import-chooser-actions .btn:disabled { opacity: .5; cursor: not-allowed; }
.import-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; margin-top: 1.1rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: .75rem; line-height: 1.45; color: var(--ink-soft); }
.import-rules > strong { grid-column: 1 / -1; color: var(--brand); white-space: nowrap; }
.import-rules i { margin-right: .25rem; color: var(--brand-light); }
.roster-upload-steps { display: flex; flex-wrap: wrap; gap: .45rem .75rem; margin: .2rem 0 1.1rem; color: var(--muted); font-size: .75rem; }
.roster-upload-steps strong { color: var(--brand); }
.roster-publish-cta { display: flex; align-items: center; justify-content: space-between; gap: .7rem; width: 100%; min-height: 62px; padding-inline: 1.2rem; font-size: .95rem; }
.roster-publish-cta > span { flex: 1; text-align: left; }
.app-confirm-dialog { width: min(440px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 1.5rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg); color: var(--ink); }
.app-confirm-dialog::backdrop { background: rgba(14, 31, 49, .64); }
.app-confirm-dialog h2 { margin: .8rem 0 .3rem; font-family: var(--font); font-size: 1.2rem; }
.app-confirm-dialog p { margin: 0 0 1.3rem; font-size: .88rem; }
.app-confirm-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 8px; background: var(--warning-bg); color: var(--warning); }
.app-confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.app-confirm-actions form { margin: 0; }
.import-review-metrics { margin-top: 1.2rem; }
.import-review-section { min-width: 0; margin: 1rem 0; padding: clamp(1rem, 2vw, 1.45rem); border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-sm); }
.import-review-section h2 { margin: 0 0 .85rem; font-family: var(--font); font-size: 1.12rem; }
.import-review-overview { padding: clamp(1rem, 2vw, 1.5rem); margin: 1rem 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.import-review-overview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.import-review-overview h2 { margin: .2rem 0 .5rem; font-size: 1.3rem; }
.import-review-overview p { margin: .5rem 0; }
.import-review-eyebrow { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .08em; }
.import-review-summary { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; padding: .9rem 0; margin: .6rem 0; border-block: 1px solid var(--line); font-size: .85rem; }
.import-review-checklist { list-style: none; margin: .75rem 0; padding: 0; display: grid; gap: .5rem; }
.import-review-checklist a { display: flex; align-items: center; gap: .8rem; padding: .85rem; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); text-decoration: none; font-size: .88rem; }
.import-review-checklist a:hover, .import-review-checklist a:focus-visible { background: var(--primary-lighter); border-color: var(--brand); }
.import-review-checklist a > :last-child { margin-left: auto; }
.import-review-action-dot { display: grid; place-items: center; flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--warning-bg); color: var(--warning); font-weight: 700; }
.import-review-panel { padding: 0; scroll-margin-top: 5rem; }
.import-review-panel > summary { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; color: var(--brand); font-size: .95rem; font-weight: 700; cursor: pointer; list-style: none; }
.import-review-panel > summary::-webkit-details-marker { display: none; }
.import-review-panel > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; flex: 0 0 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.import-review-panel[open] > summary::after { transform: rotate(225deg); }
.import-review-panel[open] { padding: 0 1rem 1rem; }
.import-review-panel[open] > summary { margin-inline: -1rem; border-bottom: 1px solid var(--line); margin-bottom: .9rem; }
.import-review-panel.needs-attention { border-left: 4px solid var(--warning); }
.import-review-panel > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.import-review-back { display: inline-block; margin: 0 0 .8rem; font-size: .8rem; }
.needs-status-mapping td { background: var(--warning-bg); }
.needs-status-mapping input { border-color: var(--warning); }
.import-review-help { margin: .4rem 0 .8rem; font-size: .85rem; }
.import-review-help > summary { display: inline-flex; align-items: center; color: var(--brand); cursor: pointer; list-style: none; min-width: 36px; min-height: 36px; }
.import-review-help > summary::-webkit-details-marker { display: none; }
.import-review-help > summary > span:first-child { display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 50%; font-weight: 700; font-family: serif; }
.import-review-help > p { padding: .8rem; border-radius: 6px; background: var(--surface-2); color: var(--ink-soft); }
.import-review-pagination { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .6rem; margin: .75rem 0; font-size: .8rem; }
.import-review-pagination[hidden], [data-preview-rows] > tr[hidden] { display: none; }
.import-review-preview-table { max-height: 32rem; overflow: auto; }
.import-review-status-table { max-height: 26rem; overflow: auto; }
.import-review-preview-table thead th, .import-review-status-table thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.import-review-toolbar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 -3px 14px rgba(14, 31, 49, .08); }
.import-review-toolbar .hint, .import-review-toolbar .actions { margin: 0; }
.has-review-changes .import-review-toolbar { border-color: var(--warning); }
.import-review-mapping summary { color: var(--brand); font-weight: 700; cursor: pointer; }
.import-review-mapping .field { margin-top: .75rem; }
.import-review-mapping .import-review-grid-scroller { margin-top: 1rem; }
.import-review-grid-scroller { max-width: 100%; overflow: auto; border: 1px solid #c8d5dc; border-radius: 7px; scrollbar-color: #9bacb6 #f2f5f7; }
.import-review-grid { width: max-content; min-width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: .78rem; line-height: 1.4; }
.import-review-grid th, .import-review-grid td { min-width: 100px; max-width: 260px; padding: .55rem .75rem; border-right: 1px solid #e1e8ea; border-bottom: 1px solid #e1e8ea; overflow-wrap: anywhere; text-align: left; }
.import-review-grid tr > :last-child { border-right: 0; }
.import-review-grid tbody tr:last-child > * { border-bottom: 0; }
.import-review-grid thead th { position: sticky; top: 0; background: #e7edf0; color: var(--brand); font-weight: 700; z-index: 1; }
.import-review-grid th:first-child { position: sticky; left: 0; min-width: 118px; background: #f1f4f5; color: var(--brand); z-index: 2; }
.import-review-grid thead th:first-child { z-index: 3; background: #e7edf0; }
.import-review-grid .import-review-grid-identity { background: #eaf2f5; color: var(--brand); font-weight: 700; }
.import-review-grid .import-review-grid-date { background: #eaf5ef; color: #176b4d; font-weight: 700; }
.import-review-grid + .hint { margin: .65rem 0 0; }
.import-review-date-order { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.import-review-date-order label, .import-review-sheet-option, .import-review-dup-option { display: flex; align-items: flex-start; gap: .65rem; padding: .75rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font-size: .84rem; cursor: pointer; }
.import-review-date-order label:has(input:checked), .import-review-sheet-option:has(input:checked), .import-review-dup-option:has(input:checked) { border-color: var(--brand); background: var(--primary-lighter); }
.import-review-date-order input, .import-review-sheet-option input, .import-review-dup-option input, .import-review-ack input { flex: 0 0 auto; margin: .25rem 0 0; accent-color: var(--brand); }
.import-review-sheet-option { margin: .55rem 0; }
.import-review-sheet-option .badge { margin-left: auto; }
.import-review-dup-group { min-width: 0; margin: .75rem 0; padding: .85rem; border: 1px solid var(--line); border-radius: 8px; }
.import-review-dup-group legend { padding: 0 .35rem; font-size: .85rem; font-weight: 700; }
.import-review-dup-option { align-items: center; margin: .4rem 0; }
.import-review-dup-option small { margin-left: auto; }
.import-review-ack { display: flex; align-items: flex-start; gap: .65rem; margin: .9rem 0 0; padding: .8rem 1rem; border: 1px solid #c8d5dc; border-radius: 7px; background: #f7fafb; color: var(--ink); font-size: .85rem; cursor: pointer; }
.import-review-advanced { margin: 1rem 0; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.import-review-advanced summary { color: var(--brand); font-weight: 700; cursor: pointer; }
.import-review-advanced .table-wrap { margin-top: .85rem; }
.import-review-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 0; }
.import-review-progress { max-width: 700px; }
.import-review-progress i { margin-right: .4rem; color: var(--brand); }
.roster-import-cancel { max-width: 700px; margin-top: 1rem; }
.roster-import-cancel p { margin: .4rem 0 0; font-size: .8rem; }
@media (max-width: 760px) {
  .import-layout-options, .import-file-fields { grid-template-columns: 1fr; }
  .import-rules { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .import-layout-direction { display: none; }
  .import-progress { gap: .45rem; font-size: .7rem; }
  .import-progress b { width: 20px; height: 20px; }
  .import-rules { grid-template-columns: 1fr; }
  .import-chooser-actions .btn { width: 100%; }
  .import-review-date-order { grid-template-columns: 1fr; }
  .import-review-dup-option { flex-wrap: wrap; }
  .import-review-actions .btn { width: 100%; }
  .import-review-toolbar { position: static; }
  .import-review-toolbar .actions { width: 100%; }
  .import-review-panel > summary { flex-wrap: wrap; }
  .import-review-pagination [data-preview-page] { order: -1; flex-basis: 100%; }
}

.roster-history-page { max-width: 1120px; }
.history-overview {
  display: flex; align-items: center; gap: 1.3rem; margin-bottom: 1rem;
  padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface);
}
.history-overview > div { display: flex; align-items: baseline; gap: .65rem; white-space: nowrap; }
.history-overview span { color: var(--muted); font-size: .82rem; }
.history-overview strong { color: var(--brand); font-size: 1.45rem; }
.history-overview p { margin: 0 0 0 auto; font-size: .82rem; }
.history-versions { display: grid; gap: .65rem; }
.history-version {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface);
}
.history-version.is-current { border-left: 4px solid var(--success); }
.history-version-details { display: flex; align-items: flex-start; gap: .9rem; min-width: 0; }
.history-version-icon {
  display: grid; place-items: center; flex: 0 0 40px; height: 40px;
  border-radius: 7px; background: var(--primary-lighter); color: var(--brand);
}
.history-version-copy { min-width: 0; }
.history-version-title { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .7rem; }
.history-version-title h2 {
  max-width: 100%; margin: 0; overflow-wrap: anywhere;
  font-family: var(--font); font-size: .98rem; font-weight: 700;
}
.history-version-copy p { margin: .2rem 0; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.history-version-meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; color: var(--muted); font-size: .76rem; }
.history-version-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .45rem; flex: 0 0 auto; }
.history-version-actions form { margin: 0; }
.history-version-actions .btn { min-height: 36px; }
.history-version-actions .history-delete { color: var(--danger); }
.history-version-actions .history-delete:hover { background: var(--danger-bg); }
@media (max-width: 950px) {
  .history-version { flex-direction: column; align-items: stretch; }
  .history-version-actions { justify-content: flex-start; padding-left: 55px; }
}
@media (max-width: 520px) {
  .history-overview { display: block; }
  .history-overview p { margin-top: .3rem; }
  .history-version-actions { padding-left: 0; }
  .history-version-actions .btn { min-height: 42px; }
}

/* Sign-in and registration workspace */
.auth-experience {
  min-height: calc(100vh - 80px);
  padding: clamp(1rem, 4vw, 3rem) 1rem;
}
.auth-experience .auth-shell {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  width: min(100%, 1120px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(20, 40, 63, .09);
}
.auth-experience .auth-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  min-width: 0;
  padding: clamp(2rem, 4vw, 3.25rem);
  overflow: hidden;
  background: radial-gradient(circle at 100% 6%, #315578 0%, transparent 50%), #14283f;
  color: #fff;
}
.auth-experience .auth-intro::after {
  position: absolute;
  right: -115px;
  bottom: 72px;
  width: 265px;
  height: 265px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.auth-experience .auth-intro-top,
.auth-experience .auth-intro-copy,
.auth-experience .auth-workflow { position: relative; z-index: 1; }
.auth-experience .auth-intro-top { display: flex; align-items: center; gap: .75rem; font-weight: 700; letter-spacing: .01em; }
.auth-experience .auth-intro-top img {
  display: block;
  flex: 0 0 42px;
  padding: 4px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}
.auth-experience .auth-intro-divider { margin: 0 .25rem; color: #b6c4cf; font-weight: 400; }
.auth-experience .auth-overline {
  display: block;
  color: #53657a;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
}
.auth-experience .auth-intro .auth-overline { color: #d7bf91; }
.auth-experience .auth-intro-title {
  display: block;
  max-width: 12ch;
  margin: 1rem 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.7rem);
  font-weight: 600;
  line-height: 1.04;
}
.auth-experience .auth-intro p { max-width: 34ch; margin: 0; color: #d8e1e9; font-size: 1.04rem; line-height: 1.6; }
.auth-experience .auth-workflow { display: grid; gap: .45rem; max-width: 350px; }
.auth-experience .auth-workflow > div {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: .91rem;
}
.auth-experience .auth-workflow span { color: #dfc9a1; font-size: .78rem; font-weight: 700; letter-spacing: .06em; }
.auth-experience .auth-workflow strong { font-weight: 600; }
.auth-experience .auth-panel { min-width: 0; padding: clamp(2rem, 4.2vw, 3.5rem); }
.auth-experience .auth-panel-heading { margin-bottom: 1.7rem; }
.auth-experience .auth-panel-heading h1 {
  margin: .65rem 0 .5rem;
  font-size: clamp(2.1rem, 3vw, 2.85rem);
  line-height: 1.1;
}
.auth-experience .auth-panel-heading p { max-width: 44ch; margin: 0; color: var(--muted); }
.auth-experience .auth-message { margin-bottom: 1.6rem; }
.auth-experience .auth-message strong,
.auth-experience .auth-message span { display: block; }
.auth-experience .auth-message ul { margin: .4rem 0 0; padding-left: 1.25rem; }
.auth-experience .auth-form-section { padding: 1.1rem 0 .15rem; border-top: 1px solid var(--line); }
.auth-experience .auth-form-heading {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .9rem;
  color: var(--brand);
  font-size: .95rem;
  font-weight: 700;
}
.auth-experience .auth-form-number { color: #80683f; font-size: .77rem; letter-spacing: .06em; }
.auth-experience .auth-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.auth-experience .field { min-width: 0; margin-bottom: 1rem; }
.auth-experience .field label { margin-bottom: .35rem; font-size: .88rem; }
.auth-experience .auth-field-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 .4rem; }
.auth-experience .auth-field-head a { font-size: .84rem; }
.auth-experience .input {
  min-height: 48px;
  padding: .65rem .8rem;
  border-color: #aeb6bc;
  background: #fff;
  font-size: 1rem;
}
.auth-experience .auth-field-hint { display: block; margin-top: .35rem; color: var(--muted); font-size: .82rem; }
.auth-experience .auth-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 50px;
  margin-top: .65rem;
  padding: .7rem 1.15rem;
  font-size: 1rem;
}
.auth-experience .auth-submit span { font-size: 1.3rem; font-weight: 400; line-height: 1; }
.auth-experience .auth-legal { margin: .85rem 0 0; color: var(--muted); font-size: .82rem; }
.auth-experience .auth-switch { margin: 1.35rem 0 0; padding-top: 1.15rem; border-top: 1px solid var(--line); font-size: .94rem; }
.auth-experience .auth-panel a { text-decoration: underline; text-underline-offset: 3px; }
.auth-experience .auth-panel a:hover { text-decoration-thickness: 2px; }

/* Email verification uses the same workspace shell with a single autofill-friendly code field. */
.otp-experience .auth-shell { max-width: 1020px; }
.otp-experience .auth-intro { min-height: 550px; }
.otp-experience .auth-panel { display: flex; flex-direction: column; justify-content: center; }
.otp-experience .auth-panel-heading { margin-bottom: 1.3rem; }
.otp-destination { color: var(--brand); overflow-wrap: anywhere; }
.otp-experience .otp-notice { display: flex; align-items: flex-start; gap: .7rem; }
.otp-experience .otp-notice i { margin-top: .25rem; }
.otp-experience .otp-notice span { display: block; }
.otp-experience .otp-field { margin-bottom: 1rem; }
.otp-experience .otp-input {
  width: min(100%, 19rem);
  min-height: 66px;
  padding: .65rem .5rem;
  border: 2px solid #aeb6bc;
  background: #f8fafc;
  color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .36em;
  text-indent: .36em;
  line-height: 1.3;
  text-align: center;
}
.otp-experience .otp-input::placeholder { color: #929ba3; opacity: 1; }
.otp-experience .otp-input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-bg); }
.otp-experience .otp-resend {
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.otp-experience .otp-resend p { margin: 0 0 .65rem; font-size: .9rem; }
.otp-experience .otp-resend-button { min-height: 44px; }

@media (max-width: 860px) {
  .auth-experience .auth-shell { grid-template-columns: minmax(0, 1fr); max-width: 650px; }
  .auth-experience .auth-intro { gap: 1.25rem; padding: 1.6rem 2rem; }
  .auth-experience .auth-intro-title { max-width: none; margin: .6rem 0 .4rem; font-size: 2rem; }
  .auth-experience .auth-intro p { max-width: 48ch; font-size: .95rem; }
  .auth-experience .auth-workflow { display: none; }
  .otp-experience .auth-intro { min-height: 0; }
}
@media (max-width: 520px) {
  .auth-experience { display: block; min-height: 0; padding: 0; }
  .auth-experience .auth-shell { border: 0; border-radius: 0; box-shadow: none; }
  .auth-experience .auth-intro { padding: 1.5rem 1.25rem; }
  .auth-experience .auth-intro-title { font-size: 1.8rem; }
  .auth-experience .auth-panel { padding: 2rem 1.25rem 2.5rem; }
  .auth-experience .auth-field-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
